-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
swancustomenvs: Install ipykernel with requirements
Install requirements at the same time as the remaining requirements for better performance
- Loading branch information
1 parent
7392c11
commit 6dfbb8f
Showing
3 changed files
with
9 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 5 additions & 13 deletions
18
SwanCustomEnvironments/swancustomenvironments/scripts/builders/mamba.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,15 @@ | ||
#!/bin/bash | ||
|
||
# Create the environment and install packages | ||
mamba create -p ${ENV_PATH} --file ${REQ_PATH} -y | tee -a ${LOG_FILE} | ||
# Create the environment, install packages and the same ipykernel that the Jupyter server uses | ||
mamba create -p ${ENV_PATH} --file ${REQ_PATH} "ipykernel==${IPYKERNEL_VERSION}" -y | tee -a ${LOG_FILE} | ||
|
||
# Activate the environment | ||
_log "Setting up the environment..." | ||
|
||
# Needed to use mamba activate without creating a new shell process | ||
# Initialize mamba and send its activation script to the user's bash profile | ||
MAMBADIR=$(mktemp -d) | ||
HOME=${MAMBADIR} mamba init | ||
ACTIVATE_MAMBA_CMD="source ${MAMBADIR}/.bashrc" | ||
eval "${ACTIVATE_MAMBA_CMD}" | ||
echo "source ${MAMBADIR}/.bashrc" >> /home/$USER/.bash_profile | ||
|
||
# Then activate the environment using mamba | ||
# Construct the activation command | ||
ACTIVATE_ENV_CMD="mamba activate ${ENV_PATH}" | ||
eval "${ACTIVATE_ENV_CMD}" | ||
|
||
# Install the same ipykernel that the Jupyter server uses | ||
mamba install "ipykernel==${IPYKERNEL_VERSION}" -y | tee -a ${LOG_FILE} | ||
|
||
# Source the mamba init script in the user's bash profile | ||
echo "${ACTIVATE_MAMBA_CMD}" >> /home/$USER/.bash_profile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters