diff --git a/.github/integration-test.py b/.github/integration-test.py index dfbf65a..7450628 100755 --- a/.github/integration-test.py +++ b/.github/integration-test.py @@ -29,9 +29,9 @@ def run_systemd_image(image_name, container_name, bootstrap_pip_spec): '--mount', 'type=bind,source=/sys/fs/cgroup,target=/sys/fs/cgroup', '--detach', '--name', container_name, - # This is the minimum VM size we support. - # If we change this, need to change all other references to this number. - '--memory', '1G', + # A bit less than 1GB to ensure TLJH runs on 1GB VMs. + # If this is changed all docs references to the required memory must be changed too. + '--memory', '900m', ] if bootstrap_pip_spec: diff --git a/docs/install/amazon.rst b/docs/install/amazon.rst index 4ee9c86..e8408dc 100644 --- a/docs/install/amazon.rst +++ b/docs/install/amazon.rst @@ -76,8 +76,9 @@ Let's create the server on which we can run JupyterHub. `Next: Configure Instance Details` in the lower right corner. Check out our guide on How To :ref:`howto/admin/resource-estimation` to help pick - how much Memory / CPU your server needs. You need to have at least **1GB** of - RAM. The smallest instance that can fit this is a **t3.small**. + how much Memory / CPU your server needs. + We recommend you use a server with at least 2GB of RAM, such as a **t3.small**. + However, if you need to minimise costs you can use a server with **1GB** RAM such as a **t2.micro**, but performance will be limited. You may wish to consult the listing `here `_ because it shows cost per hour. The **On Demand** price is the pertinent cost. diff --git a/tests/test_conda.py b/tests/test_conda.py index 12dbd81..539e646 100644 --- a/tests/test_conda.py +++ b/tests/test_conda.py @@ -13,14 +13,14 @@ def prefix(): """ Provide a temporary directory with a conda environment """ - miniconda_version = '4.7.10' - miniconda_installer_sha256 = "8a324adcc9eaf1c09e22a992bb6234d91a94146840ee6b11c114ecadafc68121" - installer_url = "https://repo.continuum.io/miniconda/Miniconda3-{}-Linux-x86_64.sh".format(miniconda_version) + mambaforge_version = '4.10.3-7' + installer_sha256 = "fc872522ec427fcab10167a93e802efaf251024b58cc27b084b915a9a73c4474" + installer_url = "https://github.com/conda-forge/miniforge/releases/download/{v}/Mambaforge-{v}-Linux-x86_64.sh".format(v=mambaforge_version) with tempfile.TemporaryDirectory() as tmpdir: - with conda.download_miniconda_installer(installer_url, miniconda_installer_sha256) as installer_path: + with conda.download_miniconda_installer(installer_url, installer_sha256) as installer_path: conda.install_miniconda(installer_path, tmpdir) conda.ensure_conda_packages(tmpdir, [ - 'conda==4.8.1' + 'conda==4.10.3' ]) yield tmpdir diff --git a/tljh/conda.py b/tljh/conda.py index 3fa8a87..9c8c749 100644 --- a/tljh/conda.py +++ b/tljh/conda.py @@ -94,7 +94,7 @@ def ensure_conda_packages(prefix, packages): """ Ensure packages (from conda-forge) are installed in the conda prefix. """ - conda_executable = [os.path.join(prefix, 'bin', 'python'), '-m', 'conda'] + conda_executable = [os.path.join(prefix, 'bin', 'mamba')] abspath = os.path.abspath(prefix) # Let subprocess errors propagate # Explicitly do *not* capture stderr, since that's not always JSON! diff --git a/tljh/installer.py b/tljh/installer.py index 2a68a19..05b4ce4 100644 --- a/tljh/installer.py +++ b/tljh/installer.py @@ -172,24 +172,33 @@ def ensure_user_environment(user_requirements_txt_file): miniconda_old_version = '4.5.4' miniconda_new_version = '4.7.10' - miniconda_installer_sha256 = "8a324adcc9eaf1c09e22a992bb6234d91a94146840ee6b11c114ecadafc68121" + # Install mambaforge using an installer from + # https://github.com/conda-forge/miniforge/releases + mambaforge_new_version = '4.10.3-7' + installer_sha256 = "fc872522ec427fcab10167a93e802efaf251024b58cc27b084b915a9a73c4474" + # Then run `mamba --version` to get the conda and mamba versions + # Keep these in sync with tests/test_conda.py::prefix + mambaforge_conda_new_version = '4.10.3' + mambaforge_mamba_version = '0.16.0' - if conda.check_miniconda_version(USER_ENV_PREFIX, miniconda_new_version): + if conda.check_miniconda_version(USER_ENV_PREFIX, mambaforge_conda_new_version): + conda_version = '4.10.3' + elif conda.check_miniconda_version(USER_ENV_PREFIX, miniconda_new_version): conda_version = '4.8.1' elif conda.check_miniconda_version(USER_ENV_PREFIX, miniconda_old_version): conda_version = '4.5.8' # If no prior miniconda installation is found, we can install a newer version else: logger.info('Downloading & setting up user environment...') - # FIXME: allow using miniforge - installer_url = "https://repo.continuum.io/miniconda/Miniconda3-{}-Linux-x86_64.sh".format(miniconda_new_version) - with conda.download_miniconda_installer(installer_url, miniconda_installer_sha256) as installer_path: + installer_url = "https://github.com/conda-forge/miniforge/releases/download/{v}/Mambaforge-{v}-Linux-x86_64.sh".format(v=mambaforge_new_version) + with conda.download_miniconda_installer(installer_url, installer_sha256) as installer_path: conda.install_miniconda(installer_path, USER_ENV_PREFIX) - conda_version = '4.8.1' + conda_version = '4.10.3' conda.ensure_conda_packages(USER_ENV_PREFIX, [ # Conda's latest version is on conda much more so than on PyPI. - 'conda==' + conda_version + 'conda==' + conda_version, + 'mamba==' + mambaforge_mamba_version, ]) conda.ensure_pip_requirements(