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
360 changes: 191 additions & 169 deletions environments.json

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions jvm/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
FROM maven:3.9.9-eclipse-temurin-22-alpine AS build
FROM maven:3.9.16-eclipse-temurin-25-alpine AS build
WORKDIR /usr/src/myapp/

# fission-java-core is no longer resolvable from any remote repository,
# so build and install it from source first.
COPY install-fission-java-core.sh /usr/local/bin/install-fission-java-core
RUN install-fission-java-core

# To reuse the build cache, here we split maven dependency
# download and package into two RUN commands to avoid cache invalidation.
COPY pom.xml .
Expand All @@ -9,8 +14,8 @@ RUN mvn dependency:go-offline
COPY src /usr/src/myapp/src/
RUN mvn package

FROM eclipse-temurin:22-jdk-alpine
FROM eclipse-temurin:25-jdk-alpine
VOLUME /tmp
COPY --from=build /usr/src/myapp/target/env-java-0.0.1-SNAPSHOT.jar /app.jar
ENTRYPOINT java ${JVM_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /app.jar --server.port=8888
EXPOSE 8888
EXPOSE 8888
17 changes: 11 additions & 6 deletions jvm/builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
ARG BUILDER_IMAGE=fission/builder:latest
FROM ${BUILDER_IMAGE} AS builder

## Use eclipse-temurin:22-jdk-alpine - (https://github.com/adoptium/containers/blob/07677395574f5d3462c3b6fdf5f6c4a0a350b683/22/jdk/alpine/Dockerfile)
## Use eclipse-temurin:25-jdk-alpine - (https://github.com/adoptium/containers)

FROM eclipse-temurin:22-jdk-alpine
FROM eclipse-temurin:25-jdk-alpine

## Section copied from the Maven Dockerfile

Expand All @@ -17,16 +17,21 @@ LABEL org.opencontainers.image.description="Apache Maven is a software project m

ENV MAVEN_HOME=/usr/share/maven

COPY --from=maven:3.9.9-eclipse-temurin-11 ${MAVEN_HOME} ${MAVEN_HOME}
COPY --from=maven:3.9.9-eclipse-temurin-11 /usr/local/bin/mvn-entrypoint.sh /usr/local/bin/mvn-entrypoint.sh
COPY --from=maven:3.9.9-eclipse-temurin-11 /usr/share/maven/ref/settings-docker.xml /usr/share/maven/ref/settings-docker.xml
COPY --from=maven:3.9.16-eclipse-temurin-25 ${MAVEN_HOME} ${MAVEN_HOME}
COPY --from=maven:3.9.16-eclipse-temurin-25 /usr/local/bin/mvn-entrypoint.sh /usr/local/bin/mvn-entrypoint.sh
COPY --from=maven:3.9.16-eclipse-temurin-25 /usr/share/maven/ref/settings-docker.xml /usr/share/maven/ref/settings-docker.xml

RUN ln -s ${MAVEN_HOME}/bin/mvn /usr/bin/mvn

ARG MAVEN_VERSION=3.9.9
ARG MAVEN_VERSION=3.9.16
ARG USER_HOME_DIR="/root"
ENV MAVEN_CONFIG="$USER_HOME_DIR/.m2"

## Pre-install fission-java-core into the local Maven repository so user
## function builds can resolve it (it is no longer available remotely).
COPY install-fission-java-core.sh /usr/local/bin/install-fission-java-core
RUN install-fission-java-core

## Fission builder specific section
COPY --from=builder /builder /builder
ADD build.sh /usr/local/bin/build
Expand Down
35 changes: 35 additions & 0 deletions jvm/builder/install-fission-java-core.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/sh
#
# NOTE: keep in sync with ../install-fission-java-core.sh (duplicated because
# the builder image is built with jvm/builder/ as its Docker build context).
#
# Installs io.fission:fission-java-core into the local Maven repository by
# building it from source (a pinned commit of fission/fission-java-libs).
#
# Background: fission-java-core was only ever published as a SNAPSHOT to
# oss.sonatype.org (OSSRH), which was decommissioned in 2025, so the artifact
# can no longer be resolved from any remote repository.
#
# The artifact is installed under several versions so that both the poms in
# this repository (0.0.2) and pre-existing user functions that still
# reference 0.0.2-SNAPSHOT resolve from the local repository.
set -eu

COMMIT=e97baa8b6a306a552dc53d576075e7c410bcfaa4
VERSIONS="0.0.1 0.0.2 0.0.2-SNAPSHOT"

workdir=$(mktemp -d)
trap 'rm -rf "$workdir"' EXIT

wget -qO "$workdir/src.tar.gz" "https://github.com/fission/fission-java-libs/archive/${COMMIT}.tar.gz"
tar -xzf "$workdir/src.tar.gz" -C "$workdir"
cd "$workdir/fission-java-libs-${COMMIT}/fission-java-core"

# The pom is missing its XML namespace declarations, which strict plugin
# parsers (e.g. versions-maven-plugin) reject; normalize the root element.
sed -i '1s|^<project[^>]*>|<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">|' pom.xml

for version in $VERSIONS; do
mvn -B -q versions:set -DnewVersion="$version"
mvn -B -q -DskipTests -Dmaven.compiler.release=17 install
done
4 changes: 2 additions & 2 deletions jvm/envconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
],
"name": "JVM Environment",
"readme": "https://github.com/fission/environments/tree/master/jvm",
"runtimeVersion": "22",
"runtimeVersion": "25",
"shortDescription": "JVM environment based on Spring Boot server",
"status": "Stable",
"version": "1.31.3"
"version": "1.32.0"
}
]
19 changes: 8 additions & 11 deletions jvm/examples/java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>17</maven.compiler.release>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.0.1.RELEASE</version>
<version>3.5.14</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.fission</groupId>
<artifactId>fission-java-core</artifactId>
<version>0.0.2-SNAPSHOT</version>
<version>0.0.2</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand All @@ -52,21 +53,17 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<version>3.5.4</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
</plugins>
</build>

