Skip to content

Commit 3520c24

Browse files
authored
Merge pull request #11 from susom/development
Merge in dev branch
2 parents 9fd3a82 + 5af64e4 commit 3520c24

File tree

7 files changed

+48
-44
lines changed

7 files changed

+48
-44
lines changed

.github/workflows/deployment.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ jobs:
2323
steps:
2424
- name: Checkout repository
2525
uses: actions/checkout@v4
26+
27+
- name: Update submodules
28+
run: |
29+
git submodule update --init --recursive
30+
git submodule update --remote --merge
2631
2732
- name: Authenticate with Google Cloud
2833
uses: google-github-actions/auth@v2
@@ -47,18 +52,10 @@ jobs:
4752
- name: Setup buildx so we can use GHA caching
4853
uses: docker/setup-buildx-action@v3
4954

50-
- name: Setup Java
51-
uses: actions/setup-java@v4
52-
with:
53-
java-version: '8'
54-
distribution: 'temurin'
55-
56-
- name: Run make
57-
run: make install
58-
5955
- name: Build and push image
6056
uses: docker/build-push-action@v6
6157
with:
58+
platforms: linux/amd64,linux/arm64
6259
context: .
6360
cache-from: type=gha
6461
cache-to: type=gha,mode=max

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,5 @@ DAT/dcm4che.jar
6565
DAT/log4j.jar
6666
DAT/pixelmed_codec.jar
6767
DAT/util.jar
68+
DICOM/
69+
DICOM-ANON/

Dockerfile

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,36 @@
11
# Dockerfile for running CTP DicomAnonymizerTool with required dependencies
2-
FROM eclipse-temurin:8
2+
FROM eclipse-temurin:17-jdk AS build
33

4-
ENV HOME=/app
4+
ENV ANT_VERSION=1.10.15
5+
ENV ANT_HOME=/opt/ant
56

6-
WORKDIR /app
7-
ADD DAT /app/DAT
8-
ADD lib /app/lib
9-
ADD DicomAnonymizerTool/source/files/log4j.properties /app
7+
# change to tmp folder
8+
WORKDIR /tmp
109

11-
WORKDIR /opt/java/openjdk
12-
RUN chmod +x /app/lib/*.bin
13-
RUN echo yes | /app/lib/jai-1_1_3-lib-linux-amd64-jdk.bin
14-
RUN echo yes | /app/lib/jai_imageio-1_1-lib-linux-amd64-jdk.bin
10+
# Download and extract apache ant to opt folder
11+
RUN wget --no-check-certificate --no-cookies http://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz \
12+
&& wget --no-check-certificate --no-cookies http://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz.sha512 \
13+
&& echo "$(cat apache-ant-${ANT_VERSION}-bin.tar.gz.sha512) apache-ant-${ANT_VERSION}-bin.tar.gz" | sha512sum -c \
14+
&& tar -zvxf apache-ant-${ANT_VERSION}-bin.tar.gz -C /opt/ \
15+
&& ln -s /opt/apache-ant-${ANT_VERSION} /opt/ant \
16+
&& rm -f apache-ant-${ANT_VERSION}-bin.tar.gz \
17+
&& rm -f apache-ant-${ANT_VERSION}-bin.tar.gz.sha512
1518

16-
WORKDIR /app
17-
CMD ["java","-cp","/app/DAT/*","org.rsna.dicomanonymizertool.DicomAnonymizerTool"]
19+
# add executables to path
20+
RUN update-alternatives --install "/usr/bin/ant" "ant" "/opt/ant/bin/ant" 1 && \
21+
update-alternatives --set "ant" "/opt/ant/bin/ant"
22+
23+
# Build CTP & DicomAnonymizerTool
24+
COPY CTP/ /build/CTP/
25+
COPY DicomAnonymizerTool/ /build/DicomAnonymizerTool/
26+
WORKDIR /build/CTP
27+
RUN ant
28+
WORKDIR /build/DicomAnonymizerTool
29+
RUN ant
30+
31+
# Install
32+
FROM eclipse-temurin:17 AS dat
33+
COPY --from=build /build/DicomAnonymizerTool/build/DicomAnonymizerTool/ /opt/DAT/
34+
WORKDIR /opt/DAT
35+
ENV CLASSPATH=/opt/DAT/DAT.jar:/opt/DAT/imageio/*:/opt/DAT/libraries/*
36+
CMD ["java","org.rsna.dicomanonymizertool.DicomAnonymizerTool"]

Makefile

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
11
TARGET = install
2-
VERSION = 1.0.0
2+
VERSION = latest
33

4-
.PHONY: clean
5-
6-
all: clean install docker
4+
all: submodule docker deinit
75

86
docker:
9-
docker build -f Dockerfile --pull -t starr-radio:$(VERSION) .
7+
docker build -f Dockerfile --pull -t stanford-mirc-ctp:$(VERSION) .
108

11-
install:
9+
submodule:
1210
git submodule update --init --recursive
1311
git submodule update --remote --merge
14-
cd CTP
15-
git fetch
16-
cd ..
17-
cd DicomAnonymizerTool
18-
git fetch
19-
cd ..
20-
$(MAKE) -C CTP
21-
ant
22-
23-
check:
24-
$(MAKE) -C tests check
25-
26-
all: clean install
2712

28-
13+
deinit:
14+
git submodule deinit -f .

anonymize.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ shift $((OPTIND-1))
3737
[[ "${1:-}" = "--" ]] && shift
3838

3939
docker run --rm -e JAVA_TOOL_OPTIONS=${DEBUG} \
40-
-p 8000:8000 -v ${PWD}/scripts:/scripts -v ${PWD}:/data/dicom mirc-ctp java ${VERBOSE} -cp /app/DAT/* org.rsna.dicomanonymizertool.DicomAnonymizerTool -v -n 8 \
40+
-p 8000:8000 -v ${PWD}/scripts:/scripts -v ${PWD}:/data/dicom stanford-mirc-ctp:latest java ${VERBOSE} org.rsna.dicomanonymizertool.DicomAnonymizerTool -v -n 8 \
4141
-in /data/dicom/DICOM \
4242
-out /data/dicom/DICOM-ANON \
4343
-dec \

0 commit comments

Comments
 (0)