Managing Virtual Appliance Versions Using Continuous Delivery

Continuous delivery is a mechanism provided for the VM authors in order to instruct the AppDB Virtual Appliance management system to automatically create and publish new VA versions by using their own delivery system.

Use case

A lot of VM authors use automated services and/or continuous integration processes to develop and build new VMs. If they wish to use the AppDB to populate their work, they need to manually maintain the updated information for every new build iteration.

Continuous delivery policy enable authors to integrate their VM building process with the AppDB virtual appliance management system without having to directly interact with it. The integration is based on the AppDB system monitoring an external URL. The URL must point to a virtual appliance description file generated by an external automated process, that describes the current virtual appliance version. If the monitoring system detects changes to its contents, the AppDB backend system performs various tasks to decide if a new VA version should be published to its virtual appliance management system and acts accordingly.


Setup Continuous delivery

Lets suppose that a VM author has an automated process of building VMs for a specific virtual appliance and wants to automatically publish the generated VM to the AppDB system. To do so, he/she must fulfill the requirements below and perform some initial setup:


Requirements


Initial setup

To setup continuous delivery for a virtual appliance, the author must visit the related virtual appliance entry in the AppDB portal and then follow the steps below:

  • Select the “Virtual Appliance Versions” and click on the “Continuous” link of the delivery policy selection, on the top left of the page. The click on the “Enable Continuous Delivery” button. This will reload the page and the “Working Version” tab will be replaced with the “Continuous Delivery” one.

NOTE: If you already have a saved working version, the continuous delivery won’t be enabled, until you delete it.

image

  • Provide the remote virtual appliance description file URL in the related settings field and click the “update” button on the bottom right corner of the settings panel.

NOTE: You will notice that the publisher field can not be edited and is fixed to your account. This means that when you, or any other user, update the settings, will become the publisher of any future published versions of this virtual appliance from the continuous delivery process.

image

  • Since this is the initial setup, the continuous delivery is by default paused and no monitoring will be performed. To start the monitoring process, click the “Resume” button.

image

  • After the resume, the monitoring process has began and AppDB system will run continuous delivery in the background. You can close your browser and revisit at any time to inspect or perform user actions.

NOTE: You will notice a panel saying “No continuous delivery process is running right now”. This is due to the fact that monitoring applies on specific time intervals. This display will change when the AppDB backend service performs continuous delivery tasks and will display their progress.

image


Continuous delivery task flow

Continuous delivery performs two tasks.The first task validates of the current continuous delivery setup. It checks that the url is properly set and the configured VA publisher has access to edit the virtual appliance and owns a personal access token. If the configuration is not valid, it will skip the process until the next iteration. If these issues successively occur, currently set to 50 iterations, the backend pauses the continuous delivery for the specific virtual appliance, until they are resolved. This kind of validation is hardly going to fail and it exists for edge cases.

The second task is the actual continuous delivery process and is separated in seven distinct steps that needs to pass in order to successfully publish a new VA version:

  • Fetch file: Fetch the file from its remote location. This file should be publicly accessible and shouldn’t need any credentials. Its location is specified in the continuous delivery settings.
  • Check file format: The service will try to parse the file. Currently supported formats are xml, json and yaml. It will also make some early checks that all the mandatory fields are provided before continuing to the next step.
  • Check new VA version: The provided version value of the file will be checked against the already used versions of the current virtual appliance. If the given VA version value is not already used, which means that it is a new version, the service continues to the next step.
  • Validate metadata: The service validates the given information is valid and complies with the AppDB registry. Such compliance has to do with the values such as architecture, cores, hypervisors etc.
  • Integrity check: The service downloads and calculates the sha512 checksum and size of the VM referenced in the url field of the remote file.
  • Prepare VA version contents: Prepare the final contents that will be posted to the AppDB system from the continuous delivery service.
  • Publish new VA version: Perform the actual VA publishing to the AppDB Virtual Appliance management system, by using the configured publisher’s personal access token.

Inspecting Continuous Delivery in AppDB portal

You can use view the current state of continuous delivery process and perform actions at any time from the AppDB portal. The continuous delivery panel is separated in various sections that change according to its state:

  • Settings: The same section you used to initially configure continuous delivery. Can be updated at any time. The changes will apply only for future continuous delivery iterations and NOT for the currently running one.
  • Running Continuous Delivery Process: Display each step of the current continuous delivery iteration process. At this point you can use the “cancel” button to cancel the process.

image

  • Last continuous delivery outcome: Displays the results of the last continuous delivery iteration. The user can view if the last iteration failed, at which step, with what error and when.

image

  • Continuous Delivery Log Entries: Here the user can view any change regarding the continuous delivery, such as property changes (url/publisher update), successful or failed virtual appliance version publish and state changes (paused/resumed)

image


User actions

Once the continuous delivery is configured properly and resumed, no other user actions are necessary. However, there are actions that can be performed in the AppDB portal by the user:

  • Pause: Available only when continuous delivery process is resumed. It will pause the process and will not perform any new checks until it is resumed. This affects only new checks. The already running ones will continue.

  • Resume: Only available when continuous delivery is paused. It will start the monitoring process again.

  • Cancel: Only available when continuous delivery is checking. It will cancel any task (eg integrity check). It applies only for the specific process. After a while the monitoring will recheck.

  • Force Check: Only available when continuous delivery process is resumed and not checking. Starts a new check.