Skip to content

Commit 4dab192

Browse files
zakkakjerboaa
authored andcommitted
Add README-Mandrel, fix version, and add workflows
1 parent 0cc910a commit 4dab192

File tree

17 files changed

+1582
-11
lines changed

17 files changed

+1582
-11
lines changed

.github/workflows/base-windows.yml

Lines changed: 606 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/base.yml

Lines changed: 661 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/build-quarkus.yml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
name: Build Quarkus
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
artifacts-suffix:
7+
type: string
8+
description: 'The maven repo artifact suffix to use'
9+
default: "null"
10+
build-from-source:
11+
type: boolean
12+
description: 'Build from source or use a release'
13+
default: true
14+
builder-image:
15+
type: string
16+
description: 'The builder image to use instead of a release or building from source (e.g. quay.io/quarkus/ubi-quarkus-mandrel:20.3-java11)'
17+
default: "null"
18+
maven-deploy-local:
19+
type: string
20+
description: 'Build flag controlling whether to deploy maven artifacts locally'
21+
default: ""
22+
target-os:
23+
type: string
24+
description: 'The operating system we are building for (linux or windows)'
25+
default: "linux"
26+
quarkus-repo:
27+
type: string
28+
description: 'The Quarkus repository to be used'
29+
default: 'quarkusio/quarkus'
30+
quarkus-version:
31+
type: string
32+
description: 'Quarkus version to test (branch, tag, commit, or "latest")'
33+
# "latest" is replaced by the latest release available in maven
34+
default: "main"
35+
# Builder image can't be tested on Windows due to https://github.com/actions/virtual-environments/issues/1143
36+
# builder-image:
37+
# description: 'The builder image to use instead of a release or building from source (e.g. quay.io/quarkus/ubi-quarkus-mandrel:20.3-java11)'
38+
# default: "null"
39+
40+
env:
41+
QUARKUS_PATH: quarkus
42+
COMMON_MAVEN_ARGS: "-e -B --settings .github/mvn-settings.xml --fail-at-end"
43+
MANDREL_HOME: ${{ github.workspace }}/mandrelvm
44+
45+
jobs:
46+
build-quarkus:
47+
name: Quarkus build
48+
runs-on: ubuntu-latest
49+
strategy:
50+
fail-fast: false
51+
steps:
52+
- uses: actions/checkout@v4
53+
with:
54+
repository: graalvm/mandrel
55+
fetch-depth: 1
56+
path: workflow-mandrel
57+
- uses: actions/checkout@v4
58+
with:
59+
repository: ${{ inputs.quarkus-repo }}
60+
fetch-depth: 1
61+
ref: ${{ inputs.quarkus-version }}
62+
path: ${{ env.QUARKUS_PATH }}
63+
- uses: actions/cache@v4
64+
with:
65+
path: ~/.m2/repository
66+
key: ${{ inputs.target-os }}-${{ inputs.quarkus-version }}-maven-${{ hashFiles('**/pom.xml') }}
67+
restore-keys: ${{ inputs.target-os }}-${{ inputs.quarkus-version }}-maven-
68+
- name: Change quarkus.version for Quarkus 2.2 to make mandrel-integration-test not apply quarkus_main.patch
69+
# See https://github.com/Karm/mandrel-integration-tests/pull/64
70+
run: |
71+
if [ "${{ inputs.quarkus-version }}" == "2.2" ]
72+
then
73+
cd quarkus
74+
bash ../workflow-mandrel/.github/update_quarkus_version.sh 2.2.999
75+
fi
76+
# Use Java 17 to build Quarkus as that's the lowest supported JDK version currently
77+
- uses: actions/setup-java@v4
78+
with:
79+
distribution: 'temurin'
80+
java-version: '17'
81+
- name: Download GraalVM Maven Repo
82+
if: ${{ inputs.build-from-source == true && inputs.builder-image == 'null' && inputs.maven-deploy-local != ''}}
83+
uses: actions/download-artifact@v4
84+
with:
85+
name: org-graalvm-artefacts-${{ inputs.artifacts-suffix }}
86+
path: .
87+
- name: Download GraalVM Maven Version
88+
if: ${{ inputs.build-from-source == true && inputs.builder-image == 'null' && inputs.maven-deploy-local != ''}}
89+
uses: actions/download-artifact@v4
90+
with:
91+
name: mandrel-maven-version-${{ inputs.artifacts-suffix }}
92+
path: .
93+
- name: Extract GraalVM Maven Repo and GraalVM Maven Version
94+
if: ${{ inputs.build-from-source == true && inputs.builder-image == 'null' && inputs.maven-deploy-local != ''}}
95+
run: |
96+
tar -xzvf graalvm-maven-artefacts.tgz -C ~
97+
tar -xzvf graalvm-version.tgz -C $(dirname ${MANDREL_HOME})
98+
- name: Build quarkus with local graalvm version
99+
if: ${{ inputs.build-from-source == true && inputs.builder-image == 'null' && inputs.maven-deploy-local != ''}}
100+
run: |
101+
rm -f maven_graalvm_before_build.txt maven_graalvm_after_build.txt
102+
find ~/.m2/repository/org/graalvm | sort > maven_graalvm_before_build.txt
103+
GRAAL_MVN_ARTIFACTS_VERS=$(cat ${MANDREL_HOME}/.maven-version)
104+
echo "Building quarkus with locally installed GraalVM maven artefacts in version: ${GRAAL_MVN_ARTIFACTS_VERS}"
105+
cd ${QUARKUS_PATH}
106+
./mvnw ${COMMON_MAVEN_ARGS} -Dquickly -Dgraal-sdk.version="${GRAAL_MVN_ARTIFACTS_VERS}"
107+
cd -
108+
find ~/.m2/repository/org/graalvm | sort > maven_graalvm_after_build.txt
109+
diff -u maven_graalvm_before_build.txt maven_graalvm_after_build.txt
110+
- name: Build quarkus with default graalvm version
111+
if: ${{ inputs.build-from-source == false || inputs.builder-image != 'null' || inputs.maven-deploy-local == ''}}
112+
run: |
113+
cd ${QUARKUS_PATH}
114+
./mvnw ${COMMON_MAVEN_ARGS} -Dquickly
115+
cd -
116+
- name: Tar Maven Repo
117+
if: inputs.target-os != 'windows'
118+
run: |
119+
tar -czvf maven-repo.tgz -C ~ .m2/repository
120+
- name: Tar Maven Repo (windows)
121+
if: inputs.target-os == 'windows'
122+
run: |
123+
tar -I 'pigz -9' -cf maven-repo.tgz -C ~ .m2/repository
124+
- name: Persist Maven Repo
125+
uses: actions/upload-artifact@v4
126+
with:
127+
name: ${{ inputs.target-os }}-maven-repo-${{ inputs.artifacts-suffix }}
128+
path: maven-repo.tgz
129+
- name: Delete Local Quarkus Artifacts From Cache
130+
run: |
131+
rm -r ~/.m2/repository/io/quarkus
132+
- name: Delete Local GraalVM Artifacts From Cache
133+
if: ${{ inputs.build-from-source == true && inputs.builder-image == 'null' && inputs.maven-deploy-local != ''}}
134+
run: |
135+
rm -rf ~/.m2/repository/org/graalvm