<!-- Adding Sonatype repository to pull snapshots -->
<repositories>
<repository>
<id>fission-java-core</id>
<name>fission-java-core-snapshot</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>
<!-- fission-java-core is not available in any remote repository; install
it into the local Maven repository first by running
jvm/install-fission-java-core.sh (the jvm-builder image ships with it
pre-installed). -->

</project>
32 changes: 32 additions & 0 deletions jvm/install-fission-java-core.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh
#
# Installs io.fission:fission-java-core into the local Maven repository by
# building it from source (a pinned commit of fission/fission-java-libs).
#
# Background: fission-java-core was only ever published as a SNAPSHOT to
# oss.sonatype.org (OSSRH), which was decommissioned in 2025, so the artifact
# can no longer be resolved from any remote repository.
#
# The artifact is installed under several versions so that both the poms in
# this repository (0.0.2) and pre-existing user functions that still
# reference 0.0.2-SNAPSHOT resolve from the local repository.
set -eu

COMMIT=e97baa8b6a306a552dc53d576075e7c410bcfaa4
VERSIONS="0.0.1 0.0.2 0.0.2-SNAPSHOT"

workdir=$(mktemp -d)
trap 'rm -rf "$workdir"' EXIT

wget -qO "$workdir/src.tar.gz" "https://github.com/fission/fission-java-libs/archive/${COMMIT}.tar.gz"
tar -xzf "$workdir/src.tar.gz" -C "$workdir"
cd "$workdir/fission-java-libs-${COMMIT}/fission-java-core"

# The pom is missing its XML namespace declarations, which strict plugin
# parsers (e.g. versions-maven-plugin) reject; normalize the root element.
sed -i '1s|^<project[^>]*>|<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">|' pom.xml

for version in $VERSIONS; do
mvn -B -q versions:set -DnewVersion="$version"
mvn -B -q -DskipTests -Dmaven.compiler.release=17 install
done
15 changes: 5 additions & 10 deletions jvm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.2</version>
<version>3.5.14</version>
</parent>

<dependencies>
Expand All @@ -22,7 +22,7 @@
<dependency>
<groupId>io.fission</groupId>
<artifactId>fission-java-core</artifactId>
<version>0.0.2-SNAPSHOT</version>
<version>0.0.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
Expand All @@ -39,12 +39,7 @@
</plugins>
</build>

<!-- Adding Sonatype repository to pull snapshots -->
<repositories>
<repository>
<id>fission-java-core</id>
<name>fission-java-core-snapshot</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>
<!-- fission-java-core is built from source and installed into the local
Maven repository (see install-fission-java-core.sh); no extra
repositories are needed. -->
</project>
14 changes: 13 additions & 1 deletion jvm/tests/test_java_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
set -euo pipefail
source test_utils/utils.sh

# Use the locally built image loaded into kind by `make jvm-test-images`
# (the utils.sh default points at the stale Docker Hub image), matching the
# convention of the go/binary/nodejs/python tests.
export JVM_RUNTIME_IMAGE=jvm-env

TEST_ID=$(generate_test_id)
echo "TEST_ID = $TEST_ID"

Expand All @@ -24,7 +29,14 @@ cd jvm/examples/java

log "Creating the jar from application"
#Using Docker to build Jar so that maven & other Java dependencies are not needed on CI server
docker run --rm -v "$(pwd)":/usr/src/mymaven -w /usr/src/mymaven maven:3.9.9-eclipse-temurin-22-alpine mvn clean package -q
#fission-java-core must be installed into the container-local Maven repository
#first because it is not resolvable from any remote repository.
docker run --rm \
-v "$(pwd)":/usr/src/mymaven \
-v "$(pwd)/../../install-fission-java-core.sh":/usr/local/bin/install-fission-java-core \
-w /usr/src/mymaven \
maven:3.9.16-eclipse-temurin-25-alpine \
sh -c "install-fission-java-core && mvn clean package -q"

log "Creating environment for Java"
fission env create --name $env --image $JVM_RUNTIME_IMAGE --version 2 --keeparchive=true
Expand Down
Loading