Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ jobs:
image-name: eduide/eduide-cloud/${{ matrix.component }}
docker-context: .
image-tag: ${{ github.event_name == 'release' && github.event.release.tag_name || github.event_name == 'workflow_dispatch' && inputs.image_tag || '' }}
# The Java build stamps the version into the jar manifest, so the version
# inside the image should match the tag on the outside. The shared workflow
# derives the tag (stripping any leading v) and passes it as APP_VERSION.
stamp-app-version: true
no-cache: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.disable_layer_cache) || false }}
# These are small Java images; the disk-reclaim step is not worth the time.
free-disk-space: false
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ openapitools.json
target/
node_modules
node/e2e-tests/test-results/.last-run.json
.flattened-pom.xml
12 changes: 7 additions & 5 deletions dockerfiles/conversion-webhook/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM eclipse-temurin:21-jdk AS builder
ARG APP_VERSION=1.2.0-SNAPSHOT
# Accept APT_HTTP_PROXY build-arg for caching
ARG APT_HTTP_PROXY
# Configure apt proxy if provided (hybrid: works on ARC and GitHub runners)
Expand All @@ -17,17 +18,18 @@ COPY java/common ./common
COPY java/conversion ./conversion
RUN --mount=type=cache,target=/root/.m2 \
cd /conversion/common/maven-conf && \
mvn clean install --no-transfer-progress && \
mvn clean install --no-transfer-progress -Drevision=${APP_VERSION} && \
cd /conversion/common/org.eclipse.theia.cloud.common && \
mvn clean install --no-transfer-progress && \
mvn clean install --no-transfer-progress -Drevision=${APP_VERSION} && \
cd /conversion/conversion/org.eclipse.theia.cloud.conversion && \
mvn clean package -Dmaven.test.skip=true -Dquarkus.package.type=uber-jar --no-transfer-progress
mvn clean package -Drevision=${APP_VERSION} -Dmaven.test.skip=true -Dquarkus.package.type=uber-jar --no-transfer-progress

FROM eclipse-temurin:21-jre-alpine
ARG APP_VERSION=1.2.0-SNAPSHOT
WORKDIR /conversion
COPY --from=builder /conversion/conversion/org.eclipse.theia.cloud.conversion/target/conversion-webhook-1.2.0-SNAPSHOT-runner.jar .
COPY --from=builder /conversion/conversion/org.eclipse.theia.cloud.conversion/target/conversion-webhook-${APP_VERSION}-runner.jar ./conversion-webhook.jar

ENV CERT_RELOAD_PERIOD=604800

ENTRYPOINT ["java", "-Dquarkus.http.ssl.certificate.reload-period=${CERT_RELOAD_PERIOD}", "-jar", "./conversion-webhook-1.2.0-SNAPSHOT-runner.jar"]
ENTRYPOINT ["java", "-Dquarkus.http.ssl.certificate.reload-period=${CERT_RELOAD_PERIOD}", "-jar", "./conversion-webhook.jar"]
CMD [ "" ]
14 changes: 8 additions & 6 deletions dockerfiles/operator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM eclipse-temurin:21-jdk AS builder
ARG APP_VERSION=1.2.0-SNAPSHOT
# Accept APT_HTTP_PROXY build-arg for caching
ARG APT_HTTP_PROXY
# Configure apt proxy if provided (hybrid: works on ARC and GitHub runners)
Expand Down Expand Up @@ -27,15 +28,16 @@ RUN --mount=type=secret,id=SENTRY_AUTH_TOKEN \
echo "No SENTRY_AUTH_TOKEN provided, skipping Sentry build integration"; \
fi && \
cd /operator/common/maven-conf && \
mvn clean install --no-transfer-progress $MAVEN_SENTRY_ARGS && \
mvn clean install --no-transfer-progress -Drevision=${APP_VERSION} $MAVEN_SENTRY_ARGS && \
cd /operator/common/org.eclipse.theia.cloud.common && \
mvn clean install --no-transfer-progress $MAVEN_SENTRY_ARGS && \
mvn clean install --no-transfer-progress -Drevision=${APP_VERSION} $MAVEN_SENTRY_ARGS && \
cd /operator/operator/org.eclipse.theia.cloud.operator && \
mvn clean install --no-transfer-progress $MAVEN_SENTRY_ARGS && \
mvn clean install --no-transfer-progress -Drevision=${APP_VERSION} $MAVEN_SENTRY_ARGS && \
cd /operator/operator/org.eclipse.theia.cloud.defaultoperator && \
mvn clean verify --no-transfer-progress $MAVEN_SENTRY_ARGS
mvn clean verify --no-transfer-progress -Drevision=${APP_VERSION} $MAVEN_SENTRY_ARGS

