From 99dc18e48f3797e2ed7636be0c8288469a9dba0b Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 5 Jun 2025 15:33:14 +0200 Subject: [PATCH 01/10] add new docker files and testing --- docker/build.sh | 8 +- docker/mountFolder/main.dml | 15 +++- docker/pythonsysdslight.Dockerfile | 111 ++++++++++++++++++++++++ docker/sysdslight.Dockerfile | 73 ++++++++++++++++ docker/sysdslight_multistage.Dockerfile | 98 +++++++++++++++++++++ docker/testsysdslight.Dockerfile | 78 +++++++++++++++++ 6 files changed, 380 insertions(+), 3 deletions(-) create mode 100644 docker/pythonsysdslight.Dockerfile create mode 100644 docker/sysdslight.Dockerfile create mode 100644 docker/sysdslight_multistage.Dockerfile create mode 100644 docker/testsysdslight.Dockerfile diff --git a/docker/build.sh b/docker/build.sh index 2898effdc22..a4ca36aeb12 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -23,8 +23,12 @@ # Build the docker containers # The first build is for running systemds through docker. -# docker image build -f docker/sysds.Dockerfile -t apache/systemds:latest . - +docker image build -f docker/sysds.Dockerfile -t apache/systemds:latest . +#docker image build -f docker/sysdslight.Dockerfile -t apache/systemds:lighttest . +docker image build -f docker/sysdslight_multistage.Dockerfile -t apache/systemds:lighttest_multistage . +docker image build -f docker/testsysdslight.Dockerfile -t apache/systemds:testsysdslight . +docker image build -f docker/pythonsysdslight.Dockerfile -t apache/systemds:pythonsysdslight . +docker image build -f docker/pythonsysds.Dockerfile -t apache/systemds:pythonsysds . # The second build is for testing systemds. This image installs the R dependencies needed to run the tests. docker image build -f docker/testsysds.Dockerfile -t apache/systemds:testing-latest . diff --git a/docker/mountFolder/main.dml b/docker/mountFolder/main.dml index 07c4862e622..e01ab2ad1ec 100644 --- a/docker/mountFolder/main.dml +++ b/docker/mountFolder/main.dml @@ -19,4 +19,17 @@ # #------------------------------------------------------------- -print("Hello, World!"); \ No newline at end of file +# kmeans_test.dml +# Simple KMeans clustering test + +# Arguments +X = [[1.0, 2.0],[1.5, 1.8],[5.0, 8.0],[8.0, 8.0],[1.0, 0.6],[9.0, 11.0]] + +# Initialization +source("scripts/builtin/kmeans.dml") as kmeans + +# Run KMeans +[centroids, assignments] = kmeans::kmeans(X=X, K=2, max_iter=100, epsilon=0.01) + +print(centroids) +print(assignments) \ No newline at end of file diff --git a/docker/pythonsysdslight.Dockerfile b/docker/pythonsysdslight.Dockerfile new file mode 100644 index 00000000000..4b588338109 --- /dev/null +++ b/docker/pythonsysdslight.Dockerfile @@ -0,0 +1,111 @@ +#------------------------------------------------------------- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +#------------------------------------------------------------- + +FROM python:3.12-slim@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db AS compile-image + +WORKDIR /usr/src/ + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + wget \ + git \ + tar \ + ca-certificates \ + && apt-get clean + +# Maven +ENV MAVEN_VERSION=3.9.9 +ENV MAVEN_HOME=/usr/lib/mvn +ENV PATH=$MAVEN_HOME/bin:$PATH +# Java +ENV JAVA_HOME=/usr/lib/jvm/jdk-17.0.15+6 +ENV PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH +ENV SYSTEMDS_ROOT=/usr/src/systemds +ENV PATH=$SYSTEMDS_ROOT/bin:$PATH +ENV SYSDS_QUIET=1 + +# Download JAVA +RUN mkdir -p /usr/lib/jvm \ + && wget -qO- \ + https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jdk_x64_linux_hotspot_17.0.15_6.tar.gz | tar xzf - \ + && mv jdk-17.0.15+6 $JAVA_HOME + +# Download Mvn +RUN wget -qO- \ + http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar xzf - \ + && mv apache-maven-$MAVEN_VERSION /usr/lib/mvn + +RUN git clone --depth 1 https://github.com/apache/systemds.git systemds && \ + cd /usr/src/systemds/ && \ + mvn --no-transfer-progress clean package -P distribution + +RUN cd /usr/src/systemds/src/main/python \ + apt-get install -y --no-install-recommends \ + python3 python3-pip && \ + apt-get clean && \ + python3 -m pip install --upgrade pip \ + && pip3 install setuptools numpy py4j wheel requests pandas \ + && python3 create_python_dist.py \ + && pip3 install . \ + && cd /usr/src/systemds/ + +COPY docker/mountFolder/main.py /input/main.py + +FROM python:3.12-slim@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + wget \ + git \ + tar \ + ca-certificates \ + && apt-get clean + +# Java +ENV JAVA_HOME=/usr/lib/jvm/jdk-17.0.15+6 +ENV PATH=$JAVA_HOME/bin:$PATH +ENV SYSTEMDS_ROOT=/systemds +ENV PATH=$SYSTEMDS_ROOT/bin:$PATH +ENV SYSDS_QUIET=1 + +RUN mkdir -p /usr/lib/jvm \ + && wget -qO- \ + https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jre_x64_linux_hotspot_17.0.15_6.tar.gz | tar xzf - \ + && mv jdk-17.0.15+6-jre $JAVA_HOME + +COPY --from=compile-image /usr/src/systemds /systemds +COPY --from=compile-image /input/main.py /input/main.py + +RUN cd /systemds/src/main/python \ + apt-get install -y --no-install-recommends \ + python3 python3-pip && \ + apt-get clean && \ + python3 -m pip install --upgrade pip \ + && pip3 install setuptools numpy py4j wheel requests pandas \ + && python3 create_python_dist.py \ + && pip3 install . \ + && cd /systemds/ + +WORKDIR /input + +CMD ["python3", "/input/main.py"] diff --git a/docker/sysdslight.Dockerfile b/docker/sysdslight.Dockerfile new file mode 100644 index 00000000000..504917313a5 --- /dev/null +++ b/docker/sysdslight.Dockerfile @@ -0,0 +1,73 @@ +#------------------------------------------------------------- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +#------------------------------------------------------------- + +FROM alpine:latest + +WORKDIR /usr/src/ + +# Do basic updates on the image +RUN apk add --update --no-cache \ + wget \ + git \ + ca-certificates \ + openjdk17 \ + bash + +# Set environment variables +# Maven +ENV MAVEN_VERSION=3.9.9 +ENV MAVEN_HOME=/usr/lib/mvn +# Java +ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk +ENV PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH +ENV SYSTEMDS_ROOT=/usr/src/systemds +ENV PATH=$SYSTEMDS_ROOT/bin:$PATH +ENV SYSDS_QUIET=1 + +# Download Java and Mvn +RUN wget -qO- \ + http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar xzf - \ + && mv apache-maven-$MAVEN_VERSION /usr/lib/mvn + +# Build the system +RUN git clone --depth 1 https://github.com/apache/systemds.git systemds && \ + cd /usr/src/systemds/ && \ + mvn --no-transfer-progress clean package -P distribution + +# Remove all unnecessary files from the Image +RUN rm -rf .git && \ + rm -rf .github && \ + rm -rf target/javadoc** && \ + rm -rf target/apidocs** && \ + rm -rf target/classes && \ + rm -rf target/test-classes && \ + rm -rf target/maven-archiver && \ + rm -rf target/systemds-** && \ + rm -rf docs && \ + rm -rf src && \ + rm -rf /usr/lib/mvn && \ + rm -rf CONTRIBUTING.md && \ + rm -rf pom.xml && \ + rm -rf ~/.m2 + +COPY docker/mountFolder/main.dml /input/main.dml + +CMD ["systemds", "/input/main.dml"] diff --git a/docker/sysdslight_multistage.Dockerfile b/docker/sysdslight_multistage.Dockerfile new file mode 100644 index 00000000000..8e0d6f47fd2 --- /dev/null +++ b/docker/sysdslight_multistage.Dockerfile @@ -0,0 +1,98 @@ +#------------------------------------------------------------- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +#------------------------------------------------------------- + +FROM alpine:3.20@sha256:de4fe7064d8f98419ea6b49190df1abbf43450c1702eeb864fe9ced453c1cc5f AS compile-image + +WORKDIR /usr/src/ + +# Do basic updates on the image +RUN apk add --no-cache \ + wget \ + git \ + ca-certificates \ + bash + +# Set environment variables +# Maven +ENV MAVEN_VERSION=3.9.9 +ENV MAVEN_HOME=/usr/lib/mvn +# Java +ENV JAVA_HOME=/usr/lib/jvm/jdk-17.0.15+6 +ENV PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH +ENV SYSTEMDS_ROOT=/usr/src/systemds +ENV PATH=$SYSTEMDS_ROOT/bin:$PATH +ENV SYSDS_QUIET=1 + +# Download Mvn and JDK +RUN mkdir -p /usr/lib/jvm \ + && wget -qO- \ + https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jdk_x64_alpine-linux_hotspot_17.0.15_6.tar.gz | tar xzf - \ + && mv jdk-17.0.15+6 $JAVA_HOME \ + && wget -qO- \ + http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar xzf - \ + && mv apache-maven-$MAVEN_VERSION /usr/lib/mvn + +# Build the system +RUN git clone --depth 1 https://github.com/apache/systemds.git systemds && \ + cd /usr/src/systemds/ && \ + mvn --no-transfer-progress clean package -P distribution + +# Remove all unnecessary files from the Image +RUN cd /usr/src/systemds/ && \ + rm -rf .git && \ + rm -rf .github && \ + rm -rf target/javadoc** && \ + rm -rf target/apidocs** && \ + rm -rf target/classes && \ + rm -rf target/test-classes && \ + rm -rf target/maven-archiver && \ + rm -rf target/systemds-** && \ + rm -rf docs && \ + rm -rf src && \ + rm -rf /usr/lib/mvn && \ + rm -rf CONTRIBUTING.md && \ + rm -rf pom.xml && \ + rm -rf ~/.m2 + +COPY docker/mountFolder/main.dml /input/main.dml + +FROM alpine:3.20@sha256:de4fe7064d8f98419ea6b49190df1abbf43450c1702eeb864fe9ced453c1cc5f + +RUN apk add --no-cache bash + +ENV JAVA_HOME=/usr/lib/jvm/jdk-17.0.15+6 +ENV PATH=$JAVA_HOME/bin:$PATH +ENV SYSTEMDS_ROOT=/systemds +ENV PATH=$SYSTEMDS_ROOT/bin:$PATH +ENV SYSDS_QUIET=1 + +RUN mkdir -p /usr/lib/jvm \ + && wget -qO- \ + https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jre_x64_alpine-linux_hotspot_17.0.15_6.tar.gz | tar xzf - \ + && mv jdk-17.0.15+6-jre $JAVA_HOME + +COPY --from=compile-image /usr/src/systemds /systemds +COPY --from=compile-image /input/main.dml /input/main.dml + +WORKDIR /input + +ENTRYPOINT ["systemds"] +CMD ["main.dml"] diff --git a/docker/testsysdslight.Dockerfile b/docker/testsysdslight.Dockerfile new file mode 100644 index 00000000000..5f5ce86a727 --- /dev/null +++ b/docker/testsysdslight.Dockerfile @@ -0,0 +1,78 @@ +#------------------------------------------------------------- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +#------------------------------------------------------------- + +FROM alpine:3.20@sha256:de4fe7064d8f98419ea6b49190df1abbf43450c1702eeb864fe9ced453c1cc5f + +WORKDIR /usr/src/ +# Set environment variables +# Maven +ENV MAVEN_VERSION=3.9.9 +ENV MAVEN_HOME=/usr/lib/mvn +# Java +ENV JAVA_HOME=/usr/lib/jvm/jdk-17.0.15+6 +ENV PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH + +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 +ENV LANG=en_US.UTF-8 +ENV LD_LIBRARY_PATH=/usr/local/lib/ + +RUN apk --no-cache add \ + curl-dev \ + libxml2-dev \ + libc6-compat \ + gnupg \ + wget \ + ca-certificates \ + git \ + cmake \ + patchelf \ + R \ + R-dev \ + R-doc \ + build-base \ + && mkdir -p /usr/lib/jvm \ + && wget -qO- \ + https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jdk_x64_alpine-linux_hotspot_17.0.15_6.tar.gz | tar xzf - \ + && mv jdk-17.0.15+6 $JAVA_HOME \ + && wget -qO- \ + http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar xzf - \ + && mv apache-maven-$MAVEN_VERSION /usr/lib/mvn + + +# Install R packages +COPY ./src/test/scripts/installDependencies.R installDependencies.R +RUN Rscript installDependencies.R \ + && rm -f installDependencies.R + +# Install SEAL +RUN wget -qO- https://github.com/microsoft/SEAL/archive/refs/tags/v3.7.0.tar.gz | tar xzf - \ + && cd SEAL-3.7.0 \ + && cmake -S . -B build -DBUILD_SHARED_LIBS=ON \ + && cmake --build build \ + && cmake --install build + +# Finally copy the entrypoint script +# This is last to enable quick updates to the script after initial local build. +COPY ./docker/entrypoint.sh /entrypoint.sh + + +ENTRYPOINT ["/entrypoint.sh"] From 4274014a3bb52547ae492139b9171f6c0290e2b3 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 10 Jun 2025 11:32:30 +0200 Subject: [PATCH 02/10] update kmeans test --- docker/mountFolder/main.dml | 5 +---- docker/sysdslight_multistage.Dockerfile | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/docker/mountFolder/main.dml b/docker/mountFolder/main.dml index e01ab2ad1ec..d1e0f6b819e 100644 --- a/docker/mountFolder/main.dml +++ b/docker/mountFolder/main.dml @@ -23,10 +23,7 @@ # Simple KMeans clustering test # Arguments -X = [[1.0, 2.0],[1.5, 1.8],[5.0, 8.0],[8.0, 8.0],[1.0, 0.6],[9.0, 11.0]] - -# Initialization -source("scripts/builtin/kmeans.dml") as kmeans +X = matrix([[1.0, 2.0],[1.5, 1.8],[5.0, 8.0],[8.0, 8.0],[1.0, 0.6],[9.0, 11.0]]) # Run KMeans [centroids, assignments] = kmeans::kmeans(X=X, K=2, max_iter=100, epsilon=0.01) diff --git a/docker/sysdslight_multistage.Dockerfile b/docker/sysdslight_multistage.Dockerfile index 8e0d6f47fd2..37b6144f9fc 100644 --- a/docker/sysdslight_multistage.Dockerfile +++ b/docker/sysdslight_multistage.Dockerfile @@ -51,7 +51,7 @@ RUN mkdir -p /usr/lib/jvm \ && mv apache-maven-$MAVEN_VERSION /usr/lib/mvn # Build the system -RUN git clone --depth 1 https://github.com/apache/systemds.git systemds && \ +RUN git clone --depth 1 https://github.com/alexanderschmi/systemds.git systemds && \ cd /usr/src/systemds/ && \ mvn --no-transfer-progress clean package -P distribution From 7543cbd324729568e2c727111193bd27059ba88a Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 10 Jun 2025 11:38:21 +0200 Subject: [PATCH 03/10] update test --- docker/mountFolder/main.dml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/mountFolder/main.dml b/docker/mountFolder/main.dml index d1e0f6b819e..517e8e8e453 100644 --- a/docker/mountFolder/main.dml +++ b/docker/mountFolder/main.dml @@ -23,7 +23,7 @@ # Simple KMeans clustering test # Arguments -X = matrix([[1.0, 2.0],[1.5, 1.8],[5.0, 8.0],[8.0, 8.0],[1.0, 0.6],[9.0, 11.0]]) +X = matrix("1.0 2.0 1.5 1.8 5.0 8.0 8.0 8.0 1.0 0.6 9.0 11.0", rows = 6, cols = 2) # Run KMeans [centroids, assignments] = kmeans::kmeans(X=X, K=2, max_iter=100, epsilon=0.01) From 10daa79525c652dadaff4a28b940a2dbdc8df423 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 10 Jun 2025 11:40:56 +0200 Subject: [PATCH 04/10] update test --- docker/mountFolder/main.dml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/mountFolder/main.dml b/docker/mountFolder/main.dml index 517e8e8e453..467fce959d5 100644 --- a/docker/mountFolder/main.dml +++ b/docker/mountFolder/main.dml @@ -26,7 +26,7 @@ X = matrix("1.0 2.0 1.5 1.8 5.0 8.0 8.0 8.0 1.0 0.6 9.0 11.0", rows = 6, cols = 2) # Run KMeans -[centroids, assignments] = kmeans::kmeans(X=X, K=2, max_iter=100, epsilon=0.01) +[centroids, assignments] = kmeans(X=X, K=2, max_iter=100, epsilon=0.01) print(centroids) print(assignments) \ No newline at end of file From 91e8556d379351e287ba557402a81f57b98efc10 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 10 Jun 2025 11:42:18 +0200 Subject: [PATCH 05/10] update test --- docker/mountFolder/main.dml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/mountFolder/main.dml b/docker/mountFolder/main.dml index 467fce959d5..e260470f98c 100644 --- a/docker/mountFolder/main.dml +++ b/docker/mountFolder/main.dml @@ -26,7 +26,7 @@ X = matrix("1.0 2.0 1.5 1.8 5.0 8.0 8.0 8.0 1.0 0.6 9.0 11.0", rows = 6, cols = 2) # Run KMeans -[centroids, assignments] = kmeans(X=X, K=2, max_iter=100, epsilon=0.01) +[centroids, assignments] = kmeans(X=X, k=2, max_iter=100, epsilon=0.01) print(centroids) print(assignments) \ No newline at end of file From 237d645d8bcb5d2cd8b5727e6749eea5da247068 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 10 Jun 2025 11:43:16 +0200 Subject: [PATCH 06/10] update test --- docker/mountFolder/main.dml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/mountFolder/main.dml b/docker/mountFolder/main.dml index e260470f98c..464aabc33a0 100644 --- a/docker/mountFolder/main.dml +++ b/docker/mountFolder/main.dml @@ -26,7 +26,7 @@ X = matrix("1.0 2.0 1.5 1.8 5.0 8.0 8.0 8.0 1.0 0.6 9.0 11.0", rows = 6, cols = 2) # Run KMeans -[centroids, assignments] = kmeans(X=X, k=2, max_iter=100, epsilon=0.01) +[centroids, assignments] = kmeans(X=X, k=2, max_iter=100, eps=0.01) print(centroids) print(assignments) \ No newline at end of file From 5fde8ea1ce4123f56d99d3bf84faa1c5b3140e0b Mon Sep 17 00:00:00 2001 From: raskade Date: Tue, 17 Jun 2025 13:05:39 +0200 Subject: [PATCH 07/10] update multistage --- docker/sysdslight_multistage.Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docker/sysdslight_multistage.Dockerfile b/docker/sysdslight_multistage.Dockerfile index 37b6144f9fc..1fca5dfedb7 100644 --- a/docker/sysdslight_multistage.Dockerfile +++ b/docker/sysdslight_multistage.Dockerfile @@ -51,10 +51,12 @@ RUN mkdir -p /usr/lib/jvm \ && mv apache-maven-$MAVEN_VERSION /usr/lib/mvn # Build the system -RUN git clone --depth 1 https://github.com/alexanderschmi/systemds.git systemds && \ +RUN git clone -b SYSTEMDS-3877 --depth 1 https://github.com/alexanderschmi/systemds.git systemds && \ cd /usr/src/systemds/ && \ mvn --no-transfer-progress clean package -P distribution +COPY docker/mountFolder/main.dml /input/main.dml + # Remove all unnecessary files from the Image RUN cd /usr/src/systemds/ && \ rm -rf .git && \ @@ -70,9 +72,10 @@ RUN cd /usr/src/systemds/ && \ rm -rf /usr/lib/mvn && \ rm -rf CONTRIBUTING.md && \ rm -rf pom.xml && \ - rm -rf ~/.m2 - -COPY docker/mountFolder/main.dml /input/main.dml + rm -rf ~/.m2 && \ + rm -rf docker && \ + rm -rf .mvn && \ + rm -rf LICENSE FROM alpine:3.20@sha256:de4fe7064d8f98419ea6b49190df1abbf43450c1702eeb864fe9ced453c1cc5f From 8612e881b9ecc53a762fa326d4cc4ab616816cb2 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 2 Jul 2025 14:13:46 +0200 Subject: [PATCH 08/10] update sysds.Dockerfile, testsysds.Dockerfile, main.dml and cleanup --- docker/build.sh | 9 +- docker/mountFolder/.gitignore | 2 + docker/mountFolder/main.dml | 5 +- docker/pythonsysdslight.Dockerfile | 111 ------------------------ docker/sysds.Dockerfile | 73 +++++++++++++--- docker/sysdslight.Dockerfile | 73 ---------------- docker/sysdslight_multistage.Dockerfile | 101 --------------------- docker/testsysds.Dockerfile | 89 +++++++++---------- docker/testsysdslight.Dockerfile | 78 ----------------- 9 files changed, 110 insertions(+), 431 deletions(-) create mode 100644 docker/mountFolder/.gitignore delete mode 100644 docker/pythonsysdslight.Dockerfile delete mode 100644 docker/sysdslight.Dockerfile delete mode 100644 docker/sysdslight_multistage.Dockerfile delete mode 100644 docker/testsysdslight.Dockerfile diff --git a/docker/build.sh b/docker/build.sh index a4ca36aeb12..204df9f4edd 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -23,14 +23,9 @@ # Build the docker containers # The first build is for running systemds through docker. -docker image build -f docker/sysds.Dockerfile -t apache/systemds:latest . -#docker image build -f docker/sysdslight.Dockerfile -t apache/systemds:lighttest . -docker image build -f docker/sysdslight_multistage.Dockerfile -t apache/systemds:lighttest_multistage . -docker image build -f docker/testsysdslight.Dockerfile -t apache/systemds:testsysdslight . -docker image build -f docker/pythonsysdslight.Dockerfile -t apache/systemds:pythonsysdslight . -docker image build -f docker/pythonsysds.Dockerfile -t apache/systemds:pythonsysds . +# docker image build -f docker/sysds.Dockerfile -t apache/systemds:latest . # The second build is for testing systemds. This image installs the R dependencies needed to run the tests. -docker image build -f docker/testsysds.Dockerfile -t apache/systemds:testing-latest . +# docker image build -f docker/testsysds.Dockerfile -t apache/systemds:testing-latest . # The third build is python docker for systemds. # docker image build -f docker/pythonsysds.Dockerfile -t apache/systemds:python-nightly . diff --git a/docker/mountFolder/.gitignore b/docker/mountFolder/.gitignore new file mode 100644 index 00000000000..50127fba364 --- /dev/null +++ b/docker/mountFolder/.gitignore @@ -0,0 +1,2 @@ +*.bin +*.bin.mtd diff --git a/docker/mountFolder/main.dml b/docker/mountFolder/main.dml index 464aabc33a0..cc2c421090a 100644 --- a/docker/mountFolder/main.dml +++ b/docker/mountFolder/main.dml @@ -23,10 +23,11 @@ # Simple KMeans clustering test # Arguments -X = matrix("1.0 2.0 1.5 1.8 5.0 8.0 8.0 8.0 1.0 0.6 9.0 11.0", rows = 6, cols = 2) +X = read("test.bin") # Run KMeans [centroids, assignments] = kmeans(X=X, k=2, max_iter=100, eps=0.01) print(centroids) -print(assignments) \ No newline at end of file +print(assignments) +write(centroids, "centroids.bin") \ No newline at end of file diff --git a/docker/pythonsysdslight.Dockerfile b/docker/pythonsysdslight.Dockerfile deleted file mode 100644 index 4b588338109..00000000000 --- a/docker/pythonsysdslight.Dockerfile +++ /dev/null @@ -1,111 +0,0 @@ -#------------------------------------------------------------- -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -#------------------------------------------------------------- - -FROM python:3.12-slim@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db AS compile-image - -WORKDIR /usr/src/ - -RUN apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends \ - wget \ - git \ - tar \ - ca-certificates \ - && apt-get clean - -# Maven -ENV MAVEN_VERSION=3.9.9 -ENV MAVEN_HOME=/usr/lib/mvn -ENV PATH=$MAVEN_HOME/bin:$PATH -# Java -ENV JAVA_HOME=/usr/lib/jvm/jdk-17.0.15+6 -ENV PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH -ENV SYSTEMDS_ROOT=/usr/src/systemds -ENV PATH=$SYSTEMDS_ROOT/bin:$PATH -ENV SYSDS_QUIET=1 - -# Download JAVA -RUN mkdir -p /usr/lib/jvm \ - && wget -qO- \ - https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jdk_x64_linux_hotspot_17.0.15_6.tar.gz | tar xzf - \ - && mv jdk-17.0.15+6 $JAVA_HOME - -# Download Mvn -RUN wget -qO- \ - http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar xzf - \ - && mv apache-maven-$MAVEN_VERSION /usr/lib/mvn - -RUN git clone --depth 1 https://github.com/apache/systemds.git systemds && \ - cd /usr/src/systemds/ && \ - mvn --no-transfer-progress clean package -P distribution - -RUN cd /usr/src/systemds/src/main/python \ - apt-get install -y --no-install-recommends \ - python3 python3-pip && \ - apt-get clean && \ - python3 -m pip install --upgrade pip \ - && pip3 install setuptools numpy py4j wheel requests pandas \ - && python3 create_python_dist.py \ - && pip3 install . \ - && cd /usr/src/systemds/ - -COPY docker/mountFolder/main.py /input/main.py - -FROM python:3.12-slim@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db - -RUN apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends \ - wget \ - git \ - tar \ - ca-certificates \ - && apt-get clean - -# Java -ENV JAVA_HOME=/usr/lib/jvm/jdk-17.0.15+6 -ENV PATH=$JAVA_HOME/bin:$PATH -ENV SYSTEMDS_ROOT=/systemds -ENV PATH=$SYSTEMDS_ROOT/bin:$PATH -ENV SYSDS_QUIET=1 - -RUN mkdir -p /usr/lib/jvm \ - && wget -qO- \ - https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jre_x64_linux_hotspot_17.0.15_6.tar.gz | tar xzf - \ - && mv jdk-17.0.15+6-jre $JAVA_HOME - -COPY --from=compile-image /usr/src/systemds /systemds -COPY --from=compile-image /input/main.py /input/main.py - -RUN cd /systemds/src/main/python \ - apt-get install -y --no-install-recommends \ - python3 python3-pip && \ - apt-get clean && \ - python3 -m pip install --upgrade pip \ - && pip3 install setuptools numpy py4j wheel requests pandas \ - && python3 create_python_dist.py \ - && pip3 install . \ - && cd /systemds/ - -WORKDIR /input - -CMD ["python3", "/input/main.py"] diff --git a/docker/sysds.Dockerfile b/docker/sysds.Dockerfile index cc6ef605d53..54785271ecd 100644 --- a/docker/sysds.Dockerfile +++ b/docker/sysds.Dockerfile @@ -19,18 +19,16 @@ # #------------------------------------------------------------- -FROM ubuntu:24.04@sha256:6015f66923d7afbc53558d7ccffd325d43b4e249f41a6e93eef074c9505d2233 +FROM alpine:3.20@sha256:de4fe7064d8f98419ea6b49190df1abbf43450c1702eeb864fe9ced453c1cc5f AS compile-image WORKDIR /usr/src/ # Do basic updates on the image -RUN apt-get update -qq \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends \ +RUN apk add --no-cache \ wget \ git \ ca-certificates \ - && apt-get clean + bash # Set environment variables # Maven @@ -43,22 +41,25 @@ ENV SYSTEMDS_ROOT=/usr/src/systemds ENV PATH=$SYSTEMDS_ROOT/bin:$PATH ENV SYSDS_QUIET=1 -# Download Java and Mvn +# Download Mvn and JDK RUN mkdir -p /usr/lib/jvm \ && wget -qO- \ - https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jdk_x64_linux_hotspot_17.0.15_6.tar.gz | tar xzf - \ - && mv jdk-17.0.15+6 /usr/lib/jvm/jdk-17.0.15+6 \ + https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jdk_x64_alpine-linux_hotspot_17.0.15_6.tar.gz | tar xzf - \ + && mv jdk-17.0.15+6 $JAVA_HOME \ && wget -qO- \ http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar xzf - \ && mv apache-maven-$MAVEN_VERSION /usr/lib/mvn # Build the system -RUN git clone --depth 1 https://github.com/apache/systemds.git systemds && \ +RUN git clone -b SYSTEMDS-3877 --depth 1 https://github.com/alexanderschmi/systemds.git systemds && \ cd /usr/src/systemds/ && \ mvn --no-transfer-progress clean package -P distribution +COPY docker/mountFolder/main.dml /input/main.dml + # Remove all unnecessary files from the Image -RUN rm -rf .git && \ +RUN cd /usr/src/systemds/ && \ + rm -rf .git && \ rm -rf .github && \ rm -rf target/javadoc** && \ rm -rf target/apidocs** && \ @@ -71,9 +72,55 @@ RUN rm -rf .git && \ rm -rf /usr/lib/mvn && \ rm -rf CONTRIBUTING.md && \ rm -rf pom.xml && \ - rm -rf ~/.m2 + rm -rf ~/.m2 && \ + rm -rf docker && \ + rm -rf .mvn +FROM alpine:3.20@sha256:de4fe7064d8f98419ea6b49190df1abbf43450c1702eeb864fe9ced453c1cc5f -COPY docker/mountFolder/main.dml /input/main.dml +RUN apk add --no-cache bash \ + snappy \ + lz4 \ + zlib + +ENV JAVA_HOME=/usr/lib/jvm/jdk-17.0.15+6 +ENV PATH=$JAVA_HOME/bin:$PATH +ENV SYSTEMDS_ROOT=/systemds +ENV PATH=$SYSTEMDS_ROOT/bin:$PATH +ENV SYSDS_QUIET=1 + +ENV HADOOP_VERSION=3.3.6 +ENV HADOOP_HOME=/opt/hadoop +ENV LD_LIBRARY_PATH=/opt/hadoop/lib/native +ENV HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib/native" +ENV GLIBC_VERSION=2.35-r1 + +RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \ + && wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk \ + && apk add glibc-${GLIBC_VERSION}.apk \ + && rm glibc-${GLIBC_VERSION}.apk + +RUN mkdir -p /usr/lib/jvm \ + && wget -qO- \ + https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jre_x64_alpine-linux_hotspot_17.0.15_6.tar.gz | tar xzf - \ + && mv jdk-17.0.15+6-jre $JAVA_HOME + +RUN mkdir -p $HADOOP_HOME/lib/native \ + && wget -q https://downloads.apache.org/hadoop/common/hadoop-${HADOOP_VERSION}/hadoop-${HADOOP_VERSION}.tar.gz && \ + tar --strip-components=2 -xzf hadoop-${HADOOP_VERSION}.tar.gz \ + hadoop-${HADOOP_VERSION}/lib/native && \ + mv native/libhadoop.so.1.0.0 /opt/hadoop/lib/native && \ + mv native/libhadoop.so /opt/hadoop/lib/native && \ + rm hadoop-${HADOOP_VERSION}.tar.gz && \ + rm -rf native + +COPY --from=compile-image /usr/src/systemds /systemds +COPY --from=compile-image /input/main.dml /input/main.dml + +WORKDIR /input + +RUN addgroup -S default && adduser -S systemds -G default +USER systemds -CMD ["systemds", "/input/main.dml"] +ENTRYPOINT ["systemds"] +CMD ["main.dml"] diff --git a/docker/sysdslight.Dockerfile b/docker/sysdslight.Dockerfile deleted file mode 100644 index 504917313a5..00000000000 --- a/docker/sysdslight.Dockerfile +++ /dev/null @@ -1,73 +0,0 @@ -#------------------------------------------------------------- -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -#------------------------------------------------------------- - -FROM alpine:latest - -WORKDIR /usr/src/ - -# Do basic updates on the image -RUN apk add --update --no-cache \ - wget \ - git \ - ca-certificates \ - openjdk17 \ - bash - -# Set environment variables -# Maven -ENV MAVEN_VERSION=3.9.9 -ENV MAVEN_HOME=/usr/lib/mvn -# Java -ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk -ENV PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH -ENV SYSTEMDS_ROOT=/usr/src/systemds -ENV PATH=$SYSTEMDS_ROOT/bin:$PATH -ENV SYSDS_QUIET=1 - -# Download Java and Mvn -RUN wget -qO- \ - http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar xzf - \ - && mv apache-maven-$MAVEN_VERSION /usr/lib/mvn - -# Build the system -RUN git clone --depth 1 https://github.com/apache/systemds.git systemds && \ - cd /usr/src/systemds/ && \ - mvn --no-transfer-progress clean package -P distribution - -# Remove all unnecessary files from the Image -RUN rm -rf .git && \ - rm -rf .github && \ - rm -rf target/javadoc** && \ - rm -rf target/apidocs** && \ - rm -rf target/classes && \ - rm -rf target/test-classes && \ - rm -rf target/maven-archiver && \ - rm -rf target/systemds-** && \ - rm -rf docs && \ - rm -rf src && \ - rm -rf /usr/lib/mvn && \ - rm -rf CONTRIBUTING.md && \ - rm -rf pom.xml && \ - rm -rf ~/.m2 - -COPY docker/mountFolder/main.dml /input/main.dml - -CMD ["systemds", "/input/main.dml"] diff --git a/docker/sysdslight_multistage.Dockerfile b/docker/sysdslight_multistage.Dockerfile deleted file mode 100644 index 1fca5dfedb7..00000000000 --- a/docker/sysdslight_multistage.Dockerfile +++ /dev/null @@ -1,101 +0,0 @@ -#------------------------------------------------------------- -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -#------------------------------------------------------------- - -FROM alpine:3.20@sha256:de4fe7064d8f98419ea6b49190df1abbf43450c1702eeb864fe9ced453c1cc5f AS compile-image - -WORKDIR /usr/src/ - -# Do basic updates on the image -RUN apk add --no-cache \ - wget \ - git \ - ca-certificates \ - bash - -# Set environment variables -# Maven -ENV MAVEN_VERSION=3.9.9 -ENV MAVEN_HOME=/usr/lib/mvn -# Java -ENV JAVA_HOME=/usr/lib/jvm/jdk-17.0.15+6 -ENV PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH -ENV SYSTEMDS_ROOT=/usr/src/systemds -ENV PATH=$SYSTEMDS_ROOT/bin:$PATH -ENV SYSDS_QUIET=1 - -# Download Mvn and JDK -RUN mkdir -p /usr/lib/jvm \ - && wget -qO- \ - https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jdk_x64_alpine-linux_hotspot_17.0.15_6.tar.gz | tar xzf - \ - && mv jdk-17.0.15+6 $JAVA_HOME \ - && wget -qO- \ - http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar xzf - \ - && mv apache-maven-$MAVEN_VERSION /usr/lib/mvn - -# Build the system -RUN git clone -b SYSTEMDS-3877 --depth 1 https://github.com/alexanderschmi/systemds.git systemds && \ - cd /usr/src/systemds/ && \ - mvn --no-transfer-progress clean package -P distribution - -COPY docker/mountFolder/main.dml /input/main.dml - -# Remove all unnecessary files from the Image -RUN cd /usr/src/systemds/ && \ - rm -rf .git && \ - rm -rf .github && \ - rm -rf target/javadoc** && \ - rm -rf target/apidocs** && \ - rm -rf target/classes && \ - rm -rf target/test-classes && \ - rm -rf target/maven-archiver && \ - rm -rf target/systemds-** && \ - rm -rf docs && \ - rm -rf src && \ - rm -rf /usr/lib/mvn && \ - rm -rf CONTRIBUTING.md && \ - rm -rf pom.xml && \ - rm -rf ~/.m2 && \ - rm -rf docker && \ - rm -rf .mvn && \ - rm -rf LICENSE - -FROM alpine:3.20@sha256:de4fe7064d8f98419ea6b49190df1abbf43450c1702eeb864fe9ced453c1cc5f - -RUN apk add --no-cache bash - -ENV JAVA_HOME=/usr/lib/jvm/jdk-17.0.15+6 -ENV PATH=$JAVA_HOME/bin:$PATH -ENV SYSTEMDS_ROOT=/systemds -ENV PATH=$SYSTEMDS_ROOT/bin:$PATH -ENV SYSDS_QUIET=1 - -RUN mkdir -p /usr/lib/jvm \ - && wget -qO- \ - https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jre_x64_alpine-linux_hotspot_17.0.15_6.tar.gz | tar xzf - \ - && mv jdk-17.0.15+6-jre $JAVA_HOME - -COPY --from=compile-image /usr/src/systemds /systemds -COPY --from=compile-image /input/main.dml /input/main.dml - -WORKDIR /input - -ENTRYPOINT ["systemds"] -CMD ["main.dml"] diff --git a/docker/testsysds.Dockerfile b/docker/testsysds.Dockerfile index 2f63dace7fa..de407fe9392 100644 --- a/docker/testsysds.Dockerfile +++ b/docker/testsysds.Dockerfile @@ -18,8 +18,29 @@ # under the License. # #------------------------------------------------------------- +# Stage 1: Build SEAL +FROM debian:bullseye-slim AS seal-build -FROM ubuntu:24.04@sha256:6015f66923d7afbc53558d7ccffd325d43b4e249f41a6e93eef074c9505d2233 +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + wget \ + tar \ + git \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /seal + +# Install SEAL +RUN wget -qO- https://github.com/microsoft/SEAL/archive/refs/tags/v3.7.0.tar.gz | tar xzf - \ + && cd SEAL-3.7.0 \ + && cmake -S . -B build -DBUILD_SHARED_LIBS=ON \ + && cmake --build build \ + && cmake --install build --prefix /seal-install + +# Stage 2: Final image with R, JDK, Maven, SEAL +FROM debian:bullseye-slim WORKDIR /usr/src/ ENV MAVEN_VERSION=3.9.9 @@ -28,61 +49,37 @@ ENV MAVEN_HOME=/usr/lib/mvn ENV JAVA_HOME=/usr/lib/jvm/jdk-17.0.15+6 ENV PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH -ENV LANGUAGE=en_US:en -ENV LC_ALL=en_US.UTF-8 -ENV LANG=en_US.UTF-8 -ENV LD_LIBRARY_PATH=/usr/local/lib/ - -RUN apt-get update -qq \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends \ - libcurl4-openssl-dev \ - libxml2-dev \ - locales \ - software-properties-common \ - dirmngr \ - gnupg \ - apt-transport-https \ - wget \ - ca-certificates \ - git \ - cmake \ - patchelf \ - && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 \ - && add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/" \ - && apt-get update -qq \ - && apt-get upgrade -y \ - && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ - && locale-gen en_US.utf8 \ - && /usr/sbin/update-locale LANG=en_US.UTF-8 \ +RUN apt-get update && apt-get install -y --no-install-recommends \ + r-base \ + wget \ + cmake \ + r-base-dev \ + libcurl4-openssl-dev \ + libssl-dev \ + libxml2-dev \ + ca-certificates \ + patchelf \ + git \ + libssl-dev \ + r-base-dev \ + r-base-core \ + && apt-get clean && rm -rf /var/lib/apt/lists/* \ && mkdir -p /usr/lib/jvm \ && wget -qO- \ https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jdk_x64_linux_hotspot_17.0.15_6.tar.gz | tar xzf - \ - && mv jdk-17.0.15+6 /usr/lib/jvm/jdk-17.0.15+6 \ + && mv jdk-17.0.15+6 $JAVA_HOME \ && wget -qO- \ - http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar xzf - \ + http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar xzf - \ && mv apache-maven-$MAVEN_VERSION /usr/lib/mvn -# Install R Base -RUN apt-get install -y --no-install-recommends \ - libssl-dev \ - r-base \ - r-base-dev \ - r-base-core - # Install R packages -COPY ./src/test/scripts/installDependencies.R installDependencies.R +COPY ./src/test/scripts/installDependencies.R installDependencies.R RUN Rscript installDependencies.R \ - && rm -rf installDependencies.R \ - && rm -rf /var/lib/apt/lists/* + && rm -f installDependencies.R -# Install SEAL -RUN wget -qO- https://github.com/microsoft/SEAL/archive/refs/tags/v3.7.0.tar.gz | tar xzf - \ - && cd SEAL-3.7.0 \ - && cmake -S . -B build -DBUILD_SHARED_LIBS=ON \ - && cmake --build build \ - && cmake --install build +# Copy SEAL +COPY --from=seal-build /seal-install /usr/local # Finally copy the entrypoint script # This is last to enable quick updates to the script after initial local build. diff --git a/docker/testsysdslight.Dockerfile b/docker/testsysdslight.Dockerfile deleted file mode 100644 index 5f5ce86a727..00000000000 --- a/docker/testsysdslight.Dockerfile +++ /dev/null @@ -1,78 +0,0 @@ -#------------------------------------------------------------- -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -#------------------------------------------------------------- - -FROM alpine:3.20@sha256:de4fe7064d8f98419ea6b49190df1abbf43450c1702eeb864fe9ced453c1cc5f - -WORKDIR /usr/src/ -# Set environment variables -# Maven -ENV MAVEN_VERSION=3.9.9 -ENV MAVEN_HOME=/usr/lib/mvn -# Java -ENV JAVA_HOME=/usr/lib/jvm/jdk-17.0.15+6 -ENV PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH - -ENV LANGUAGE=en_US:en -ENV LC_ALL=en_US.UTF-8 -ENV LANG=en_US.UTF-8 -ENV LD_LIBRARY_PATH=/usr/local/lib/ - -RUN apk --no-cache add \ - curl-dev \ - libxml2-dev \ - libc6-compat \ - gnupg \ - wget \ - ca-certificates \ - git \ - cmake \ - patchelf \ - R \ - R-dev \ - R-doc \ - build-base \ - && mkdir -p /usr/lib/jvm \ - && wget -qO- \ - https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jdk_x64_alpine-linux_hotspot_17.0.15_6.tar.gz | tar xzf - \ - && mv jdk-17.0.15+6 $JAVA_HOME \ - && wget -qO- \ - http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar xzf - \ - && mv apache-maven-$MAVEN_VERSION /usr/lib/mvn - - -# Install R packages -COPY ./src/test/scripts/installDependencies.R installDependencies.R -RUN Rscript installDependencies.R \ - && rm -f installDependencies.R - -# Install SEAL -RUN wget -qO- https://github.com/microsoft/SEAL/archive/refs/tags/v3.7.0.tar.gz | tar xzf - \ - && cd SEAL-3.7.0 \ - && cmake -S . -B build -DBUILD_SHARED_LIBS=ON \ - && cmake --build build \ - && cmake --install build - -# Finally copy the entrypoint script -# This is last to enable quick updates to the script after initial local build. -COPY ./docker/entrypoint.sh /entrypoint.sh - - -ENTRYPOINT ["/entrypoint.sh"] From d344cc7d03eab47fd6e1190bf22d3d15b3b71695 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 8 Jul 2025 12:31:13 +0200 Subject: [PATCH 09/10] cleanup --- docker/build.sh | 1 + docker/testsysds.Dockerfile | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docker/build.sh b/docker/build.sh index 204df9f4edd..eddc29d7108 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -24,6 +24,7 @@ # The first build is for running systemds through docker. # docker image build -f docker/sysds.Dockerfile -t apache/systemds:latest . + # The second build is for testing systemds. This image installs the R dependencies needed to run the tests. # docker image build -f docker/testsysds.Dockerfile -t apache/systemds:testing-latest . diff --git a/docker/testsysds.Dockerfile b/docker/testsysds.Dockerfile index de407fe9392..fc6eb1491e1 100644 --- a/docker/testsysds.Dockerfile +++ b/docker/testsysds.Dockerfile @@ -19,7 +19,7 @@ # #------------------------------------------------------------- # Stage 1: Build SEAL -FROM debian:bullseye-slim AS seal-build +FROM debian:bullseye-slim@sha256:b5f9bc44bdfbd9d551dfdd432607cbc6bb5d9d6dea726a1191797d7749166973 AS seal-build RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ @@ -40,7 +40,7 @@ RUN wget -qO- https://github.com/microsoft/SEAL/archive/refs/tags/v3.7.0.tar.gz && cmake --install build --prefix /seal-install # Stage 2: Final image with R, JDK, Maven, SEAL -FROM debian:bullseye-slim +FROM debian:bullseye-slim@sha256:b5f9bc44bdfbd9d551dfdd432607cbc6bb5d9d6dea726a1191797d7749166973 WORKDIR /usr/src/ ENV MAVEN_VERSION=3.9.9 From b33283cb8f2eaa2cf490eeb58bf94008462b721e Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 8 Jul 2025 12:48:17 +0200 Subject: [PATCH 10/10] final cleanup --- .gitignore | 4 ++++ docker/mountFolder/.gitignore | 2 -- docker/mountFolder/main.dml | 4 ++-- docker/sysds.Dockerfile | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) delete mode 100644 docker/mountFolder/.gitignore diff --git a/.gitignore b/.gitignore index f3c28571bdf..d4b817a1ae5 100644 --- a/.gitignore +++ b/.gitignore @@ -150,3 +150,7 @@ venv/* # resource optimization scripts/resource/output *.pem + +# docker tests +docker/mountFolder/*.bin +docker/mountFolder/*.bin.mtd diff --git a/docker/mountFolder/.gitignore b/docker/mountFolder/.gitignore deleted file mode 100644 index 50127fba364..00000000000 --- a/docker/mountFolder/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.bin -*.bin.mtd diff --git a/docker/mountFolder/main.dml b/docker/mountFolder/main.dml index cc2c421090a..0efbb6e948a 100644 --- a/docker/mountFolder/main.dml +++ b/docker/mountFolder/main.dml @@ -23,11 +23,11 @@ # Simple KMeans clustering test # Arguments -X = read("test.bin") +X = matrix("1.0 2.0 1.5 1.8 5.0 8.0 8.0 8.0 1.0 0.6 9.0 11.0", rows = 6, cols = 2) # Run KMeans [centroids, assignments] = kmeans(X=X, k=2, max_iter=100, eps=0.01) print(centroids) print(assignments) -write(centroids, "centroids.bin") \ No newline at end of file +write(centroids, "centroids.bin") diff --git a/docker/sysds.Dockerfile b/docker/sysds.Dockerfile index 54785271ecd..2238aa878a8 100644 --- a/docker/sysds.Dockerfile +++ b/docker/sysds.Dockerfile @@ -51,7 +51,7 @@ RUN mkdir -p /usr/lib/jvm \ && mv apache-maven-$MAVEN_VERSION /usr/lib/mvn # Build the system -RUN git clone -b SYSTEMDS-3877 --depth 1 https://github.com/alexanderschmi/systemds.git systemds && \ +RUN git clone --depth 1 https://github.com/apache/systemds.git systemds && \ cd /usr/src/systemds/ && \ mvn --no-transfer-progress clean package -P distribution