Skip to content

Commit

Permalink
rewrite dragonwell11 ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Accelerator1996 committed Mar 6, 2024
1 parent 0d5b44a commit 1f63552
Show file tree
Hide file tree
Showing 8 changed files with 527 additions and 404 deletions.
102 changes: 102 additions & 0 deletions .github/actions/build-serverless-adapter/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#
## Copyright (c) 2019 Alibaba Group Holding Limited. All Rights Reserved.
## DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
##
## This code is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License version 2 only, as
## published by the Free Software Foundation. Alibaba designates this
## particular file as subject to the "Classpath" exception as provided
## by Oracle in the LICENSE file that accompanied this code.
##
## This code is distributed in the hope that it will be useful, but WITHOUT
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
## version 2 for more details (a copy is included in the LICENSE file that
## accompanied this code).
##
## You should have received a copy of the GNU General Public License version
## 2 along with this work; if not, write to the Free Software Foundation,
## Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
##

name: 'Build serverless-adapter'
description: 'Build it using built JDK'
inputs:
platform:
description: 'Platform name'
required: true
debug-suffix:
description: 'File name suffix denoting debug level, possibly empty'
required: false

runs:
using: composite
steps:
- name: 'Found bundle'
id: bundle_found
run: |
# Only support linux now.
jdk_bundle_tar_gz="$(ls build/*/bundles/jdk-*_bin${{ inputs.debug-suffix }}.tar.gz 2> /dev/null || true)"
if [[ "$jdk_bundle_tar_gz" != "" ]]; then
jdk_bundle_name=${jdk_bundle_tar_gz##*/}
echo "jdk_pkg=$jdk_bundle_tar_gz" >> $GITHUB_OUTPUT
echo "jdk_pkg_name=$jdk_bundle_name" >> $GITHUB_OUTPUT
echo "decompress_cmd=tar zxf" >> $GITHUB_OUTPUT
echo "decompress_redirect_flag=-C" >> $GITHUB_OUTPUT
echo "decompress_extra_cmd=--strip-components=1" >> $GITHUB_OUTPUT
echo "compress_cmd=tar zcf" >> $GITHUB_OUTPUT
else
echo "jdk_pkg=" >> $GITHUB_OUTPUT
echo "jdk_pkg_name=" >> $GITHUB_OUTPUT
echo "decompress_cmd=" >> $GITHUB_OUTPUT
echo "decompress_redirect_flag=" >> $GITHUB_OUTPUT
echo "decompress_extra_cmd=" >> $GITHUB_OUTPUT
echo "compress_cmd=" >> $GITHUB_OUTPUT
fi
echo "jdk_pkg: $jdk_pkg"
echo "jdk_pkg_name: $jdk_pkg_name"
shell: bash

- name: 'Bundle decompression'
id: bundle_decompress
run: |
mkdir -p bundle_workdir
${{ steps.bundle_found.outputs.decompress_cmd }} ${{ steps.bundle_found.outputs.jdk_pkg }} ${{ steps.bundle_found.outputs.decompress_redirect_flag }} bundle_workdir ${{ steps.bundle_found.outputs.decompress_extra_cmd }}
java_path="$(ls bundle_workdir/bin/java 2> /dev/null || true)"
ls -l
ls -l bundle_workdir
java_home=${java_path%%'/bin'*}
echo "path=bundle_workdir" >> $GITHUB_OUTPUT
echo "java_home=$java_home" >> $GITHUB_OUTPUT
shell: bash
if: steps.bundle_found.outputs.jdk_pkg != '' && steps.bundle_found.outputs.decompress_cmd != ''

- name: 'Checkout serverless-adapter source code'
id: serverless_adapter_checkout
uses: actions/checkout@v3
with:
repository: dragonwell-project/serverless-adapter
ref: main
path: serverless-adapter

- name: 'Build serverless-adapter'
id: serverless_adapter_build
run: |
JAVA_HOME=${{ steps.bundle_decompress.outputs.java_home }};PATH=${{ steps.bundle_decompress.outputs.java_home }}/bin:${{ env.PATH }} mvn package
shell: bash
working-directory: serverless-adapter

- name: 'Copy serverless-adapter into boot jdk'
run: |
mkdir -p ${{ steps.bundle_decompress.outputs.java_home }}/lib/serverless
cp -f serverless-adapter/target/serverless-adapter-0.1.jar ${{ steps.bundle_decompress.outputs.java_home }}/lib/serverless/serverless-adapter.jar
cp -f serverless-adapter/output/libloadclassagent.so ${{ steps.bundle_decompress.outputs.java_home }}/lib/serverless/libloadclassagent.so
shell: bash

- name: 'Regenerate bundle'
run: |
cd ${{ steps.bundle_decompress.outputs.java_home }}
${{ steps.bundle_found.outputs.compress_cmd }} ${{ steps.bundle_found.outputs.jdk_pkg_name }} *
mv -f ${{ steps.bundle_found.outputs.jdk_pkg_name }} ${{ steps.bundle_found.outputs.jdk_pkg }}
shell: bash
2 changes: 2 additions & 0 deletions .github/actions/config/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ runs:
# Extract value from configuration file
value="$(grep -h ${{ inputs.var }}= make/conf/github-actions.conf | cut -d '=' -f 2-)"
echo "value=$value" >> $GITHUB_OUTPUT
dragonwell_value="$(grep -h ${{ inputs.var }}= make/conf/test-dependencies | cut -d '=' -f 2-)"
echo "value=$value" >> $GITHUB_OUTPUT
shell: bash
13 changes: 11 additions & 2 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
- name: 'Checkout the JDK source'
uses: actions/checkout@v4

- name: 'Get the BootJDK'
- name: 'Get boot JDK'
id: bootjdk
uses: ./.github/actions/get-bootjdk
with:
Expand All @@ -107,7 +107,7 @@ jobs:
fi
sudo apt-get update
sudo apt-get install --only-upgrade apt
sudo apt-get install gcc-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} g++-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }}
sudo apt-get install gcc-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} g++-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }} tar
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ inputs.gcc-major-version }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ inputs.gcc-major-version }}
- name: 'Configure'
Expand All @@ -116,6 +116,7 @@ jobs:
--with-conf-name=${{ inputs.platform }}
${{ matrix.flags }}
--with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA}
--with-version-build=0
--with-boot-jdk=${{ steps.bootjdk.outputs.path }}
--with-jtreg=${{ steps.jtreg.outputs.path }}
--enable-jtreg-failure-handler
Expand All @@ -133,6 +134,14 @@ jobs:
platform: ${{ inputs.platform }}
debug-suffix: '${{ matrix.suffix }}'

