vivarium-dagger 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. vivarium_dagger-0.1.0/.readthedocs.yaml +42 -0
  2. vivarium_dagger-0.1.0/CHANGELOG.rst +8 -0
  3. vivarium_dagger-0.1.0/Jenkinsfile +41 -0
  4. vivarium_dagger-0.1.0/LICENSE +27 -0
  5. vivarium_dagger-0.1.0/Makefile +129 -0
  6. vivarium_dagger-0.1.0/PKG-INFO +131 -0
  7. vivarium_dagger-0.1.0/README.rst +81 -0
  8. vivarium_dagger-0.1.0/docs/nitpick-exceptions +6 -0
  9. vivarium_dagger-0.1.0/docs/source/_static/.gitkeep +0 -0
  10. vivarium_dagger-0.1.0/docs/source/api_reference/cli.rst +1 -0
  11. vivarium_dagger-0.1.0/docs/source/api_reference/config/builder.rst +1 -0
  12. vivarium_dagger-0.1.0/docs/source/api_reference/config/config.rst +1 -0
  13. vivarium_dagger-0.1.0/docs/source/api_reference/config/index.rst +7 -0
  14. vivarium_dagger-0.1.0/docs/source/api_reference/config/interface.rst +1 -0
  15. vivarium_dagger-0.1.0/docs/source/api_reference/config/parsing.rst +1 -0
  16. vivarium_dagger-0.1.0/docs/source/api_reference/config/serialization.rst +1 -0
  17. vivarium_dagger-0.1.0/docs/source/api_reference/config/validation.rst +1 -0
  18. vivarium_dagger-0.1.0/docs/source/api_reference/index.rst +11 -0
  19. vivarium_dagger-0.1.0/docs/source/api_reference/runner.rst +1 -0
  20. vivarium_dagger-0.1.0/docs/source/conf.py +242 -0
  21. vivarium_dagger-0.1.0/docs/source/dagger.rst +511 -0
  22. vivarium_dagger-0.1.0/docs/source/index.rst +19 -0
  23. vivarium_dagger-0.1.0/pyproject.toml +126 -0
  24. vivarium_dagger-0.1.0/python_versions.json +1 -0
  25. vivarium_dagger-0.1.0/setup.cfg +4 -0
  26. vivarium_dagger-0.1.0/src/vivarium/dagger/__init__.py +16 -0
  27. vivarium_dagger-0.1.0/src/vivarium/dagger/cli.py +215 -0
  28. vivarium_dagger-0.1.0/src/vivarium/dagger/config/__init__.py +14 -0
  29. vivarium_dagger-0.1.0/src/vivarium/dagger/config/builder.py +136 -0
  30. vivarium_dagger-0.1.0/src/vivarium/dagger/config/config.py +255 -0
  31. vivarium_dagger-0.1.0/src/vivarium/dagger/config/interface.py +592 -0
  32. vivarium_dagger-0.1.0/src/vivarium/dagger/config/parsing.py +525 -0
  33. vivarium_dagger-0.1.0/src/vivarium/dagger/config/serialization.py +176 -0
  34. vivarium_dagger-0.1.0/src/vivarium/dagger/config/utilities.py +257 -0
  35. vivarium_dagger-0.1.0/src/vivarium/dagger/config/validation.py +173 -0
  36. vivarium_dagger-0.1.0/src/vivarium/dagger/py.typed +0 -0
  37. vivarium_dagger-0.1.0/src/vivarium/dagger/runner.py +226 -0
  38. vivarium_dagger-0.1.0/src/vivarium_dagger.egg-info/PKG-INFO +131 -0
  39. vivarium_dagger-0.1.0/src/vivarium_dagger.egg-info/SOURCES.txt +57 -0
  40. vivarium_dagger-0.1.0/src/vivarium_dagger.egg-info/dependency_links.txt +1 -0
  41. vivarium_dagger-0.1.0/src/vivarium_dagger.egg-info/entry_points.txt +2 -0
  42. vivarium_dagger-0.1.0/src/vivarium_dagger.egg-info/requires.txt +31 -0
  43. vivarium_dagger-0.1.0/src/vivarium_dagger.egg-info/scm_file_list.json +53 -0
  44. vivarium_dagger-0.1.0/src/vivarium_dagger.egg-info/scm_version.json +8 -0
  45. vivarium_dagger-0.1.0/src/vivarium_dagger.egg-info/top_level.txt +1 -0
  46. vivarium_dagger-0.1.0/tests/__init__.py +0 -0
  47. vivarium_dagger-0.1.0/tests/config/__init__.py +0 -0
  48. vivarium_dagger-0.1.0/tests/config/conftest.py +91 -0
  49. vivarium_dagger-0.1.0/tests/config/test_builder.py +465 -0
  50. vivarium_dagger-0.1.0/tests/config/test_config.py +1410 -0
  51. vivarium_dagger-0.1.0/tests/config/test_interface.py +542 -0
  52. vivarium_dagger-0.1.0/tests/config/utilities.py +153 -0
  53. vivarium_dagger-0.1.0/tests/data/e2e_branches.yaml +4 -0
  54. vivarium_dagger-0.1.0/tests/data/e2e_model_spec.yaml +27 -0
  55. vivarium_dagger-0.1.0/tests/data/e2e_model_spec_fail_once.yaml +32 -0
  56. vivarium_dagger-0.1.0/tests/test_cli.py +411 -0
  57. vivarium_dagger-0.1.0/tests/test_e2e.py +590 -0
  58. vivarium_dagger-0.1.0/tests/test_package.py +14 -0
  59. vivarium_dagger-0.1.0/tests/test_runner.py +558 -0
