Skip to content

Commit

Permalink
- Adjustments for issue #33
Browse files Browse the repository at this point in the history
  Built-in execute command (a help command)
  User now has to specify WORKDIR or CMD to do real work
  • Loading branch information
Alan Christie committed Apr 25, 2019
1 parent f85c524 commit 4476368
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 2 deletions.
14 changes: 14 additions & 0 deletions Dockerfile-obabel
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,17 @@ RUN pip install im-pipelines-utils==2.2.* im-pipelines-utils-rdkit==1.4.*

USER obabel

# The CMD is simply to run 'execute' in the WORKDIR.
# The user would normally mount a volume with their own execute
# script in it and then set the WORKDIR to the directory it's in.
# In its absence we just run the built-in 'execute',
# which is expected to echo some descriptive/helpful text.
#
# The default 'execute' relies on an ENV to name the pipeline it's in,
# which can be defined with the docker 'pipeline' build argument.
ARG pipeline=informaticsmatters/pipelines-obabel:latest
ENV PIPELINE=$pipeline
WORKDIR /home/obable
COPY --chown=obabel:0 execute ./
RUN chmod +x ./execute
CMD ["./execute"]
14 changes: 14 additions & 0 deletions Dockerfile-pli
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,17 @@ USER 1001

WORKDIR /home/pli
ENV PLI_DIR /usr/local/pli

# The CMD is simply to run 'execute' in the WORKDIR.
# The user would normally mount a volume with their own execute
# script in it and then set the WORKDIR to the directory it's in.
# In its absence we just run the built-in 'execute',
# which is expected to echo some descriptive/helpful text.
#
# The default 'execute' relies on an ENV to name the pipeline it's in,
# which can be defined with the docker 'pipeline' build argument.
ARG pipeline=informaticsmatters/pli:latest
ENV PIPELINE=$pipeline
COPY --chown=1001:0 execute ./
RUN chmod +x ./execute
CMD ["./execute"]
15 changes: 15 additions & 0 deletions Dockerfile-rdkit
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,18 @@ RUN pip install -e /opt/python
# And the pip packages including pipeline-utilities and im-pipelines-utils-rdkit
RUN pip install molvs standardiser matplotlib \
im-pipelines-utils>=2.4.5 im-pipelines-utils-rdkit>=1.5.7

# The CMD is simply to run 'execute' in the WORKDIR.
# The user would normally mount a volume with their own execute
# script in it and then set the WORKDIR to the directory it's in.
# In its absence we just run the built-in 'execute',
# which is expected to echo some descriptive/helpful text.
#
# The default 'execute' relies on an ENV to name the pipeline it's in,
# which can be defined with the docker 'pipeline' build argument.
ARG pipeline=informaticsmatters/rdkit_pipelines:latest
ENV PIPELINE=$pipeline
WORKDIR /home/rdkit
COPY execute ./
RUN chmod +x ./execute
CMD ["./execute"]
17 changes: 16 additions & 1 deletion Dockerfile-rdkit-centos
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,19 @@ COPY src/python /opt/python
RUN pip install -e /opt/python
# And the pip packages including pipeline-utilities and im-pipelines-utils-rdkit
# NOTE: matplotlib is missing
RUN pip install molvs standardiser im-pipelines-utils==2.2.* im-pipelines-utils-rdkit==1.4.*
RUN pip install molvs standardiser im-pipelines-utils>=2.4.5 im-pipelines-utils-rdkit>=1.5.7

# The CMD is simply to run 'execute' in the WORKDIR.
# The user would normally mount a volume with their own execute
# script in it and then set the WORKDIR to the directory it's in.
# In its absence we just run the built-in 'execute',
# which is expected to echo some descriptive/helpful text.
#
# The default 'execute' relies on an ENV to name the pipeline it's in,
# which can be defined with the docker 'pipeline' build argument.
ARG pipeline=informaticsmatters/rdkit_pipelines:latest
ENV PIPELINE=$pipeline
WORKDIR /home/rdkit
COPY execute ./
RUN chmod +x ./execute
CMD ["./execute"]
14 changes: 13 additions & 1 deletion Dockerfile-smog
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,17 @@ ARG USERID=1001
RUN useradd -u $USERID -g 0 -m smog
USER $USERID


# The CMD is simply to run 'execute' in the WORKDIR.
# The user would normally mount a volume with their own execute
# script in it and then set the WORKDIR to the directory it's in.
# In its absence we just run the built-in 'execute',
# which is expected to echo some descriptive/helpful text.
#
# The default 'execute' relies on an ENV to name the pipeline it's in,
# which can be defined with the docker 'pipeline' build argument.
ARG pipeline=informaticsmatters/smog:latest
ENV PIPELINE=$pipeline
WORKDIR /home/smog
COPY --chown=smog:0 execute ./
RUN chmod +x ./execute
CMD ["./execute"]
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ task buildPipelinesImage(type: DockerBuildImage) {
dockerFile = file('Dockerfile-rdkit')
inputDir = file('.')
tag = "informaticsmatters/rdkit_${pipeline}:latest"
buildArgs = ['pipeline':"informaticsmatters/rdkit_${pipeline}:latest"]
}

task buildPliImage(type: DockerBuildImage) {
Expand All @@ -73,6 +74,7 @@ task buildPliImage(type: DockerBuildImage) {
dockerFile = file('Dockerfile-pli')
inputDir = file('.')
tag = "informaticsmatters/pli:latest"
buildArgs = ['pipeline':"informaticsmatters/pli:latest"]
}

task buildSmogImage(type: DockerBuildImage) {
Expand All @@ -82,6 +84,7 @@ task buildSmogImage(type: DockerBuildImage) {
dockerFile = file('Dockerfile-smog')
inputDir = file('.')
tag = "informaticsmatters/smog:latest"
buildArgs = ['pipeline':"informaticsmatters/smog:latest"]
}

task buildSdPosterImage(type: DockerBuildImage) {
Expand All @@ -99,6 +102,7 @@ task buildObabelImage(type: DockerBuildImage) {
dockerFile = file('Dockerfile-obabel')
inputDir = file('.')
tag = "informaticsmatters/pipelines-obabel:latest"
buildArgs = ['pipeline':"informaticsmatters/pipelines-obabel:latest"]
}

task buildDockerImages() {
Expand Down
32 changes: 32 additions & 0 deletions execute
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/bash

echo
echo "PIPELINES (RDKit)"
echo "-----------------"
echo "You have just run the built-in 'execute' command. Congratulations!"
echo ""
echo "In order to use this container productively you need to provide your own"
echo "'execute' script or command and any corresponding data files."
echo ""
echo "You could mount a volume into this container that contains an executable"
echo "file named 'execute', which contains the command you wish to run,"
echo "and also include any additional data files. When you run the container,"
echo "adjust the default container WORKDIR by using the docker '-w' option,"
echo "specifying the mounted path of the volume as its value. As an example,"
echo "if you've placed an 'execute' and its data in the current working"
echo "directory you could run the container like this: -"
echo ""
echo " $ docker run --rm \\"
echo " -v \$PWD:/squonk/work/docker \\"
echo " -w=\"/squonk/work/docker\" \\"
echo " $PIPELINE"
echo ""
echo "Alternatively you can run interactive commands by over-riding the"
echo "built-in container 'CMD' (which is './execute'). To enter the"
echo "container's shell (bash) using the default 'WORKDIR' you can run: -"
echo ""
echo " $ docker run --rm \\"
echo " -it \\"
echo " $PIPELINE \\"
echo " bash"
echo

0 comments on commit 4476368

Please sign in to comment.