Merge pull request #277 from TeamPiped/graalvm

Add support for GraalVM's JVM
This commit is contained in:
Kavin 2022-06-02 13:23:27 +01:00 committed by GitHub
commit 35a9aa8f56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 77 additions and 4 deletions

View file

@ -1,8 +1,8 @@
.*
build
bin
Dockerfile
Dockerfile.*
Dockerfile*
docker-compose.yml
*.bat
LICENSE
*.md

View file

@ -4,10 +4,12 @@ on:
push:
paths-ignore:
- "**.md"
branches:
- master
pull_request:
jobs:
build-hotspot-test:
build-test:
runs-on: ubuntu-latest
strategy:
matrix:
@ -16,6 +18,10 @@ jobs:
- testing/docker-compose.hsqldb.yml
- testing/docker-compose.cockroachdb.yml
- testing/docker-compose.yugabytedb.yml
dockerfile:
- Dockerfile
- Dockerfile.openj9
- Dockerfile.graalvm-jvm
steps:
- uses: actions/checkout@v3
- name: Create Version File
@ -25,8 +31,12 @@ jobs:
with:
context: .
load: true
file: ${{ matrix.dockerfile }}
tags: 1337kavin/piped:latest
- name: Start Docker-Compose services
run: docker-compose -f ${{ matrix.docker-compose-file }} up -d && sleep 5
run: docker-compose -f ${{ matrix.docker-compose-file }} up -d && sleep 20
- name: Run tests
run: ./testing/api-test.sh
- name: Collect services logs
if: failure()
run: docker-compose -f ${{ matrix.docker-compose-file }} logs

View file

@ -68,3 +68,33 @@ jobs:
tags: 1337kavin/piped:latest,1337kavin/piped:openj9
cache-from: type=gha
cache-to: type=gha,mode=max
build-docker-graalvm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create Version File
run: echo $(git log -1 --date=short --pretty=format:%cd)-$(git rev-parse --short HEAD) > VERSION
- name: Set up QEMU
uses: docker/setup-qemu-action@v2.0.0
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2.0.0
with:
version: latest
- name: Login to DockerHub
uses: docker/login-action@v2.0.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v3.0.0
with:
context: .
file: ./Dockerfile.graalvm-jvm
platforms: linux/amd64,linux/arm64
push: true
tags: 1337kavin/piped:graalvm-jvm
cache-from: type=gha
cache-to: type=gha,mode=max

32
Dockerfile.graalvm-jvm Normal file
View file

@ -0,0 +1,32 @@
FROM ghcr.io/graalvm/native-image:latest as build
WORKDIR /app/
COPY . /app/
RUN --mount=type=cache,target=/root/.gradle/caches/ \
./gradlew shadowJar
RUN jlink \
--add-modules java.base,java.logging,java.sql,java.management,java.xml,java.naming,java.desktop,jdk.crypto.ec \
--strip-debug \
--no-man-pages \
--no-header-files \
--compress=2 \
--output /javaruntime
FROM debian:stable-slim
ENV JAVA_HOME=/opt/java/openjdk
ENV PATH "${JAVA_HOME}/bin:${PATH}"
COPY --from=build /javaruntime $JAVA_HOME
WORKDIR /app/
COPY --from=build /app/build/libs/piped-1.0-all.jar /app/piped.jar
COPY VERSION .
EXPOSE 8080
CMD java -jar /app/piped.jar

View file

@ -8,6 +8,7 @@ services:
- ./config.yugabytedb.properties:/app/config.properties
depends_on:
- yb-tserver
command: [ "sh", "-c", "sleep 10 && java -jar piped.jar" ]
yb-master:
image: yugabytedb/yugabyte:latest
command: