From 01492f31c5a9d41a80988d453492157298056b67 Mon Sep 17 00:00:00 2001 From: Lucas A Estrada <63303345+laestrada@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:56:05 -0400 Subject: [PATCH] Bugfix/docker env (#201) * update docker container to activate micromamba env correctly --- .../base-image/install-scripts/install-micromamba.sh | 2 +- resources/containers/container_config.yml | 2 +- resources/containers/entrypoint.sh | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/resources/containers/base-image/install-scripts/install-micromamba.sh b/resources/containers/base-image/install-scripts/install-micromamba.sh index c6926982..ac2a27ed 100644 --- a/resources/containers/base-image/install-scripts/install-micromamba.sh +++ b/resources/containers/base-image/install-scripts/install-micromamba.sh @@ -16,4 +16,4 @@ echo "export MAMBA_ROOT_PREFIX=/opt/micromamba" >> /etc/bashrc echo 'eval "$(/opt/micromamba/bin/micromamba shell hook -s posix)"' >> /etc/bashrc # set alias to use conda and micromamba interchangeably -echo "alias conda='micromamba'" >> /etc/bashrc +echo $'conda() {\n micromamba "$@"\n}' >> /etc/bashrc diff --git a/resources/containers/container_config.yml b/resources/containers/container_config.yml index 74863da2..359b5408 100644 --- a/resources/containers/container_config.yml +++ b/resources/containers/container_config.yml @@ -175,7 +175,7 @@ OutputPath: "/home/al2/imi_output_dir" DataPath: "/home/al2/ExtData" ## Conda environment files -CondaFile: "/opt/conda/etc/profile.d/conda.sh" +CondaFile: "/etc/bashrc" CondaEnv: "imi_env" ## Download initial restart file from AWS S3? diff --git a/resources/containers/entrypoint.sh b/resources/containers/entrypoint.sh index f830dee8..7b73f558 100644 --- a/resources/containers/entrypoint.sh +++ b/resources/containers/entrypoint.sh @@ -55,8 +55,7 @@ if [[ "x${IMI_CONFIG_PATH}" != "x" ]]; then else config_file="config.yml" # remove default config file and replace with docker config file - rm config.yml - mv resources/containers/container_config.yml config.yml + cp resources/containers/container_config.yml config.yml fi # override specific config file vars with env variables of