Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graalvm static build with musl + windows build #401

Merged
merged 31 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ddd062b
Enable MUSL support in GraalVM build
satran004 Nov 18, 2024
e97dad7
Update native-image properties for static Musl build
satran004 Nov 18, 2024
4ef3cec
Update CI workflow and native-image properties
satran004 Nov 18, 2024
d5ff5fc
Add x86-64 architecture flag to native image properties
satran004 Nov 18, 2024
0dcbe5d
Add x86-64 architecture flag to native image properties
satran004 Nov 18, 2024
c10005c
Update version extraction for platform compatibility
satran004 Nov 18, 2024
ee10b16
Fix profile suffix setting for Windows runners
satran004 Nov 18, 2024
fb9f845
Disable dynamic version retrieval for Windows in CI
satran004 Nov 18, 2024
0449a96
Disable dynamic version retrieval for Windows in CI
satran004 Nov 18, 2024
4acdf48
Disable dynamic version retrieval for Windows in CI
satran004 Nov 18, 2024
82e101f
Disable dynamic version retrieval for Windows in CI
satran004 Nov 18, 2024
f09a416
Remove duplicate Gradle version parameter
satran004 Nov 18, 2024
52cb787
Remove duplicate Gradle version parameter
satran004 Nov 18, 2024
463019b
Add native-image properties for Windows CI
satran004 Nov 18, 2024
39204e2
Update workflow to focus on Windows platform
satran004 Nov 18, 2024
b6593e1
Refactor version extraction for consistency
satran004 Nov 18, 2024
05001b2
Refactor profile suffix setting in workflow
satran004 Nov 18, 2024
0a53fef
Refactor profile suffix setting in workflow
satran004 Nov 18, 2024
b0eead5
Refactor profile suffix setting in workflow
satran004 Nov 18, 2024
68294c4
Refactor profile suffix setting in workflow
satran004 Nov 18, 2024
fcc8f8f
Refactor profile suffix setting in workflow
satran004 Nov 18, 2024
64e0f13
Refactor profile suffix setting in workflow
satran004 Nov 18, 2024
105881d
Refactor profile suffix setting in workflow
satran004 Nov 18, 2024
0369f34
Refactor profile suffix setting in workflow
satran004 Nov 18, 2024
b3f45e0
Refactor profile suffix setting in workflow
satran004 Nov 18, 2024
6a892d5
Update GraalVM version in CI workflow
satran004 Nov 19, 2024
ff07089
Refactor CI workflow to separate musl builds.
satran004 Nov 19, 2024
941aefa
Add new build jobs and update version
satran004 Nov 19, 2024
5f77a82
Update native-image properties for static linking
satran004 Nov 19, 2024
1efd201
Downgrade GraalVM version and update native image args
satran004 Nov 19, 2024
61ccd75
Downgrade GraalVM version and update native image args
satran004 Nov 19, 2024
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
119 changes: 112 additions & 7 deletions .github/workflows/dev_release_native.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: Build and Upload Yaci Store Zip
name: Dev Build and Upload Yaci Store Zip

on:
workflow_dispatch:

jobs:
buildAndUpload:
buildAndUpload-mostly-static:
strategy:
matrix:
# os: ["ubuntu-20.04", "macos-14"]
os: ["ubuntu-20.04", "macOS", "macos-13"]
profile: ["n2c", ""]
# os: ["ubuntu-20.04", "macos-14"]
os: [ "ubuntu-20.04", "macOS", "macos-13" ]
profile: [ "n2c", "" ]
runs-on: ${{ matrix.os }}
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
Expand All @@ -22,15 +22,15 @@ jobs:
java-version: '21'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
version: '21.0.4'
version: '21.0.5'
native-image-job-reports: 'true'
- name: Get Version from gradle.properties
run: |
VERSION=$(grep "version=" gradle.properties | cut -d'=' -f2 | xargs)
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Copy CI specific native-image properties
- name: Copy CI specific native-image properties and env setup
if: runner.os == 'Linux'
run: |
echo "os_prefix=linux" >> $GITHUB_ENV
Expand All @@ -55,3 +55,108 @@ jobs:
with:
name: yaci-store-${{ env.VERSION }}-${{ env.os_prefix }}-${{ env.arch }}${{ env.PROFILE_SUFFIX }}
path: ./applications/all/build/output/yaci-store-${{ env.VERSION }}-${{ env.os_prefix }}-${{ env.arch }}${{ env.PROFILE_SUFFIX }}.zip