.github/workflows/mandrel.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Mandrel-Quarkus tests
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- '.github/workflows/main.yml'
7+
- '.github/workflows/quarkus.yml'
8+
- '**.md'
9+
pull_request:
10+
paths-ignore:
11+
- '.github/workflows/main.yml'
12+
- '.github/workflows/quarkus.yml'
13+
- '**.md'
14+
workflow_dispatch:
15+
16+
# The following aims to reduce CI CPU cycles by:
17+
# 1. Cancelling any previous builds of this PR when pushing new changes to it
18+
# 2. Cancelling any previous builds of a branch when pushing new changes to it in a fork
19+
# 3. Cancelling any pending builds, but not active ones, when pushing to a branch in the main
20+
# repository. This prevents us from constantly cancelling CI runs, while being able to skip
21+
# intermediate builds. E.g., if we perform two pushes the first one will start a CI job and
22+
# the second one will add another one to the queue; if we perform a third push while the
23+
# first CI job is still running the previously queued CI job (for the second push) will be
24+
# cancelled and a new CI job will be queued for the latest (third) push.
25+
concurrency:
26+
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}"
27+
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'graalvm/mandrel' }}
28+
29+
jobs:
30+
q-main-ea:
31+
name: "Q main M 25.0 EA"
32+
uses: ./.github/workflows/base.yml
33+
with:
34+
quarkus-version: "main"
35+
repo: ${{ github.repository }}
36+
version: ${{ github.ref }}
37+
mandrel-packaging-version: "25.0"
38+
jdk: "25/ea"
39+
q-main-ea-win:
40+
name: "Q main M 25.0 windows EA"
41+
uses: ./.github/workflows/base-windows.yml
42+
with:
43+
quarkus-version: "main"
44+
repo: ${{ github.repository }}
45+
version: ${{ github.ref }}
46+
mandrel-packaging-version: "25.0"
47+
jdk: "25/ea"
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Native tests stats upload
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
artifacts-suffix:
7+
type: string
8+
description: 'The stats artifact suffix to download'
9+
default: "null"
10+
build-stats-tag:
11+
type: string
12+
description: 'The tag to use for build stats upload of native tests (e.g. 22.3.0-dev-jdk17-mytest-patch-before)'
13+
default: "null"
14+
category:
15+
type: string
16+
description: 'The native integration test category to upload stats for'
17+
default: "null"
18+
secrets:
19+
UPLOAD_COLLECTOR_TOKEN:
20+
description: 'A token used to report build statistics to a collector'
21+
required: false
22+
23+
jobs:
24+
native-tests-stats-upload:
25+
name: Upload build stats to collector
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
with:
30+
repository: graalvm/mandrel
31+
fetch-depth: 1
32+
path: workflow-mandrel
33+
- uses: actions/download-artifact@v4
34+
with:
35+
name: build-stats-${{inputs.category}}-${{ inputs.artifacts-suffix }}
36+
path: .
37+
- name: Extract and import build stats
38+
env:
39+
BUILD_STATS_TAG: ${{ inputs.build-stats-tag }}
40+
UPLOAD_TOKEN: ${{ secrets.UPLOAD_COLLECTOR_TOKEN }}
41+
COLLECTOR_URL: https://collector.foci.life/api/v1/image-stats
42+
shell: bash
43+
run: |
44+
tar -xf build-stats.tgz
45+
echo "Tag for stat upload is going to be: '${BUILD_STATS_TAG}'"
46+
DIR=quarkus/ TAG="${BUILD_STATS_TAG}" TOKEN="${UPLOAD_TOKEN}" URL="${COLLECTOR_URL}" bash workflow-mandrel/.github/import_stats.sh

