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

Add windows gradle check agent params #2840

Closed
Changes from 2 commits
Commits
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
39 changes: 29 additions & 10 deletions jenkins/gradle/gradle-check.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ pipeline {
throttleOption: 'project',
)
}
// gradle check have a lot of issues running on containers
// Therefore, we directly run it on the agent node
agent {
node {
// Must use Ubuntu agent with 1 executor or gradle check will show a lot of java-related errors
// The c524xlarge is the instance type that has the least amount of errors during gradle check
// https://github.com/opensearch-project/OpenSearch/issues/1975
label 'Jenkins-Agent-Ubuntu2004-X64-C524xlarge-Single-Host'
}
}
parameters {
string(
name: 'GIT_REPO_URL',
Expand All @@ -39,6 +29,14 @@ pipeline {
defaultValue: 'main',
trim: true
)
// Must use agent with 1 executor or gradle check will show a lot of java-related errors
// The c524xlarge is the instance type that has the least amount of errors during gradle check
// https://github.com/opensearch-project/OpenSearch/issues/1975
choice(
name: 'AGENT_LABEL',
description: 'Choose which jenkins agent to run gradle check',
peterzhuamazon marked this conversation as resolved.
Show resolved Hide resolved
choices: ['Jenkins-Agent-Ubuntu2004-X64-C524xlarge-Single-Host', 'Jenkins-Agent-Windows2019-X64-C524xlarge-Single-Host'],
)
}
triggers {
GenericTrigger(
Expand All @@ -64,6 +62,24 @@ pipeline {
TIMER_BUILD_CAUSE = currentBuild.getBuildCauses('hudson.triggers.TimerTrigger$TimerTriggerCause')
}
stages {
stage('verify-parameters') {
agent {
docker {
label 'Jenkins-Agent-AL2-X64-C54xlarge-Docker-Host'
image 'alpine:3'
alwaysPull true
}
}
steps {
script {
currentBuild.description = BUILD_MANIFEST_URL
if (AGENT_LABEL == '') {
currentBuild.result = 'ABORTED'
error("Gradle Check (Jenkins) failed to start. Missing parameter: AGENT_LABEL.")
}
}
}
}
stage('Install openjdk-8') {
tools {
jdk 'openjdk-8'
Expand Down Expand Up @@ -101,6 +117,9 @@ pipeline {
}
}
stage('Run Gradle Check') {
// gradle check have a lot of issues running on containers
// Therefore, we directly run it on the agent node
agent { label AGENT_LABEL }
steps {
script {
sh("ls /var/jenkins/tools/hudson.model.JDK/")
Expand Down