Skip to content

Commit

Permalink
builders update to excl unnecessary steps
Browse files Browse the repository at this point in the history
  • Loading branch information
JennyonOort committed Dec 8, 2024
1 parent 8d1f0d6 commit 73316fe
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 200 deletions.
40 changes: 20 additions & 20 deletions builders/docker_magic_builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

# Set environment name and required dependency versions
ENV_NAME="diabetes_predictor"
CONDA_VERSION="23.9.0"
CONDA_VERSION="24.11.0"
CONDA_LOCK_VERSION="2.5.7"
MAMBA_VERSION="1.5.8"
JUPYTERLAB_VERSION="4.0.0"
NB_CONDA_KERNELS_VERSION="2.3.1"
MAMBA_VERSION="2.0.4"
JUPYTERLAB_VERSION="4.3.2"
NB_CONDA_KERNELS_VERSION="2.5.1"

# Function to check if a command exists
check_command() {
Expand All @@ -29,19 +29,19 @@ ensure_dependency() {
fi
}

# Step 1: Check for Conda and initialize if necessary
check_command conda
if ! grep -q 'conda' <<< "$PATH"; then
echo "Conda is not initialized. Initializing Conda..."
conda init
exec bash
fi
# # Step 1: Check for Conda and initialize if necessary
# check_command conda
# if ! grep -q 'conda' <<< "$PATH"; then
# echo "Conda is not initialized. Initializing Conda..."
# conda init
# exec bash
# fi

# Step 2: Remove the existing environment if it exists
if conda env list | grep -q "^${ENV_NAME}"; then
echo "Environment '${ENV_NAME}' already exists. Removing it..."
conda env remove --name "$ENV_NAME" --yes
fi
# # Step 2: Remove the existing environment if it exists
# if conda env list | grep -q "^${ENV_NAME}"; then
# echo "Environment '${ENV_NAME}' already exists. Removing it..."
# conda env remove --name "$ENV_NAME" --yes
# fi

# # Step 3: Create the Conda environment from environment.yml
# echo "Creating the Conda environment from environment.yml..."
Expand All @@ -52,20 +52,20 @@ fi
# eval "$(conda shell.bash hook)"
# conda activate "$ENV_NAME"

# Step 3: Ensure all dependencies are installed
# Step 1: Ensure all dependencies are installed
ensure_dependency "conda" "$CONDA_VERSION"
ensure_dependency "conda-lock" "$CONDA_LOCK_VERSION"
ensure_dependency "mamba" "$MAMBA_VERSION"
ensure_dependency "jupyterlab" "$JUPYTERLAB_VERSION"
ensure_dependency "nb_conda_kernels" "$NB_CONDA_KERNELS_VERSION"

# Step 4: Creating/Updating conda-linux-64.lock
# Step 2: Creating/Updating conda-linux-64.lock
echo "Creating/Updating conda-linux-64.lock..."
conda-lock -k explicit --file environment.yml -p linux-64

# Step 5: Build the Docker image and create the Conda environment
# Step 3: Build the Docker image and create the Conda environment
echo "Building the Docker image and setting up the Conda environment..."
docker-compose up --build

# Step 8: Confirm that the services are running
# Step 4: Confirm that the services are running
echo "Docker containers are up and running."
Loading

0 comments on commit 73316fe

Please sign in to comment.