From c0aadc7d7d11b49d3fd60fdc42340b79ee910097 Mon Sep 17 00:00:00 2001 From: Ryan Forsyth Date: Thu, 15 Jun 2023 12:18:46 -0700 Subject: [PATCH] Change workflow to mamba --- .github/workflows/build_workflow.yml | 2 +- .github/workflows/release_workflow.yml | 3 +- conda/dev.yml | 3 +- docs/source/getting_started.rst | 59 ++++++++++++++++---------- setup.py | 5 --- 5 files changed, 40 insertions(+), 32 deletions(-) diff --git a/.github/workflows/build_workflow.yml b/.github/workflows/build_workflow.yml index 46c59805..3001d0ba 100644 --- a/.github/workflows/build_workflow.yml +++ b/.github/workflows/build_workflow.yml @@ -81,7 +81,7 @@ jobs: - name: Install Dependencies run: | - pip install sphinx==5.2.3 sphinx_rtd_theme==1.0.0 sphinx-multiversion==0.2.4 docutils==0.16 "jinja2<3.1" + mamba install -y sphinx==5.2.3 sphinx_rtd_theme==1.0.0 sphinx-multiversion==0.2.4 docutils==0.16 "jinja2<3.1" - name: Build Sphinx Docs run: | diff --git a/.github/workflows/release_workflow.yml b/.github/workflows/release_workflow.yml index ff9a9bf0..d96da724 100644 --- a/.github/workflows/release_workflow.yml +++ b/.github/workflows/release_workflow.yml @@ -33,10 +33,9 @@ jobs: ${{ runner.os }}-pip- ${{ runner.os }}- - # Using pip for Sphinx dependencies because it takes too long to reproduce a conda environment (~10 secs vs. 3-4 mins) - name: Install Dependencies run: | - pip install sphinx==5.2.3 sphinx_rtd_theme==1.0.0 sphinx-multiversion==0.2.4 docutils==0.16 "jinja2<3.1" + mamba install -y sphinx==5.2.3 sphinx_rtd_theme==1.0.0 sphinx-multiversion==0.2.4 docutils==0.16 "jinja2<3.1" - name: Build Sphinx Docs run: | diff --git a/conda/dev.yml b/conda/dev.yml index 437f0119..051bf97f 100644 --- a/conda/dev.yml +++ b/conda/dev.yml @@ -25,9 +25,8 @@ dependencies: - jinja2<3.1 - sphinx=5.2.3 - sphinx_rtd_theme=1.0.0 + - sphinx-multiversion==0.2.4 # Need to pin docutils because 0.17 has a bug with unordered lists # https://github.com/readthedocs/sphinx_rtd_theme/issues/1115 - docutils=0.16 - - pip: - - sphinx-multiversion==0.2.4 prefix: /opt/miniconda3/envs/zstash_dev diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index 0172f28a..16b22a28 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -81,32 +81,38 @@ Others/Local If the system doesn't come with conda pre-installed, follow these instructions: -1. Download Conda +1. Download Mambaforge Linux :: - wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh + wget https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh - MacOS (note that ``zstash`` is not supported on MacOS, but it may be useful to contribute to the documentation on MacOS) + MacOS x86_64 (note that ``zstash`` is not supported on MacOS, but it may be useful to contribute to the documentation on MacOS) :: - wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh + wget https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-MacOSX-x86_64.sh -2. Install Conda +2. Install Mambaforge Linux :: - bash ./Miniconda3-latest-Linux-x86_64.sh + bash ./Mambaforge-Linux-x86_64.sh - MacOS + MacOS x86_64 :: - bash ./Miniconda3-latest-MacOSX-x86_64.sh + bash ./Mambaforge-MacOSX-x86_64.sh - - ``Do you wish the installer to initialize Miniconda3 by running conda init? [yes|no] yes`` + When you see: :: + + by running conda init? [yes|no] + [no] >>> yes + + respond with ``yes`` so ``conda`` and ``mamba`` commands are available on + initializing a new bash terminal. 3. If you are working on a machine/network that intercepts SSL communications (such as acme1), you will get an SSL error unless you disable the SSL verification: @@ -116,31 +122,40 @@ acme1), you will get an SSL error unless you disable the SSL verification: conda config --set ssl_verify false binstar config --set ssl_verify False -4. Once conda is properly working, you can install the **(a) Latest Stable Release** or +4. Once conda and mamba are properly working, you can install the **(a) Latest Stable Release** or create a **(b) Development Environment**. (a) Latest Stable Release ========================= -Installation using conda +Installation using mamba ------------------------ First, make sure that you're using ``bash``. :: - $ bash + bash -You must have Anaconda installed as well. +You must have a conda base enviornment installed as well. See :ref:`"Installation in a Conda Environment" ` section above for installing conda. Create a new Anaconda environment with zstash installed and activate it: :: - $ conda create -n zstash_env -c e3sm -c conda-forge zstash - $ source activate zstash_env +These steps should not be necessary if you installed Mambaforge as suggested +above but may be needed if you have previously installed Miniconda3 instead: :: + + conda install -y -n base mamba + conda config --add channels conda-forge + conda config --set channel_priority strict + +Create a new conda environment with ``zstash`` installed and activate it: :: -Or you can install zstash in an existing environment. :: + mamba create -n zstash_env zstash + conda activate zstash_env - $ conda install zstash -c e3sm -c conda-forge +Or (less recommended because of potential conflicts) you can install ``zstash`` +in an existing environment. :: + mamba install zppy Installation on NERSC --------------------- @@ -154,10 +169,10 @@ not directly available there, so you will need to manually activate Anaconda bef Updating -------- -If you **installed via Anaconda** (e.g., not through the unified environment), -you can update ``zstash`` by doing the following: :: +If you **installed into your own conda environment** (e.g., not through the +unified environment), you can update ``zstash`` by doing the following: :: - conda update zstash -c e3sm -c conda-forge + mamba update zstash .. _dev-env: @@ -224,7 +239,7 @@ Furthermore, the dev environment includes quality assurance (QA) tools such as c :: - conda clean --all + mamba clean --all 4. Enter the fork's clone. @@ -239,7 +254,7 @@ Furthermore, the dev environment includes quality assurance (QA) tools such as c :: - conda env create -f conda/dev.yml + mamba env create -f conda/dev.yml conda activate zstash_dev 6. Install ``pre-commit``. diff --git a/setup.py b/setup.py index 00e4c539..6bdd5be9 100644 --- a/setup.py +++ b/setup.py @@ -8,10 +8,5 @@ description="Long term HPSS archiving software for E3SM", packages=find_packages(include=["zstash", "zstash.*"]), python_requires=">=3.6", - install_requires=[ - "fair-research-login>=0.2.6,<0.3.0", - "globus-sdk>=3.0.0,<4.0.0", - "six", - ], entry_points={"console_scripts": ["zstash=zstash.main:main"]}, )