Skip to content

Git and Conda configuration on JASMIN

Herbie Bradley edited this page Mar 3, 2021 · 4 revisions

Git configuration

First, make sure you have an SSH key (can be any key, not just the same key you use to connect to JASMIN) associated with your Github account as described here, so that the key is registered on your user-agent. Check that ssh -T [email protected] successfully registers your Github username.

Then SSH to one of the JASMIN Sci servers that does not block SSH (not 3, 6, or 8). Go to the gtc-biodiversity directory, and test with a git push. If it asks you for your username and password, this means that the remote target for this git repository is set with HTTPS, not SSH. Type

git remote set-url origin [email protected]:ai4er-cdt/gtc-biodiversity.git

to set the remote target with SSH - then you should be able to do git push successfully with no errors, since it will use your SSH key that is forwarded with your user-agent to JASMIN to connect to Github. To avoid doing this, if you ever need to clone this repository from scratch in the future, just clone from SSH instead of HTTPS. Setting your name and email in Git config is completely optional.

Conda configuration

Unfortunately, the conda installation that comes with Jaspy using module load jaspy is not really designed to use to create your own environments - it is better to install conda separately in your home directory and ignore module load ...

Therefore, type wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh to download the latest Miniconda, and bash Miniconda3-latest-Linux-x86_64.sh to run it. Then accept the license, press enter to install it in your home directory under /home/users/username/miniconda3, then type yes to have the installer run conda init - this will put a script that activates conda when you start the bash shell in the .bashrc file. But now we need to make sure that the .bashrc file is run every time we connect to JASMIN via SSH. To do this, type nano .bash_profile and paste the following:

# .bash_profile

# If .bash_profile exists, bash doesn't read .profile
if [[ -f ~/.profile ]]; then
  . ~/.profile
fi

# If the shell is interactive and .bashrc exists, get the aliases and functions
if [[ $- == *i* && -f ~/.bashrc ]]; then
    . ~/.bashrc
fi

Then press Ctrl+O, Enter, Ctrl+X to save and exit the file. Now type logout to exit JASMIN, and immediately SSH back into JASMIN. You should see (miniconda3) prefixed to your prompt, and this should work on any of the sci servers - conda now has a stable installation that you can do whatever you like with.

Clone this wiki locally