From af40c25accedb897342498eb6f4aa911fe24e3fb Mon Sep 17 00:00:00 2001 From: jaimergp Date: Thu, 17 Oct 2024 16:02:00 +0200 Subject: [PATCH 1/5] add support for micromamba provisioning --- conda_smithy/templates/build_steps.sh.tmpl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/conda_smithy/templates/build_steps.sh.tmpl b/conda_smithy/templates/build_steps.sh.tmpl index dc71d3c5d..ff5749eb2 100644 --- a/conda_smithy/templates/build_steps.sh.tmpl +++ b/conda_smithy/templates/build_steps.sh.tmpl @@ -27,12 +27,22 @@ conda-build: root-dir: ${FEEDSTOCK_ROOT}/build_artifacts pkgs_dirs: - ${FEEDSTOCK_ROOT}/build_artifacts/pkg_cache +{%- if conda_install_tool == "micromamba" %} + - /opt/mamba/pkgs +{%- endif %} - /opt/conda/pkgs {%- if conda_solver %} solver: {{ conda_solver }} {%- endif %} CONDARC + +{%- if conda_install_tool == "micromamba" %} +micromamba create --root-prefix /opt/conda --prefix /opt/mamba \ + --yes --quiet --override-channels --channel conda-forge --strict-channel-priority \ + pip {{ conda_install_tool_deps }} {{ conda_build_tool_deps }} {{ " ".join(remote_ci_setup) }} +{%- endif %} + {%- if conda_build_tool == "mambabuild" %} {%- set BUILD_CMD="conda-mambabuild" %} {%- elif conda_build_tool == "conda-build+conda-libmamba-solver" %} @@ -47,12 +57,10 @@ CONDARC {%- if conda_solver == "libmamba" %} export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1 {%- endif %} -{%- if conda_install_tool == "micromamba" %} -{%- set conda_install_tool = "mamba" %} -{%- endif %} - +{%- if conda_install_tool in ("conda", "mamba") %} {{ conda_install_tool }} install --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ pip {{ conda_install_tool_deps }} {{ conda_build_tool_deps }} {{ " ".join(remote_ci_setup) }} +{%- endif %} {%- if conda_install_tool == "mamba" and (conda_build_tool_deps != "" or conda_install_tool_deps != "") %} {{ conda_install_tool }} update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ pip {{ conda_install_tool_deps }} {{ conda_build_tool_deps }} {{ " ".join(remote_ci_setup_update) }} From 93b78a7f4339a09cd19c3cdaccedc285e3bdf88b Mon Sep 17 00:00:00 2001 From: jaimergp Date: Thu, 17 Oct 2024 16:02:32 +0200 Subject: [PATCH 2/5] update docs --- conda_smithy/data/conda-forge.json | 2 +- conda_smithy/schema.py | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/conda_smithy/data/conda-forge.json b/conda_smithy/data/conda-forge.json index 78795a921..d2015bf4f 100644 --- a/conda_smithy/data/conda-forge.json +++ b/conda_smithy/data/conda-forge.json @@ -1777,7 +1777,7 @@ } ], "default": "micromamba", - "description": "Use this option to choose which tool is used to provision the tooling in your\nfeedstock. Defaults to micromamba.\n\nIf conda or mamba are chosen, the latest Miniforge will be used to\nprovision the base environment. If micromamba is chosen, Miniforge\nis not involved; the environment is created directly by micromamba.\n\nNote: micromamba is only used on macOS and Windows for now.\nOn Linux, mamba (as provided in the Docker images) will still be used\neven if micromamba is chosen.", + "description": "Use this option to choose which tool is used to provision the tooling in your\nfeedstock. Defaults to micromamba.\n\nIf conda or mamba are chosen, the latest Miniforge will be used to\nprovision the base environment. If micromamba is chosen, Miniforge\nis not involved; the environment is created directly by micromamba.", "title": "Conda Install Tool" }, "conda_forge_output_validation": { diff --git a/conda_smithy/schema.py b/conda_smithy/schema.py index d6415bb7d..c912abc5c 100644 --- a/conda_smithy/schema.py +++ b/conda_smithy/schema.py @@ -637,10 +637,6 @@ class ConfigModel(BaseModel): If conda or mamba are chosen, the latest Miniforge will be used to provision the base environment. If micromamba is chosen, Miniforge is not involved; the environment is created directly by micromamba. - - Note: micromamba is only used on macOS and Windows for now. - On Linux, mamba (as provided in the Docker images) will still be used - even if micromamba is chosen. """ ), ) From e9690525910eca2ea956c08325a74c0061a64bf1 Mon Sep 17 00:00:00 2001 From: jaimergp Date: Thu, 17 Oct 2024 19:17:34 +0200 Subject: [PATCH 3/5] install to /opt/conda, do not pin python --- conda_smithy/templates/build_steps.sh.tmpl | 30 ++++++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/conda_smithy/templates/build_steps.sh.tmpl b/conda_smithy/templates/build_steps.sh.tmpl index ff5749eb2..a816730fd 100644 --- a/conda_smithy/templates/build_steps.sh.tmpl +++ b/conda_smithy/templates/build_steps.sh.tmpl @@ -27,9 +27,6 @@ conda-build: root-dir: ${FEEDSTOCK_ROOT}/build_artifacts pkgs_dirs: - ${FEEDSTOCK_ROOT}/build_artifacts/pkg_cache -{%- if conda_install_tool == "micromamba" %} - - /opt/mamba/pkgs -{%- endif %} - /opt/conda/pkgs {%- if conda_solver %} solver: {{ conda_solver }} @@ -38,8 +35,31 @@ solver: {{ conda_solver }} CONDARC {%- if conda_install_tool == "micromamba" %} -micromamba create --root-prefix /opt/conda --prefix /opt/mamba \ - --yes --quiet --override-channels --channel conda-forge --strict-channel-priority \ +if [[ ! -f /opt/conda/condabin/micromamba ]]; then + # TEMPORARY: only until https://github.com/conda-forge/docker-images/pull/288 is merged + export micromamba_version="1.5.10-0" + if [ "$(uname -m)" = "x86_64" ]; then + export micromamba_arch="64" + export micromamba_chksum="80057e007579d482a39dc283dd3e725503e34da7e7c51844957164511cdb917b" + elif [ "$(uname -m)" = "ppc64le" ]; then + export micromamba_arch="ppc64le" + export micromamba_chksum="5528e92b12f7389a8d23a409a476e871f4f889a17e381924cf74459f14627ddd" + elif [ "$(uname -m)" = "aarch64" ]; then + export micromamba_arch="aarch64" + export micromamba_chksum="7803a2aa51a5f0a58f3d2ef0f07724edb67f31f61b3e44ae9b8d6c9f009f7996" + else + exit 1 + fi + export micromambapkg="https://github.com/mamba-org/micromamba-releases/releases/download/${micromamba_version}/micromamba-linux-${micromamba_arch}" + # Download micromamba and put it condabin + curl -s -L $micromambapkg > /opt/conda/condabin/micromamba + sha256sum /opt/conda/condabin/micromamba | grep $micromamba_chksum + chmod +x /opt/conda/condabin/micromamba +fi +micromamba info --root-prefix ~/.conda +echo > /opt/conda/conda-meta/history +micromamba install --root-prefix ~/.conda --prefix /opt/conda \ + --yes --override-channels --channel conda-forge --strict-channel-priority \ pip {{ conda_install_tool_deps }} {{ conda_build_tool_deps }} {{ " ".join(remote_ci_setup) }} {%- endif %} From cb2edb92ebeccbc052bffae0de41515fbbd8f5ef Mon Sep 17 00:00:00 2001 From: jaimergp Date: Thu, 17 Oct 2024 23:03:23 +0200 Subject: [PATCH 4/5] clean up --- conda_smithy/templates/build_steps.sh.tmpl | 23 +--------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/conda_smithy/templates/build_steps.sh.tmpl b/conda_smithy/templates/build_steps.sh.tmpl index a816730fd..aa5fb904b 100644 --- a/conda_smithy/templates/build_steps.sh.tmpl +++ b/conda_smithy/templates/build_steps.sh.tmpl @@ -35,28 +35,7 @@ solver: {{ conda_solver }} CONDARC {%- if conda_install_tool == "micromamba" %} -if [[ ! -f /opt/conda/condabin/micromamba ]]; then - # TEMPORARY: only until https://github.com/conda-forge/docker-images/pull/288 is merged - export micromamba_version="1.5.10-0" - if [ "$(uname -m)" = "x86_64" ]; then - export micromamba_arch="64" - export micromamba_chksum="80057e007579d482a39dc283dd3e725503e34da7e7c51844957164511cdb917b" - elif [ "$(uname -m)" = "ppc64le" ]; then - export micromamba_arch="ppc64le" - export micromamba_chksum="5528e92b12f7389a8d23a409a476e871f4f889a17e381924cf74459f14627ddd" - elif [ "$(uname -m)" = "aarch64" ]; then - export micromamba_arch="aarch64" - export micromamba_chksum="7803a2aa51a5f0a58f3d2ef0f07724edb67f31f61b3e44ae9b8d6c9f009f7996" - else - exit 1 - fi - export micromambapkg="https://github.com/mamba-org/micromamba-releases/releases/download/${micromamba_version}/micromamba-linux-${micromamba_arch}" - # Download micromamba and put it condabin - curl -s -L $micromambapkg > /opt/conda/condabin/micromamba - sha256sum /opt/conda/condabin/micromamba | grep $micromamba_chksum - chmod +x /opt/conda/condabin/micromamba -fi -micromamba info --root-prefix ~/.conda +mv /opt/conda/conda-meta/history /opt/conda/conda-meta/history.$(date +%Y-%m-%d-%H-%M-%S) echo > /opt/conda/conda-meta/history micromamba install --root-prefix ~/.conda --prefix /opt/conda \ --yes --override-channels --channel conda-forge --strict-channel-priority \ From 952899efc244e7bf29b81964002dbf2b338a1dc3 Mon Sep 17 00:00:00 2001 From: jaimergp Date: Thu, 17 Oct 2024 23:17:51 +0200 Subject: [PATCH 5/5] amend news --- news/gh2075-micromamba-install-tool.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/gh2075-micromamba-install-tool.rst b/news/gh2075-micromamba-install-tool.rst index 5df087290..0994e7ef1 100644 --- a/news/gh2075-micromamba-install-tool.rst +++ b/news/gh2075-micromamba-install-tool.rst @@ -1,6 +1,6 @@ **Added:** -* Added ``micromamba`` as the default install tool on macOS and Windows. (#2075) +* Added ``micromamba`` as the default install tool on Linux, macOS and Windows. (#2075, #2097) **Changed:**