Skip to content

Commit 49e2842

Browse files
authored
v0.5.0 (#161)
v0.5.0
1 parent 52db170 commit 49e2842

Some content is hidden

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

59 files changed

+949
-358
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"

.coveragerc

+8-6
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@ include =
66

77
omit =
88
tests/*
9+
htmap/run/*
10+
htmap/checkpointing.py
11+
htmap/transfer_output.py
912

1013
[report]
1114
exclude_lines =
1215
pragma: no cover
13-
16+
pragma: unreachable
1417
def __repr__
15-
1618
def __str__
17-
1819
raise NotImplementedError
19-
20-
for _ in \[\]:
21-
20+
raise AssertionError
21+
if 0:
22+
if False:
23+
if __name__ == .__main__.:

.readthedocs.yml

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1+
version: 2
2+
13
build:
24
image: latest
5+
6+
sphinx:
7+
configuration: docs/source/conf.py
8+
9+
formats: all
310

411
python:
5-
version: 3.6
6-
7-
requirements_file: requirements_docs.txt
12+
version: 3.7
13+
install:
14+
- requirements: docs/requirements.txt

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ matrix:
1515
fast_finish: true
1616

1717
install:
18-
- docker build -t htmap-test --file tests/_inf/Dockerfile --build-arg HTCONDOR_VERSION --build-arg PYTHON_VERSION=$TRAVIS_PYTHON_VERSION .
18+
- travis_retry docker build -t htmap-test --file tests/_inf/Dockerfile --build-arg HTCONDOR_VERSION --build-arg PYTHON_VERSION=$TRAVIS_PYTHON_VERSION .
1919

2020
script:
2121
- docker run htmap-test tests/_inf/travis.sh

MANIFEST.in

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include LICENSE README.md
2+
include requirements.txt
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
-r requirements_dev.txt
1+
-r ../requirements-dev.txt
22

33
sphinx
44
sphinx_rtd_theme
55
sphinx_autodoc_typehints
66
pygments-github-lexers
7+
ipython
78
nbsphinx

docs/source/conf.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# If extensions (or modules to document with autodoc) are in another directory,
1212
# add these directories to sys.path here. If the directory is relative to the
1313
# documentation root, use os.path.abspath to make it absolute, like shown here.
14-
#
14+
1515
import os
1616
import sys
1717

@@ -48,6 +48,7 @@
4848
'sphinx.ext.ifconfig',
4949
'sphinx.ext.viewcode',
5050
'nbsphinx',
51+
'IPython.sphinxext.ipython_console_highlighting',
5152
]
5253

5354
# Add any paths that contain templates here, relative to this directory.
@@ -170,7 +171,7 @@
170171

171172
autodoc_member_order = 'bysource'
172173
autoclass_content = 'both'
173-
autodoc_default_flags = ['undoc-members']
174+
autodoc_default_options = {"undoc-members": True}
174175

175176
napoleon_use_rtype = False
176177

docs/source/devs.rst

+4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ For Developers
77
:doc:`devs/env`
88
How to set up an environment for development and testing.
99

10+
:doc:`devs/release`
11+
How to release a new version of HTMap.
12+
1013

1114
.. toctree::
1215
:maxdepth: 2
1316
:hidden:
1417

1518
devs/innards
1619
devs/env
20+
devs/release

docs/source/devs/release.rst

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
How to Release a New HTMap Version
2+
==================================
3+
4+
.. py:currentmodule:: htmap
5+
6+
7+
To release a new version of HTMap:
8+
9+
1. Merge the version PR into ``master`` via GitHub.
10+
1. Make a GitHub release from https://github.com/htcondor/htmap/releases .
11+
Name it exactly ``vX.Y.Z``, and link to the release notes for that version
12+
(like https://htmap.readthedocs.io/en/latest/versions/vX_Y_Z.html )
13+
in the description (the page will not actually exist yet).
14+
1. Delete anything in the ``dist/`` directory in your copy of the repository.
15+
1. On your machine, make sure ``master`` is up-to-date, then run
16+
``python3 setup.py sdist bdist_wheel`` to create the source distribution
17+
and the wheel. (This is where the files in ``dist/`` are created.)
18+
1. Install Twine: ``pip install twine``.
19+
1. Upload to PyPI:
20+
``python3 -m twine upload dist/*``.
21+
You will be prompted for your PyPI login.

docs/source/recipes.rst

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ Recipes
1616
:doc:`recipes/checkpointing-maps`
1717
How to write a function that can continue from partial progress after being evicted.
1818

19+
:doc:`recipes/using-htmap-on-osg`
20+
How to use HTMap on the `Open Science Grid <https://opensciencegrid.org/>`_.
21+
1922

2023
.. toctree::
2124
:maxdepth: 2
@@ -25,3 +28,4 @@ Recipes
2528
recipes/output-files
2629
recipes/wrapping-external-programs
2730
recipes/checkpointing-maps
31+
recipes/using-htmap-on-osg

docs/source/recipes/docker-image-cookbook.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ Some notes on the above:
125125
* The ``-y`` options for the ``conda`` commands are the equivalent of answering "yes" to questions that ``conda`` asks on the command line, since the Docker build is non-interactive.
126126
* A trailing ``\`` is a line continuation, so that first command is equivalent to running ``conda install -y foobar && conda clean -y --all``, which is just ``bash`` shorthand for "do both of these things".
127127

128-
If you need install many packages, we recommend writing a ``requirements.txt`` file (see `the docs <https://pip.pypa.io/en/stable/user_guide/#requirements-files>`_) and using
128+
If you need install many packages, we recommend writing a ``requirements.txt``
129+
file (see `the Python packaging docs <https://pip.pypa.io/en/stable/user_guide/#requirements-files>`_)
130+
and using
129131

130132
.. code-block:: docker
131133

docs/source/tutorials.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ Tutorials
33

44
.. attention::
55

6-
The most convenient way to go through these tutorials is through Binder, which requires no setup on your part.
6+
The most convenient way to go through these tutorials is through Binder, which requires no setup on your part: |binder|
77

8-
.. image:: https://mybinder.org/badge_logo.svg
9-
:target: https://mybinder.org/v2/gh/htcondor/htmap/master?urlpath=lab/tree/tutorials/first-steps.ipynb
8+
.. |binder| image:: https://mybinder.org/badge_logo.svg
9+
:target: https://mybinder.org/v2/gh/htcondor/htmap/master?urlpath=lab/tree/tutorials/first-steps.ipynb
1010

1111

1212
:doc:`tutorials/first-steps`

docs/source/versions/v0_5_0.rst

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
v0.5.0
2+
======
3+
4+
New Features
5+
------------
6+
7+
* HTMap CLI commands that operate on tags can now pattern-match for tags using
8+
glob syntax. Try adding ``-p "<pattern>"`` to commands like ``htmap remove``
9+
or ``htmap release``!
10+
Issue: https://github.com/htcondor/htmap/issues/159
11+
* Component status tracking is now preserved between sessions, so it won't be
12+
performed from scratch every time. This will only work if the HTCondor Python
13+
bindings version is 8.9.3 or greater. You can upgrade your bindings version
14+
roughly-independently of HTMap by running ``pip install --upgrade htcondor``.
15+
Issue: https://github.com/htcondor/htmap/issues/166
16+
* :class:`htmap.Map`, :class:`htmap.MapStdOut`, :class:`htmap.MapStdErr`,
17+
and :class:`htmap.MapOutputFiles` now all support in the ``in`` operator to check
18+
if a component index is in the map.
19+
20+
21+
Deprecated Features
22+
-------------------
23+
24+
* The various iteration methods on :class:`htmap.Map` no longer have a
25+
``callback`` argument.
26+
27+
28+
Bug Fixes
29+
---------
30+
31+
* It should now be much harder to accidentally get a dangling, inaccessible map
32+
due to an interrupted ``remove``.
33+
Issue: https://github.com/htcondor/htmap/issues/127
34+
* When an execution errors occurs, the exception and traceback will be printed
35+
to stderr execute-side (in addition to being brought back submit-side). This
36+
should make some debugging patterns work as expected.
37+
Issue: https://github.com/htcondor/htmap/issues/178
38+
* The CLI command ``htmap status --live`` now has much better behavior when
39+
the table width is nearly the width of the terminal. It should now never wrap
40+
unless the table is actually wider than the terminal, instead of a few
41+
characters before the actual width.
42+
* HTMap now handles late materialized jobs much more smoothly: maps with
43+
unmaterialized components can be removed, and various CLI commands that output
44+
color won't fail when acting on maps with unmaterialized components. However,
45+
unmaterialized components do not show as `IDLE`, which mirrors the behavior
46+
of `condor_q`. This does make it hard to know how many components are in a
47+
late-materialized map at a glance; we are thinking about how to address this.
48+
Issue: https://github.com/htcondor/htmap/issues/158
49+
50+
51+
Known Issues
52+
------------
53+
54+
* Execution errors that result in the job being terminated but no output being
55+
produced are still not handled entirely gracefully. Right now, the component
56+
state will just show as ``ERRORED``, but there won't be an actual error report.
57+
* Map component state may become corrupted when a map is manually vacated.
58+
Force-removal may be needed to clean up maps if HTCondor and HTMap disagree
59+
about the state of their components.
60+
Issue: https://github.com/htcondor/htmap/issues/129

dr.cmd

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@echo off
2+
3+
SET CONTAINER_TAG=htmap-tests
4+
5+
ECHO Building HTMap testing container...
6+
7+
docker build --quiet -t %CONTAINER_TAG% --file tests/_inf/Dockerfile .
8+
docker run -it --rm %CONTAINER_TAG% %*

htmap-exec/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
FROM continuumio/anaconda3:2019.03
16+
FROM continuumio/anaconda3:2019.07
17+
ENV PATH=/opt/conda/bin/:${PATH}
1718

1819
LABEL maintainer="[email protected]"
1920

htmap/__init__.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
from .settings import settings, USER_SETTINGS, BASE_SETTINGS
2626

2727
# SET UP NULL LOG HANDLER
28-
logger = _logging.getLogger(__name__)
29-
logger.setLevel(_logging.DEBUG)
30-
logger.addHandler(_logging.NullHandler())
28+
_logger = _logging.getLogger(__name__)
29+
_logger.setLevel(_logging.DEBUG)
30+
_logger.addHandler(_logging.NullHandler())
3131

3232
from .mapping import (
3333
map,
@@ -60,8 +60,8 @@
6060
)
6161
from .tags import get_tags
6262
from .checkpointing import checkpoint
63-
from .output_files import transfer_output_files
64-
from .transfer import TransferPath, TransferWindowsPath, TransferPosixPath
63+
from .transfer_output import transfer_output_files
64+
from .transfer_input import TransferPath, TransferWindowsPath, TransferPosixPath
6565
from . import exceptions
6666

6767
from . import _startup

htmap/_startup.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77

88
logger = logging.getLogger('htmap')
99

10-
LOGS_DIR_PATH = Path(settings['HTMAP_DIR']) / names.LOGS_DIR
11-
1210

1311
def setup_internal_file_logger():
14-
LOGS_DIR_PATH.mkdir(parents = True, exist_ok = True)
12+
LOGS_DIR_PATH = Path(settings['HTMAP_DIR']) / names.LOGS_DIR
1513
LOG_FILE = LOGS_DIR_PATH / 'htmap.log'
14+
LOGS_DIR_PATH.mkdir(parents = True, exist_ok = True)
1615
_logfile_handler = handlers.RotatingFileHandler(
1716
filename = LOG_FILE,
1817
mode = 'a',
@@ -36,15 +35,16 @@ def ensure_htmap_dir_exists():
3635
_htmap_dir,
3736
_htmap_dir / _names.MAPS_DIR,
3837
_htmap_dir / _names.TAGS_DIR,
39-
_htmap_dir / _names.REMOVED_TAGS_DIR
38+
_htmap_dir / _names.LOGS_DIR,
39+
_htmap_dir / _names.REMOVED_TAGS_DIR,
4040
)
4141
for dir in dirs:
4242
dir.mkdir(parents = True, exist_ok = True)
4343

4444
if did_not_exist:
45-
logger.debug(f'created HTMap dir at {_htmap_dir}')
45+
logger.debug(f'Created HTMap dir at {_htmap_dir}')
4646
except PermissionError as e:
47-
raise PermissionError(f'the HTMap directory ({_htmap_dir}) needs to be writable') from e
47+
raise PermissionError(f'The HTMap directory ({_htmap_dir}) needs to be writable') from e
4848

4949

5050
if os.getenv('HTMAP_ON_EXECUTE') != '1':

htmap/checkpointing.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,20 @@
2020
from . import names
2121

2222

23-
def checkpoint(*paths: os.PathLike):
23+
def checkpoint(*paths: os.PathLike) -> None:
2424
"""
2525
Informs HTMap about the existence of checkpoint files.
2626
This function should be called every time the checkpoint files are changed, even if they have the same names as before.
2727
2828
.. attention::
2929
30-
This function is a no-op when executing locally, so you if you're testing your function it won't do anything.
30+
This function is a no-op when executing locally (i.e., not execute-side),
31+
so you if you're testing your function locally it won't do anything.
3132
3233
.. attention::
3334
34-
The files will be copied, so try not to make the checkpoint files too large.
35+
The files will be **copied** by this function,
36+
so try not to make the checkpoint files too large.
3537
3638
Parameters
3739
----------

0 commit comments

Comments
 (0)