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 list
This 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
studiolab
conda 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/conda
We recommend that you do not export the
studiolab
,studiolab-safemode
, andbase
environments. 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. Thebase
environment in Studio Lab and thebase
environment 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
default
environment 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.
Note
Downloading a directory from the Studio Lab GUI by right-clicking on the directory is currently unavailable. If you wish to export a directory, please follow the steps using the Save to Git repository tab.
One option is to save the environment onto your local machine. To do this, use the following procedure.
-
In Studio Lab, choose the File Browser icon (
) on the left menu, so that the File Browser panel shows on the left.
-
Navigate to your user directory by choosing the file icon beneath the file search bar.
-
Choose (right-click) the
myenv.yml
file and then choose Download. You can repeat this process for other files you want to import to Studio Classic.
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.
If you saved the files to your local machine, you can import the files to Studio Classic using the following steps.
-
Open the File Browser panel (
) at the top left of Studio Classic.
-
Choose the Upload Files icon (
) on the menu at the top of the File Browser panel.
-
Navigate to the file that you want to import, then choose Open.
Note
To import a directory into Studio Classic, first compress the directory on your local
machine to a file. On a Mac, right-click the directory and choose Compress
"<DIRECTORY_NAME>
". In Windows,
right-click the directory and choose Send to, and then choose
Compressed (zipped) folder. After the directory is compressed,
import the compressed file using the preceding steps. Unzip the compressed file by
navigating to the Studio Classic terminal and running the command
. <DIRECTORY_NAME>
.zip
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>