buildAndUpload-musl:
strategy:
matrix:
# os: ["ubuntu-20.04", "macos-14"]
os: ["ubuntu-20.04"]
profile: ["n2c", ""]
runs-on: ${{ matrix.os }}
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
FORCE_COLOR: 1
steps:
- uses: actions/checkout@v4
- uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
version: '21.0.5'
native-image-musl: true
native-image-job-reports: 'true'
- name: Get Version from gradle.properties
run: |
VERSION=$(grep "version=" gradle.properties | cut -d'=' -f2 | xargs)
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Copy CI specific native-image properties and env setup
if: runner.os == 'Linux'
run: |
echo "os_prefix=linux" >> $GITHUB_ENV
cp applications/all/src/main/resources/META-INF/native-image/yaci-store-all/native-image.properties.musl applications/all/src/main/resources/META-INF/native-image/yaci-store-all/native-image.properties
- name: MacOS specific env
if: runner.os == 'macOS'
run: |
echo "os_prefix=macos" >> $GITHUB_ENV
- name: Set lowercase architecture
run: echo "arch=$(echo ${{ runner.arch }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Set Profile Suffix
run: |
if [ -n "${{ matrix.profile }}" ]; then
echo "PROFILE_SUFFIX=-${{ matrix.profile }}" >> $GITHUB_ENV
else
echo "PROFILE_SUFFIX=" >> $GITHUB_ENV
fi
- name: Build with Gradle
run: ./gradlew --no-daemon -i -Pversion=${{ env.VERSION }} -Pprofile=${{ matrix.profile }} clean cliZip
- name: Copy artifacts
run: mv applications/all/build/output/yaci-store-*.zip applications/all/build/output/yaci-store-${{ env.VERSION }}-${{ env.os_prefix }}-musl-${{ env.arch }}${{ env.PROFILE_SUFFIX }}.zip
- uses: actions/upload-artifact@v4
with:
name: yaci-store-${{ env.VERSION }}-${{ env.os_prefix }}-musl-${{ env.arch }}${{ env.PROFILE_SUFFIX }}
path: ./applications/all/build/output/yaci-store-${{ env.VERSION }}-${{ env.os_prefix }}-musl-${{ env.arch }}${{ env.PROFILE_SUFFIX }}.zip

windowBuild:
strategy:
matrix:
profile: ["n2c", ""]
runs-on: windows-latest
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
FORCE_COLOR: 1
steps:
- uses: actions/checkout@v4
- uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
version: '21.0.5'
native-image-job-reports: 'true'
- name: Extract version (Windows)
shell: pwsh
run: |
$VERSION = (Get-Content gradle.properties | Where-Object { $_ -match "^version=" } | ForEach-Object { $_.Split('=')[1].Trim() })
echo "VERSION=$VERSION" >> $env:GITHUB_ENV
- name: Set Profile Suffix
shell: pwsh
run: |
if ("${{ matrix.profile }}" -ne "") {
Add-Content -Path $env:GITHUB_ENV -Value "PROFILE_SUFFIX=-${{ matrix.profile }}"
} else {
Add-Content -Path $env:GITHUB_ENV -Value "PROFILE_SUFFIX="
}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Windows specific env
run: |
echo "os_prefix=win" >> $GITHUB_ENV
copy applications\all\src\main\resources\META-INF\native-image\yaci-store-all\native-image.properties.win applications\all\src\main\resources\META-INF\native-image\yaci-store-all\native-image.properties
- name: Set lowercase architecture
shell: pwsh
run: |
$arch = "${{ runner.arch }}".ToLower()
Add-Content -Path $env:GITHUB_ENV -Value "arch=$arch"
- name: Build with Gradle
run: ./gradlew --no-daemon -i -Pprofile=${{ matrix.profile }} clean cliZip
- name: Copy artifacts
run: mv applications/all/build/output/yaci-store-*.zip applications/all/build/output/yaci-store-${{ env.VERSION }}-windows-${{ env.arch }}${{ env.PROFILE_SUFFIX }}.zip
- uses: actions/upload-artifact@v4
with:
name: yaci-store-${{ env.VERSION }}-windows-${{ env.arch }}${{ env.PROFILE_SUFFIX }}
path: ./applications/all/build/output/yaci-store-${{ env.VERSION }}-windows-${{ env.arch }}${{ env.PROFILE_SUFFIX }}.zip
125 changes: 119 additions & 6 deletions .github/workflows/release_native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ on:
- 'rel-graal-*'

