Skip to content

Commit

Permalink
cont
Browse files Browse the repository at this point in the history
  • Loading branch information
amazy committed Jun 24, 2023
1 parent 7657e82 commit 18c2815
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 37 deletions.
64 changes: 34 additions & 30 deletions docker/orthanc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ENV AWS_SECRET_ACCESS_KEY=$ARG_AWS_SECRET_ACCESS_KEY
ARG PREFER_DOWNLOADS=1
ARG ENABLE_UPLOAD=0
ARG PLATFORM=linux/amd64

ARG BASE_IMAGE_TAG=unknown


FROM osimis/orthanc-runner-base:${BASE_IMAGE_TAG} as orthanc-runner-base
Expand All @@ -22,7 +22,7 @@ FROM osimis/orthanc-builder-base:vcpkg-azure-${BASE_IMAGE_TAG} as build-plugin-o
FROM orthanc-builder-base as build-orthanc

ARG ORTHANC_COMMIT_ID
RUN /scripts/build-or-download.sh target=orthanc commitId=$ORTHANC_COMMIT_ID baseImage=$PLATFORM$BASE_IMAGE_TAG preferDownloads=$PREFER_DOWNLOADS enableUploads=$ENABLE_UPLOAD
RUN /scripts/build-or-download.sh target=orthanc commitId=$ORTHANC_COMMIT_ID baseImage=$PLATFORM/$BASE_IMAGE_TAG preferDownloads=$PREFER_DOWNLOADS enableUploads=$ENABLE_UPLOAD
# RUN hg clone https://hg.orthanc-server.com/orthanc/ -r $ORTHANC_COMMIT_ID /sources
# WORKDIR /build

Expand All @@ -37,7 +37,7 @@ RUN /scripts/build-or-download.sh target=orthanc commitId=$ORTHANC_COMMIT_ID bas
FROM orthanc-builder-base as build-gdcm

ARG ORTHANC_GDCM_COMMIT_ID
RUN /scripts/build-or-download.sh target=orthanc-gdcm commitId=$ORTHANC_GDCM_COMMIT_ID baseImage=$PLATFORM$BASE_IMAGE_TAG preferDownloads=$PREFER_DOWNLOADS enableUploads=$ENABLE_UPLOAD
RUN /scripts/build-or-download.sh target=orthanc-gdcm commitId=$ORTHANC_GDCM_COMMIT_ID baseImage=$PLATFORM/$BASE_IMAGE_TAG preferDownloads=$PREFER_DOWNLOADS enableUploads=$ENABLE_UPLOAD


# RUN hg clone https://hg.orthanc-server.com/orthanc-gdcm/ -r $ORTHANC_GDCM_COMMIT_ID /sources
Expand All @@ -50,7 +50,7 @@ RUN /scripts/build-or-download.sh target=orthanc-gdcm commitId=$ORTHANC_GDCM_COM
FROM orthanc-builder-base as build-plugin-pg

ARG ORTHANC_PG_COMMIT_ID
RUN /scripts/build-or-download.sh target=orthanc-pg commitId=$ORTHANC_PG_COMMIT_ID baseImage=$PLATFORM$BASE_IMAGE_TAG preferDownloads=$PREFER_DOWNLOADS enableUploads=$ENABLE_UPLOAD
RUN /scripts/build-or-download.sh target=orthanc-pg commitId=$ORTHANC_PG_COMMIT_ID baseImage=$PLATFORM/$BASE_IMAGE_TAG preferDownloads=$PREFER_DOWNLOADS enableUploads=$ENABLE_UPLOAD

# RUN hg clone https://hg.orthanc-server.com/orthanc-databases/ -r $ORTHANC_PG_COMMIT_ID /sources
# WORKDIR /build
Expand All @@ -63,7 +63,7 @@ RUN /scripts/build-or-download.sh target=orthanc-pg commitId=$ORTHANC_PG_COMMIT_
FROM orthanc-builder-base as build-plugin-mysql

ARG ORTHANC_MYSQL_COMMIT_ID
RUN /scripts/build-or-download.sh target=orthanc-mysql commitId=$ORTHANC_MYSQL_COMMIT_ID baseImage=$PLATFORM$BASE_IMAGE_TAG preferDownloads=$PREFER_DOWNLOADS enableUploads=$ENABLE_UPLOAD
RUN /scripts/build-or-download.sh target=orthanc-mysql commitId=$ORTHANC_MYSQL_COMMIT_ID baseImage=$PLATFORM/$BASE_IMAGE_TAG preferDownloads=$PREFER_DOWNLOADS enableUploads=$ENABLE_UPLOAD