FROM eclipse-temurin:21-jre-alpine
ARG APP_VERSION=1.2.0-SNAPSHOT
RUN apk add --no-cache curl unzip
RUN mkdir /templates
WORKDIR /log-config
Expand All @@ -44,7 +46,7 @@ WORKDIR /operator
RUN curl -fsSL -o sentry-agent.zip https://github.com/getsentry/sentry-java/releases/download/8.29.0/sentry-opentelemetry-agent-8.29.0.zip && \
unzip -j sentry-agent.zip -d . && \
rm sentry-agent.zip
COPY --from=builder /operator/operator/org.eclipse.theia.cloud.defaultoperator/target/defaultoperator-1.2.0-SNAPSHOT-jar-with-dependencies.jar .
COPY --from=builder /operator/operator/org.eclipse.theia.cloud.defaultoperator/target/defaultoperator-${APP_VERSION}-jar-with-dependencies.jar ./operator.jar
COPY --from=builder /operator/operator/org.eclipse.theia.cloud.defaultoperator/sentry.properties ./sentry.properties

# If set to true, enables Sentry Java agent flags.
Expand All @@ -67,7 +69,7 @@ fi

exec java $JAVA_OPTS \
-Dlog4j2.configurationFile=/log-config/log4j2.xml \
-jar ./defaultoperator-1.2.0-SNAPSHOT-jar-with-dependencies.jar \
-jar ./operator.jar \
"$@"
EOF_ENTRYPOINT

Expand Down
12 changes: 7 additions & 5 deletions dockerfiles/service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM eclipse-temurin:21-jdk AS builder
ARG APP_VERSION=1.2.0-SNAPSHOT
# Accept APT_HTTP_PROXY build-arg for caching
ARG APT_HTTP_PROXY
# Configure apt proxy if provided (hybrid: works on ARC and GitHub runners)
Expand Down Expand Up @@ -27,19 +28,20 @@ RUN --mount=type=secret,id=SENTRY_AUTH_TOKEN \
echo "No SENTRY_AUTH_TOKEN provided, skipping Sentry build integration"; \
fi && \
cd /service/common/maven-conf && \
mvn clean install --no-transfer-progress $MAVEN_SENTRY_ARGS && \
mvn clean install --no-transfer-progress -Drevision=${APP_VERSION} $MAVEN_SENTRY_ARGS && \
cd /service/common/org.eclipse.theia.cloud.common && \
mvn clean install --no-transfer-progress $MAVEN_SENTRY_ARGS && \
mvn clean install --no-transfer-progress -Drevision=${APP_VERSION} $MAVEN_SENTRY_ARGS && \
cd /service/service/org.eclipse.theia.cloud.service && \
mvn clean package -Dmaven.test.skip=true -Dquarkus.package.type=uber-jar --no-transfer-progress $MAVEN_SENTRY_ARGS
mvn clean package -Drevision=${APP_VERSION} -Dmaven.test.skip=true -Dquarkus.package.type=uber-jar --no-transfer-progress $MAVEN_SENTRY_ARGS

FROM eclipse-temurin:21-jre-alpine
ARG APP_VERSION=1.2.0-SNAPSHOT
RUN apk add --no-cache curl unzip
WORKDIR /service
RUN curl -fsSL -o sentry-agent.zip https://github.com/getsentry/sentry-java/releases/download/8.29.0/sentry-opentelemetry-agent-8.29.0.zip && \
unzip -j sentry-agent.zip -d . && \
rm sentry-agent.zip
COPY --from=builder /service/service/org.eclipse.theia.cloud.service/target/service-1.2.0-SNAPSHOT-runner.jar .
COPY --from=builder /service/service/org.eclipse.theia.cloud.service/target/service-${APP_VERSION}-runner.jar ./service.jar
COPY --from=builder /service/service/org.eclipse.theia.cloud.service/sentry.properties ./sentry.properties

