Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
${{ matrix.extra-pytest-warnings }}
enable-coverage: ${{ matrix.enable-coverage }}
jupyter-platform-dirs: "1"
package-managers: "uv pixi"
package-managers: "uv pixi conda"
codecov-flags: "unit"
strategy:
fail-fast: false
Expand Down
29 changes: 16 additions & 13 deletions doc/howtoguides/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ What is stored
:term:`package manager` can recreate the environment from this list.
* ``manager``: the :term:`package manager` that generated the requirements, with the content
of the files it needs to recreate the environment: ``requirements.txt`` for pip-venv,
``pyproject.toml`` and ``uv.lock`` for uv, ``pixi.toml`` and ``pixi.lock`` for pixi.
``pyproject.toml`` and ``uv.lock`` for uv, ``environment.yml`` for conda, ``pixi.toml``
and ``pixi.lock`` for pixi.

Use ``--exclude-requirements`` to store nothing.

Expand Down Expand Up @@ -55,8 +56,8 @@ is not on the ``PATH`` or when a faster implementation should be used

.. code-block:: bash

ewoks install demo.json --yes --package-manager-name uv \
--package-manager-command /path/to/uv
ewoks install demo.json --yes --package-manager-name conda \
--package-manager-command micromamba

Choose the environment
----------------------
Expand Down Expand Up @@ -85,27 +86,29 @@ The default name is the identifier of the :term:`workflow`, which is the ``id``
``graph`` field. A :term:`workflow` without an identifier gets a name derived from its
content.

Without ``--env-root`` the :term:`package manager` decides where the environment goes. venv,
uv and pixi create an environment wherever they are told to, so for pip-venv, uv and pixi
ewoks uses ``~/.ewoks/envs``.
Without ``--env-root`` the :term:`package manager` decides where the environment goes: conda
creates it in its own environment directory (``conda config --show envs_dirs``), so
``conda activate <name>`` finds it. venv, uv and pixi create an environment wherever they are
told to, so for those ewoks uses ``~/.ewoks/envs``.

An environment that already exists is installed in, which adds the requirements to what is
already there. Use ``--clean`` to remove it first. Only a directory that contains a python
environment is removed.

The environment of a :term:`workflow` is a directory: for pip-venv it is a virtual
environment, for uv a project with the environment in ``.venv`` and for pixi a workspace with
the environment in ``.pixi/envs/default``. ``ewoks execute --env`` takes that directory, not
the python interpreter inside it.
The environment of a :term:`workflow` is a directory. For pip-venv and conda it is a python
environment, for uv it is a project with the environment in ``.venv`` and for pixi it is a
workspace with the environment in ``.pixi/envs/default``. ``ewoks execute --env`` takes that
directory, not the python interpreter inside it.

Limitations
-----------

* ``--in-place`` is only supported by pip-venv and uv. The other package managers only install
in an environment they created themselves.
* ``--python-version`` is a request: uv can provide any python version, pixi provides the patch
versions built by its channel and pip-venv can only use the version of the python interpreter
that creates the environment. A warning is emitted when the version cannot be provided.
* ``--python-version`` is a request: uv can provide any python version, conda and pixi provide
the patch versions built by their channel and pip-venv can only use the version of the python
interpreter that creates the environment. A warning is emitted when the version cannot be
provided.
* uv and pixi resolve the ``distributions`` into a lock file, which requires access to the
package index. When that fails, a warning is emitted and the requirements are stored without
files: the environment is then recreated from the ``distributions`` list.
Expand Down
2 changes: 1 addition & 1 deletion doc/reference/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Glossary
An execution engine is the underlying software used to execute the :term:`workflow`. :term:`Ewoks` supports multiple execution engines: pypushflow, orange, dask and the ewoks internal excution engine.

Package manager
A package manager creates python environments and installs packages in them. :term:`Ewoks` uses package managers to store the environment in which a :term:`workflow` was created and to recreate it: pip with venv, uv and pixi.
A package manager creates python environments and installs packages in them. :term:`Ewoks` uses package managers to store the environment in which a :term:`workflow` was created and to recreate it: pip with venv, uv, conda and pixi.

blissdata
`Blissdata <https://bliss.gitlab-pages.esrf.fr/blissdata>`_ is an API for accessing data from BLISS in memory.
1 change: 1 addition & 0 deletions doc/tutorials/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ of the supported ones

install/pip_venv
install/uv
install/conda
install/pixi

The producer and the re-producer do not need the same :term:`package manager`: the
Expand Down
179 changes: 179 additions & 0 deletions doc/tutorials/install/conda.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
.. _install_conda:

conda
=====

End-to-end walk-through with `conda <https://docs.conda.io/>`_. Conda installs python itself,
so the environment of a :term:`workflow` can have another python version than the one that
recreates it.

Install conda
-------------

`Miniforge <https://github.com/conda-forge/miniforge>`_ is a conda installation configured
with the conda-forge channel

.. tabs::

.. group-tab:: Linux

.. code-block:: bash

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

.. group-tab:: macOS

.. code-block:: bash

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

.. group-tab:: Windows

.. code-block:: powershell

$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 :term:`ewoks` in it and store a :term:`workflow` with the
packages of that environment as its ``requirements``

.. tabs::

.. group-tab:: Linux

.. code-block:: bash

conda create --yes --prefix ewoks_producer python pip
conda activate ./ewoks_producer
pip install ewoks
ewoks convert demo demo.json --test
conda deactivate

.. group-tab:: macOS

.. code-block:: bash

conda create --yes --prefix ewoks_producer python pip
conda activate ./ewoks_producer
pip install ewoks
ewoks convert demo demo.json --test
conda deactivate

.. group-tab:: Windows

.. code-block:: powershell

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 :term:`tasks <Task>` instead of
``ewoks`` for a real :term:`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``

.. tabs::

.. group-tab:: Linux

.. code-block:: bash

conda create --yes --prefix ewoks_reproducer python pip
conda activate ./ewoks_reproducer
pip install ewoks
ewoks install demo.json --yes --env-root ewoks_envs

.. group-tab:: macOS

.. code-block:: bash

conda create --yes --prefix ewoks_reproducer python pip
conda activate ./ewoks_reproducer
pip install ewoks
ewoks install demo.json --yes --env-root ewoks_envs

.. group-tab:: Windows

.. code-block:: powershell

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 :term:`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
--------------------

.. tabs::

.. group-tab:: Linux

.. code-block:: bash

ewoks execute --env ewoks_envs/demo demo.json --outputs=all

.. group-tab:: macOS

.. code-block:: bash

ewoks execute --env ewoks_envs/demo demo.json --outputs=all

.. group-tab:: Windows

.. code-block:: powershell

ewoks execute --env ewoks_envs\demo demo.json --outputs=all

Clean up
--------

.. tabs::

.. group-tab:: Linux

.. code-block:: bash

conda deactivate
rm -rf ewoks_producer ewoks_reproducer ewoks_envs demo.json

.. group-tab:: macOS

.. code-block:: bash

conda deactivate
rm -rf ewoks_producer ewoks_reproducer ewoks_envs demo.json

.. group-tab:: Windows

.. code-block:: powershell

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.
Loading