Skip to content

Conversation

remram44
Copy link
Member

@remram44 remram44 commented May 11, 2017

Right now, reprounzip run does the work, looking up environment variables/command-lines/... This makes the created Docker images useless by themselves, you need to run them through reprounzip.

By moving some of the run logic from Python to an entrypoint (shell), I can make an image that can be run directly from Docker as well.

Step towards #169

$ docker run -ti --rm reprounzip_image_351oi6lubs help
Image built from reprounzip-docker
Usage: docker run <image> [cmd word [word ...]] [run <R>]
    `cmd ...` changes the command for the next `run` option
    `run <name|number>` runs the specified run
By default, all the runs are executed.
The runs in this image are:
    get_data: python 01_getdata.py
    build_classifier: python 02_classifier.py
    predict: python 03_predict.py
    evaluate: python 04_confusion_matrix.py
$ docker run -ti --rm reprounzip_image_351oi6lubs
Confusion matrix:
[[87  0  0  0  1  0  0  0  0  0]
 [ 0 88  1  0  0  0  0  0  1  1]
 [ 0  0 85  1  0  0  0  0  0  0]
 [ 0  0  0 79  0  3  0  4  5  0]
 [ 0  0  0  0 88  0  0  0  0  4]
 [ 0  0  0  0  0 88  1  0  0  2]
 [ 0  1  0  0  0  0 90  0  0  0]
 [ 0  0  0  0  0  1  0 88  0  0]
 [ 0  0  0  0  0  0  0  0 88  0]
 [ 0  0  0  1  0  1  0  0  0 90]]

@remram44 remram44 added C-unpackers/docker Component: The Docker unpacker T-enhancement Type: En enhancement to existing code, or a new feature labels May 11, 2017
@remram44 remram44 added this to the 1.1 milestone May 11, 2017
@remram44 remram44 self-assigned this May 11, 2017
This is a first step to having stand-alone Docker images, i.e. images
that can be run without reprounzip once created. Right now,
`reprounzip run` does the work, looking up environment
variables/command-lines/... If this is moved to an entrypoint script,
then the image can be run directly from Docker as well.
@remram44 remram44 force-pushed the docker-entrypoint branch from a7d021c to ddc3e6c Compare May 11, 2017 16:24
remram44 added 2 commits May 11, 2017 13:46
Those methods return the environment variables to be set and unset, for
X11 and the command-line arguments respectively, instead of directly
returning the changed environment like the current methods do
(X11Handler#fix_env() and fixup_environment()).

This is useful for Docker, which merges the changes with the original
environment internally with `env`.
@remram44 remram44 added the A-pending-review Attention: This is ready for review and can be merged afterwards label May 11, 2017
@remram44
Copy link
Member Author

Seems to be working. Lots can go wrong here, most notably with quoting/escaping, so testing required.

@remram44 remram44 changed the base branch from 1.0.x to master May 18, 2017 20:18
@remram44 remram44 force-pushed the docker-entrypoint branch from 6afd0bf to f053e90 Compare May 18, 2017 20:20
@remram44 remram44 merged commit 6afd0bf into master May 18, 2017
@remram44 remram44 deleted the docker-entrypoint branch May 18, 2017 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-pending-review Attention: This is ready for review and can be merged afterwards C-unpackers/docker Component: The Docker unpacker T-enhancement Type: En enhancement to existing code, or a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant