Skip to content

Commit

Permalink
Merge branch 'master' into jmhToTools
Browse files Browse the repository at this point in the history
  • Loading branch information
karianna authored May 27, 2024
2 parents ccbaeb4 + c999e31 commit d74a79e
Show file tree
Hide file tree
Showing 12 changed files with 126 additions and 36 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/code-freeze.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
# ********************************************************************************
# Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made
# available under the terms of the Apache Software License 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: Apache-2.0
# ********************************************************************************

name: Code Freeze Bot

# Controls when the workflow will run
on:
pull_request_target:
branches: [ "v[0-9]+.[0-9]+.[0-9]+" ]
issue_comment:
types: [created]

Expand All @@ -12,6 +24,15 @@ permissions:
pull-requests: write

jobs:
codefreeze:
# Check if the pull request target branch matches the required branch-regex?
codefreeze_branch_check:
uses: adoptium/.github/.github/workflows/code-freeze-regex-branch.yml@main
with:
branch-regex: "^v[0-9]+.[0-9]+.[0-9]+$"

# Code freeze if branch-regex matches
codefreeze_if_branch_match:
needs: codefreeze_branch_check
uses: adoptium/.github/.github/workflows/code-freeze.yml@main
if: (github.event_name == 'pull_request_target' || (github.event_name == 'issue_comment' && github.event.issue.pull_request)) && needs.codefreeze_branch_check.outputs.regex-matches == 'true'
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/semgrep_diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# ********************************************************************************
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made
# available under the terms of the Apache Software License 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: Apache-2.0
# ********************************************************************************
---
name: Semgrep Differential Scan
on:
pull_request:

jobs:
semgrep-diff:
uses: adoptium/.github/.github/workflows/semgrep_diff.yml@main
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
Expand Down
11 changes: 11 additions & 0 deletions pipelines/build/common/build_base_file.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,17 @@ class Builder implements Serializable {
}
}
context.parallel jobs
context.node('worker') {
// Archive tap files as a single tar file
context.sh "find . -type f -name '*.tap' -exec tar -czf AQAvitTapFiles.tar.gz {} + "
try {
context.timeout(time: pipelineTimeouts.ARCHIVE_ARTIFACTS_TIMEOUT, unit: 'HOURS') {
context.archiveArtifacts artifacts: "AQAvitTapFiles.tar.gz"
}
} catch (FlowInterruptedException e) {
throw new Exception("[ERROR] Archive AQAvitTapFiles.tar.gz timeout Exiting...")
}
}
// publish to github if needed
// Don't publish release automatically
if (publish || release) {
Expand Down
58 changes: 36 additions & 22 deletions pipelines/build/common/openjdk_build_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,6 @@ class Build {
def vendorTestBranches = ''
def vendorTestDirs = ''
List testList = buildConfig.TEST_LIST
List dynamicList = buildConfig.DYNAMIC_LIST
List numMachines = buildConfig.NUM_MACHINES
def enableTestDynamicParallel = Boolean.valueOf(buildConfig.ENABLE_TESTDYNAMICPARALLEL)
def aqaBranch = 'master'
def useTestEnvProperties = false
Expand All @@ -374,6 +372,14 @@ class Build {
}

def aqaAutoGen = buildConfig.AQA_AUTO_GEN ?: false
def parallel = 'None'
def numMachinesPerTest = ''
def testTime = ''
// Enable time based parallel. Set expected completion time to 120 mins
if (enableTestDynamicParallel) {
testTime = '120'
parallel = 'Dynamic'
}

testList.each { testType ->
// For each requested test, i.e 'sanity.openjdk', 'sanity.system', 'sanity.perf', 'sanity.external', call test job
Expand Down Expand Up @@ -416,20 +422,6 @@ class Build {
}

def jobParams = getAQATestJobParams(testType)
def parallel = 'None'
def numMachinesPerTest = ''

if (enableTestDynamicParallel && dynamicList.contains(testType)) {
numMachinesPerTest = numMachines[(dynamicList.indexOf(testType))]
if (!numMachinesPerTest) {
// see build configuration in jdk*_pipeline_config.groovy
// when numMachines is an array, its size should match the testLists size
throw new Exception("No number of machines provided for running ${testType} tests in parallel, numMachines: ${numMachines}!")
}
context.println "Number of machines for running parallel tests: ${numMachinesPerTest}"

parallel = 'Dynamic'
}

def jobName = jobParams.TEST_JOB_NAME
String helperRef = buildConfig.HELPER_REF ?: DEFAULTS_JSON['repository']['helper_ref']
Expand Down Expand Up @@ -478,6 +470,7 @@ class Build {
context.booleanParam(name: 'KEEP_REPORTDIR', value: keep_test_reportdir),
context.string(name: 'PARALLEL', value: parallel),
context.string(name: 'NUM_MACHINES', value: "${numMachinesPerTest}"),
context.string(name: 'TEST_TIME', value: testTime),
context.booleanParam(name: 'USE_TESTENV_PROPERTIES', value: useTestEnvProperties),
context.booleanParam(name: 'GENERATE_JOBS', value: aqaAutoGen),
context.string(name: 'ADOPTOPENJDK_BRANCH', value: aqaBranch),
Expand Down Expand Up @@ -796,8 +789,6 @@ class Build {
We run two jobs if we have a JRE (see https://github.com/adoptium/temurin-build/issues/1751).
*/
private void buildWindowsInstaller(VersionInfo versionData, String filter, String category) {
def nodeFilter = "${buildConfig.TARGET_OS}&&wix"

def buildNumber = versionData.build

if (versionData.major == 8) {
Expand All @@ -813,6 +804,12 @@ class Build {
// Get version patch number if one is present
def patch_version = versionData.patch ?: 0

def INSTALLER_JVM = "${buildConfig.VARIANT}"
// if variant is temurin set param as hotpot
if (buildConfig.VARIANT == 'temurin') {
INSTALLER_JVM = 'hotspot'
}

// Execute installer job
def installerJob = context.build job: 'build-scripts/release/create_installer_windows',
propagate: true,
Expand All @@ -827,9 +824,8 @@ class Build {
context.string(name: 'PRODUCT_BUILD_NUMBER', value: "${buildNumber}"),
context.string(name: 'MSI_PRODUCT_VERSION', value: "${versionData.msi_product_version}"),
context.string(name: 'PRODUCT_CATEGORY', value: "${category}"),
context.string(name: 'JVM', value: "${buildConfig.VARIANT}"),
context.string(name: 'JVM', value: "${INSTALLER_JVM}"),
context.string(name: 'ARCH', value: "${INSTALLER_ARCH}"),
['$class': 'LabelParameterValue', name: 'NODE_LABEL', label: "${nodeFilter}"]
]
context.copyArtifacts(
projectName: 'build-scripts/release/create_installer_windows',
Expand Down Expand Up @@ -1530,6 +1526,24 @@ class Build {
}
}

// Always clean any previous "openjdk_build_dir" output, possibly from any previous aborted build..
try {
try {
context.timeout(time: buildTimeouts.NODE_CLEAN_TIMEOUT, unit: 'HOURS') {
if (context.WORKSPACE != null && !context.WORKSPACE.isEmpty()) {
context.println 'Removing workspace openjdk build directory: ' + openjdk_build_dir
context.sh(script: 'rm -rf ' + openjdk_build_dir)
} else {
context.println 'Warning: Unable to remove workspace openjdk build directory as context.WORKSPACE is null/empty'
}
}
} catch (FlowInterruptedException e) {
throw new Exception("[ERROR] Remove workspace openjdk build directory timeout (${buildTimeouts.NODE_CLEAN_TIMEOUT} HOURS) has been reached. Exiting...")
}
} catch (e) {
context.println "[WARNING] Failed to remove workspace openjdk build directory: ${e}"
}

try {
context.timeout(time: buildTimeouts.NODE_CHECKOUT_TIMEOUT, unit: 'HOURS') {
if (useAdoptShellScripts) {
Expand Down Expand Up @@ -2009,13 +2023,13 @@ class Build {
context.docker.image(buildConfig.DOCKER_IMAGE).pull()
}
}
// Store the pulled docker image digest as 'buildinfo'
dockerImageDigest = context.sh(script: "docker inspect --format='{{.RepoDigests}}' ${buildConfig.DOCKER_IMAGE}", returnStdout:true)
}
} catch (FlowInterruptedException e) {
throw new Exception("[ERROR] Controller docker image pull timeout (${buildTimeouts.DOCKER_PULL_TIMEOUT} HOURS) has been reached. Exiting...")
}
}
// Store the pulled docker image digest as 'buildinfo'
dockerImageDigest = context.sh(script: "docker inspect --format='{{.RepoDigests}}' ${buildConfig.DOCKER_IMAGE}", returnStdout:true)

// Use our dockerfile if DOCKER_FILE is defined
if (buildConfig.DOCKER_FILE) {
Expand Down
4 changes: 2 additions & 2 deletions pipelines/build/common/trigger_beta_build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ def isDuringReleasePeriod() {
releaseTuesday = day17th.with(TemporalAdjusters.previous(DayOfWeek.TUESDAY))
}

// Release period no trigger from previous Saturday to following Sunday
// Release period no trigger from prior week previous Saturday to following Sunday
def days = ChronoUnit.DAYS.between(releaseTuesday, now)
if (days >= -3 && days <= 5) {
if (days >= -10 && days <= 5) {
releasePeriod = true
}
}
Expand Down
19 changes: 17 additions & 2 deletions pipelines/build/devkit/make_devkit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,24 @@ if [ "${BASE_OS}" = "rhel" ]; then
BASE_OS=Centos
fi

# Perform devkit build
# Perform "bootstrap" devkit build
echo "Building 'bootstrap' DevKit toolchain, to be used to build the final DevKit..."
cd make/devkit && pwd && make TARGETS=${devkit_target} BASE_OS=${BASE_OS} BASE_OS_VERSION=${BASE_OS_VERSION}
find ../../build/devkit -type f -print

# Move "bootstrap" devkit toolchain to a new folder and setup gcc toolchain to point at it
cd ../..
mv build/devkit/result/${devkit_target}-to-${devkit_target} build/bootstrap_${devkit_target}-to-${devkit_target}
export CC=$(pwd)/build/bootstrap_${devkit_target}-to-${devkit_target}/bin/gcc
export CXX=$(pwd)/build/bootstrap_${devkit_target}-to-${devkit_target}/bin/g++
export LD_LIBRARY_PATH=$(pwd)/build/bootstrap_${devkit_target}-to-${devkit_target}/lib64
export PATH=$(pwd)/build/bootstrap_${devkit_target}-to-${devkit_target}/bin:$PATH
gcc --version

# Make final "DevKit" using the bootstrap devkit
rm -rf build/devkit
echo "Building 'final' DevKit toolchain, using 'bootstrap' toolchain in $(pwd)/build/bootstrap_${devkit_target}-to-${devkit_target}"
cd make/devkit && pwd && make TARGETS=${devkit_target} BASE_OS=${BASE_OS} BASE_OS_VERSION=${BASE_OS_VERSION}

# Back to original folder
cd ../../..

Expand Down
3 changes: 3 additions & 0 deletions pipelines/jobs/configurations/jdk17u_release.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ targetConfigurations = [
],
'arm32Linux' : [
'temurin'
],
'riscv64Linux': [
'temurin'
]
]

Expand Down
6 changes: 4 additions & 2 deletions pipelines/jobs/configurations/jdk21u_pipeline_config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Config21 {
openj9 : 'pipelines/build/dockerFiles/cuda.dockerfile'
],
test: [
weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'sanity.external', 'dev.openjdk', 'dev.functional', 'dev.system']
weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'sanity.external', 'dev.openjdk', 'dev.functional', 'dev.system', 'special.system']
],
reproducibleCompare : [
'temurin' : true
Expand Down Expand Up @@ -70,7 +70,9 @@ class Config21 {
os : 'windows',
arch : 'x64',
additionalNodeLabels: 'win2022&&vs2022',
test : 'default',
test: [
weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system']
],
reproducibleCompare : [
'temurin' : true
],
Expand Down
6 changes: 4 additions & 2 deletions pipelines/jobs/configurations/jdk22u_pipeline_config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Config22 {
openj9 : 'pipelines/build/dockerFiles/cuda.dockerfile'
],
test: [
weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'dev.openjdk', 'dev.functional', 'dev.system']
weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'dev.openjdk', 'dev.functional', 'dev.system', 'special.system']
],
additionalTestLabels: [
openj9 : '!(centos6||rhel6)',
Expand Down Expand Up @@ -65,7 +65,9 @@ class Config22 {
os : 'windows',
arch : 'x64',
additionalNodeLabels: 'win2022&&vs2022',
test : 'default',
test: [
weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system']
],
configureArgs : "--with-ucrt-dll-dir='C:/progra~2/wi3cf2~1/10/Redist/10.0.22621.0/ucrt/DLLs/x64'",
buildArgs : [
'temurin' : '--create-jre-image --create-sbom'
Expand Down
6 changes: 4 additions & 2 deletions pipelines/jobs/configurations/jdk23_pipeline_config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Config23 {
openj9 : 'pipelines/build/dockerFiles/cuda.dockerfile'
],
test: [
weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'dev.openjdk', 'dev.functional', 'dev.system']
weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'dev.openjdk', 'dev.functional', 'dev.system', 'special.system']
],
additionalTestLabels: [
openj9 : '!(centos6||rhel6)',
Expand Down Expand Up @@ -65,7 +65,9 @@ class Config23 {
os : 'windows',
arch : 'x64',
additionalNodeLabels: 'win2022&&vs2022',
test : 'default',
test: [
weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system']
],
configureArgs : "--with-ucrt-dll-dir='C:/progra~2/wi3cf2~1/10/Redist/10.0.22621.0/ucrt/DLLs/x64'",
buildArgs : [
'temurin' : '--create-jre-image --create-sbom'
Expand Down

0 comments on commit d74a79e

Please sign in to comment.