- name: 'Build serverless-adapter'
id: build-serverless-adapter
uses: ./.github/actions/build-serverless-adapter
with:
platform: ${{ inputs.platform }}
debug-suffix: '${{ matrix.suffix }}'
# if: ${{ matrix.suffix }} == ''

- name: 'Upload bundles'
uses: ./.github/actions/upload-bundles
with:
Expand Down
174 changes: 107 additions & 67 deletions .github/workflows/check_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,91 +19,131 @@
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#

name: Dragonwell_11_build_test
name: Prerequisites

on: [pull_request]
on:
workflow_call:
inputs:
platforms:
required: true
type: string

jobs:
check_commit:
name: 'Check Commit Message'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dragonwell-releng/check_commit_action@master
if: github.event_name == 'pull_request'

build_release_amd64_jdk:
prerequisites:
name: 'Prerequisites'
runs-on: ubuntu-latest
container:
image: docker.io/alibabadragonwelljdk/build_jdk:11-latest
outputs:
should_run: ${{ steps.check_submit.outputs.should_run }}
bundle_id: ${{ steps.check_bundle_id.outputs.bundle_id }}
jdk_version: ${{ steps.check_jdk_versions.outputs.jdk_version }}
platform_linux_x64: ${{ steps.check_platforms.outputs.platform_linux_x64 }}
platform_linux_aarch64: ${{ steps.check_platforms.outputs.platform_linux_aarch64 }}
platform_windows_x64: ${{ steps.check_platforms.outputs.platform_windows_x64 }}
dependencies: ${{ steps.check_deps.outputs.dependencies }}

