Export an Amazon SageMaker Studio Lab environment to Amazon SageMaker Studio Classic
Amazon SageMaker Studio Classic offers many features for machine learning and deep learning work flows that are unavailable in Amazon SageMaker Studio Lab. This page shows how to migrate a Studio Lab environment to Studio Classic to take advantage of more compute capacity, storage, and features. However, you may want to familiarize yourself with Studio Classic's prebuilt containers, which are optimized for the full MLOP pipeline. For more information, see Amazon SageMaker Studio Lab
To migrate your Studio Lab environment to Studio Classic, you must first onboard to Studio Classic following the steps in Amazon SageMaker AI domain overview.
Topics
Step 1: Export your Studio Lab conda environment
You can export a conda environment and add libraries or packages to the environment by
following the steps in Manage your environment. The following example demonstrates using the
default environment to be exported to Studio Classic.
-
Open the Studio Lab terminal by opening the File Browser panel (
), choose the plus (+) sign on the menu at the
top of the file browser to open the Launcher, then choose
Terminal. From the Studio Lab terminal, list the conda environments by
running the following.conda env listThis command outputs a list of the conda environments and their locations in the file system. When you onboard to Studio Lab, you automatically activate the
studiolabconda environment.# conda environments: # default /home/studio-lab-user/.conda/envs/default studiolab * /home/studio-lab-user/.conda/envs/studiolab studiolab-safemode /opt/amazon/sagemaker/safemode-home/.conda/envs/studiolab-safemode base /opt/condaWe recommend that you do not export the
studiolab,studiolab-safemode, andbaseenvironments. These environments are not usable in Studio Classic for the following reasons:-
studiolab: This sets up the JupyterLab environment for Studio Lab. Studio Lab runs a different major version of JupyterLab than Studio Classic, so it is not usable in Studio Classic. -
studiolab-safemode: This also sets up the JupyterLab environment for Studio Lab. Studio Lab runs a different major version of JupyterLab than Studio Classic, so it is not usable in Studio Classic. -
base: This environment comes with conda by default. Thebaseenvironment in Studio Lab and thebaseenvironment in Studio Classic have incompatible versions of many packages.
-
-
For the conda environment that you want to migrate to Studio Classic, first activate the conda environment. The
defaultenvironment is then changed when new libraries are installed or removed from it. To get the exact state of the environment, export it into a YAML file using the command line. The following command lines export the default environment into a YAML file, creating a file calledmyenv.yml.conda activate default conda env export > ~/myenv.yml
Step 2: Save your Studio Lab artifacts
Now that you have saved your environment to a YAML file, you can move the environment file to any platform.
Step 3: Import your Studio Lab artifacts to Studio Classic
The following procedure shows how to import artifacts to Studio Classic. The instructions on using Feature Store through the console depends on if you have enabled Studio or Studio Classic as your default experience. For information on accessing Studio Classic through the console, see Launch Studio Classic if Studio is your default experience.
From Studio Classic, you can import files from your local machine or from a Git repository. You can do this using the Studio Classic GUI or terminal. The following procedure uses the examples from Step 2: Save your Studio Lab artifacts.
Step 4: Install your Studio Lab conda environments in Studio Classic
You can now recreate your conda environment by using your YAML file in your Studio Classic instance. Open the Studio Classic Launcher. For more information on opening the Launcher, see Amazon SageMaker Studio Classic Launcher. From the Launcher, choose Open image terminal. In the terminal navigate to the directory that contains the YAML file, then run the following commands.
conda env create --file<ENVIRONMENT_NAME>.yml conda activate<ENVIRONMENT_NAME>
After these commands are complete, you can select your environment as the kernel for your
Studio Classic notebook instances. To view the available environment, run conda env
list. To activate your environment, run conda activate
.<ENVIRONMENT_NAME>