Skip to content

Commit

Permalink
Merge pull request #1227 from bernt-matthias/doc_testing_bioconda
Browse files Browse the repository at this point in the history
Make `--channels` also affect mulled channels and update/extend howto use bioconda artifacts
  • Loading branch information
mvdbeek committed Oct 13, 2022
2 parents a83301c + 9b0f50d commit 69e3cbf
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
31 changes: 23 additions & 8 deletions docs/writing_how_do_i.rst
Original file line number Diff line number Diff line change
Expand Up @@ -333,20 +333,31 @@ file.
----------------------------------------------------------------------------

First, obtain the artifacts of the PR by adding this comment:
``@BiocondaBot please fetch artifacts``. In the reply one finds the links to the
built package and docker image.
``@BiocondaBot please fetch artifacts``. In the reply one finds the links a zip file containing
the built package and docker image. Download this zip and extract it. For the following let
``PACKAGES_DIR`` be the absolute path to the directory ``packages`` in the resulting unzipped directory
and ``IMAGE_ZIP`` be the absolute path to the ``tar.gz`` file in the ``images`` directory in the unzipped directory.

In order to test the tool with the package add the following to the planemo call::

$ planemo test ... --conda_channels LINK_TO_PACKAGE,conda-forge,bioconda,defaults ...
$ planemo test ... --conda_channels file://PACKAGES_DIR,conda-forge,bioconda,defaults ...

For containerized testing the docker image needs to be loaded::
For containerized testing we need to differentiate two cases:

$ curl -L "LINK_TO_DOCKER_IMAGE.tar.gz" | gzip -dc | docker load
1. the tool has a single requirement (that is fulfilled by the container)
2. the tool has multiple requirements (in this case a docker image will be built on the fly using package)

A planemo test will then simply use this image::
For the former case the docker image that has been created by the bioconda CI needs to be loaded::

$ planemo test ... --biocontainers --no_conda_auto_init ...
$ gzip -dc IMAGE_ZIP | docker load

and a planemo test can then simply use this image::

$ planemo test ... --biocontainers --no_dependency_resolution --no_conda_auto_init ...

For the later case it suffices to call planemo as follows::

$ planemo test ... --biocontainers --no_dependency_resolution --no_conda_auto_init --conda_channels file://PACKAGES_DIR,conda-forge,bioconda,defaults ...

--------------------------------------
\.\.\. interactively debug tool tests?
Expand Down Expand Up @@ -383,4 +394,8 @@ For a tool test that uses Docker to to resolve the requirements one needs to exe
``../galaxy_3.sh``, because it executes ``docker run ... tool_script.sh`` in order to rerun the job
(with a possible edited version of the tool script). In order to run the docker container
interactively execute the ``docker run .... /bin/bash`` that you find in ``../galaxy_3.sh``
(i.e. ommitting the call of the ``tool_script.sh``) with added parameter ``-it``.
(i.e. ommitting the call of the ``tool_script.sh``) with added parameter ``-it``. Note that the
``docker run`` command contains some shell variables (``-v "$_GALAXY_JOB_TMP_DIR:$_GALAXY_JOB_TMP_DIR:rw" -v "$_GALAXY_JOB_HOME_DIR:$_GALAXY_JOB_HOME_DIR:rw"``)
which ensure that the job's temporary and home directory are available within docker. Ideally
these shell variables are set to the same values as in ``../galaxy_3.sh``, but often its sufficient
to remove this part from the ``docker run`` call.
3 changes: 3 additions & 0 deletions planemo/galaxy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ def config_join(*args):
@contextlib.contextmanager
def local_galaxy_config(ctx, runnables, for_tests=False, **kwds):
"""Set up a ``GalaxyConfig`` in an auto-cleaned context."""

test_data_dir = _find_test_data(runnables, **kwds)
tool_data_table = _find_tool_data_table(runnables, test_data_dir=test_data_dir, **kwds)
data_manager_config_paths = [r.data_manager_conf_path for r in runnables if r.data_manager_conf_path]
Expand Down Expand Up @@ -423,6 +424,8 @@ def config_join(*args):
)
_handle_container_resolution(ctx, kwds, properties)
properties["database_connection"] = _database_connection(database_location, **kwds)
if kwds.get("mulled_containers", False):
properties["mulled_channels"] = kwds.get("conda_ensure_channels", "")

_handle_kwd_overrides(properties, kwds)

Expand Down

0 comments on commit 69e3cbf

Please sign in to comment.