# RUN hg clone https://hg.orthanc-server.com/orthanc-databases/ -r $ORTHANC_MYSQL_COMMIT_ID /sources
# WORKDIR /build
Expand Down Expand Up @@ -128,7 +128,7 @@ RUN /build/UnitTests
FROM orthanc-builder-base as build-plugin-auth

ARG ORTHANC_AUTH_COMMIT_ID
RUN /scripts/build-or-download.sh target=orthanc-authorization commitId=$ORTHANC_AUTH_COMMIT_ID baseImage=$PLATFORM$BASE_IMAGE_TAG preferDownloads=$PREFER_DOWNLOADS enableUploads=$ENABLE_UPLOAD
RUN /scripts/build-or-download.sh target=orthanc-authorization commitId=$ORTHANC_AUTH_COMMIT_ID baseImage=$PLATFORM/$BASE_IMAGE_TAG preferDownloads=$PREFER_DOWNLOADS enableUploads=$ENABLE_UPLOAD

# RUN hg clone https://hg.orthanc-server.com/orthanc-authorization/ -r $ORTHANC_AUTH_COMMIT_ID /sources
# WORKDIR /build
Expand All @@ -141,7 +141,7 @@ RUN /scripts/build-or-download.sh target=orthanc-authorization commitId=$ORTHANC
FROM orthanc-builder-base as build-plugin-python

ARG ORTHANC_PYTHON_COMMIT_ID
RUN /scripts/build-or-download.sh target=orthanc-python commitId=$ORTHANC_PYTHON_COMMIT_ID baseImage=$PLATFORM$BASE_IMAGE_TAG preferDownloads=$PREFER_DOWNLOADS enableUploads=$ENABLE_UPLOAD
RUN /scripts/build-or-download.sh target=orthanc-python commitId=$ORTHANC_PYTHON_COMMIT_ID baseImage=$PLATFORM/$BASE_IMAGE_TAG preferDownloads=$PREFER_DOWNLOADS enableUploads=$ENABLE_UPLOAD


# RUN hg clone https://hg.orthanc-server.com/orthanc-python/ -r $ORTHANC_PYTHON_COMMIT_ID /sources
Expand All @@ -155,7 +155,7 @@ RUN /scripts/build-or-download.sh target=orthanc-python commitId=$ORTHANC_PYTHON
FROM orthanc-builder-base as build-plugin-odbc

ARG ORTHANC_ODBC_COMMIT_ID
RUN /scripts/build-or-download.sh target=orthanc-odbc commitId=$ORTHANC_ODBC_COMMIT_ID baseImage=$PLATFORM$BASE_IMAGE_TAG preferDownloads=$PREFER_DOWNLOADS enableUploads=$ENABLE_UPLOAD
RUN /scripts/build-or-download.sh target=orthanc-odbc commitId=$ORTHANC_ODBC_COMMIT_ID baseImage=$PLATFORM/$BASE_IMAGE_TAG preferDownloads=$PREFER_DOWNLOADS enableUploads=$ENABLE_UPLOAD

# RUN hg clone https://hg.orthanc-server.com/orthanc-databases/ -r $ORTHANC_ODBC_COMMIT_ID /sources
# WORKDIR /build
Expand All @@ -168,7 +168,7 @@ RUN /scripts/build-or-download.sh target=orthanc-odbc commitId=$ORTHANC_ODBC_COM
FROM orthanc-builder-base as build-plugin-indexer

ARG ORTHANC_INDEXER_COMMIT_ID
RUN /scripts/build-or-download.sh target=orthanc-indexer commitId=$ORTHANC_INDEXER_COMMIT_ID baseImage=$PLATFORM$BASE_IMAGE_TAG preferDownloads=$PREFER_DOWNLOADS enableUploads=$ENABLE_UPLOAD
RUN /scripts/build-or-download.sh target=orthanc-indexer commitId=$ORTHANC_INDEXER_COMMIT_ID baseImage=$PLATFORM/$BASE_IMAGE_TAG preferDownloads=$PREFER_DOWNLOADS enableUploads=$ENABLE_UPLOAD

# RUN hg clone https://orthanc.uclouvain.be/hg/orthanc-indexer/ -r $ORTHANC_INDEXER_COMMIT_ID /sources
# WORKDIR /build
Expand All @@ -180,7 +180,7 @@ RUN /scripts/build-or-download.sh target=orthanc-indexer commitId=$ORTHANC_INDEX
FROM orthanc-builder-base as build-plugin-neuro

ARG ORTHANC_NEURO_COMMIT_ID
RUN /scripts/build-or-download.sh target=orthanc-neuro commitId=$ORTHANC_NEURO_COMMIT_ID baseImage=$PLATFORM$BASE_IMAGE_TAG preferDownloads=$PREFER_DOWNLOADS enableUploads=$ENABLE_UPLOAD
RUN /scripts/build-or-download.sh target=orthanc-neuro commitId=$ORTHANC_NEURO_COMMIT_ID baseImage=$PLATFORM/$BASE_IMAGE_TAG preferDownloads=$PREFER_DOWNLOADS enableUploads=$ENABLE_UPLOAD

