anaconda / anaconda-project

Tool for encapsulating, running, and reproducing data science projects
https://anaconda-project.readthedocs.io/en/latest/
Other
217 stars 88 forks source link

Docker build (s2i) #306

Closed AlbertDeFusco closed 3 years ago

AlbertDeFusco commented 3 years ago

This adds the anaconda-project dockerize command to create Docker images from projects. This will run s2i build using the s2i-anaconda-project builder images by default.

usage: anaconda-project dockerize [-h] [--directory PROJECT_DIR] [-t TAG]
                                  [--command COMMAND]
                                  [--builder-image BUILDER_IMAGE]
                                  [build_args [build_args ...]]

positional arguments:
  build_args            Optional arguments for the s2i build command. See the
                        output of "s2i build --help" for the available
                        arguments. It is recommended to include a -- separator
                        before supplying these arguments.

optional arguments:
  -h, --help            show this help message and exit
  --directory PROJECT_DIR
                        Project directory containing anaconda-project.yml
                        (defaults to current directory)
  -t TAG, --tag TAG     Tag of the output docker image in the format name:tag.
                        Default: "<project-name>:latest", where <project-name>
                        is taken from the name tag in the anaconda-project.yml
                        file.
  --command COMMAND     Select the command to run. If unspecified the
                        "default" command is run. The default command is
                        defined as either the command named "default" or the
                        first command specified in the anaconda-project.yml
                        file.
  --builder-image BUILDER_IMAGE
                        The s2i builder image
bkreider commented 3 years ago

Any reason not to call the subcommand "docker" instead of "dock"?

AlbertDeFusco commented 3 years ago

I'm not particularly partial. I used to "dock" since it is a verb like other commands (prepare, archive, etc.).

AlbertDeFusco commented 3 years ago

Maybe "dockerize" or "build-image"? What else might be a good name for this subcommand?

jbednar commented 3 years ago

dock, docker, dockerize, and docker-image all sound fine to me (so I'm not much help!).

AlbertDeFusco commented 3 years ago

@jbednar , could you re-open this PR?

bkreider commented 3 years ago

Ah. It looked like a shortening of docker. In my eyes, dock is less self-descriptive, dockerize seems nice, but I'm not strongly opinionated either way. I was just a little confused by dock.

AlbertDeFusco commented 3 years ago

dockerize it is then!

mcg1969 commented 3 years ago

just a final sign off here. If one of you can review then go ahead and merge too!

AlbertDeFusco commented 3 years ago

Thanks! I'll add those changes first thing tomorrow

AlbertDeFusco commented 3 years ago

Recommended changes incorporated, thanks