ENV SERVICE_PORT=8081
Expand Down Expand Up @@ -84,7 +86,7 @@ exec java $JAVA_OPTS \
-Dquarkus.oidc.auth-server-url="${KEYCLOAK_SERVERURL}" \
-Dquarkus.oidc.client-id="${KEYCLOAK_CLIENTID}" \
-Dquarkus.oidc.credentials.secret="${KEYCLOAK_CLIENTSECRET}" \
-jar ./service-1.2.0-SNAPSHOT-runner.jar \
-jar ./service.jar \
"$@"
EOF_ENTRYPOINT

Expand Down
37 changes: 36 additions & 1 deletion java/common/maven-conf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.theia.cloud</groupId>
<artifactId>conf</artifactId>
<version>1.2.0-SNAPSHOT</version>
<version>${revision}</version>
<packaging>pom</packaging>
<name>Theia Cloud Maven Configuration</name>
<description>Common properties and configuration</description>

<properties>
<!-- CI overrides this: mvn -Drevision=2.3.0 -->
<revision>1.2.0-SNAPSHOT</revision>
<failsafe.useModulePath>false</failsafe.useModulePath>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
Expand Down Expand Up @@ -42,6 +44,39 @@
</pluginRepository>
</pluginRepositories>

<build>
<plugins>
<!--
Required by the ${revision} versioning above. Without it the pom
installed into the local repository still contains the literal
${revision}, and the next module cannot resolve this parent.
resolveCiFriendliesOnly rewrites only revision/sha1/changelist
and leaves the rest of the pom untouched.
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>1.6.0</version>
<configuration>
<updatePomFile>true</updatePomFile>
<flattenMode>resolveCiFriendliesOnly</flattenMode>
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals><goal>flatten</goal></goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals><goal>clean</goal></goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>github</id>
Expand Down
2 changes: 1 addition & 1 deletion java/common/org.eclipse.theia.cloud.common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.eclipse.theia.cloud</groupId>
<artifactId>conf</artifactId>
<version>1.2.0-SNAPSHOT</version>
<version>${revision}</version>
<relativePath>../../common/maven-conf/</relativePath>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions java/conversion/org.eclipse.theia.cloud.conversion/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>org.eclipse.theia.cloud</groupId>
<artifactId>conf</artifactId>
<version>1.2.0-SNAPSHOT</version>
<version>${revision}</version>
<relativePath>../../common/maven-conf/</relativePath>
</parent>

Expand Down Expand Up @@ -45,7 +45,7 @@
<dependency>
<groupId>org.eclipse.theia.cloud</groupId>
<artifactId>common</artifactId>
<version>1.2.0-SNAPSHOT</version>
<version>${revision}</version>
</dependency>
<!-- Webhooks -->
<dependency>
Expand Down
6 changes: 3 additions & 3 deletions java/operator/org.eclipse.theia.cloud.defaultoperator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
<parent>
<groupId>org.eclipse.theia.cloud</groupId>
<artifactId>conf</artifactId>
<version>1.2.0-SNAPSHOT</version>
<version>${revision}</version>
<relativePath>../../common/maven-conf/</relativePath>
</parent>

<dependencies>
<dependency>
<groupId>org.eclipse.theia.cloud</groupId>
<artifactId>operator</artifactId>
<version>1.2.0-SNAPSHOT</version>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>org.eclipse.theia.cloud</groupId>
<artifactId>common</artifactId>
<version>1.2.0-SNAPSHOT</version>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
Expand Down
4 changes: 2 additions & 2 deletions java/operator/org.eclipse.theia.cloud.operator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
<parent>
<groupId>org.eclipse.theia.cloud</groupId>
<artifactId>conf</artifactId>
<version>1.2.0-SNAPSHOT</version>
<version>${revision}</version>
<relativePath>../../common/maven-conf/</relativePath>
</parent>

<dependencies>
<dependency>
<groupId>org.eclipse.theia.cloud</groupId>
<artifactId>common</artifactId>
<version>1.2.0-SNAPSHOT</version>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
Expand Down
4 changes: 2 additions & 2 deletions java/service/org.eclipse.theia.cloud.service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>org.eclipse.theia.cloud</groupId>
<artifactId>conf</artifactId>
<version>1.2.0-SNAPSHOT</version>
<version>${revision}</version>
<relativePath>../../common/maven-conf/</relativePath>
</parent>

Expand Down Expand Up @@ -76,7 +76,7 @@
<dependency>
<groupId>org.eclipse.theia.cloud</groupId>
<artifactId>common</artifactId>
<version>1.2.0-SNAPSHOT</version>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
Expand Down
Loading