Publishing a Conda Environment to an Object Storage Bucket in Your Tenancy

Before you can publish a conda environment or install a published conda environment, you need to configure odsc conda to use an Object Storage bucket using this command:

odsc conda init -b <your-bucket-name> -n <your-tenancy-namespace> -a <api_key or resource_principal>
Change these values in the command:
  • <your-bucket-name>: is the name of the object storage bucket in your tenancy containing Published Conda Environments.

  • <your-tenancy-namespace>: is the namespace of your tenancy.

  • <api_key or resource_principal>: provide either an API key or a resource principal. If you are using the API key option, you must have a valid API keys configuration. The default directory for the key is /home/datascience/.oci. If you want to use an alternate directory for API key, run the odsc conda init -a command and specify either an api_key or resource_principal name.

    You can run odsc conda init -h for more information about the options.

You only need to run the odsc conda init command once per notebook session. Your bucket and namespace values persist through deactivation and activation of the notebook session.

You can publish a conda environment that you have installed in a notebook session. Publishing a conda environment consists of creating a pack of a conda environment and uploading it to a specified Object Storage. This allows conda environments to be shared among colleagues or to persist them across notebook sessions. We recommend that you publish conda environments to ensure that a model training environment can be reproduced.

You can publish a conda by clicking Publish in an installed environment card. Copy the code snippet, and then run it in a terminal window tab:

odsc conda publish -s <slug>

The <slug> is the slug of the environment you want to publish.

Important

ADS warns you when you create the model artifact to publish your conda environment before saving the model to the model catalog. If you have already published the conda environment, you can provide ADS with the path on Object Storage to that conda environment when you save the model. References to training environments are stored in the runtime.yaml file that is part of the model artifact, see managing models.