jobs:
buildAndUpload:
buildAndUpload-mostly-static:
strategy:
matrix:
# os: ["ubuntu-20.04", "macos-14"]
os: ["ubuntu-20.04", "macOS", "macos-13"]
profile: ["n2c", ""]
os: [ "ubuntu-20.04", "macOS", "macos-13" ]
profile: [ "n2c", "" ]
runs-on: ${{ matrix.os }}
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
Expand All @@ -24,15 +23,15 @@ jobs:
java-version: '21'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
version: '21.0.4'
version: '21.0.5'
native-image-job-reports: 'true'
- name: Get Version from gradle.properties
run: |
VERSION=$(grep "version=" gradle.properties | cut -d'=' -f2 | xargs)
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Copy CI specific native-image properties
- name: Copy CI specific native-image properties and env setup
if: runner.os == 'Linux'
run: |
echo "os_prefix=linux" >> $GITHUB_ENV
Expand Down Expand Up @@ -62,3 +61,117 @@ jobs:
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

buildAndUpload-musl:
strategy:
matrix:
os: ["ubuntu-20.04"]
profile: ["n2c", ""]
runs-on: ${{ matrix.os }}
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
FORCE_COLOR: 1
steps:
- uses: actions/checkout@v4
- uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
version: '21.0.5'
native-image-musl: true
native-image-job-reports: 'true'
- name: Get Version from gradle.properties
run: |
VERSION=$(grep "version=" gradle.properties | cut -d'=' -f2 | xargs)
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Copy CI specific native-image properties and env setup
if: runner.os == 'Linux'
run: |
echo "os_prefix=linux" >> $GITHUB_ENV
cp applications/all/src/main/resources/META-INF/native-image/yaci-store-all/native-image.properties.musl applications/all/src/main/resources/META-INF/native-image/yaci-store-all/native-image.properties
- name: MacOS specific env
if: runner.os == 'macOS'
run: |
echo "os_prefix=macos" >> $GITHUB_ENV
- name: Set lowercase architecture
run: echo "arch=$(echo ${{ runner.arch }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Set Profile Suffix
run: |
if [ -n "${{ matrix.profile }}" ]; then
echo "PROFILE_SUFFIX=-${{ matrix.profile }}" >> $GITHUB_ENV
else
echo "PROFILE_SUFFIX=" >> $GITHUB_ENV
fi
- name: Build with Gradle
run: ./gradlew --no-daemon -i -Pversion=${{ env.VERSION }} -Pprofile=${{ matrix.profile }} clean cliZip
- name: Copy artifacts
run: mv applications/all/build/output/yaci-store-*.zip applications/all/build/output/yaci-store-${{ env.VERSION }}-${{ env.os_prefix }}-musl-${{ env.arch }}${{ env.PROFILE_SUFFIX }}.zip
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
applications/all/build/output/yaci-store-${{ env.VERSION }}-${{ env.os_prefix }}-musl-${{ env.arch }}${{ env.PROFILE_SUFFIX }}.zip
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

