Skip to content
This repository was archived by the owner on Aug 7, 2020. It is now read-only.

Commit 0652622

Browse files
authored
Merge pull request #12 from htcondor/v0.2.0
v0.2.0
2 parents f154364 + 7064cd8 commit 0652622

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2999
-1129
lines changed

.codecov.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
coverage:
2+
range: 50..90
3+
round: down
4+
precision: 0
5+
6+
comment:
7+
layout: "diff, files"

.dockerignore

+5
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ venv.bak/
105105
.mypy_cache/
106106

107107
.idea/
108+
.vscode/
108109

109110
Dockerfile
110111
dr
112+
113+
/examples/mandelbrot/mandelbrot-dag/
114+
/examples/mandelbrot/test.png
115+
/examples/mandelbrot/test.ppm

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,7 @@ venv.bak/
106106
# Editors
107107
.idea/
108108
.vscode/
109+
110+
/examples/mandelbrot/mandelbrot-dag/
111+
/examples/mandelbrot/test.png
112+
/examples/mandelbrot/test.ppm

docs/source/api.rst

+24
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ API Reference
33

44
.. py:currentmodule:: htcondor_dags
55
6+
.. attention::
7+
This is not documentation for DAGMan itself! If you run into DAGMan jargon
8+
that isn't explained here, see `The DAGMan Manual <https://htcondor.readthedocs.io/en/latest/users-manual/dagman-applications.html>`_.
9+
610
Creating DAGs
711
-------------
812

@@ -11,6 +15,7 @@ Creating DAGs
1115

1216
.. autoclass:: WalkOrder
1317

18+
1419
Nodes and Node-likes
1520
++++++++++++++++++++
1621

@@ -28,8 +33,15 @@ Nodes and Node-likes
2833
.. autoclass:: Nodes
2934
:members:
3035

36+
37+
Edges
38+
+++++
39+
3140
.. autoclass:: OneToOne
3241
.. autoclass:: ManyToMany
42+
.. autoclass:: Grouper
43+
.. autoclass:: Slicer
44+
3345

3446
Node Configuration
3547
++++++++++++++++++
@@ -39,6 +51,12 @@ Node Configuration
3951
.. autoclass:: DAGAbortCondition
4052

4153

54+
Writing a DAG to Disk
55+
+++++++++++++++++++++
56+
57+
.. autofunction:: write_dag
58+
59+
4260
DAG Configuration
4361
-----------------
4462

@@ -47,3 +65,9 @@ DAG Configuration
4765
.. autoclass:: NodeStatusFile
4866

4967

68+
Rescue DAGs
69+
-----------
70+
71+
.. autofunction:: rescue
72+
73+
.. autofunction:: find_rescue_file

docs/source/conf.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"sphinx.ext.mathjax",
4444
"sphinx.ext.ifconfig",
4545
"sphinx.ext.viewcode",
46+
"sphinx.ext.graphviz",
4647
"nbsphinx",
4748
]
4849

@@ -80,8 +81,8 @@
8081

8182
autodoc_member_order = "bysource"
8283
autoclass_content = "both"
83-
autodoc_default_flags = ["undoc-members"]
84-
84+
autodoc_default_options = {"undoc-members": True}
85+
add_module_names = False
8586
napoleon_use_rtype = False
8687

8788

docs/source/versions/v0_2_0.rst

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
v0.2.0
2+
======
3+
4+
.. py:currentmodule:: htcondor_dags
5+
6+
New Features
7+
------------
8+
9+
* You can now walk over all of the ancestors of a node
10+
(i.e., its parents, the parents of its parents, the parents of parents of
11+
its parents, etc.) using :meth:`~BaseNode.walk_ancestors`,
12+
and similarly for its descendants using :meth:`~BaseNode.walk_descendants`.
13+
* Implemented a new :class:`~Grouper` edge. It allows flexible "chunking" of the
14+
parent and child layers. For example, every three nodes in the parent layer can
15+
be connected to every two nodes in the child layer.
16+
* Custom edges can now be created by implementing the :class:`~BaseEdge` interface.
17+
* ``NOOP`` and ``DONE`` can now be set on individual nodes inside a layer.
18+
In addition to being a single boolean value, the corresponding :class:`~NodeLayer`
19+
attributes can now be set to a dictionary mapping node indices to a boolean.
20+
Missing indices are assumed to be ``False``
21+
For example, if node index 5 is not present in the ``noop`` dictionary, it is not ``NOOP``.
22+
It is only ``NOOP`` if it is present and its value is ``True``.
23+
* The submit description for a :class:`~NodeLayer` can be given as a path to an
24+
existing HTCondor submit file.
25+
* State information from previous DAGMan runs, encoded in a DAGMan "rescue" file,
26+
can now be loaded and laid over an existing :class:`~DAG` using the new
27+
:func:`~rescue` function.
28+
29+
30+
Bug Fixes
31+
---------
32+
33+
34+
Known Issues
35+
------------
36+

