Importing & Exporting¶
Deployments, pipelines, training experiments (as deployment versions) and environment variables can be imported and exported.
This is useful when you want to share your solutions among different projects, or when you want to create a back-up.
Creating imports and exports is supported in the WebApp, the API, CLI and client libraries.
Deployments, pipelines, trainig experiments, and environment variables are exported as a ZIP file. Multiple objects can be part of the same export.
When you want to use the WebApp to create an export, navigate to Imports & Exports in the sidebar.
Then, switch to the Exports tab and click 'New export'. First, select all pipelines you want to include in your export (this step can be skipped). The deployments that are part of the selected pipelines are automatically selected in the second step where you can include deployments.
Include a deployment/pipeline by using the select box at the top. After selecting the object, the selected object will be displayed and its default version (if any) is automatically selected. You can add more versions by using the version select box, and remove versions by unchecking the checkbox in front of them.
Deployment and deployment version environment variables are automatically selected for the selected deployments and versions. It's possible to exclude environment variables entirely or just their value. It is, for example, useful to exclude the value of the environment variables if you want to share the object with someone else who needs to fill in their own values. Secret values are automatically excluded and can't be part of the export. Excluded values must be provided when you want to import the export file again. This can be done in the confirmation step of the import.
If you want to export a training experiment you have to skip the pipeline selection first. Then you need to select the
training-base-deployment for a deployment, as UbiOps treats all your training experiments as version of this deployment. Your training experiments will be available as a version for an export. The
training-base-deployment is auto-generated by UbiOps and immutable. UbiOps uses this deployment to run your training experiments.
Deployments, pipelines and environment variables can be imported from a ZIP file. You can upload a ZIP file or provide a link to a publicly accessible storage for UbiOps to retrieve it from. This can for instance be a publicly accessible Google or Amazon bucket. Make sure it's possible to download from the link without giving any credentials.
The structure of the ZIP file will be described below. Multiple objects can be part of the same import. After import creation, the objects found in the import file can be reviewed and confirmed before they are actually created. In this confirmation step, you could also provide missing environment variable values.
When you want to use the WebApp to create an import, navigate to Imports & Exports in the sidebar.
Then, click 'New import', upload a ZIP file containing the deployments and pipelines you want to import, and click "Next: Review". You will continue with the confirmation step of the import. In this step you can exclude objects, rename objects if they already exist, and fill in the value of environment variables. When you complete the confirmation step, the objects will be created in the project.
Import file structure¶
The content of your import ZIP file should have the structure as described below. An example of an import can be found on our GitHub page. Any export you make will automatically follow this structure so that it is easy to import later.
The name of the root directory doesn't matter
This file contains at least
format_spec, which is the version of the import format, e.g., 'v1.0'
This directory contains all deployments that you want to import. In this case, just
This is an example of a deployment to import. The name of the directory doesn't matter, but it usually contains the deployment name.
Required settings file of the deployment. This file may contain all deployment parameters, and should at least provide the required fields
output_type. You may want to include deployment environment variables using
This directory contains all versions of
deployment-1that you want to import. In this case, just
Required settings file of the deployment version. This file may contain all version parameters, and should at least provide the required field
version_name. You may want to include version environment variables using
Optional deployment package ZIP file of the deployment version. The file must have the same name as the version yaml file it belongs to, only with a .zip extension instead.
This directory contains all pipelines that you want to import. In this case, just
This is an example of a pipeline to import. The name of the directory doesn't matter, but usually contains the pipeline name.
Required settings file of the pipeline. This file may contain all pipeline parameters, and should at least provide the required fields
This directory contains all versions of
pipeline-1that you want to import. In this case, just
Required settings file of the pipeline version. This file may contain all version parameters, and should at least provide the required field
You may want to include environment variables on project level using
project_environment_variables. Pass the environment variables in the same way as the environment variables on deployment or version level. Note that verifying project environment variables is not supported by the WebApp.