From 56862a779f00b8c0f67fa49d1ffddce8bdc5ba7b Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Wed, 13 Jul 2016 10:23:20 -0400 Subject: [PATCH 1/3] refactored Makefile --- .gitignore | 2 ++ Makefile | 54 +++++++++++++----------------------- README.markdown => README.md | 0 3 files changed, 21 insertions(+), 35 deletions(-) create mode 100644 .gitignore rename README.markdown => README.md (100%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..36e1304 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +ExampleHumanImages +output diff --git a/Makefile b/Makefile index 7148a34..a91689e 100644 --- a/Makefile +++ b/Makefile @@ -1,45 +1,29 @@ -SVN = http://cellprofiler.org/svnmirror/ExampleImages/ExampleHumanImages +ARCHIVES = http://d1zymp9ayga15t.cloudfront.net/content/Examplezips .DEFAULT_GOAL: build build: docker build -t cellprofiler . -.PHONY: input -input: - mkdir -p $@ +ExampleHumanImages: ExampleHumanImages.zip + unzip $< -output: - mkdir -m 777 -p $@ - -ExampleHuman.cppipe: - curl -O ${SVN}/ExampleHuman.cppipe - -input/ExampleHuman.cppipe: ExampleHuman.cppipe - mv $< $@ - -AS_09125_050116030001_D03f00d0.tif: - curl -O ${SVN}/$@ - -input/AS_09125_050116030001_D03f00d0.tif: AS_09125_050116030001_D03f00d0.tif - mv $< $@ +.INTERMEDIATE: ExampleHumanImages.zip +ExampleHumanImages.zip: + wget ${ARCHIVES}/$@ -AS_09125_050116030001_D03f00d1.tif: AS_09125_050116030001_D03f00d1.tif - curl -O ${SVN}/$@ +ExampleHumanImages/filelist.txt: ExampleHumanImages + echo 'file:///ExampleHumanImages/AS_09125_050116030001_D03f00d0.tif' >> $@ + echo 'file:///ExampleHumanImages/AS_09125_050116030001_D03f00d1.tif' >> $@ + echo 'file:///ExampleHumanImages/AS_09125_050116030001_D03f00d2.tif' >> $@ -input/AS_09125_050116030001_D03f00d1.tif: AS_09125_050116030001_D03f00d1.tif - mv $< $@ - -AS_09125_050116030001_D03f00d2.tif: - curl -O ${SVN}/$@ - -input/AS_09125_050116030001_D03f00d2.tif: AS_09125_050116030001_D03f00d2.tif - mv $< $@ - -input/filelist.txt: input/AS_09125_050116030001_D03f00d0.tif input/AS_09125_050116030001_D03f00d1.tif input/AS_09125_050116030001_D03f00d2.tif - echo 'file:///input/AS_09125_050116030001_D03f00d0.tif' >> $@ - echo 'file:///input/AS_09125_050116030001_D03f00d1.tif' >> $@ - echo 'file:///input/AS_09125_050116030001_D03f00d2.tif' >> $@ +output: + mkdir -m 777 -p $@ .PHONY: test -test: input output input/filelist.txt input/ExampleHuman.cppipe - docker run --volume=`pwd`/input:/input --volume=`pwd`/output:/output cellprofiler --image-directory=/input --output-directory=/output --pipeline=/input/ExampleHuman.cppipe --file-list=/input/filelist.txt +test: ExampleHumanImages/filelist.txt output + docker run --volume=`pwd`/ExampleHumanImages:/ExampleHumanImages \ + --volume=`pwd`/output:/output cellprofiler \ + --file-list=/ExampleHumanImages/filelist.txt \ + --image-directory=/ExampleHumanImages \ + --output-directory=/output \ + --pipeline=/ExampleHumanImages/ExampleHuman.cppipe diff --git a/README.markdown b/README.md similarity index 100% rename from README.markdown rename to README.md From 6a747662194aff786c07ce7691699d9ab31d5613 Mon Sep 17 00:00:00 2001 From: jmoore Date: Fri, 3 Mar 2017 11:24:36 +0000 Subject: [PATCH 2/3] Add a VERSION argument Previously, master of CellProfiler/CellProfiler was always built, since the Dockerfile is not hosted in the main repo. Since only a change to this repository triggers a rebuild, the version available on hub.docker.com is disconnected from the main release cycle. By adding a build argument which version of CellProfiler is built can be controlled locally: ``` $ docker build -t cp-220 --build-arg VERSION=2.2.0 . $ docker run -ti --rm cp-220 --version CellProfiler 2.2.0 Git ac0529e Version 20160503183100 Built 2016-05-03T18:31:00 ``` This is a first step toward having trusted tags on Docker Hub. Additionally, on each CellProfiler release, a new commit will need to be created and tagged which sets VERSION to the correct value. If the Docker Hub build is configured properly, a new image will be built when that tag is pushed to GitHub. --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b7d3a02..e1438d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -71,7 +71,8 @@ RUN apt-get -y update && \ python-zmq \ xvfb WORKDIR /usr/local/src -RUN git clone https://github.com/CellProfiler/CellProfiler.git +ARG VERSION=master +RUN git clone -b $VERSION https://github.com/CellProfiler/CellProfiler.git WORKDIR /usr/local/src/CellProfiler RUN pip install \ --editable \ From 069e54289b4651526987cfbe5da23e7f747db924 Mon Sep 17 00:00:00 2001 From: jmoore Date: Fri, 3 Mar 2017 12:13:54 +0000 Subject: [PATCH 3/3] Switch to stable build --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e1438d8..47f2d7e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -71,7 +71,7 @@ RUN apt-get -y update && \ python-zmq \ xvfb WORKDIR /usr/local/src -ARG VERSION=master +ARG VERSION=stable RUN git clone -b $VERSION https://github.com/CellProfiler/CellProfiler.git WORKDIR /usr/local/src/CellProfiler RUN pip install \