dr.cmd

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@echo off
2+
3+
SET CONTAINER_TAG=htcondor-dags-test-container
4+
5+
docker build ^
6+
--quiet ^
7+
--tag %CONTAINER_TAG% ^
8+
--file tests/_inf/Dockerfile ^
9+
.
10+
11+
docker run ^
12+
-it ^
13+
--rm ^
14+
--mount type=bind,source="%CD%",target=/home/dagger/htcondor-dags ^
15+
-p 8000:8000 ^
16+
%CONTAINER_TAG% ^
17+
%*

examples/basic_diamond/make_dag.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
# to vars.
3939
# Because NUM_CHUNKS is 5, this will create 5 DAGMan nodes, one to process
4040
# each chunk created by the previous layer.
41-
count_words = split_words.child(
41+
count_words = split_words.child_layer(
4242
name="count_words",
4343
submit_description=htcondor.Submit(
4444
{
@@ -57,7 +57,7 @@
5757
# of the previous step.
5858
# It's input files are all of the output files from the previous step, which
5959
# is easy in this case because we know the naming scheme.
60-
combine_counts = count_words.child(
60+
combine_counts = count_words.child_layer(
6161
name="combine_counts",
6262
submit_description=htcondor.Submit(
6363
{
@@ -78,5 +78,5 @@
7878
# If you write it out to a different directory, you may need to be careful
7979
# about filepaths in your submit descriptions!
8080
this_dir = Path(__file__).parent
81-
diamond.write(this_dir)
81+
dags.write_dag(diamond, this_dir)
8282
print(f"Wrote DAG files to {this_dir}")

examples/delayed_diamond/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This will necessarily change the structure of our workflow. In the Basic Diamond
1616
example, the `count_words` layer looked like this:
1717

1818
```python
19-
count_words = split_words.child(
19+
count_words = split_words.child_layer(
2020
name="count_words",
2121
submit_description=Submit(
2222
{

examples/delayed_diamond/make_analysis_dag.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
)
3232

3333
# This is the "combine the counts from each chunk" step.
34-
combine_counts = count_words.child(
34+
combine_counts = count_words.child_layer(
3535
name="combine_counts",
3636
submit_description=htcondor.Submit(
3737
{
@@ -52,5 +52,5 @@
5252
# If you write it out to a different directory, you may need to be careful
5353
# about filepaths in your submit descriptions!
5454
this_dir = Path(__file__).parent
55-
analysis_dag.write(this_dir, dag_file_name="analysis.dag")
55+
dags.write_dag(analysis_dag, this_dir, dag_file_name="analysis.dag")
5656
print(f"Wrote DAG files to {this_dir}")

examples/delayed_diamond/make_top_dag.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@
2929
# Now that we're going to have two DAG input files in this directory, we need
3030
# to give them unique names.
3131
this_dir = Path(__file__).parent
32-
top_layer_dag.write(this_dir, dag_file_name="top_level.dag")
32+
dags.write_dag(top_layer_dag, this_dir, dag_file_name="top_level.dag")
3333
print(f"Wrote DAG files to {this_dir}")

examples/mandelbrot/Dockerfile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM htcondor/htc-base-notebook:latest
2+
3+
USER root
4+
5+
RUN apt-get update \
6+
&& apt-get install -y --no-install-recommends imagemagick-6.q16 graphviz \
7+
&& apt-get -y clean \
8+
&& rm -rf /var/lib/apt/lists/*
9+
10+
USER jovyan
11+
12+
RUN pip install --upgrade htcondor==8.9.4b1 graphviz
13+
14+
COPY --chown=jovyan:0 . /home/jovyan/htcondor-dags
15+
RUN pip install -e /home/jovyan/htcondor-dags
16+
17+
WORKDIR /home/jovyan/htcondor-dags/examples/mandelbrot

examples/mandelbrot/edit.cmd

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@echo off
2+
3+
SET CONTAINER_TAG=htcondor-dags-mandelbrot-example
4+
5+
docker build -t %CONTAINER_TAG% --file examples/mandelbrot/Dockerfile . || exit /b
6+
docker run -it --rm -p 8888:8888 --mount type=bind,source="%cd%",target=/home/jovyan/htcondor-dags %CONTAINER_TAG% %* || exit /b

examples/mandelbrot/goatbrot

18.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)