# RUN hg clone https://orthanc.uclouvain.be/hg/orthanc-neuro/ -r $ORTHANC_NEURO_COMMIT_ID /sources
# WORKDIR /build
Expand All @@ -192,7 +192,7 @@ RUN /scripts/build-or-download.sh target=orthanc-neuro commitId=$ORTHANC_NEURO_C
FROM orthanc-builder-base as build-plugin-tcia

ARG ORTHANC_TCIA_COMMIT_ID
RUN /scripts/build-or-download.sh target=orthanc-tcia commitId=$ORTHANC_TCIA_COMMIT_ID baseImage=$PLATFORM$BASE_IMAGE_TAG preferDownloads=$PREFER_DOWNLOADS enableUploads=$ENABLE_UPLOAD
RUN /scripts/build-or-download.sh target=orthanc-tcia commitId=$ORTHANC_TCIA_COMMIT_ID baseImage=$PLATFORM/$BASE_IMAGE_TAG preferDownloads=$PREFER_DOWNLOADS enableUploads=$ENABLE_UPLOAD

# RUN hg clone https://orthanc.uclouvain.be/hg/orthanc-tcia/ -r $ORTHANC_TCIA_COMMIT_ID /sources
# WORKDIR /build
Expand Down Expand Up @@ -322,32 +322,36 @@ RUN make -j 4

FROM orthanc-builder-base as build-oe2

RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get --assume-yes update && \
apt-get --assume-yes install npm && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN curl -fsSL https://deb.nodesource.com/setup_19.x | bash - && \
apt-get install -y nodejs

ARG ORTHANC_OE2_COMMIT_ID
ARG ORTHANC_OE2_VERSION

WORKDIR /sources
RUN /scripts/build-or-download.sh target=orthanc-explorer-2 commitId=$ORTHANC_OE2_COMMIT_ID extraArg1=$ORTHANC_OE2_VERSION baseImage=$PLATFORM/$BASE_IMAGE_TAG preferDownloads=$PREFER_DOWNLOADS enableUploads=$ENABLE_UPLOAD

RUN git clone https://github.com/orthanc-server/orthanc-explorer-2.git && \
cd /sources/orthanc-explorer-2 && \
git checkout $ORTHANC_OE2_COMMIT_ID

WORKDIR /sources/orthanc-explorer-2/WebApplication
# RUN export DEBIAN_FRONTEND=noninteractive && \
# apt-get --assume-yes update && \
# apt-get --assume-yes install npm && \
# apt-get clean && \
# rm -rf /var/lib/apt/lists/*

RUN npm install
RUN npm run build
# RUN curl -fsSL https://deb.nodesource.com/setup_19.x | bash - && \
# apt-get install -y nodejs

WORKDIR /build
RUN cmake -DALLOW_DOWNLOADS=ON -DCMAKE_BUILD_TYPE:STRING=Release -DUSE_SYSTEM_ORTHANC_SDK=OFF -DPLUGIN_VERSION=$ORTHANC_OE2_VERSION /sources/orthanc-explorer-2/
RUN make -j 4

# WORKDIR /sources

# RUN git clone https://github.com/orthanc-server/orthanc-explorer-2.git && \
# cd /sources/orthanc-explorer-2 && \
# git checkout $ORTHANC_OE2_COMMIT_ID

# WORKDIR /sources/orthanc-explorer-2/WebApplication

# RUN npm install
# RUN npm run build

# WORKDIR /build
# RUN cmake -DALLOW_DOWNLOADS=ON -DCMAKE_BUILD_TYPE:STRING=Release -DUSE_SYSTEM_ORTHANC_SDK=OFF -DPLUGIN_VERSION=$ORTHANC_OE2_VERSION /sources/orthanc-explorer-2/
# RUN make -j 4


########################## Kitware's VolView for Orthanc
Expand Down
46 changes: 39 additions & 7 deletions docker/orthanc/build-or-download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ preferDownloads=0
enableUploads=0
baseImage=unknown
commitId=xxx

extraArg1=

for argument in "$@"
do
Expand All @@ -36,10 +36,13 @@ echo "preferDownloads = $preferDownloads"
echo "enableUploads = $enableUploads"
echo "baseImage = $baseImage"
echo "commitId = $commitId"
echo "extraArg1 = $extraArg1"

# while debugging the script on your local machine, you might want to change these paths
buildRootPath=/tmp/build
sourcesRootPath=/tmp/sources
# buildRootPath=/tmp/build
# sourcesRootPath=/tmp/sources
buildRootPath=/build
sourcesRootPath=/sources
dl=0