windowBuild:
strategy:
matrix:
profile: ["n2c", ""]
runs-on: windows-latest
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
FORCE_COLOR: 1
steps:
- uses: actions/checkout@v4
- uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
version: '21.0.5'
native-image-job-reports: 'true'
- name: Extract version (Windows)
shell: pwsh
run: |
$VERSION = (Get-Content gradle.properties | Where-Object { $_ -match "^version=" } | ForEach-Object { $_.Split('=')[1].Trim() })
echo "VERSION=$VERSION" >> $env:GITHUB_ENV
- name: Set Profile Suffix
shell: pwsh
run: |
if ("${{ matrix.profile }}" -ne "") {
Add-Content -Path $env:GITHUB_ENV -Value "PROFILE_SUFFIX=-${{ matrix.profile }}"
} else {
Add-Content -Path $env:GITHUB_ENV -Value "PROFILE_SUFFIX="
}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Windows specific env
run: |
echo "os_prefix=win" >> $GITHUB_ENV
copy applications\all\src\main\resources\META-INF\native-image\yaci-store-all\native-image.properties.win applications\all\src\main\resources\META-INF\native-image\yaci-store-all\native-image.properties
- name: Set lowercase architecture
shell: pwsh
run: |
$arch = "${{ runner.arch }}".ToLower()
Add-Content -Path $env:GITHUB_ENV -Value "arch=$arch"
- name: Build with Gradle
run: ./gradlew --no-daemon -i -Pprofile=${{ matrix.profile }} clean cliZip
- name: Copy artifacts
run: mv applications/all/build/output/yaci-store-*.zip applications/all/build/output/yaci-store-${{ env.VERSION }}-windows-${{ env.arch }}${{ env.PROFILE_SUFFIX }}.zip
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
applications/all/build/output/yaci-store-${{ env.VERSION }}-windows-${{ env.arch }}${{ env.PROFILE_SUFFIX }}.zip
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Args = -H:+StaticExecutableWithDynamicLibC --initialize-at-run-time=io.netty.channel.epoll.Epoll \
Args = -H:+StaticExecutableWithDynamicLibC -march=compatibility --initialize-at-run-time=io.netty.channel.epoll.Epoll \
--initialize-at-run-time=io.netty.channel.epoll.Native \
--initialize-at-run-time=io.netty.channel.epoll.EpollEventLoop \
--initialize-at-run-time=io.netty.channel.epoll.EpollEventArray \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Args = --static --libc=musl -march=compatibility --initialize-at-run-time=io.netty.channel.epoll.Epoll \
--initialize-at-run-time=io.netty.channel.epoll.Native \
--initialize-at-run-time=io.netty.channel.epoll.EpollEventLoop \
--initialize-at-run-time=io.netty.channel.epoll.EpollEventArray \
--initialize-at-run-time=io.netty.channel.DefaultFileRegion \
--initialize-at-run-time=io.netty.channel.kqueue.KQueueEventArray \
--initialize-at-run-time=io.netty.channel.kqueue.KQueueEventLoop \
--initialize-at-run-time=io.netty.channel.kqueue.Native \
--initialize-at-run-time=io.netty.channel.unix.Errors \
--initialize-at-run-time=io.netty.channel.unix.IovArray \
--initialize-at-run-time=io.netty.channel.unix.Limits \
--initialize-at-run-time=io.netty.util.internal.logging.Log4JLogger \
--initialize-at-run-time=io.netty.channel.kqueue.KQueue \
--initialize-at-run-time=io.netty.handler.ssl.BouncyCastleAlpnSslUtils
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Args = --static --libc=musl --initialize-at-run-time=io.netty.channel.epoll.Epoll \
Args = -march=compatibility --initialize-at-run-time=io.netty.channel.epoll.Epoll \
--initialize-at-run-time=io.netty.channel.epoll.Native \
--initialize-at-run-time=io.netty.channel.epoll.EpollEventLoop \
--initialize-at-run-time=io.netty.channel.epoll.EpollEventArray \
Expand Down