diff --git a/metaflow/plugins/pypi/micromamba.py b/metaflow/plugins/pypi/micromamba.py index bf5f659e0a7..b40a1c77a0d 100644 --- a/metaflow/plugins/pypi/micromamba.py +++ b/metaflow/plugins/pypi/micromamba.py @@ -21,6 +21,9 @@ def __init__(self, error): super(MicromambaException, self).__init__(msg) +GLIBC_VERSION = os.environ.get("CONDA_OVERRIDE_GLIBC", "2.38") + + class Micromamba(object): def __init__(self, logger=None): # micromamba is a tiny version of the mamba package manager and comes with @@ -78,6 +81,9 @@ def solve(self, id_, packages, python, platform): "MAMBA_ADD_PIP_AS_PYTHON_DEPENDENCY": "true", "CONDA_SUBDIR": platform, # "CONDA_UNSATISFIABLE_HINTS_CHECK_DEPTH": "0" # https://github.com/conda/conda/issues/9862 + # Add a default glibc version for linux-64 environments (ignored for other platforms) + # TODO: Make the version configurable + "CONDA_OVERRIDE_GLIBC": GLIBC_VERSION, } cmd = [ "create", @@ -132,6 +138,7 @@ def download(self, id_, packages, python, platform): with tempfile.TemporaryDirectory() as tmp_dir: env = { "CONDA_SUBDIR": platform, + "CONDA_OVERRIDE_GLIBC": GLIBC_VERSION, } cmd = [ "create", @@ -171,6 +178,7 @@ def create(self, id_, packages, python, platform): # use hardlinks when possible, otherwise copy files # disabled for now since it adds to environment creation latencies "CONDA_ALLOW_SOFTLINKS": "0", + "CONDA_OVERRIDE_GLIBC": GLIBC_VERSION, } cmd = [ "create",