steps:
- uses: actions/checkout@v2
- name: Compile release mode on amd64
run: |
chmod 755 configure
bash make.sh release
- name: 'Check if submit tests should actually run depending on secrets and manual triggering'
id: check_submit
run: echo "::set-output name=should_run::${{ github.event.inputs.platforms != '' || (!secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/')) }}"

- name: Sanity test
- name: 'Check which platforms should be included'
id: check_platforms
run: |
TEST_JDK_HOME=build/linux-x86_64-normal-server-release/images/jdk
${TEST_JDK_HOME}/bin/java -version
echo "::set-output name=platform_linux_x64::${{ contains(github.event.inputs.platforms, 'linux x64') || (github.event.inputs.platforms == '') }}"
echo "::set-output name=platform_linux_aarch64::${{ contains(github.event.inputs.platforms, 'linux aarch64') || (github.event.inputs.platforms == '') }}"
echo "::set-output name=platform_windows_x64::${{ contains(github.event.inputs.platforms, 'windows x64') || (github.event.inputs.platforms == '') }}"
if: steps.check_submit.outputs.should_run != 'false'

build_release_arm64_jdk:
runs-on: [self-hosted , ARM64]
container:
image: docker.io/alibabadragonwelljdk/build_jdk:11-latest
steps:
- uses: actions/checkout@v2
- name: Compile release mode on arm64
run: |
chmod 755 configure
bash make.sh release
- name: 'Determine unique bundle identifier'
id: check_bundle_id
run: echo "::set-output name=bundle_id::${GITHUB_ACTOR}_${GITHUB_SHA:0:8}"
if: steps.check_submit.outputs.should_run != 'false'

- name: Sanity test
run: |
TEST_JDK_HOME=build/linux-aarch64-normal-server-release/images/jdk
${TEST_JDK_HOME}/bin/java -version
- name: 'Checkout the source'
uses: actions/checkout@v3
with:
path: jdk
if: steps.check_submit.outputs.should_run != 'false'

build_fastdebug_amd64_jdk:
runs-on: ubuntu-latest
container:
image: docker.io/alibabadragonwelljdk/build_jdk:11-latest
steps:
- uses: actions/checkout@v2
- name: Compile slowdebug mode
run: |
chmod 755 configure
bash make.sh fastdebug
- name: 'Determine versions and locations to be used for dependencies'
id: check_deps
run: "echo ::set-output name=dependencies::`cat make/autoconf/version-numbers make/conf/test-dependencies | sed -e '1i {' -e 's/#.*//g' -e 's/\"//g' -e 's/\\(.*\\)=\\(.*\\)/\"\\1\": \"\\2\",/g' -e '$s/,\\s\\{0,\\}$/\\}/'`"
working-directory: jdk
if: steps.check_submit.outputs.should_run != 'false'

- name: Sanity test
run: |
TEST_JDK_HOME=build/linux-x86_64-normal-server-fastdebug/images/jdk
${TEST_JDK_HOME}/bin/java -version
- name: 'Print extracted dependencies to the log'
run: "echo '${{ steps.check_deps.outputs.dependencies }}'"
if: steps.check_submit.outputs.should_run != 'false'

build_slowdebug_amd64_jdk:
runs-on: ubuntu-latest
container:
image: docker.io/alibabadragonwelljdk/build_jdk:11-latest
steps:
- uses: actions/checkout@v2
- name: Compile slowdebug mode
- name: 'Determine full JDK versions'
id: check_jdk_versions
shell: bash
run: |
chmod 755 configure
bash make.sh debug
FEATURE=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_FEATURE }}
INTERIM=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_INTERIM }}
UPDATE=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_UPDATE }}
PATCH=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_PATCH }}
if [ "x${PATCH}" != "x0" ]; then
V=${FEATURE}.${INTERIM}.${UPDATE}.${PATCH}
elif [ "x${UPDATE}" != "x0" ]; then
V=${FEATURE}.${INTERIM}.${UPDATE}
elif [ "x${INTERIM}" != "x0" ]; then
V={FEATURE}.${INTERIM}
else
V=${FEATURE}
fi
echo "::set-output name=jdk_version::${V}"
if: steps.check_submit.outputs.should_run != 'false'

