conda#
End-to-end walk-through with conda. Conda installs python itself, so the environment of a workflow can have another python version than the one that recreates it.
Install conda#
Miniforge is a conda installation configured with the conda-forge channel
export CONDA_ROOT=$HOME/miniforge3
curl -LsSf -o /tmp/miniforge.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
bash /tmp/miniforge.sh -b -p $CONDA_ROOT
source $CONDA_ROOT/etc/profile.d/conda.sh
export CONDA_ROOT=$HOME/miniforge3
curl -LsSf -o /tmp/miniforge.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh
bash /tmp/miniforge.sh -b -p $CONDA_ROOT
source $CONDA_ROOT/etc/profile.d/conda.sh
$env:CONDA_ROOT = "$env:USERPROFILE\miniforge3"
irm https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe -OutFile miniforge.exe
Start-Process -Wait -FilePath .\miniforge.exe -ArgumentList "/S", "/D=$env:CONDA_ROOT"
& "$env:CONDA_ROOT\shell\condabin\conda-hook.ps1"
Producer side#
Create an environment, install ewoks in it and store a workflow with the
packages of that environment as its requirements
conda create --yes --prefix ewoks_producer python pip
conda activate ./ewoks_producer
pip install ewoks
ewoks convert demo demo.json --test
conda deactivate
conda create --yes --prefix ewoks_producer python pip
conda activate ./ewoks_producer
pip install ewoks
ewoks convert demo demo.json --test
conda deactivate
conda create --yes --prefix ewoks_producer python pip
conda activate .\ewoks_producer
pip install ewoks
ewoks convert demo demo.json --test
conda deactivate
Install any package that provides tasks instead of
ewoks for a real workflow. Conda stores the packages it installed
itself and the ones installed with pip: the pip section of the
environment.yml file in the requirements is the conda way of expressing
packages of the python package index.
Re-producer side#
Only ewoks itself is needed to recreate the environment of demo.json
conda create --yes --prefix ewoks_reproducer python pip
conda activate ./ewoks_reproducer
pip install ewoks
ewoks install demo.json --yes --env-root ewoks_envs
conda create --yes --prefix ewoks_reproducer python pip
conda activate ./ewoks_reproducer
pip install ewoks
ewoks install demo.json --yes --env-root ewoks_envs
conda create --yes --prefix ewoks_reproducer python pip
conda activate .\ewoks_reproducer
pip install ewoks
ewoks install demo.json --yes --env-root ewoks_envs
The environment of the workflow is a conda environment in ewoks_envs/demo. Without
--env-root it is created in the first environment directory of conda, where
conda activate demo finds it.
Execute the workflow#
ewoks execute --env ewoks_envs/demo demo.json --outputs=all
ewoks execute --env ewoks_envs/demo demo.json --outputs=all
ewoks execute --env ewoks_envs\demo demo.json --outputs=all
Clean up#
conda deactivate
rm -rf ewoks_producer ewoks_reproducer ewoks_envs demo.json
conda deactivate
rm -rf ewoks_producer ewoks_reproducer ewoks_envs demo.json
conda deactivate
Remove-Item -Recurse -Force ewoks_producer, ewoks_reproducer, ewoks_envs, demo.json
Note
mamba and micromamba are faster implementations of conda. Use
--package-manager-command micromamba to let ewoks install invoke one of them.