-
Notifications
You must be signed in to change notification settings - Fork 74
PDP-817: Added support to execute regressions on arm infrastructure #1891
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,34 +1,53 @@ | ||||||||||
| @Library('shared-libraries') _ | ||||||||||
|
|
||||||||||
| def getJavaHomePath() { | ||||||||||
| if (env.JAVA_VERSION == "JAVA21") { | ||||||||||
| return "/home/builder/java/jdk-21.0.1" | ||||||||||
| } else { | ||||||||||
| return "/home/builder/java/jdk-17.0.2" | ||||||||||
| } | ||||||||||
| if (params.arm_regressions) { | ||||||||||
| def version = (env.JAVA_VERSION == "JAVA21") ? "21" : "17" | ||||||||||
| def path = "/usr/lib/jvm/java-${version}-amazon-corretto.aarch64" | ||||||||||
| return path | ||||||||||
| } else { | ||||||||||
| if (env.JAVA_VERSION == "JAVA21") { | ||||||||||
| return "/home/builder/java/jdk-21.0.1" | ||||||||||
| } else { | ||||||||||
| return "/home/builder/java/jdk-17.0.2" | ||||||||||
| } | ||||||||||
| } | ||||||||||
| } | ||||||||||
|
|
||||||||||
| def getPlatform() { | ||||||||||
| return params.arm_regressions ? "linux/arm64" : "linux/amd64" | ||||||||||
| } | ||||||||||
|
|
||||||||||
| def setConverters() { | ||||||||||
| return params.arm_regressions ? "false" :"true" | ||||||||||
| } | ||||||||||
|
|
||||||||||
| def setupDockerMarkLogic(String image) { | ||||||||||
| cleanupDocker() | ||||||||||
| sh label: 'mlsetup', script: '''#!/bin/bash | ||||||||||
| echo "Removing any running MarkLogic server and clean up MarkLogic data directory" | ||||||||||
| sudo /usr/local/sbin/mladmin remove | ||||||||||
| sudo /usr/local/sbin/mladmin cleandata | ||||||||||
| cd java-client-api | ||||||||||
| docker compose down -v || true | ||||||||||
| docker volume prune -f | ||||||||||
| echo "Using image: "''' + image + ''' | ||||||||||
| docker pull ''' + image + ''' | ||||||||||
| MARKLOGIC_IMAGE=''' + image + ''' MARKLOGIC_LOGS_VOLUME=marklogicLogs docker compose up -d --build | ||||||||||
| export JAVA_HOME=$JAVA_HOME_DIR | ||||||||||
| export GRADLE_USER_HOME=$WORKSPACE/$GRADLE_DIR | ||||||||||
| export PATH=$JAVA_HOME/bin:$PATH | ||||||||||
| cleanupDocker() | ||||||||||
| sh label: 'mlsetup', script: '''#!/bin/bash | ||||||||||
| echo "Removing any running MarkLogic server and clean up MarkLogic data directory" | ||||||||||
| sudo /usr/local/sbin/mladmin remove | ||||||||||
| sudo /usr/local/sbin/mladmin cleandata | ||||||||||
| cd java-client-api | ||||||||||
| export PLATFORM=$PLATFORM | ||||||||||
| export SET_CONVERTERS=$SET_CONVERTERS | ||||||||||
| docker compose down -v || true | ||||||||||
| docker volume prune -f | ||||||||||
|
|
||||||||||
| echo "Using image: "''' + image + ''' | ||||||||||
| docker pull ''' + image + ''' | ||||||||||
|
|
||||||||||
| MARKLOGIC_IMAGE=''' + image + ''' MARKLOGIC_LOGS_VOLUME=marklogicLogs \ | ||||||||||
| docker compose up -d --build | ||||||||||
| echo "Waiting for MarkLogic server to initialize." | ||||||||||
| sleep 60 | ||||||||||
|
Comment on lines
+42
to
+43
|
||||||||||
| export JAVA_HOME=$JAVA_HOME_DIR | ||||||||||
| export GRADLE_USER_HOME=$WORKSPACE/$GRADLE_DIR | ||||||||||
| export PATH=$GRADLE_USER_HOME:$JAVA_HOME/bin:$PATH | ||||||||||
| ./gradlew -i mlWaitTillReady | ||||||||||
| sleep 3 | ||||||||||
| ./gradlew -i mlWaitTillReady | ||||||||||
| ./gradlew mlTestConnections | ||||||||||
| ./gradlew -i mlDeploy mlReloadSchemas | ||||||||||
| ''' | ||||||||||
| ./gradlew mlTestConnections | ||||||||||
| ./gradlew -i mlDeploy mlReloadSchemas | ||||||||||
| ''' | ||||||||||
| } | ||||||||||
|
|
||||||||||
| def runTests(String image) { | ||||||||||
|
|
@@ -171,23 +190,28 @@ pipeline { | |||||||||
|
|
||||||||||
| parameters { | ||||||||||
| booleanParam(name: 'regressions', defaultValue: false, description: 'indicator if build is for regressions') | ||||||||||
| booleanParam(name: 'arm_regressions', defaultValue: false, description: 'indicator if build is for ARM regressions') | ||||||||||
| string(name: 'JAVA_VERSION', defaultValue: 'JAVA17', description: 'Either JAVA17 or JAVA21') | ||||||||||
| string(name: 'MARKLOGIC_IMAGE_TAGS', defaultValue: 'marklogic-server-ubi:latest-11,marklogic-server-ubi:latest-12', description: 'Comma-delimited list of MarkLogic image tags including variant (e.g., marklogic-server-ubi:latest-11,marklogic-server-ubi-rootless:11.3.2). The registry/org (ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic) path will be prepended automatically.') | ||||||||||
| string(name: 'packagefile', defaultValue: 'Packagedependencies', description: 'package dependency file') | ||||||||||
| string(name: 'terraformBranch', defaultValue: 'master', description: 'Branch of terraform-templates repo to use') | ||||||||||
| } | ||||||||||
|
|
||||||||||
| environment { | ||||||||||
| JAVA_HOME_DIR = getJavaHomePath() | ||||||||||
| GRADLE_DIR = ".gradle" | ||||||||||
| DMC_USER = credentials('MLBUILD_USER') | ||||||||||
| DMC_PASSWORD = credentials('MLBUILD_PASSWORD') | ||||||||||
| PLATFORM = getPlatform() | ||||||||||
| SET_CONVERTERS = setConverters() | ||||||||||
| } | ||||||||||
|
|
||||||||||
| stages { | ||||||||||
|
|
||||||||||
| stage('pull-request-tests') { | ||||||||||
| when { | ||||||||||
| not { | ||||||||||
| expression { return params.regressions } | ||||||||||
| expression { | ||||||||||
| return !params.regressions && !params.arm_regressions | ||||||||||
| } | ||||||||||
|
Comment on lines
+213
to
215
|
||||||||||
| expression { | |
| return !params.regressions && !params.arm_regressions | |
| } | |
| expression { return !params.regressions && !params.arm_regressions } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,9 +4,9 @@ services: | |
|
|
||
| marklogic: | ||
| image: "${MARKLOGIC_IMAGE}" | ||
| platform: linux/amd64 | ||
| platform: "${PLATFORM:-linux/amd64}" | ||
| environment: | ||
| - INSTALL_CONVERTERS=true | ||
| - INSTALL_CONVERTERS=${SET_CONVERTERS:-true} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please rename |
||
| - MARKLOGIC_INIT=true | ||
| - MARKLOGIC_ADMIN_USERNAME=admin | ||
| - MARKLOGIC_ADMIN_PASSWORD=admin | ||
|
|
@@ -21,4 +21,4 @@ services: | |
| - "8010-8015:8010-8015" # Range of ports used by app servers, at least one of which - 8015 - is created by a test. | ||
|
|
||
| volumes: | ||
| marklogicLogs: | ||
| marklogicLogs: | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The environment variable names are identical to the variable names being assigned ($PLATFORM and $SET_CONVERTERS). This creates ambiguity about which values are being used and makes the code harder to follow. Consider renaming the shell variables to avoid shadowing, e.g.,
export PLATFORM=$PLATFORM_VALUEor use more descriptive names that clarify the source.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here - avoid using "SET_CONVERTERS", use "MARKLOGIC_INSTALL_CONVERTERS".