Skip to content

Commit dcb7e2c

Browse files
authored
Merge pull request #196 from htcondor/v0.6.0
v0.6.0
2 parents c189367 + 704e77a commit dcb7e2c

File tree

97 files changed

+3744
-1194
lines changed

Some content is hidden

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

97 files changed

+3744
-1194
lines changed

.coveragerc

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@ data_file = /tmp/htmap-test-coverage
55

66
include =
77
htmap/*
8+
tests/*
89

910
omit =
10-
tests/*
1111
htmap/run/*
12-
htmap/checkpointing.py
13-
htmap/transfer_output.py
1412

1513
[report]
1614
exclude_lines =
1715
pragma: no cover
1816
pragma: unreachable
17+
pragma: execute-only
1918
def __repr__
2019
def __str__
2120
raise NotImplementedError

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,4 @@ venv.bak/
110110
!htmap-exec/singularity.d/*
111111

112112
prof/
113+
docs/source/tutorials/*.txt

.readthedocs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ formats: all
1111
python:
1212
version: 3.7
1313
install:
14-
- requirements: docs/requirements.txt
14+
- requirements: requirements-docs.txt

.travis.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ jobs:
1616
fast_finish: true
1717

1818
install:
19-
- pip install codecov
20-
- travis_retry docker build -t htmap-test --file tests/_inf/Dockerfile --build-arg HTCONDOR_VERSION --build-arg PYTHON_VERSION=${TRAVIS_PYTHON_VERSION} .
19+
- travis_retry docker build -t htmap-test --file docker/Dockerfile --build-arg HTCONDOR_VERSION --build-arg PYTHON_VERSION=${TRAVIS_PYTHON_VERSION} .
2120

2221
script:
23-
- docker run --mount type=bind,src="$PWD",dst=/home/mapper/htmap,readonly htmap-test bash tests/_inf/travis.sh
22+
- docker run --mount type=bind,src="$PWD",dst=/home/mapper/htmap,readonly htmap-test bash tests/travis.sh

CONTRIBUTORS

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Joshua Karpel
2+
Scott Sievert

README.md

+14-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,20 @@
44
[![Build Status](https://travis-ci.org/htcondor/htmap.svg?branch=master)](https://travis-ci.org/htcondor/htmap)
55
[![codecov](https://codecov.io/gh/htcondor/htmap/branch/master/graph/badge.svg)](https://codecov.io/gh/htcondor/htmap)
66

7-
**Jump right in to the tutorials with Binder!** [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/htcondor/htmap/master?urlpath=lab%2Ftree%2Ffirst-steps.ipynb)
7+
**Jump right in to the tutorials with Binder!**
8+
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/htcondor/htmap/master?urlpath=lab%2Ftree%2Ffirst-steps.ipynb)
89

9-
HTMap is a library that wraps the process of mapping Python function calls out to an HTCondor pool.
10-
It provides tools for submitting, managing, and processing the output of arbitrary functions.
10+
HTMap is a library that wraps the process of mapping Python function calls out
11+
to an HTCondor pool.
12+
It provides tools for submitting, managing, and processing the output of
13+
arbitrary functions.
1114

12-
Our goal is to provide as transparent an interface as possible to high-throughput computing resources so that you can spend more time thinking about your own code, and less about how to get it running on a cluster.
15+
Our goal is to provide as transparent an interface as possible to
16+
high-throughput computing resources so that you can spend more time thinking
17+
about your own code, and less about how to get it running on a cluster.
1318

14-
For tutorials, installation instructions, and more details, see the [documentation](https://htmap.readthedocs.io/en/latest/).
19+
For tutorials, installation instructions, and more details, see the
20+
[documentation](https://htmap.readthedocs.io/en/latest/).
21+
22+
Please post bug reports and feature requests to
23+
[our issue tracker](https://github.com/htcondor/htmap/issues).

binder/Dockerfile

+13-10
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,22 @@
1414
# limitations under the License.
1515

1616
FROM htcondor/htc-minimal-notebook:latest
17-
ENV NB_USER="jovyan"
1817

19-
USER ${NB_USER}
18+
USER root
2019

21-
# copy the tutorial notebooks into the container
22-
COPY --chown=jovyan:0 docs/source/tutorials ${HOME}/tutorials
20+
RUN echo '#!/bin/bash\nfind ${HOME}/tutorials -name '\''*.ipynb'\'' -and -not -iname '\''*-checkpoint.ipynb'\''' > /usr/bin/find_notebooks \
21+
&& chmod +x /usr/bin/find_notebooks
2322

24-
# use the repository version of HTMap, not whatever was in the htc notebook
25-
# also, strip any run results out of the tutorial notebooks
26-
COPY --chown=jovyan:0 . /tmp/htmap
27-
RUN pip install --no-cache-dir nbstripout \
23+
# Use the repository version of HTMap, not whatever was in the htc-notebook.
24+
COPY . ${HOME}/htmap
25+
RUN chown -R ${NB_UID}:${NB_GID} ${HOME}/htmap
26+
27+
USER ${NB_UID}:${NB_GID}
28+
29+
# Install HTMap and strip any run results out of the tutorial notebooks.
30+
RUN cp -r ${HOME}/htmap/docs/source/tutorials ${HOME}/tutorials \
31+
&& pip install --no-cache-dir nbstripout \
2832
&& nbstripout ${HOME}/tutorials/* \
29-
&& pip install --no-cache-dir --upgrade /tmp/htmap \
30-
&& rm -rf /tmp/htmap
33+
&& pip install --no-cache-dir --upgrade -e ${HOME}/htmap
3134

3235
WORKDIR ${HOME}/tutorials

binder/condor_config.local

-39
This file was deleted.

binder/edit.sh

100644100755
-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@ set -e
44

55
CONTAINER_TAG=htmap-binder-edit
66

7-
echo "Building HTMap Binder container..."
8-
97
docker build -t ${CONTAINER_TAG} --file binder/Dockerfile .
108
docker run -it --rm -p 8888:8888 --mount type=bind,source="$(pwd)"/docs/source/tutorials,target=/home/jovyan/tutorials ${CONTAINER_TAG}

binder/exec.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
CONTAINER_TAG=htmap-binder-exec
6+
7+
docker build -t ${CONTAINER_TAG} --file binder/Dockerfile .
8+
docker run --rm --mount type=bind,source="$(pwd)"/docs/source/tutorials,target=/home/jovyan/tutorials ${CONTAINER_TAG} -- bash -l -c 'sleep 5 && condor_who -wait:60 "IsReady && STARTD_State =?= \"Ready\"" && rm -r /home/jovyan/tutorials/*.txt ; for x in $(find_notebooks); do nbstripout $x && jupyter nbconvert --to notebook --inplace --execute --allow-errors --ExecutePreprocessor.timeout=None $x && htmap remove --all ; done && rm -r /home/jovyan/tutorials/*.txt'

binder/test.sh binder/run.sh

-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@ set -e
44

55
CONTAINER_TAG=htmap-binder-test
66

7-
echo "Building HTMap Binder container..."
8-
97
docker build -t ${CONTAINER_TAG} --file binder/Dockerfile .
108
docker run -it --rm -p 8888:8888 ${CONTAINER_TAG} "$@"

binder/test.cmd

-8
This file was deleted.

docker/.htmaprc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DELIVERY_METHOD = "shared"

tests/_inf/Dockerfile docker/Dockerfile

+10-10
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ARG PYTHON_VERSION=3.6
1919
FROM python:${PYTHON_VERSION}
2020

2121
# build config
22-
ARG HTCONDOR_VERSION=8.8
22+
ARG HTCONDOR_VERSION=8.9
2323

2424
# switch to root to do root-level config
2525
USER root
@@ -29,7 +29,7 @@ ENV DEBIAN_FRONTEND=noninteractive
2929

3030
# install utils and dependencies
3131
RUN apt-get update \
32-
&& apt-get -y install --no-install-recommends vim less git gnupg wget ca-certificates locales graphviz \
32+
&& apt-get -y install --no-install-recommends vim less git gnupg wget ca-certificates locales graphviz pandoc strace \
3333
&& apt-get -y clean \
3434
&& rm -rf /var/lib/apt/lists/* \
3535
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \
@@ -48,7 +48,7 @@ RUN wget -qO - https://research.cs.wisc.edu/htcondor/debian/HTCondor-Release.gpg
4848
&& rm -rf /var/lib/apt/lists/*
4949

5050
# copy entrypoint into place and make executable
51-
COPY tests/_inf/entrypoint.sh /.entrypoint.sh
51+
COPY docker/entrypoint.sh /.entrypoint.sh
5252
RUN chmod +x /.entrypoint.sh
5353

5454
# create a user, set their PATH and PYTHONPATH
@@ -61,17 +61,17 @@ RUN groupadd ${SUBMIT_USER} \
6161
# switch to the user, don't need root anymore
6262
USER ${SUBMIT_USER}
6363

64-
# install htmap dependencies and debugging tools early for docker build caching
64+
# install dependencies and debugging tools early for docker build caching
6565
COPY requirements* /tmp/
66-
RUN pip install --user --no-cache-dir -r /tmp/requirements-dev.txt \
67-
&& pip install --user --no-cache-dir ipython \
68-
&& pip install --user --no-cache-dir --upgrade htcondor==${HTCONDOR_VERSION}.*
66+
RUN python -m pip install --user --no-cache-dir -r /tmp/requirements-dev.txt -r /tmp/requirements-docs.txt ipython \
67+
&& python -m pip install --user --no-cache-dir --upgrade htcondor==${HTCONDOR_VERSION}.*
6968

70-
# copy HTCondor and HTMap testing configs into place
71-
COPY tests/_inf/condor_config.local /etc/condor/condor_config.local
69+
# copy testing configs into place
70+
COPY docker/condor_config.local /etc/condor/condor_config.local
71+
COPY --chown=mapper:mapper docker/.htmaprc /home/${SUBMIT_USER}/
7272

7373
# set default entrypoint and command
7474
# the entrypoint is critical: it starts HTCondor in the container
7575
WORKDIR /home/${SUBMIT_USER}/htmap
7676
ENTRYPOINT ["/.entrypoint.sh"]
77-
CMD ["pytest"]
77+
CMD ["bash"]

tests/_inf/condor_config.local docker/condor_config.local

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ use ROLE: CentralManager
44
use ROLE: Submit
55
use ROLE: Execute
66

7+
# Logging setup
8+
#ALL_DEBUG = D_ALL
9+
#TOOL_DEBUG = D_ALL
10+
STARTER_LOG_NAME_APPEND=jobid
11+
712
# Edit paths so all state gets stored in user home directory
8-
LOCAL_DIR=$ENV(HOME)/.condor/state
13+
LOCAL_DIR=$ENV(HOME)/.condor/local
914
LOCK=$(LOCAL_DIR)/lock
1015
LOG=$(LOCAL_DIR)/log
1116
RUN=$(LOCAL_DIR)/run
@@ -33,6 +38,7 @@ SCHED_UNIV_RENICE_INCREMENT=5
3338
SHADOW_RENICE_INCREMENT=5
3439

3540
# Get the HTMap source into the Python path
41+
# We do this instead of doing an editable pip install because we don't necessarily want to write to the git dir
3642
JOB_TRANSFORM_NAMES = $(JOB_TRANSFORM_NAMES) SetPyVars
3743
JOB_TRANSFORM_SetPyVars @=end
3844
[

tests/_inf/entrypoint.sh docker/entrypoint.sh

+2-10
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ mkdir -p "$_condor_local_dir/lock" "$_condor_local_dir/log" "$_condor_local_dir/
88

99
# start condor
1010
condor_master
11-
echo "Starting HTCondor..."
11+
12+
condor_version
1213

1314
# once the shared port daemon wakes up, use condor_who to wait for condor to stand up
1415
while [[ ! -s "${_condor_local_dir}/log/SharedPortLog" ]]
@@ -18,13 +19,4 @@ done
1819
sleep 1 # fudge factor to let shared port *actually* wake up
1920
condor_who -wait:60 'IsReady && STARTD_State =?= "Ready"' > /dev/null
2021

21-
if [[ -n $@ ]];
22-
then
23-
echo "Executing command \"$@\" in container..."
24-
else
25-
echo "Executing default test command in container..."
26-
fi
27-
28-
condor_version
29-
3022
exec "$@"

docs/autobuild.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
export PYTHONPATH="$PWD:$PYTHONPATH"
6+
7+
echo "NOTE: CONNECT TO http://127.0.0.1:8000 NOT WHAT SPHINX-AUTOBUILD TELLS YOU"
8+
sleep 3
9+
10+
sphinx-autobuild docs/source docs/_build --host 0.0.0.0 --poll --watch htmap/

docs/source/api.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,11 @@ Additionally, default map options can be set globally via ``settings['MAP_OPTION
149149
.. autoclass:: htmap.MapOptions
150150
:members:
151151

152-
Input File Transfer
152+
File Transfer
153153
-------------------
154154

155155
.. autoclass:: htmap.TransferPath
156156

157-
158-
Output File Transfer
159-
--------------------
160-
161157
.. autofunction:: htmap.transfer_output_files
162158

163159

@@ -194,6 +190,10 @@ These functions are useful for generating machine-readable status information.
194190

195191
.. autofunction:: htmap.status_csv
196192

193+
Delivery Methods
194+
----------------
195+
196+
.. autofunction:: htmap.register_delivery_method
197197

198198
Transplant Installs
199199
+++++++++++++++++++

docs/source/cli.rst

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.. _cli:
2+
3+
CLI Reference
4+
=============
5+
6+
HTMap provides a command line tool called ``htmap`` that exposes a subset
7+
of functionality focused around monitoring long-running maps without needing
8+
to run Python yourself.
9+
10+
View the available sub-commands by running:
11+
12+
.. code:: shell
13+
14+
htmap --help # View available commands
15+
16+
Some useful commands are highlighted in the Tips and Tricks section at
17+
:ref:`cli-tips`.
18+
19+
Here's the full documentation on all of the available commands:
20+
21+
.. click:: htmap.cli:cli
22+
:prog: htmap
23+
:show-nested:

docs/source/conf.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# -- Project information -----------------------------------------------------
2323

2424
project = 'HTMap'
25-
copyright = '2018, HTCondor Team, Computer Sciences Department, University of Wisconsin-Madison, WI'
25+
copyright = '2018-2020, HTCondor Team, Computer Sciences Department, University of Wisconsin-Madison, WI'
2626
author = 'HTCondor Team'
2727

2828
# The short X.Y version
@@ -49,6 +49,8 @@
4949
'sphinx.ext.viewcode',
5050
'nbsphinx',
5151
'IPython.sphinxext.ipython_console_highlighting',
52+
'sphinx_click.ext',
53+
'sphinx_issues',
5254
]
5355

5456
# Add any paths that contain templates here, relative to this directory.
@@ -175,6 +177,7 @@
175177

176178
napoleon_use_rtype = False
177179

180+
issues_github_path = "htcondor/htmap"
178181

179182
def setup(app):
180183
app.add_stylesheet('css/custom.css')

0 commit comments

Comments
 (0)