-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #203 from QIICR/standalone-packaging-rebased
Standalone packaging
- Loading branch information
Showing
13 changed files
with
209 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
build/ | ||
docker/dcmqi/dcmqi-linux/ | ||
|
||
*.[ao] | ||
*~ | ||
*.swp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,37 @@ | ||
machine: | ||
# XXX: btrfs circleCI fix, see: https://github.com/docker/docker/issues/9939 and https://github.com/Sabayon/docker-stage3-base-amd64/commit/8c1bf737113a278dd2f | ||
pre: | ||
- sudo curl -L -o /usr/bin/docker 'https://s3-external-1.amazonaws.com/circle-downloads/docker-1.9.0-circleci' | ||
- sudo chmod 0755 /usr/bin/docker | ||
services: | ||
- docker | ||
python: | ||
version: 2.7.11 | ||
dependencies: | ||
cache_directories: | ||
- "~/dcmqi-build/zlib" | ||
- "~/dcmqi-build/zlib-build" | ||
- "~/dcmqi-build/ITK" | ||
- "~/dcmqi-build/ITK-build" | ||
- "~/dcmqi-build/DCMTK" | ||
- "~/dcmqi-build/DCMTK-build" | ||
- "~/dcmqi-build/SlicerExecutionModel" | ||
- "~/dcmqi-build/SlicerExecutionModel-build" | ||
- dicom3tools_1.00.snapshot.20160721064406 | ||
pre: | ||
# Install tools required to run DCMQI "doc" tests | ||
- npm install jsonlint -g | ||
- npm install ajv-cli -g | ||
# Install xutils-dev package providing "imake" | ||
- sudo apt-get update | ||
- sudo apt-get install xutils-dev | ||
# If needed, download and build dicom3tools | ||
- | | ||
dicom3tools_version=dicom3tools_1.00.snapshot.20160721064406 | ||
if [[ ! -e $dicom3tools_version ]]; then | ||
wget --no-check-certificate http://slicer.kitware.com/midas3/download/item/270310/dicom3tools_1.00.snapshot.20160721064406.tar.bz2 -O dicom3tools.tar.bz2 \ | ||
&& tar xjf dicom3tools.tar.bz2 \ | ||
&& (cd $dicom3tools_version/ \ | ||
&& ./Configure \ | ||
&& imake -I./config -DUseQIICRID \ | ||
&& make -j$(grep -c processor /proc/cpuinfo) World > /dev/null 2>&1) | ||
else | ||
echo "Reusing " | ||
fi | ||
cd $dicom3tools_version && sudo make install | ||
# Install Ninja | ||
- wget --no-check-certificate https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-linux.zip | ||
- unzip ninja-linux.zip && sudo cp ninja /usr/local/bin/ && sudo chmod 755 /usr/local/bin/ninja | ||
# Use scikit-ci-addons to streamline installation of CMake | ||
- pip install scikit-ci-addons==0.11.0 | ||
- ci_addons circle/install_cmake 3.6.2 | ||
- "~/dcmqi/build" | ||
|
||
post: | ||
- mkdir -p ~/dcmqi-build && cd ~/dcmqi-build && cmake -G Ninja ../dcmqi && ninja | ||
- cd docker && make dcmqi | ||
# Install package required by convert.py | ||
- pip install lxml==3.6.4 | ||
- | | ||
cd ~/dcmqi-build/dcmqi-build && \ | ||
ctest -j4 -D ExperimentalTest -VV --no-compress-output && \ | ||
python ../../dcmqi/util/junit/convert.py \ | ||
~/dcmqi-build/dcmqi-build/ \ | ||
../../dcmqi/util/junit/conv.xsl > ~/dcmqi-build/BaseTest.xml | ||
cd docker && make dcmqi.test && \ | ||
python ../util/junit/convert.py \ | ||
../build/dcmqi-build/ \ | ||
../util/junit/conv.xsl > ../build/BaseTest.xml | ||
test: | ||
post: | ||
- mkdir -p ${CIRCLE_TEST_REPORTS}/junit | ||
- cp ~/dcmqi-build/BaseTest.xml ${CIRCLE_TEST_REPORTS}/junit | ||
- cp ~/dcmqi/build/BaseTest.xml ${CIRCLE_TEST_REPORTS}/junit | ||
|
||
deployment: | ||
release: # just a label | ||
branch: master | ||
commands: | ||
- | | ||
[ "$DOCKER_EMAIL" != "" ] \ | ||
&& docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS \ | ||
&& docker push qiicr/dcmqi:`git describe --exact-match 2> /dev/null || echo "latest"` \ | ||
|| echo "skipping docker push" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# | ||
# Parameters | ||
# | ||
|
||
# Name of the docker executable | ||
DOCKER = docker | ||
|
||
# Docker organization to pull the images from | ||
ORG = qiicr | ||
|
||
# Directories | ||
ROOT_DIR = $(shell pwd)/.. | ||
BUILD_DIR = build | ||
DOCKER_DIR = $(ROOT_DIR)/docker | ||
TMP = /tmp | ||
|
||
dicom3tools_version=dicom3tools_1.00.snapshot.20160721064406 | ||
|
||
# | ||
# Targets | ||
# | ||
|
||
image: dcmqi dcmqi.test | ||
|
||
# Pull dockcross image | ||
prereq.pull_dockcross: | ||
$(DOCKER) pull dockcross/manylinux-x64 | ||
$(DOCKER) run --rm dockcross/manylinux-x64 > $(TMP)/dockcross | ||
chmod u+x $(TMP)/dockcross | ||
|
||
# Download and build dicom3tools | ||
prereq.build_dicom3tools: prereq.pull_dockcross | ||
mkdir -p $(ROOT_DIR)/$(BUILD_DIR) | ||
cd $(ROOT_DIR)/$(BUILD_DIR) \ | ||
&& [ ! -e $(dicom3tools_version) ] \ | ||
&& wget --no-check-certificate http://slicer.kitware.com/midas3/download/item/270310/dicom3tools_1.00.snapshot.20160721064406.tar.bz2 -O dicom3tools.tar.bz2 \ | ||
&& tar xjf dicom3tools.tar.bz2 \ | ||
&& cd $(dicom3tools_version)/ \ | ||
&& $(TMP)/dockcross ./Configure \ | ||
&& $(TMP)/dockcross imake -I./config -DUseQIICRID \ | ||
&& ( $(TMP)/dockcross make -j$(grep -c processor /proc/cpuinfo) World > /dev/null 2>&1 )\ | ||
|| echo "Reusing " | ||
|
||
# Download and install "ajv" and "jsonlint" tools | ||
prereq.install_npm_packages: prereq.pull_dockcross | ||
mkdir -p $(ROOT_DIR)/$(BUILD_DIR) | ||
# If needed, download node | ||
cd $(ROOT_DIR)/$(BUILD_DIR) && \ | ||
[ ! -e node-v6.9.5-linux-x64 ] && \ | ||
wget --no-check-certificate https://nodejs.org/dist/v6.9.5/node-v6.9.5-linux-x64.tar.xz && \ | ||
tar xf node-v6.9.5-linux-x64.tar.xz || true | ||
# Install tools required to run DCMQI "doc" tests | ||
cd $(ROOT_DIR) && \ | ||
$(TMP)/dockcross bash -c "export PATH=/work/build/node-v6.9.5-linux-x64/bin:$$PATH && npm install jsonlint -g && npm install ajv-cli -g" | ||
|
||
# Configure, build and package | ||
dcmqi.generate_package: prereq.pull_dockcross | ||
cd $(ROOT_DIR) && \ | ||
$(TMP)/dockcross cmake -B$(BUILD_DIR) -H. -GNinja -DCMAKE_BUILD_TYPE:STRING=Release && \ | ||
$(TMP)/dockcross bash -c "export PATH=/work/build/node-v6.9.5-linux-x64/bin:/work/build/$(dicom3tools_version)/appsrc/dcfile:$$PATH && ninja -C$(BUILD_DIR) -v" && \ | ||
$(TMP)/dockcross ninja -C$(BUILD_DIR)/dcmqi-build package | ||
|
||
# Build "dcmqi" docker image | ||
dcmqi.docker_image: | ||
tar -xzvf $(ROOT_DIR)/$(BUILD_DIR)/dcmqi-build/dcmqi-linux.tar.gz -C $(DOCKER_DIR)/dcmqi | ||
cd $(DOCKER_DIR) && \ | ||
docker build -t $(ORG)/dcmqi:`git describe --exact-match 2> /dev/null || echo "latest"` \ | ||
--build-arg IMAGE=$(ORG)/dcmqi \ | ||
--build-arg VCS_REF=`git describe --exact-match 2> /dev/null || git rev-parse --short HEAD` \ | ||
--build-arg VCS_URL=`git config --get remote.origin.url` \ | ||
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ | ||
dcmqi | ||
|
||
dcmqi: prereq.build_dicom3tools prereq.install_npm_packages dcmqi.generate_package dcmqi.docker_image | ||
|
||
dcmqi.test: | ||
cd $(ROOT_DIR) && \ | ||
$(TMP)/dockcross bash -c "export PATH=/work/build/node-v6.9.5-linux-x64/bin:/work/build/$(dicom3tools_version)/appsrc/dcfile:/opt/python/cp27-cp27mu/bin/:$$PATH && cd /work/build/dcmqi-build && ctest -j4 -D ExperimentalTest -VV --no-compress-output" | ||
|
||
dcmqi.clean: | ||
rm -rf $(ROOT_DIR)/$(BUILD_DIR) | ||
rm -rf $(DOCKER_DIR)/dcmqi/dcmqi-linux | ||
|
||
.PHONY: image dcmqi dcmqi.% prereq.% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM centos:5 | ||
MAINTAINER http://github.com/QIICR | ||
|
||
COPY imagefiles/docker_entry.sh /dcmqi/ | ||
COPY dcmqi-linux/bin/* /usr/bin/ | ||
|
||
WORKDIR /work | ||
ENTRYPOINT ["/bin/bash","/dcmqi/docker_entry.sh"] | ||
|
||
# Build-time metadata as defined at http://label-schema.org | ||
ARG BUILD_DATE | ||
ARG IMAGE | ||
ARG VCS_REF | ||
ARG VCS_URL | ||
LABEL org.label-schema.build-date=$BUILD_DATE \ | ||
org.label-schema.name=$IMAGE \ | ||
org.label-schema.vcs-ref=$VCS_REF \ | ||
org.label-schema.vcs-url=$VCS_URL \ | ||
org.label-schema.schema-version="1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
case "$1" in | ||
itkimage2paramap|paramap2itkimage|itkimage2segimage|segimage2itkimage|tid1500reader|tid1500writer) | ||
$1 "${@:2}" | ||
;; | ||
*) | ||
echo "ERROR: Unknown command" | ||
echo "" | ||
cat >&2 <<ENDHELP | ||
Usage: docker run [-v <HOST_DIR>:<CONTAINER_DIR>] qiicr/dcmqi <command> [args] | ||
Run the given dcmqi *command*. | ||
Available commands are: | ||
itkimage2paramap | ||
paramap2itkimage | ||
itkimage2segimage | ||
segimage2itkimage | ||
tid1500reader | ||
tid1500writer | ||
For *command* help use: docker run qiicr/dcmqi <command> --help | ||
ENDHELP | ||
exit 1 | ||
;; | ||
esac | ||
|