- name: Sanity test
run: |
TEST_JDK_HOME=build/linux-x86_64-normal-server-slowdebug/images/jdk
${TEST_JDK_HOME}/bin/java -version
#- name: 'Determine the jtreg ref to checkout'
# run: "echo JTREG_REF=jtreg-${{ fromJson(steps.check_deps.outputs.dependencies).JTREG_VERSION }} >> $GITHUB_ENV"
# if: steps.check_submit.outputs.should_run != 'false'

build_release_riscv_jdk:
runs-on: [self-hosted , X64]
container:
image: docker.io/alibabadragonwelljdk/centos7_gcc7_build_image:latest
steps:
- uses: actions/checkout@v2
- name: Compile release mode riscv jdk
run: |
chmod 755 configure
LD_LIBRARY_PATH=/opt/riscv_toolchain_linux/lib64 \
PATH=/opt/riscv_toolchain_linux/bin:/usr/local/gcc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
bash configure --verbose --with-vendor-name=Alibaba --with-vendor-url=http://www.alibabagroup.com --with-vendor-bug-url='mailto:[email protected]' --with-vendor-vm-bug-url='mailto:[email protected]' --with-vendor-name=Alibaba --with-vendor-url=http://www.alibabagroup.com --with-vendor-bug-url='mailto:[email protected]' --with-vendor-vm-bug-url='mailto:[email protected]' --without-version-opt --without-version-pre --with-version-build=9 --with-version-patch=14 --with-boot-jdk=/usr/lib/jvm/jdk-10 --with-debug-level=release --with-native-debug-symbols=external --with-jvm-variants=server --disable-warnings-as-errors --openjdk-target=riscv64-unknown-linux-gnu --with-sysroot=/opt/fedora28_riscv_root -with-boot-jdk=/usr/lib/jvm/jdk-10 --openjdk-target=riscv64-unknown-linux-gnu --with-sysroot=/opt/fedora28_riscv_root
make images
#- name: 'Determine the jtreg version to build'
# run: echo "BUILD_VERSION=${{ fromJson(steps.check_deps.outputs.dependencies).JTREG_VERSION }}" >> $GITHUB_ENV
# if: steps.check_submit.outputs.should_run != 'false'

#- name: 'Determine the jtreg build number to build'
# run: echo "BUILD_NUMBER=${{ fromJson(steps.check_deps.outputs.dependencies).JTREG_BUILD }}" >> $GITHUB_ENV
# if: steps.check_submit.outputs.should_run != 'false'

#- name: 'Check if a jtreg image is present in the cache'
# id: jtreg
# uses: actions/cache@v3
# with:
# path: ~/jtreg/
# key: jtreg-${{ env.JTREG_REF }}-v1
# if: steps.check_submit.outputs.should_run != 'false'

#- name: 'Checkout the jtreg source'
# uses: actions/checkout@v3
# with:
# repository: "openjdk/jtreg"
# ref: ${{ env.JTREG_REF }}
# path: jtreg
# if: steps.check_submit.outputs.should_run != 'false' && steps.jtreg.outputs.cache-hit != 'true'

#- name: 'Build jtreg'
# run: bash make/build.sh --jdk ${JAVA_HOME_8_X64}
# working-directory: jtreg
# if: steps.check_submit.outputs.should_run != 'false' && steps.jtreg.outputs.cache-hit != 'true'

#- name: 'Move jtreg image to destination folder'
# run: mv build/images/jtreg ~/
# working-directory: jtreg
# if: steps.check_submit.outputs.should_run != 'false' && steps.jtreg.outputs.cache-hit != 'true'

#- name: 'Store jtreg for use by later steps'
# uses: actions/upload-artifact@v3
# with:
# name: transient_jtreg_${{ steps.check_bundle_id.outputs.bundle_id }}
# path: ~/jtreg/
# if: steps.check_submit.outputs.should_run != 'false'
Loading

0 comments on commit 1f63552

Please sign in to comment.