# rewrite pushd/popd such that they do not produce any output in bash functions (https://stackoverflow.com/questions/25288194/dont-display-pushd-popd-stack-across-several-bash-scripts-quiet-pushd-popd)
Expand Down Expand Up @@ -177,7 +180,7 @@ elif [[ $target == "orthanc-odbc" ]]; then

hg clone https://hg.orthanc-server.com/orthanc-databases/ -r $commitId $sourcesRootPath
pushd $buildRootPath
cmake -DALLOW_DOWNLOADS=ON -DCMAKE_BUILD_TYPE:STRING=Release -DUSE_SYSTEM_GOOGLE_TEST=ON -DUSE_SYSTEM_ORTHANC_SDK=OFF $sourcesRootPath/MySQL
cmake -DALLOW_DOWNLOADS=ON -DCMAKE_BUILD_TYPE:STRING=Release -DUSE_SYSTEM_GOOGLE_TEST=ON -DUSE_SYSTEM_ORTHANC_SDK=OFF $sourcesRootPath/Odbc
make -j 4

upload libOrthancOdbcIndex.so
Expand All @@ -190,7 +193,7 @@ elif [[ $target == "orthanc-indexer" ]]; then

if [[ $dl != 0 ]]; then

hg clone https://hg.orthanc-server.com/orthanc-indexer/ -r $commitId $sourcesRootPath
hg clone https://orthanc.uclouvain.be/hg/orthanc-indexer/ -r $commitId $sourcesRootPath
pushd $buildRootPath
cmake -DALLOW_DOWNLOADS=ON -DCMAKE_BUILD_TYPE:STRING=Release -DUSE_SYSTEM_GOOGLE_TEST=ON -DUSE_SYSTEM_ORTHANC_SDK=OFF -DUSE_SYSTEM_LIBCSV=OFF $sourcesRootPath
make -j 4
Expand All @@ -204,7 +207,7 @@ elif [[ $target == "orthanc-neuro" ]]; then

if [[ $dl != 0 ]]; then

hg clone https://hg.orthanc-server.com/orthanc-neuro/ -r $commitId $sourcesRootPath
hg clone https://orthanc.uclouvain.be/hg/orthanc-neuro/ -r $commitId $sourcesRootPath
pushd $buildRootPath
cmake -DALLOW_DOWNLOADS=ON -DCMAKE_BUILD_TYPE:STRING=Release -DUSE_SYSTEM_GOOGLE_TEST=ON -DUSE_SYSTEM_ORTHANC_SDK=OFF -DUSE_SYSTEM_NIFTILIB=OFF $sourcesRootPath
make -j 4
Expand All @@ -218,13 +221,42 @@ elif [[ $target == "orthanc-tcia" ]]; then

if [[ $dl != 0 ]]; then

hg clone https://hg.orthanc-server.com/orthanc-tcia/ -r $commitId $sourcesRootPath
hg clone https://orthanc.uclouvain.be/hg/orthanc-tcia/ -r $commitId $sourcesRootPath
pushd $buildRootPath
cmake -DALLOW_DOWNLOADS=ON -DCMAKE_BUILD_TYPE:STRING=Release -DUSE_SYSTEM_GOOGLE_TEST=ON -DUSE_SYSTEM_ORTHANC_SDK=OFF -DUSE_SYSTEM_LIBCSV=OFF $sourcesRootPath
make -j 4

upload libOrthancTcia.so
fi

elif [[ $target == "orthanc-explorer-2" ]]; then

dl=$(( $dl + $(download libOrthancExplorer2.so) ))

if [[ $dl != 0 ]]; then

export DEBIAN_FRONTEND=noninteractive && apt-get --assume-yes update && apt-get --assume-yes install npm && apt-get clean && rm -rf /var/lib/apt/lists/*

curl -fsSL https://deb.nodesource.com/setup_19.x | bash - && apt-get install -y nodejs

pushd $sourcesRootPath

git clone https://github.com/orthanc-server/orthanc-explorer-2.git && \
cd $sourcesRootPath/orthanc-explorer-2 && \
git checkout $commitId

pushd $sourcesRootPath/orthanc-explorer-2/WebApplication

npm install
npm run build

pushd $buildRootPath
cmake -DALLOW_DOWNLOADS=ON -DCMAKE_BUILD_TYPE:STRING=Release -DUSE_SYSTEM_ORTHANC_SDK=OFF -DPLUGIN_VERSION=$extraArg1 $sourcesRootPath/orthanc-explorer-2/
make -j 4

upload libOrthancExplorer2.so
fi


fi

0 comments on commit 18c2815

Please sign in to comment.