Skip to content

Commit

Permalink
Simplize workflows, add Temurin and IBM
Browse files Browse the repository at this point in the history
  • Loading branch information
xMikux authored Jan 31, 2024
1 parent c0be59e commit f9da1fa
Show file tree
Hide file tree
Showing 11 changed files with 107 additions and 72 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name: Yolk - Reusable Docker Build
on:
workflow_call:
inputs:
image_source:
required: false
type: string
image_version:
required: true
type: string
build_name:
required: true
type: string
Expand Down Expand Up @@ -54,17 +60,15 @@ jobs:
username: ${{ secrets.ocr_username }}
password: ${{ secrets.ocr_password }}

- name: Temporary fix
run: |
cd ${{ inputs.build_path }}
cp ../entrypoint.sh .
- uses: docker/build-push-action@v5
with:
context: ${{ inputs.build_path }}
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
build-args: |
BUILD_SOURCE=${{ inputs.image_source }}
BUILD_VERSION=${{ inputs.image_version }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/java-graalvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on:
branches:
- main
paths:
- Java/**
- Java/GraalVM/**
pull_request:
branches:
- main
paths:
- Java/**
- Java/GraalVM/**
workflow_dispatch: {}

jobs:
Expand All @@ -19,7 +19,8 @@ jobs:
uses: ./.github/workflows/docker-build.yml
with:
build_name: ${{ matrix.name }}
build_path: ${{ matrix.path }}
build_path: "Java/GraalVM"
image_version: ${{ matrix.version }}
ocr_login: true
secrets:
ocr_username: ${{ secrets.OCR_USERNAME }}
Expand All @@ -29,8 +30,8 @@ jobs:
matrix:
include:
- name: "graalvm_java_8"
path: "Java/GraalVM/8"
version: "ol9-java8-21"
- name: "graalvm_java_11"
path: "Java/GraalVM/11"
version: "ol9-java11-22"
- name: "graalvm_java_17"
path: "Java/GraalVM/17"
version: "ol9-java17-22"
12 changes: 6 additions & 6 deletions .github/workflows/java-graalvmlz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on:
branches:
- main
paths:
- Java/**
- Java/GraalVM-LZ/**
pull_request:
branches:
- main
paths:
- Java/**
- Java/GraalVM-LZ/**
workflow_dispatch: {}

jobs:
Expand All @@ -19,7 +19,7 @@ jobs:
uses: ./.github/workflows/docker-build.yml
with:
build_name: ${{ matrix.name }}
build_path: ${{ matrix.path }}
build_path: "Java/GraalVM-LZ"
ocr_login: true
secrets:
ocr_username: ${{ secrets.OCR_USERNAME }}
Expand All @@ -29,8 +29,8 @@ jobs:
matrix:
include:
- name: "graalvm_lz_java_8"
path: "Java/GraalVM-LZ/8"
version: "ol9-java8-21"
- name: "graalvm_lz_java_11"
path: "Java/GraalVM-LZ/11"
version: "ol9-java11-22"
- name: "graalvm_lz_java_17"
path: "Java/GraalVM-LZ/17"
version: "ol9-java17-22"
55 changes: 55 additions & 0 deletions .github/workflows/java-temurin-ibm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Java - Temurin & IBM Build

on:
push:
branches:
- main
paths:
- Java/Temurin-IBM-LZ/**
pull_request:
branches:
- main
paths:
- Java/Temurin-IBM-LZ/**
workflow_dispatch: {}

jobs:
build:
name: ${{ matrix.name }}
uses: ./.github/workflows/docker-build.yml
with:
build_name: ${{ matrix.name }}
build_path: "Java/Temurin-IBM-LZ"
image_source: ${{ matrix.source }}
image_version: ${{ matrix.version }}
ocr_login: false

strategy:
matrix:
include:
# Temurin
- name: "temurin_lz_java_8"
source: "eclipse-temurin"
version: "8u312-b07-jdk-focal"
- name: "temurin_lz_java_11"
source: "eclipse-temurin"
version: "11.0.13_8-jdk-focal"
- name: "temurin_lz_java_17"
source: "eclipse-temurin"
version: "17-jdk-jammy"
- name: "temurin_lz_java_21"
source: "eclipse-temurin"
version: "21-jdk-jammy"
# IBM
- name: "ibm_lz_java_8"
source: "ibm-semeru-runtimes"
version: "open-8-jdk"
- name: "ibm_lz_java_11"
source: "ibm-semeru-runtimes"
version: "open-11-jdk"
- name: "ibm_lz_java_17"
source: "ibm-semeru-runtimes"
version: "open-17-jdk"
- name: "ibm_lz_java_21"
source: "ibm-semeru-runtimes"
version: "open-21-jdk"
24 changes: 0 additions & 24 deletions Java/GraalVM-LZ/8/Dockerfile

This file was deleted.

4 changes: 3 additions & 1 deletion Java/GraalVM-LZ/11/Dockerfile → Java/GraalVM-LZ/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ RUN apt-get update && \
cargo build --release && \
chmod +x target/release/lazymc

FROM container-registry.oracle.com/graalvm/jdk-ee:ol9-java11-22
ARG BUILD_SOURCE=container-registry.oracle.com/graalvm/jdk-ee
ARG BUILD_VERSION
FROM ${BUILD_SOURCE}:${BUILD_VERSION}

RUN useradd -d /home/container -m container

Expand Down
12 changes: 0 additions & 12 deletions Java/GraalVM/11/Dockerfile

This file was deleted.

12 changes: 0 additions & 12 deletions Java/GraalVM/8/Dockerfile

This file was deleted.

5 changes: 4 additions & 1 deletion Java/GraalVM/17/Dockerfile → Java/GraalVM/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM busybox as tools
FROM container-registry.oracle.com/graalvm/jdk-ee:ol9-java17-22

ARG BUILD_SOURCE=container-registry.oracle.com/graalvm/jdk-ee
ARG BUILD_VERSION
FROM ${BUILD_SOURCE}:${BUILD_VERSION}

RUN useradd -d /home/container -m container

Expand Down
11 changes: 6 additions & 5 deletions Java/GraalVM-LZ/17/Dockerfile → Java/Temurin-IBM-LZ/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
FROM busybox as tools

FROM rust:buster as lazymc

WORKDIR /lazymc
Expand All @@ -10,15 +8,18 @@ RUN apt-get update && \
cargo build --release && \
chmod +x target/release/lazymc

FROM container-registry.oracle.com/graalvm/jdk-ee:ol9-java17-22
ARG BUILD_SOURCE
ARG BUILD_VERSION
FROM ${BUILD_SOURCE}:${BUILD_VERSION}

RUN useradd -d /home/container -m container
RUN apt-get update -y \
&& apt-get install -y tzdata iproute2 \
&& useradd -d /home/container -m container

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

COPY --from=tools /bin/ip /bin/
COPY --from=lazymc /lazymc/target/release/lazymc /bin/lazymc
COPY entrypoint.sh /entrypoint.sh
CMD [ "/bin/bash", "/entrypoint.sh" ]
17 changes: 17 additions & 0 deletions Java/Temurin-IBM-LZ/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

TZ=${TZ:-UTC}
export TZ

INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-0);exit}')
export INTERNAL_IP

cd /home/container || exit 1

printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0mjava -version\n"
java -version

PARSED=$(echo "${STARTUP}" | sed -e 's/{{/${/g' -e 's/}}/}/g' | eval echo "$(cat -)")

printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0m%s\n" "$PARSED"
exec env ${PARSED}

0 comments on commit f9da1fa

Please sign in to comment.