README-Mandrel.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Mandrel
2+
3+
Mandrel is [a downstream distribution of the GraalVM community edition](https://developers.redhat.com/blog/2020/06/05/mandrel-a-community-distribution-of-graalvm-for-the-red-hat-build-of-quarkus/).
4+
Mandrel's main goal is to provide a `native-image` release specifically to support [Quarkus](https://quarkus.io).
5+
The aim is to align the `native-image` capabilities from GraalVM with OpenJDK and Red Hat Enterprise Linux libraries to improve maintainability for native Quarkus applications.
6+
Mandrel can best be described as a distribution of a regular OpenJDK with a specially packaged GraalVM Native Image builder (`native-image`).
7+
8+
## How Does Mandrel Differ From Graal
9+
10+
Mandrel releases are built from a code base derived from the upstream GraalVM code base, with only minor changes but some significant exclusions.
11+
A full distribution of GraalVM is much more than `native-image`: it has polyglot support, the Truffle framework which allows for efficient implementation of interpreters, an LLVM compiler back end for native image, the libgraal JIT compiler as a replacement for Hotspot’s C2 server compiler and much more.
12+
Mandrel is the small subset of that functionality we support for the `native-image` use-case.
13+
14+
Mandrel's `native-image` also doesn't include the following features:
15+
* The experimental image-build server, i.e., the `--experimental-build-server` option.
16+
* The LLVM backend, i.e., the `-H:CompilerBackend=llvm` option.
17+
* The musl libc implementation, i.e., the `--libc=musl` option.
18+
* Support for generating static native images, i.e., the `--static` option.
19+
* Support for non JVM-based languages and polyglot, i.e., the `--language:<languageId>` option.
20+
21+
Mandrel is also built slightly differently to GraalVM, using the standard OpenJDK project release of jdk25u.
22+
This means it does not profit from a few small enhancements that Oracle have added to the version of OpenJDK used to build their own GraalVM downloads.
23+
Most of these enhancements are to the JVMCI module that allows the Graal compiler to be run inside OpenJDK.
24+
The others are small cosmetic changes to behaviour.
25+
These enhancements may in some cases cause minor differences in the progress of native image generation.
26+
They should not cause the resulting images themselves to execute in a noticeably different manner.
27+
28+
## Communication Channels
29+
30+
* [Slack](https://www.graalvm.org/slack-invitation) - Join `#mandrel` channel at graalvm's slack workspace
31+
* [[email protected]](mailto:[email protected]?subject=[MANDREL]) mailing list - Subscribe [here](https://oss.oracle.com/mailman/listinfo/graalvm-dev)
32+
* [GitHub issues](https://github.com/graalvm/mandrel/issues) for bug reports, questions, or requests for enhancements.
33+
34+
Please report security vulnerabilities according to the [Reporting Vulnerabilities guide](https://www.oracle.com/corporate/security-practices/assurance/vulnerability/reporting.html).
35+
36+
## Getting Started
37+
38+
Mandrel distributions can be downloaded from [the repository's releases](https://github.com/graalvm/mandrel/releases)
39+
and container images are available at [quay.io](https://quay.io/repository/quarkus/ubi-quarkus-mandrel-builder-image?tag=latest&tab=tags).
40+
41+
### Prerequisites
42+
43+
Mandrel's `native-image` depends on the following packages:
44+
* freetype-devel
45+
* gcc
46+
* glibc-devel
47+
* libstdc++-static
48+
* zlib-devel
49+
50+
On Fedora/CentOS/RHEL they can be installed with:
51+
```bash
52+
dnf install glibc-devel zlib-devel gcc freetype-devel libstdc++-static
53+
```
54+
55+
**Note**: The package might be called `glibc-static` or `libstdc++-devel` instead of `libstdc++-static` depending on your system.
56+
If the system is missing stdc++, `gcc-c++` package is needed too.
57+
58+
On Ubuntu-like systems with:
59+
```bash
60+
apt install g++ zlib1g-dev libfreetype6-dev
61+
```
62+
63+
## Building Mandrel From Source
64+
65+
For building Mandrel from source please see [mandrel-packaging](https://github.com/graalvm/mandrel-packaging)
66+
and consult [Repository Structure in CONTRIBUTING.md](CONTRIBUTING.md#repository-structure) regarding which branch of Mandrel to use.
67+
68+
# Community
69+
Empowering Software Development with Works on Arm Initiative
70+
![Works on Arm logo](img/works_on_arm_900x77.png)
71+
[Works on Arm](https://www.arm.com/solutions/infrastructure/works-on-arm) is a strategic initiative to enable and accelerate the
72+
software ecosystem for Arm64.
73+
74+
[GraalVM's](https://www.graalvm.org/) [Mandrel](https://github.com/graalvm/mandrel) distribution that
75+
powers [Quarkus Native](https://quarkus.io/guides/building-native-image) proudly counts itself among the libraries and
76+
tools that successfully leveraged the resources from Works on Arm.

compiler/mx.compiler/suite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"sourceinprojectwhitelist" : [],
55

66
"groupId" : "org.graalvm.compiler",
7-
"version" : "25.0.0",
7+
"version" : "25.0.0.0",
88
"release" : False,
99
"url" : "http://www.graalvm.org/",
1010
"developer" : {

espresso-shared/mx.espresso-shared/suite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
suite = {
2626
"mxversion": "7.38.0",
2727
"name": "espresso-shared",
28-
"version" : "25.0.0",
28+
"version" : "25.0.0.0",
2929
"release" : False,
3030
"groupId" : "org.graalvm.espresso",
3131
"url" : "https://www.graalvm.org/reference-manual/java-on-truffle/",

espresso/mx.espresso/suite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
suite = {
2525
"mxversion": "7.46.0",
2626
"name": "espresso",
27-
"version" : "25.0.0",
27+
"version" : "25.0.0.0",
2828
"release" : False,
2929
"groupId" : "org.graalvm.espresso",
3030
"url" : "https://www.graalvm.org/reference-manual/java-on-truffle/",

regex/mx.regex/suite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
"name" : "regex",
4545

46-
"version" : "25.0.0",
46+
"version" : "25.0.0.0",
4747
"release" : False,
4848
"groupId" : "org.graalvm.regex",
4949
"url" : "http://www.graalvm.org/",

0 commit comments

Comments
 (0)