Configuring custom environments and sample projects
When you create a new project in Anaconda Enterprise, you must select a base environment for the project. Anaconda provides several base Anaconda environments, along with Python, R, or Hadoop-Spark environments for you to choose from.
If these environments do not suit your needs, you can create a custom environment, then include it in the list of environments that are available upon project creation.
Preparing to create custom environments
Custom environments must be created using a machine with platform architecture identical to your instance of Anaconda Enterprise.
-
Connect to the machine you are using to create environments.
-
If necessary, install the
bzip2
utility by running the following command: -
If necessary, install the
wget
utility by running the following command: -
If necessary, update or install miniconda.
-
Create or clear your environments directory by running the following commands:
-
Clean the conda install by running the following command:
-
Using your preferred file editor, open your
~/.bash_profile
file. -
Add these two export commands to the end of the file to instruct conda to create all new environments in the
/opt/continuum/envs/
directory: -
Save your work and close the file.
-
Apply your changes by running the following command:
Creating a custom environment
-
Use conda to create or clone your custom environment:
Create a conda environment by running the following command:
python 3.8
andipykernel
are just examples. Create your environment using the packages you need!Create a conda environment by running the following command:
python 3.8
andipykernel
are just examples. Create your environment using the packages you need!Clone an existing environment by running the following command:
-
Verify that your environment was created in the
/opt/continuum/envs
directory by running the following command: -
Create an archive file containing the custom environment by running the following commands:
Your archive file includes the directory that is named after your environment and the
.pkgs
directory.
For more help with creating environments using conda, see the official conda documentation.
Uploading your custom environment
-
Open a browser and log in to Anaconda Enterprise as a user with administrator permissions.
The
anaconda-enterprise
user account has these permissions. -
Open any existing project by clicking on it to view its settings.
-
If necessary, change the Default Editor to JupyterLab.
-
Open a session for the project.
-
Upload your environment archive file to the project.
You may see a Large File Size warning. This can safely be ignored.
-
Open a terminal in your project session and unpack your environment archive file by running the following command:
-
Verify your environment archive file unpacked successfully by running the following command:
-
Delete the uploaded environment archive file from the project and stop the project session.
Creating a project template archive
The project template archive file must contain, at a minimum, the anaconda-project.yml
file. For more information and help building projects, see the official Anaconda Project documentation.
-
Connect to the machine you are using to create environments.
-
If necessary, create the project directory by running the following command:
-
Enter the directory you just created by running the following command:
-
Using your preferred file editor, create and populate an
anaconda-project.yml
file in your project directory. Save and close the file when complete.Your project’s
name:
will display on the Sample Projects grid or the Environments dropdown list after the project is created. -
Create an archive file for the project, then set permissions for it by running the following commands:
This archive file is the template that other projects will use as a starting point for their own projects.
Creating a sample project
You must upload and move the project into the /gallery
directory to display the project on the Sample Projects page.
-
Open a browser and log in to Anaconda Enterprise as a user with administrator permissions.
The
anaconda-enterprise
user account has these permissions. -
Click Create +, then select Upload project.
-
Upload your
<PROJECT>.tar.bz2
file to create the project. -
View your project’s settings.
-
If necessary, change the Default Editor to JupyterLab.
-
Open a session for the new project.
-
Upload your project archive file to the new project.
You may see a Large File Size warning. This can safely be ignored.
-
Open a terminal in your session and move your project archive file to the sample project gallery by running the following command:
-
Enter the sample gallery by running the following command:
-
Update the sample projects gallery to include your project by running the following command:
-
Verify that you can find and select your sample project on the Sample Projects page.
Creating a project template environment
Adding a project that is in the /gallery
directory to the TEMPLATE
file will include it as an Environment option when creating a new project.
Including a project from the /gallery
directory in the TEMPLATE
file will remove it from the sample projects page.
- Open a browser and log in to Anaconda Enterprise as a user with administrator permissions.
The anaconda-enterprise
user account has these permissions.
-
Open any project and view its settings.
-
If necessary, change the Default Editor to JupyterLab.
-
Open a session for the project.
-
Open a terminal in your session, then enter the sample gallery directory by running the following command:
-
Using your preferred file editor, add the project archive file name (
<PROJECT>.tar.bz2
) to theTEMPLATE
file. -
Save and close the file when complete.
-
Update the project template environment list to include your project by running the following command:
-
Create a new project and verify that your project template appears in the Environment dropdown menu.
Was this page helpful?