@@ -0,0 +1,42 @@
1
+ # Paths are repo-root-relative even when this file lives in a subdirectory,
2
+ # so the package path must be qualified with libs/dagger/.
3
+ #
4
+ # This file is read by RTD only when the vivarium-dagger RTD
5
+ # project's Admin > Advanced Settings > "Path for .readthedocs.yaml" points
6
+ # here. The root-level /.readthedocs.yaml is a placeholder used by the
7
+ # import wizard and ignored for any project that has overridden the path.
8
+ version: 2
9
+
10
+ sphinx:
11
+ configuration: libs/dagger/docs/source/conf.py
12
+ fail_on_warning: true
13
+
14
+ build:
15
+ os: ubuntu-22.04
16
+ tools:
17
+ python: "3.13"
18
+ jobs:
19
+ post_checkout:
20
+ - git fetch --unshallow origin 2>/dev/null || git fetch origin main
21
+ # Cancel PR (external) builds that don't touch this lib (Exit 183 is RTD's
22
+ # signal to cancel the build immediately).
23
+ - |
24
+ if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet "origin/main...HEAD" -- libs/dagger/; then
25
+ echo "Skipping docs build: this PR changes nothing under libs/dagger/."
26
+ exit 183
27
+ fi
28
+ pre_install:
29
+ # RTD installs dependencies from PyPI. Install cluster-tools from the tree first, at
30
+ # the version its CHANGELOG is about to release, so the docs build before that
31
+ # release reaches PyPI (setuptools_scm alone would give it the previous tag's version).
32
+ - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_VIVARIUM_CLUSTER_TOOLS=$(grep -m1 -oE '[0-9]+\.[0-9]+\.[0-9]+' libs/cluster-tools/CHANGELOG.rst) "$READTHEDOCS_VIRTUALENV_PATH/bin/python" -m pip install ./libs/cluster-tools
33
+
34
+ python:
35
+ install:
36
+ - method: pip
37
+ path: libs/dagger
38
+ extra_requirements:
39
+ - docs
40
+
41
+ formats:
42
+ - pdf
@@ -0,0 +1,8 @@
1
+ **0.1.0 - 11/04/26**
2
+
3
+ - Initial release: Dagger moved from vivarium-cluster-tools
4
+ - Fix ``dagger restart -P/-q`` not reaching steps that took the workflow's project or queue
5
+ - Refuse a workflow whose ``simulation`` steps would write their runs to the same directory
6
+ - Finish Dagger runs that have a ``simulation`` step and were started under
7
+ ``vivarium-cluster-tools`` 4.x before upgrading. psimulate's worker module path changed, so
8
+ restarting such a run after the upgrade is not supported
@@ -0,0 +1,41 @@
1
+ /* This Jenkinsfile simply loads the `reusable_pipeline` pipeline from the
2
+ vivarium-build-utils package, which lives at ``libs/build-utils/`` inside the
3
+ ``ihmeuw/vivarium-suite`` monorepo (https://github.com/ihmeuw/vivarium-suite).
4
+
5
+ vivarium-build-utils is loaded as a Jenkins shared library
6
+ (https://www.jenkins.io/doc/book/pipeline/shared-libraries/).
7
+ Jenkins shared library convention dictates that importable modules must be stored
8
+ in the 'vars' folder.
9
+
10
+ Jenkins shared libraries can be configured in the Jenkins UI:
11
+ * Manage Jenkins
12
+ * Configure System
13
+ * Global Pipeline Libraries section
14
+ * Library subsection
15
+ * Name: The Name for the lib
16
+ * Version: The branch you want to use. Throws an error
17
+ for nonexistent branches.
18
+ * Project Repository: Url to the shared lib
19
+ * Credentials: SSH key to access the repo
20
+
21
+ Note that updating the shared repo will take effect on the next pipeline invocation.
22
+ */
23
+
24
+ // Load the get_vbu_version function from build-utils/bootstrap/
25
+ // (the directory to load from is defined in the Jenkins shared library configuration)
26
+ @Library("get_vbu_version@main") _
27
+
28
+ // Load the full vivarium_build_utils library at the expected version
29
+ library("vivarium_build_utils@${get_vbu_version()}")
30
+
31
+ reusable_pipeline(
32
+ scheduled_branches: [
33
+ // Add additional branches for cron jobs below.
34
+ // Note: Newly added branches will require a manual trigger of the first build
35
+ // for subsequent scheduled builds to run.
36
+ "main",
37
+ ],
38
+ requires_slurm: "weekly",
39
+ skip_doc_build: true,
40
+ env_reqs: "ci_jenkins",
41
+ )
@@ -0,0 +1,27 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright 2026 Institute for Health Metrics and Evaluation
4
+
5
+ Redistribution and use in source and binary forms, with or without modification,
6
+ are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this list
9
+ of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice, this
12
+ list of conditions and the following disclaimer in the documentation and/or other
13
+ materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its contributors may
16
+ be used to endorse or promote products derived from this software without specific
17
+ prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY
20
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
22
+ SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
24
+ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,129 @@
1
+ # Check if we're running in Jenkins
2
+ ifdef JENKINS_URL
3
+ # Files are already in workspace from shared library
4
+ MAKE_INCLUDES := .
5
+ else
6
+ # For local dev, use the installed vivarium.build_utils package if it exists
7
+ # First, check if we can import vivarium.build_utils and assign 'yes' or 'no'.
8
+ # We do this by importing the package in python and redirecting stderr to the null device.
9
+ # If the import is successful (&&), it will print 'yes', otherwise (||) it will print 'no'.
10
+ VIVARIUM_BUILD_UTILS_AVAILABLE := $(shell python -c "import vivarium.build_utils" 2>/dev/null && echo "yes" || echo "no")
11
+ # If vivarium.build_utils is available, get the makefiles path or else set it to empty
12
+ ifeq ($(VIVARIUM_BUILD_UTILS_AVAILABLE),yes)
13
+ MAKE_INCLUDES := $(shell python -c "from vivarium.build_utils.resources import get_makefiles_path; print(get_makefiles_path())")
14
+ else
15
+ MAKE_INCLUDES :=
16
+ endif
17
+ endif
18
+
19
+ # Set the package name as the last part of this file's parent directory path
20
+ PACKAGE_NAME = $(notdir $(CURDIR))
21
+
22
+ ifneq ($(MAKE_INCLUDES),) # not empty
23
+ # Include makefiles from vivarium.build_utils
24
+ include $(MAKE_INCLUDES)/base.mk
25
+ include $(MAKE_INCLUDES)/test.mk
26
+ else # empty
27
+ # Use this help message (since the vivarium.build_utils version is not available)
28
+ help:
29
+ @echo
30
+ @echo "For Make's standard help, run 'make --help'."
31
+ @echo
32
+ @echo "Most of our Makefile targets are provided by the vivarium.build_utils"
33
+ @echo "package. To access them, you need to create a development environment first."
34
+ @echo
35
+ @echo "make build-env"
36
+ @echo
37
+ @echo "USAGE:"
38
+ @echo " make build-env [name=<environment name>] [py=<python version>] [artifactory_access=<yes|no>] [keep_env=<yes|no>]"
39
+ @echo
40
+ @echo "ARGUMENTS:"
41
+ @echo " name [optional]"
42
+ @echo " Name of the conda environment to create (defaults to <PACKAGE_NAME>)"
43
+ @echo " py [optional]"
44
+ @echo " Python version (defaults to latest supported)"
45
+ @echo " artifactory_access [optional]"
46
+ @echo " Whether the build host can reach the IHME artifactory. Either 'yes'"
47
+ @echo " (default) or 'no'; use 'no' to build off-VPN without artifactory."
48
+ @echo " keep_env [optional]"
49
+ @echo " Whether to keep a failed build's partial environment for inspection."
50
+ @echo " Either 'yes' or 'no' (default, i.e. tear it down)."
51
+ @echo
52
+ @echo "After creating the environment:"
53
+ @echo " 1. Activate it: 'conda activate <environment_name>'"
54
+ @echo " 2. Run 'make help' again to see all newly available targets"
55
+ @echo
56
+ endif
57
+
58
+ build-env: # Create a new environment with installed packages
59
+ # Validate arguments - exit if unsupported arguments are passed
60
+ @allowed="name py artifactory_access keep_env"; \
61
+ for arg in $(filter-out build-env,$(MAKECMDGOALS)) $(MAKEFLAGS); do \
62
+ case $$arg in \
63
+ *=*) \
64
+ arg_name=$${arg%%=*}; \
65
+ if ! echo " $$allowed " | grep -q " $$arg_name "; then \
66
+ allowed_list=$$(echo $$allowed | sed 's/ /, /g'); \
67
+ echo "Error: Invalid argument '$$arg_name'. Allowed arguments are: $$allowed_list" >&2; \
68
+ exit 1; \
69
+ fi \
70
+ ;; \
71
+ esac; \
72
+ done
73
+
74
+ # Handle arguments and set defaults
75
+ # name
76
+ @$(eval name ?= $(PACKAGE_NAME))
77
+ # python version - validate if specified, else get default from json file
78
+ @supported_versions=$$(python -c "import json; print(' '.join(json.load(open('python_versions.json'))))" 2>/dev/null || echo ""); \
79
+ if [ -n "$(py)" ] && ! echo "$$supported_versions" | grep -q "$(py)"; then \
80
+ echo "Error: Python version '$(py)' is not supported. Available: $$(echo $$supported_versions | sed 's/ /, /g')" >&2; \
81
+ exit 1; \
82
+ fi
83
+ @$(eval py ?= $(shell python -c "import json; print(max(json.load(open('python_versions.json')), key=lambda x: tuple(map(int, x.split('.')))))"))
84
+ # artifactory_access
85
+ @$(eval artifactory_access ?= yes)
86
+ @case "$(artifactory_access)" in \
87
+ yes|no) ;; \
88
+ *) echo "Error: 'artifactory_access' must be 'yes' or 'no', got '$(artifactory_access)'" >&2; exit 1 ;; \
89
+ esac
90
+ # keep_env
91
+ @$(eval keep_env ?= no)
92
+ @case "$(keep_env)" in \
93
+ yes|no) ;; \
94
+ *) echo "Error: 'keep_env' must be 'yes' or 'no', got '$(keep_env)'" >&2; exit 1 ;; \
95
+ esac
96
+
97
+ # Tear down on failure rather than leave an env that activates with nothing installed.
98
+ @if ! $(MAKE) --no-print-directory _build-env \
99
+ name=$(name) py=$(py) artifactory_access=$(artifactory_access); then \
100
+ echo >&2; \
101
+ if [ "$(keep_env)" = "yes" ]; then \
102
+ echo "Error: failed to build environment '$(name)'. Keeping it (keep_env=yes)." >&2; \
103
+ else \
104
+ echo "Error: failed to build environment '$(name)'. Removing it; pass keep_env=yes to keep it for inspection." >&2; \
105
+ conda env remove -n $(name) --yes; \
106
+ fi; \
107
+ exit 1; \
108
+ fi
109
+
110
+ @echo
111
+ @echo "Finished building environment"
112
+ @echo " name: $(name)"
113
+ @echo " python version: $(py)"
114
+ @echo
115
+ @echo "Don't forget to activate it with:"
116
+ @echo "conda activate $(name)"
117
+ @echo
118
+
119
+ # Private: the build steps live here so `build-env` can tear down the env if any fails.
120
+ .PHONY: _build-env
121
+ _build-env:
122
+ conda create -n $(name) python=$(py) --yes
123
+ # --no-capture-output streams output, so a failure isn't hidden behind a long silence.
124
+ conda run --no-capture-output -n $(name) pip install vivarium-build-utils
125
+ # artifactory_access=no passes an empty IHME_PYPI, which clears base.mk's EXTRA_INDEX_FLAGS
126
+ conda run --no-capture-output -n $(name) make install $(if $(filter no,$(artifactory_access)),IHME_PYPI=)
127
+ # A fresh env's only editable install is this checkout, so an empty list means it never installed.
128
+ @conda run --no-capture-output -n $(name) pip list --editable --format=freeze | grep -q . \
129
+ || { echo "Error: nothing was installed into '$(name)' from $(CURDIR)." >&2; exit 1; }
@@ -0,0 +1,131 @@
1
+ Metadata-Version: 2.4
2
+ Name: vivarium-dagger
3
+ Version: 0.1.0
4
+ Summary: Build and run multi-step data pipelines.
5
+ Author-email: The vivarium developers <vivarium.dev@gmail.com>
6
+ License: BSD-3-Clause
7
+ Project-URL: Homepage, https://github.com/ihmeuw/vivarium-suite
8
+ Project-URL: Source, https://github.com/ihmeuw/vivarium-suite/tree/main/libs/dagger
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Intended Audience :: Education
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: License :: OSI Approved :: BSD License
13
+ Classifier: Natural Language :: English
14
+ Classifier: Operating System :: MacOS :: MacOS X
15
+ Classifier: Operating System :: POSIX
16
+ Classifier: Operating System :: POSIX :: BSD
17
+ Classifier: Operating System :: POSIX :: Linux
18
+ Classifier: Operating System :: Microsoft :: Windows
19
+ Classifier: Programming Language :: Python
20
+ Classifier: Programming Language :: Python :: Implementation :: CPython
21
+ Classifier: Topic :: Education
22
+ Classifier: Topic :: Scientific/Engineering
23
+ Classifier: Topic :: Software Development :: Libraries
24
+ Requires-Python: >=3.11
25
+ Description-Content-Type: text/x-rst
26
+ License-File: LICENSE
27
+ Requires-Dist: vivarium-dependencies[click,loguru,pyyaml]
28
+ Requires-Dist: vivarium-build-utils<5.0.0,>=4.0.0
29
+ Requires-Dist: vivarium-cluster-tools>=5.0.0
30
+ Provides-Extra: cluster
31
+ Requires-Dist: jobmon_installer_ihme; extra == "cluster"
32
+ Provides-Extra: simulation
33
+ Requires-Dist: vivarium-psimulate>=1.0.0; extra == "simulation"
34
+ Provides-Extra: test
35
+ Requires-Dist: vivarium-dependencies[pytest]; extra == "test"
36
+ Requires-Dist: pytest-vivarium; extra == "test"
37
+ Provides-Extra: docs
38
+ Requires-Dist: vivarium-dependencies[docutils,sphinx,sphinx-click]; extra == "docs"
39
+ Provides-Extra: interactive
40
+ Requires-Dist: vivarium-dependencies[interactive]; extra == "interactive"
41
+ Provides-Extra: lint
42
+ Requires-Dist: vivarium-dependencies[lint]; extra == "lint"
43
+ Provides-Extra: dev
44
+ Requires-Dist: vivarium-dagger[cluster,docs,interactive,lint,simulation,test]; extra == "dev"
45
+ Provides-Extra: ci-github
46
+ Requires-Dist: vivarium-dagger[docs,lint,simulation,test]; extra == "ci-github"
47
+ Provides-Extra: ci-jenkins
48
+ Requires-Dist: vivarium-dagger[ci_github,cluster]; extra == "ci-jenkins"
49
+ Dynamic: license-file
50
+
51
+ ===============
52
+ Vivarium Dagger
53
+ ===============
54
+
55
+ .. image:: https://badge.fury.io/py/vivarium-dagger.svg
56
+ :target: https://badge.fury.io/py/vivarium-dagger
57
+
58
+ .. image:: https://readthedocs.org/projects/vivarium-dagger/badge/?version=latest
59
+ :target: https://vivarium-dagger.readthedocs.io/en/latest/?badge=latest
60
+ :alt: Documentation Status
61
+
62
+ This library builds and runs multi-step data pipelines. It provides ``dagger``,
63
+ a command that runs a pipeline described in a YAML file as one Jobmon workflow
64
+ on a Slurm cluster.
65
+
66
+ **Supported Python versions: 3.11, 3.12, 3.13**
67
+
68
+ You can install ``vivarium-dagger`` from PyPI with pip:
69
+
70
+ .. code-block:: bash
71
+
72
+ pip install vivarium-dagger
73
+
74
+ or build it from source by cloning the monorepo and installing this package:
75
+
76
+ .. code-block:: bash
77
+
78
+ git clone https://github.com/ihmeuw/vivarium-suite.git
79
+ cd vivarium-suite
80
+ pip install libs/dagger
81
+
82
+ .. note::
83
+
84
+ The ``[cluster]`` extra (``pip install vivarium-dagger[cluster]``) pulls in
85
+ ``jobmon_installer_ihme`` from IHME's internal PyPI mirror. ``dagger`` needs
86
+ it to submit jobs. The ``[simulation]`` extra installs ``vivarium-psimulate``,
87
+ which a workflow with a ``simulation`` step needs.
88
+
89
+ Multi-step workflows with ``dagger``
90
+ ------------------------------------
91
+
92
+ A ``dagger`` workflow file lists steps that run in order. Each step gives its
93
+ command and its compute resources:
94
+
95
+ .. code-block:: yaml
96
+
97
+ workflow:
98
+ name: my_pipeline
99
+ project: proj_simscience
100
+ queue: all.q
101
+ output_directory: /path/to/output
102
+ steps:
103
+ - name: run_sims
104
+ type: simulation
105
+ resources:
106
+ memory_gb: 3
107
+ runtime: "24:00:00"
108
+ args:
109
+ model_specification: /path/to/model_specification.yaml
110
+ branch_configuration: /path/to/branches.yaml
111
+ - name: post_process
112
+ command: my_post_processing_script /path/to/output
113
+ resources:
114
+ memory_gb: 8
115
+ runtime: "00:30:00"
116
+
117
+ Launch the workflow with
118
+
119
+ .. code-block:: console
120
+
121
+ dagger run -c /path/to/workflow.yaml
122
+
123
+ If a run fails partway through, resume it from its output directory, skipping
124
+ steps that already completed, with
125
+
126
+ .. code-block:: console
127
+
128
+ dagger restart /path/to/output
129
+
130
+ `Check out the docs! <https://vivarium-dagger.readthedocs.io/en/latest/>`_
131
+ --------------------------------------------------------------------------
@@ -0,0 +1,81 @@
1
+ ===============
2
+ Vivarium Dagger
3
+ ===============
4
+
5
+ .. image:: https://badge.fury.io/py/vivarium-dagger.svg
6
+ :target: https://badge.fury.io/py/vivarium-dagger
7
+
8
+ .. image:: https://readthedocs.org/projects/vivarium-dagger/badge/?version=latest
9
+ :target: https://vivarium-dagger.readthedocs.io/en/latest/?badge=latest
10
+ :alt: Documentation Status
11
+
12
+ This library builds and runs multi-step data pipelines. It provides ``dagger``,
13
+ a command that runs a pipeline described in a YAML file as one Jobmon workflow
14
+ on a Slurm cluster.
15
+
16
+ **Supported Python versions: 3.11, 3.12, 3.13**
17
+
18
+ You can install ``vivarium-dagger`` from PyPI with pip:
19
+
20
+ .. code-block:: bash
21
+
22
+ pip install vivarium-dagger
23
+
24
+ or build it from source by cloning the monorepo and installing this package:
25
+
26
+ .. code-block:: bash
27
+
28
+ git clone https://github.com/ihmeuw/vivarium-suite.git
29
+ cd vivarium-suite
30
+ pip install libs/dagger
31
+
32
+ .. note::
33
+
34
+ The ``[cluster]`` extra (``pip install vivarium-dagger[cluster]``) pulls in
35
+ ``jobmon_installer_ihme`` from IHME's internal PyPI mirror. ``dagger`` needs
36
+ it to submit jobs. The ``[simulation]`` extra installs ``vivarium-psimulate``,
37
+ which a workflow with a ``simulation`` step needs.
38
+
39
+ Multi-step workflows with ``dagger``
40
+ ------------------------------------
41
+
42
+ A ``dagger`` workflow file lists steps that run in order. Each step gives its
43
+ command and its compute resources:
44
+
45
+ .. code-block:: yaml
46
+
47
+ workflow:
48
+ name: my_pipeline
49
+ project: proj_simscience
50
+ queue: all.q
51
+ output_directory: /path/to/output
52
+ steps:
53
+ - name: run_sims
54
+ type: simulation
55
+ resources:
56
+ memory_gb: 3
57
+ runtime: "24:00:00"
58
+ args:
59
+ model_specification: /path/to/model_specification.yaml
60
+ branch_configuration: /path/to/branches.yaml
61
+ - name: post_process
62
+ command: my_post_processing_script /path/to/output
63
+ resources:
64
+ memory_gb: 8
65
+ runtime: "00:30:00"
66
+
67
+ Launch the workflow with
68
+
69
+ .. code-block:: console
70
+
71
+ dagger run -c /path/to/workflow.yaml
72
+
73
+ If a run fails partway through, resume it from its output directory, skipping
74
+ steps that already completed, with
75
+
76
+ .. code-block:: console
77
+
78
+ dagger restart /path/to/output
79
+
80
+ `Check out the docs! <https://vivarium-dagger.readthedocs.io/en/latest/>`_
81
+ --------------------------------------------------------------------------
@@ -0,0 +1,6 @@
1
+ # pathlib
2
+ py:class pathlib._local.Path
3
+ # jobmon
4
+ py:class jobmon.client.api.Tool
5
+ py:class jobmon.client.task.Task
6
+ py:class jobmon.client.workflow.Workflow
File without changes
@@ -0,0 +1 @@
1
+ .. automodule:: vivarium.dagger.cli
@@ -0,0 +1 @@
1
+ .. automodule:: vivarium.dagger.config.builder
@@ -0,0 +1 @@
1
+ .. automodule:: vivarium.dagger.config.config
@@ -0,0 +1,7 @@
1
+ .. automodule:: vivarium.dagger.config
2
+
3
+ .. toctree::
4
+ :maxdepth: 2
5
+ :glob:
6
+
7
+ *
@@ -0,0 +1 @@
1
+ .. automodule:: vivarium.dagger.config.interface
@@ -0,0 +1 @@
1
+ .. automodule:: vivarium.dagger.config.parsing
@@ -0,0 +1 @@
1
+ .. automodule:: vivarium.dagger.config.serialization
@@ -0,0 +1 @@
1
+ .. automodule:: vivarium.dagger.config.validation
@@ -0,0 +1,11 @@
1
+ API Reference
2
+ =============
3
+
4
+ .. automodule:: vivarium.dagger
5
+
6
+ .. toctree::
7
+ :maxdepth: 2
8
+ :glob:
9
+
10
+ *
11
+ */index
@@ -0,0 +1 @@
1
+ .. automodule:: vivarium.dagger.runner