Using a proxy for conda packages¶
You can configure Anaconda Enterprise to use a proxy for conda packages, if your organization’s network security policy requires it. To do so, you’ll need to do the following:
Install Miniconda, a mini version of Anaconda that includes conda, its dependencies, and Python.
Download the Miniconda installer to the current working directory.
If you want the file saved in a different directory, make sure you
cd to the working directory before running this command.
curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
Run the following command to install Miniconda to the root directory (e.g.,
Re-initialize your terminal for the previous steps to take effect:
Whitelist the local repository by running the following command to set the
NO_PROXYenvironment variable, providing the FQDN of the local repo:
Installing and configuring the Anaconda Enterprise CLI¶
You’ll need to use the Anaconda Enterprise CLI in subsequent steps, so install it now if you haven’t already done so.
Run the following command to install the Anaconda Enteprise CLI and package mirroring tool:
conda install -kc https://<your-server.domain.com>/repository/conda/anaconda-enterprise anaconda-enterprise-cli cas-mirror git
After the list of package dependencies has been resolved, type
yto proceed with the installation.
To configure the Anaconda CLI, run the following commands, using the FQDN of your Anaconda Enterprise instance:
anaconda-enterprise-cli config set sites.master.url https://<your-server.domain.com>/repository/api anaconda-enterprise-cli config set default_site master anaconda-enterprise-cli config set ssl_verify false
Configuring Anaconda Enterprise¶
After you’ve installed and configured the required tools, you can update your Anaconda Enterprise configuration:
Log in to the Operations Center UI at
https://<your-server.domain.com>:32009, using either the default credentials
firstname.lastname@example.org / aeplatformor the credentials of another Operations Center Admin user.
Click Configuration in the menu on the left and use the Config maps drop-down menu to select the
We strongly recommend you make a manual backup copy of this file before editing it, as any changes you make will impact how Anaconda Enterprise functions.
Scroll down to the
condasection and ensure it looks like the following:
conda: # Common conda settings for editing sessions and deployments channels: - defaults default_channels: # List of channels that should be used for channel 'defaults' - https://repo.anaconda.com/pkgs/main - https://repo.anaconda.com/pkgs/free - https://repo.anaconda.com/pkgs/
Run this command to access the CLI:
Log in using the same username and password that you use to log in the Anaconda Enterprise web interface (or the default Admin credentials
Create a config file (
condarc.secret.txt) for conda proxying with the following content, and mount it at
proxy_servers: http: http://proxy.url.com:<port> https: https://proxy.url.com:<port>
Run the following command to create a Kubernetes secret:
anaconda-enterprise-cli spark-config --config /etc/conda/.condarc condarc.secret.txt
Upload the secret to Kubernetes.
This will delete any existing custom Kubernetes secrets in
anaconda-config-files-secret.yaml, so if you’ve already configured other secrets (e.g., for Hadoop Spark access) make sure you include those secrets and move the existing file to a remote location to preserve it.
sudo kubectl replace -f anaconda-config-files-secret.yaml -n default
Restart the relevant pods:
sudo gravity enter kubectl get pods | grep 'ap-deploy\|ap-workspace\|ap-ui' | cut -d' ' -f1 | xargs kubectl delete pods
Verifying the proxy works¶
After you’ve configured the platform, you can test your changes to verify that it’s using the proxy.
Log into Anaconda Enterprise.
Click Projects, and open the project you want to use to test the proxy.
If the project already has an open session, you’ll need to stop the current session and start a new session.
Open a terminal window within JupyterLab and run the following command to display the conda configuration:
conda config --show
Verify the proxy config information from
condarc.secret.txtis being set.
Run the following command to prepare the project:
Packages should be resolving and being pulled from public Anaconda repositories.