ai-center
2020.10
false
AI Center
Automation CloudAutomation SuiteStandalone
Last updated Jun 6, 2024

Import/Export ML Packages

You can export and import ML Packages from/to UiPath AI Center using scripts. This allows you to do the following:

  • Backup your ML Packages.
  • Move ML Packages from one tenant to another.
  • Move ML Packages from one AI Center to another.

The two scripts can be found at this link: Scripts.

Prerequisites

You can run these scripts from any machine having access to AI Center and Identity Server (included in Orchestrator most of the time). However you need to have the following installed on the machine:

  • jq
  • curl

Exporting ML Packages

Use the export.sh script file to export an ML package. This script will download the ML package from the target environment (zip file) and save it locally under the timestamp folder. It will also download a metadata.json file for this ML Package.

Before running the script, you need to create a json file with the following key/values:

  • hostOrFQDN: Public endpoint from where the backend service can be accessible with port number.
  • identityServerEndPoint: Endpoint where the identity server is hosted (often Orchestrator).
  • hostTenantName: The name of the host tenant registered in the identity server.
  • hostTenantIdOrEmailId: The ID or email ID of the host tenant.
  • hostTenantPassword: The password of the host tenant.
  • tenantName: The name of the tenant from where the ML package export will be carried out.
  • projectName: The project name from where the ML package will be exported.
  • mlPackageName: The name of the ML package which will be downloaded from the target environment.
  • mlPackageVersion: The version number of the ML package which will be downloaded. The version number should have the following format: 3.2, 3.1.

For example, your file will look like this:

{
    "hostOrFQDN":  "myinternalAIC.com:31390",
    "identityServerEndPoint": "internal-orchestrator.com",
    "hostTenantName": "host",
    "hostTenantIdOrEmailId": "admin",
    "hostTenantPassword": "P@sswOrd123",
    "tenantName":  "DevTenant",
    "projectName": "InvoicesProject",
    "mlPackageName": "InvoicesFinal",
    "mlPackageVersion": "8.3"
}{
    "hostOrFQDN":  "myinternalAIC.com:31390",
    "identityServerEndPoint": "internal-orchestrator.com",
    "hostTenantName": "host",
    "hostTenantIdOrEmailId": "admin",
    "hostTenantPassword": "P@sswOrd123",
    "tenantName":  "DevTenant",
    "projectName": "InvoicesProject",
    "mlPackageName": "InvoicesFinal",
    "mlPackageVersion": "8.3"
}

Then simply run the following command from command line:

./export.sh export_input.json./export.sh export_input.json

It will locally create the two files:

  • InvoicesFinal.zip: the ML Package
  • InvoicesFinal_v8.3_metadata.json: metadata of the ML Package

Importing ML Packages

Use the import.sh script file to import an ML package. This script will upload a local ML Package to the target AI Center project.

Before running the script, you need to provide the following information:

  • hostOrFQDN: Public endpoint from where the backend service can be accessible with port number.
  • identityServerEndPoint: Endpoint where the identity server is hosted (often Orchestrator).
  • hostTenantName: The name of the host tenant registered in the identity server.
  • hostTenantIdOrEmailId: The ID or email ID of the host tenant.
  • hostTenantPassword: The password of the host tenant.
  • tenantName: The name of the tenant to where the ML package import will be carried out.
  • projectName: The project name to which the ML package will be imported.
  • mlPackageName: The name of the ML package to which a new version will be uploaded, if it exists. If not, a new ML package with the same name will be created.
  • mlPackageMajorVersionForPrivatePackage: This is used to upload new minor versions (for example, 3.1). This is only used for only private packages. The default value should be zero.
  • mlPackageZipFilePath: The filepath to the ML package zip file path with the extension that will be uploaded to the target environment.
  • mlPackageMetadataFilePath: The ML package import metadata JSON filepath with extension.

For example, your file will look like this:

{
    "hostOrFQDN":  "myinternalAIC.com:31390",
    "identityServerEndPoint": "internal-orchestrator.com",
    "hostTenantName": "host",
    "hostTenantIdOrEmailId": "admin",
    "hostTenantPassword": "P@sswOrd123",
    "tenantName":  "ProdTenant",
    "projectName": "InvoicesProject",
    "mlPackageName": "InvoicesFinal",
    "mlPackageMajorVersionForPrivatePackage": 8,
    "mlPackageZipFilePath": "full/path/InvoicesFinal.zip",
    "mlPackageMetadataFilePath": "full/path/InvoicesFinal_v8.3_metadata.json"
}{
    "hostOrFQDN":  "myinternalAIC.com:31390",
    "identityServerEndPoint": "internal-orchestrator.com",
    "hostTenantName": "host",
    "hostTenantIdOrEmailId": "admin",
    "hostTenantPassword": "P@sswOrd123",
    "tenantName":  "ProdTenant",
    "projectName": "InvoicesProject",
    "mlPackageName": "InvoicesFinal",
    "mlPackageMajorVersionForPrivatePackage": 8,
    "mlPackageZipFilePath": "full/path/InvoicesFinal.zip",
    "mlPackageMetadataFilePath": "full/path/InvoicesFinal_v8.3_metadata.json"
}

Then simply run the following command from command line:

./import.sh import_input.json./import.sh import_input.json

This will upload the ML Package to the desired tenant and project, the version will be the major version specify in your input file and the next available minor version.

In above example, if the ML Package InvoicesFinal v8 already exist andlast minor version is 8.4 the ML Package will be uploaded with version 8.5. If the ML Package doesn't already exist on this project, the ML Package will be uploaded with version 8.1.

  • Prerequisites
  • Exporting ML Packages
  • Importing ML Packages

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.