bb0a6cfecdc4237f29e3b7b6dade4a0249ae4e32
.github/workflows/create-docker-image.yml
| ... | ... | @@ -6,7 +6,7 @@ on: |
| 6 | 6 | workflow_run: |
| 7 | 7 | workflows: [release] |
| 8 | 8 | types: [completed] |
| 9 | - branches: [main, docker-24] |
|
| 9 | + branches: [main, docker-24, docker-25] |
|
| 10 | 10 | workflow_dispatch: |
| 11 | 11 | inputs: |
| 12 | 12 | release: |
| ... | ... | @@ -72,12 +72,12 @@ jobs: |
| 72 | 72 | uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0 |
| 73 | 73 | with: |
| 74 | 74 | build-args: RELEASE=${{ env.RELEASE }} |
| 75 | - tags: ghcr.io/${{steps.ghcr.outputs.PACKAGE}}:${{ env.RELEASE }}${{ env.BRANCH == 'main' && github.event.inputs.release == '' && format(',ghcr.io/{0}:latest', steps.ghcr.outputs.PACKAGE) || env.BRANCH == 'docker-17' && github.event.inputs.release == '' && format(',ghcr.io/{0}:latest-17', steps.ghcr.outputs.PACKAGE) || env.BRANCH == 'docker-21' && github.event.inputs.release == '' && format(',ghcr.io/{0}:latest-21', steps.ghcr.outputs.PACKAGE) || env.BRANCH == 'docker-24' && github.event.inputs.release == '' && format(',ghcr.io/{0}:latest-24', steps.ghcr.outputs.PACKAGE) || '' }} |
|
| 75 | + tags: ghcr.io/${{steps.ghcr.outputs.PACKAGE}}:${{ env.RELEASE }}${{ env.BRANCH == 'main' && github.event.inputs.release == '' && format(',ghcr.io/{0}:latest', steps.ghcr.outputs.PACKAGE) || env.BRANCH == 'docker-17' && github.event.inputs.release == '' && format(',ghcr.io/{0}:latest-17', steps.ghcr.outputs.PACKAGE) || env.BRANCH == 'docker-21' && github.event.inputs.release == '' && format(',ghcr.io/{0}:latest-21', steps.ghcr.outputs.PACKAGE) || env.BRANCH == 'docker-24' && github.event.inputs.release == '' && format(',ghcr.io/{0}:latest-24', steps.ghcr.outputs.PACKAGE) || env.BRANCH == 'docker-25' && github.event.inputs.release == '' && format(',ghcr.io/{0}:latest-25', steps.ghcr.outputs.PACKAGE) || '' }} |
|
| 76 | 76 | annotations: | |
| 77 | 77 | maintainer=axel.uhl@sap.com |
| 78 | 78 | index:org.opencontainers.image.title=Sailing Analytics |
| 79 | 79 | index:org.opencontainers.image.description=The Sailing Analytics Web Application |
| 80 | - file: ${{ env.BRANCH == 'docker-17' && 'docker/Dockerfile_sapsailing_on_sapmachine17' || env.BRANCH == 'docker-21' && 'docker/Dockerfile_sapsailing_on_sapmachine21' || env.BRANCH == 'docker-24' && 'docker/Dockerfile_sapsailing_on_sapmachine24' || 'docker/Dockerfile' }} |
|
| 80 | + file: ${{ env.BRANCH == 'docker-17' && 'docker/Dockerfile_sapsailing_on_sapmachine17' || env.BRANCH == 'docker-21' && 'docker/Dockerfile_sapsailing_on_sapmachine21' || env.BRANCH == 'docker-24' && 'docker/Dockerfile_sapsailing_on_sapmachine24' || env.BRANCH == 'docker-25' && 'docker/Dockerfile_sapsailing_on_sapmachine25' || 'docker/Dockerfile' }} |
|
| 81 | 81 | context: docker/ |
| 82 | 82 | platforms: linux/amd64,linux/arm64 |
| 83 | 83 | push: true |
.github/workflows/merge-main-into-docker-25.yml
| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | +name: Merge main branch into docker-25 after successful build |
|
| 2 | +on: |
|
| 3 | + workflow_run: |
|
| 4 | + workflows: [release] |
|
| 5 | + types: [completed] |
|
| 6 | + branches: [main] |
|
| 7 | + workflow_dispatch: {} |
|
| 8 | +jobs: |
|
| 9 | + merge-main-into-docker-25: |
|
| 10 | + permissions: |
|
| 11 | + contents: write |
|
| 12 | + if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} |
|
| 13 | + runs-on: ubuntu-latest |
|
| 14 | + steps: |
|
| 15 | + - name: Checkout |
|
| 16 | + uses: actions/checkout@v4 |
|
| 17 | + with: |
|
| 18 | + ref: docker-25 |
|
| 19 | + fetch-depth: 0 # fetch the whole thing to make sure the histories merge |
|
| 20 | + - name: Merge main into docker-25 |
|
| 21 | + uses: devmasx/merge-branch@854d3ac71ed1e9deb668e0074781b81fdd6e771f # v1.4.0 |
|
| 22 | + env: |
|
| 23 | + GH_TOKEN: ${{ secrets.REPO_TOKEN_FOR_MERGE_AND_PUSH }} |
|
| 24 | + with: |
|
| 25 | + type: now |
|
| 26 | + from_branch: main |
|
| 27 | + target_branch: docker-25 |
|
| 28 | + message: Auto-merging main into docker-25 after successful release build |
|
| 29 | + github_token: ${{ secrets.REPO_TOKEN_FOR_MERGE_AND_PUSH }} |
.github/workflows/release.yml
| ... | ... | @@ -78,12 +78,12 @@ jobs: |
| 78 | 78 | distribution: 'temurin' # See 'Supported distributions' for available options |
| 79 | 79 | java-version: '8' |
| 80 | 80 | mvn-toolchain-id: 'JavaSE-1.8' |
| 81 | - - name: Install JDK 17 |
|
| 81 | + - name: Install JDK 25 |
|
| 82 | 82 | uses: actions/setup-java@v4 |
| 83 | 83 | with: |
| 84 | 84 | distribution: 'temurin' # See 'Supported distributions' for available options |
| 85 | - java-version: '17' |
|
| 86 | - mvn-toolchain-id: 'JavaSE-17' |
|
| 85 | + java-version: '25' |
|
| 86 | + mvn-toolchain-id: 'JavaSE-25' |
|
| 87 | 87 | - name: Setup Android SDK |
| 88 | 88 | uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3.2.2 |
| 89 | 89 | with: |
| ... | ... | @@ -131,7 +131,7 @@ jobs: |
| 131 | 131 | reporter: java-junit |
| 132 | 132 | fail-on-error: true |
| 133 | 133 | - name: Build Release |
| 134 | - if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/docker-24' || startsWith(github.ref, 'refs/heads/releases/') }} |
|
| 134 | + if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/docker-24' || github.ref == 'refs/heads/docker-25' || startsWith(github.ref, 'refs/heads/releases/') }} |
|
| 135 | 135 | shell: bash |
| 136 | 136 | run: | |
| 137 | 137 | ./configuration/buildAndUpdateProduct.sh -u -L ${{ github.event.inputs.skip_tests == 'true' && '-n untested' || '' }} release |
| ... | ... | @@ -148,14 +148,14 @@ jobs: |
| 148 | 148 | retention-days: 90 |
| 149 | 149 | - name: Upload distribution artifact |
| 150 | 150 | uses: actions/upload-artifact@v4 |
| 151 | - if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/docker-24' || startsWith(github.ref, 'refs/heads/releases/') }} |
|
| 151 | + if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/docker-24' || github.ref == 'refs/heads/docker-25' || startsWith(github.ref, 'refs/heads/releases/') }} |
|
| 152 | 152 | with: |
| 153 | 153 | name: ${{ env.SIMPLE_VERSION_INFO }} |
| 154 | 154 | path: dist/**/* |
| 155 | 155 | retention-days: 90 |
| 156 | 156 | - name: Create Release |
| 157 | 157 | id: create_release |
| 158 | - if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/docker-24' || startsWith(github.ref, 'refs/heads/releases/') }} |
|
| 158 | + if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/docker-24' || github.ref == 'refs/heads/docker-25' || startsWith(github.ref, 'refs/heads/releases/') }} |
|
| 159 | 159 | uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1 |
| 160 | 160 | with: |
| 161 | 161 | tag_name: ${{ env.SIMPLE_VERSION_INFO }} |
| ... | ... | @@ -164,7 +164,7 @@ jobs: |
| 164 | 164 | prerelease: false |
| 165 | 165 | - name: Upload Release Asset tar.gz |
| 166 | 166 | id: upload-release-asset-tar-gz |
| 167 | - if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/docker-24' || startsWith(github.ref, 'refs/heads/releases/') }} |
|
| 167 | + if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/docker-24' || github.ref == 'refs/heads/docker-25' || startsWith(github.ref, 'refs/heads/releases/') }} |
|
| 168 | 168 | uses: actions/upload-release-asset@v1 |
| 169 | 169 | env: |
| 170 | 170 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| ... | ... | @@ -175,7 +175,7 @@ jobs: |
| 175 | 175 | asset_content_type: application/x-tar |
| 176 | 176 | - name: Upload Release Asset release_notes.txt |
| 177 | 177 | id: upload-release-asset-release-notes-txt |
| 178 | - if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/docker-24' || startsWith(github.ref, 'refs/heads/releases/') }} |
|
| 178 | + if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/docker-24' || github.ref == 'refs/heads/docker-25' || startsWith(github.ref, 'refs/heads/releases/') }} |
|
| 179 | 179 | uses: actions/upload-release-asset@v1 |
| 180 | 180 | env: |
| 181 | 181 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
docker/Dockerfile_sapsailing_on_sapmachine25
| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | +FROM sapmachine:25.0.1 |
|
| 2 | +# This Dockerfile assumes that the release to use is provided as |
|
| 3 | +# ${RELEASE}.tar.gz in the current Docker workspace. Use, e.g., |
|
| 4 | +# the configuration/github-download-release-assets.sh script to |
|
| 5 | +# obtain the tar.gz file for a specific or the latest "main" release. |
|
| 6 | +ARG RELEASE |
|
| 7 | +LABEL maintainer=axel.uhl@sap.com |
|
| 8 | +LABEL org.opencontainers.image.description="Sailing Analytics with Java 25" |
|
| 9 | +# Download and extract the release |
|
| 10 | +WORKDIR /home/sailing/servers/server |
|
| 11 | +RUN apt-get update \ |
|
| 12 | + && apt-get install -y wget apt-utils vim telnet dnsutils net-tools jq |
|
| 13 | +COPY vimrc /root/.vimrc |
|
| 14 | +RUN wget -O /tmp/rds.pem https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem \ |
|
| 15 | + && ${JAVA_HOME}/bin/keytool -importcert -alias AWSRDS -file /tmp/rds.pem -keystore ${JAVA_HOME}/lib/security/cacerts -noprompt -storepass changeit \ |
|
| 16 | + && rm /tmp/rds.pem |
|
| 17 | +COPY ${RELEASE}.tar.gz /tmp |
|
| 18 | +RUN tar xzvpf /tmp/${RELEASE}.tar.gz \ |
|
| 19 | + && rm /tmp/${RELEASE}.tar.gz |
|
| 20 | +COPY env.sh . |
|
| 21 | +RUN cat env-default-rules.sh >>env.sh |
|
| 22 | +COPY start . |
|
| 23 | +COPY JavaSE-11.profile . |
|
| 24 | +EXPOSE 8888 14888 8000 7091 6666 |
|
| 25 | +CMD [ "/home/sailing/servers/server/start", "docker" ] |
docker/Dockerfile_windestimation-on-sapmachine25
| ... | ... | @@ -0,0 +1,16 @@ |
| 1 | +FROM sapmachine:25.0.1 |
|
| 2 | +LABEL maintainer=axel.uhl@sap.com |
|
| 3 | +# Download and extract the release |
|
| 4 | +WORKDIR /home/sailing |
|
| 5 | +RUN chmod 777 /home/sailing; mkdir logs; mkdir dump |
|
| 6 | +RUN apt-get -y update; apt-get -y upgrade; apt-get -y install apt-utils wget curl |
|
| 7 | +RUN curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | apt-key add - |
|
| 8 | +RUN echo "deb [arch=amd64,arm64] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" >/etc/apt/sources.list.d/mongodb-org-4.4.list |
|
| 9 | +RUN apt-get update \ |
|
| 10 | + && apt-get install -y vim mongodb-org-shell |
|
| 11 | +COPY vimrc /root/.vimrc |
|
| 12 | +RUN wget -O /tmp/rds.pem https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem \ |
|
| 13 | + && ${JAVA_HOME}/bin/keytool -importcert -alias AWSRDS -file /tmp/rds.pem -keystore ${JAVA_HOME}/lib/security/cacerts -noprompt -storepass changeit \ |
|
| 14 | + && rm /tmp/rds.pem |
|
| 15 | +RUN wget -O /home/sailing/WindEstimationModelsTraining.jar https://static.sapsailing.com/WindEstimationModelsTraining.jar |
|
| 16 | +CMD exec java "${MEMORY}" -Dmongo.uri="${MONGODB_URI}" -XX:+UseParallelGC -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=dump/ -Xlog:gc*=info,gc+region*=info,gc+ergo*=info,gc+humongous*=info,gc+liveness=trace:file=logs/gc.log:time,level,tags:filecount=10,filesize=100000000 -jar WindEstimationModelsTraining.jar "${BEARER_TOKEN}" ${TRAINING_DATA_PERCENT} |
docker/docker-compose-25.yml
| ... | ... | @@ -0,0 +1,19 @@ |
| 1 | +version: "3.10" |
|
| 2 | +services: |
|
| 3 | + sailing-analytics: |
|
| 4 | + image: "ghcr.io/sap/sailing-analytics:latest-25" |
|
| 5 | + ports: |
|
| 6 | + - "8888:8888" |
|
| 7 | + - "6666:6666" |
|
| 8 | + - "14888:14888" |
|
| 9 | + environment: |
|
| 10 | + MONGODB_URI: mongodb://mongo/test |
|
| 11 | + SERVER_NAME: test |
|
| 12 | + REPLICATION_HOST: rabbitmq |
|
| 13 | + REPLICATION_CHANNEL: test |
|
| 14 | + REPLICATION_PORT: 5672 |
|
| 15 | + mongo: |
|
| 16 | + image: "mongo:7" |
|
| 17 | + rabbitmq: |
|
| 18 | + image: "rabbitmq:3.13" |
|
| 19 | + |
docker/makeImageForLatestRelease-on-sapmachine25
| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | +#!/bin/bash |
|
| 2 | +release_prefix=$1 |
|
| 3 | +GITROOT="`dirname $0`/.." |
|
| 4 | +DOCKERDIR="${GITROOT}/docker" |
|
| 5 | +DOCKERFILE="$DOCKERDIR/Dockerfile" |
|
| 6 | +if [ "${release_prefix}" = "" ]; then |
|
| 7 | + SET_LATEST=1 |
|
| 8 | + release_prefix="docker-25-" |
|
| 9 | +fi |
|
| 10 | +pushd "${DOCKERDIR}" |
|
| 11 | +RELEASE_TAR_GZ_FILENAME=$( ${GITROOT}/configuration/github-download-release-assets.sh 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 "${release_prefix}" ) |
|
| 12 | +if [ "${RELEASE_TAR_GZ_FILENAME}" = "" ]; then |
|
| 13 | + echo "No release with prefix ${release_prefix} found" >&2 |
|
| 14 | +else |
|
| 15 | + release=$( echo ${RELEASE_TAR_GZ_FILENAME} | sed -e 's/\.tar\.gz//' ) |
|
| 16 | + echo Release is ${release} |
|
| 17 | + echo "Copying files from GITROOT $GITROOT into Docker workspace" |
|
| 18 | + cp "$GITROOT/java/target/env.sh" "$DOCKERDIR" |
|
| 19 | + cp "$GITROOT/java/target/start" "$DOCKERDIR" |
|
| 20 | + cp "$GITROOT/java/target/configuration/JavaSE-11.profile" "$DOCKERDIR" |
|
| 21 | + cd "$DOCKERDIR" |
|
| 22 | + docker build --build-arg RELEASE=${release} -t ghcr.io/sap/sailing-analytics:${release} -f Dockerfile_sapsailing_on_sapmachine25 . |
|
| 23 | + echo "Cleaning up..." |
|
| 24 | + rm start env.sh JavaSE-11.profile ${RELEASE_TAR_GZ_FILENAME} release-notes.txt |
|
| 25 | + docker push ghcr.io/sap/sailing-analytics:${release} |
|
| 26 | + if [ "$SET_LATEST" = "1" ]; then |
|
| 27 | + docker tag ghcr.io/sap/sailing-analytics:${release} ghcr.io/sap/sailing-analytics:latest-25 |
|
| 28 | + docker push ghcr.io/sap/sailing-analytics:latest-25 |
|
| 29 | + fi |
|
| 30 | +fi |
|
| 31 | +popd |