Skip to content

Commit

Permalink
fix: JVM support on Kube (#3074)
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas authored Oct 10, 2024
1 parent 54bb6e2 commit d75804a
Show file tree
Hide file tree
Showing 33 changed files with 45 additions and 44 deletions.
8 changes: 3 additions & 5 deletions Dockerfile.box
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ RUN apt-get install -y curl git zip
COPY ./bin /src/bin
ENV PATH="/src/bin:$PATH"
ENV HERMIT_STATE_DIR=/hermit
RUN hermit uninstall jbr
RUN hermit install openjre-18.0.2.1_1
RUN hermit install openjdk-17.0.8_7
# openjre and jbr conflict, but we want the JRE in the cache
RUN hermit uninstall openjre
RUN hermit install jbr
RUN go version
RUN java -version

WORKDIR /src

Expand All @@ -33,7 +31,7 @@ FROM ubuntu:24.04
WORKDIR /root/

ENV PATH="/root/jre/bin:$PATH"
COPY --from=builder /hermit/pkg/openjre-18.0.2.1_1/ ./jre/
COPY --from=builder /hermit/pkg/openjdk-17.0.8_7/ ./jre/
COPY --from=builder /src/build/release/ftl .
RUN mkdir deployments
# Where the module artifacts are stored
Expand Down
11 changes: 4 additions & 7 deletions Dockerfile.runner
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ RUN apt-get install -y curl git zip
COPY ./bin /src/bin
ENV PATH="/src/bin:$PATH"
ENV HERMIT_STATE_DIR=/hermit
RUN hermit uninstall jbr
RUN hermit install openjre-18.0.2.1_1
# openjre and jbr conflict, but we want the JRE in the cache
RUN hermit uninstall openjre
RUN hermit install jbr
RUN hermit install openjdk-17.0.8_7
RUN go version
RUN mvn -B --version

Expand All @@ -36,8 +32,9 @@ RUN apt-get install -y ca-certificates

WORKDIR /root/

ENV PATH="/root/jre/bin:$PATH"
COPY --from=builder /hermit/pkg/openjre-18.0.2.1_1/ ./jre/
ENV PATH="/root/jdk/bin:$PATH"
ENV JAVA_HOME="/root/jdk"
COPY --from=builder /hermit/pkg/openjdk-17.0.8_7/ /root/jdk/
COPY --from=builder /src/build/release/ftl-runner .
COPY --from=builder /src/build/release/ftl .
RUN mkdir deployments
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion bin/jar
2 changes: 1 addition & 1 deletion bin/jarsigner
2 changes: 1 addition & 1 deletion bin/java
2 changes: 1 addition & 1 deletion bin/javac
2 changes: 1 addition & 1 deletion bin/javadoc
2 changes: 1 addition & 1 deletion bin/javap
2 changes: 1 addition & 1 deletion bin/jcmd
2 changes: 1 addition & 1 deletion bin/jconsole
2 changes: 1 addition & 1 deletion bin/jdb
2 changes: 1 addition & 1 deletion bin/jdeprscan
2 changes: 1 addition & 1 deletion bin/jdeps
2 changes: 1 addition & 1 deletion bin/jfr
2 changes: 1 addition & 1 deletion bin/jhsdb
2 changes: 1 addition & 1 deletion bin/jimage
2 changes: 1 addition & 1 deletion bin/jinfo
2 changes: 1 addition & 1 deletion bin/jlink
2 changes: 1 addition & 1 deletion bin/jmap
2 changes: 1 addition & 1 deletion bin/jmod
2 changes: 1 addition & 1 deletion bin/jpackage
2 changes: 1 addition & 1 deletion bin/jps
2 changes: 1 addition & 1 deletion bin/jrunscript
2 changes: 1 addition & 1 deletion bin/jshell
2 changes: 1 addition & 1 deletion bin/jstack
2 changes: 1 addition & 1 deletion bin/jstat
2 changes: 1 addition & 1 deletion bin/jstatd
2 changes: 1 addition & 1 deletion bin/keytool
2 changes: 1 addition & 1 deletion bin/rmiregistry
2 changes: 1 addition & 1 deletion bin/serialver
13 changes: 9 additions & 4 deletions deployment/Dockerfile.runner.test
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
FROM ubuntu:24.04 AS builder
RUN apt-get update

WORKDIR /src

# Finally create the runtime image.
FROM ubuntu:24.04
RUN apt-get update
RUN apt-get install -y ca-certificates openjdk-17-jdk

WORKDIR /root/

#this image does not have a JRE, only test golang on kube

COPY docker-build/ftl-runner .
COPY docker-build/ftl .
RUN mkdir deployments
Expand All @@ -12,6 +18,5 @@ EXPOSE 8894

ENV FTL_ENDPOINT="http://host.docker.internal:8892"
ENV FTL_RUNNER_BIND="http://0.0.0.0:8893"
ENV FTL_RUNNER_ADVERTISE="http://127.0.0.1:8893"

CMD ["/root/ftl-runner", "--deployment-dir=deployments"]
CMD ["/root/ftl-runner", "--deployment-dir=deployments"]
1 change: 1 addition & 0 deletions deployment/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ ftl-status:
build-executables:
# we build locally then copy into the docker files
# it is way faster than building in the docker files
java -version #make sure hermit has downloaded Java
mkdir -p "docker-build"
cd ../ && GOARCH=amd64 GOOS=linux CGO_ENABLED=0 just build ftl-controller ftl-runner ftl-initdb ftl
cp ../build/release/* ./docker-build/
Expand Down

0 comments on commit d75804a

Please sign in to comment.