diff --git a/Jenkinsfile b/Jenkinsfile index 4c66c7298..641ad6141 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,8 @@ #!/usr/bin/env groovy /* groovylint-disable DuplicateListLiteral, DuplicateMapLiteral, DuplicateNumberLiteral */ // groovylint-disable DuplicateStringLiteral, NestedBlockDepth, VariableName -/* Copyright (C) 2019-2023 Intel Corporation +/* Copyright 2019-2024 Intel Corporation + * Copyright 2025 Hewlett Packard Enterprise Development LP * All rights reserved. * * This file is part of the DAOS Project. It is subject to the license terms @@ -229,6 +230,7 @@ pipeline { dockerfile { filename 'docker/Dockerfile.el.8' label 'docker_runner' + additionalBuildArgs dockerBuildArgs() } } steps { @@ -268,7 +270,7 @@ pipeline { dockerfile { filename 'docker/Dockerfile.el.8' label 'docker_runner' - additionalBuildArgs dockerBuildArgs(cachebust: false, add_repos: false) + additionalBuildArgs dockerBuildArgs(cachebust: false) } } steps { diff --git a/vars/buildRpm.groovy b/vars/buildRpm.groovy index 80370abd9..fbf8e0d2b 100755 --- a/vars/buildRpm.groovy +++ b/vars/buildRpm.groovy @@ -1,5 +1,9 @@ /* groovylint-disable DuplicateStringLiteral, VariableName */ // vars/buildRpm.groovy +/* + * Copyright 2020-2024 Intel Corporation + * Copyright 2025 Hewlett Packard Enterprise Development LP + */ /** * buildRpm step method @@ -60,6 +64,16 @@ Map call(Map config = [:]) { env_vars = ' CHROOT_NAME=' + config['chroot_name'] } + String https_proxy = '' + if (env.DAOS_HTTPS_PROXY) { + https_proxy = "${env.DAOS_HTTPS_PROXY}" + } else if (env.HTTPS_PROXY) { + https_proxy = "${env.HTTPS_PROXY}" + } + if (https_proxy) { + env_vars += ' HTTPS_PROXY=' + https_proxy + } + String error_stage_result = 'FAILURE' String error_build_result = 'FAILURE' if (config['unstable']) { diff --git a/vars/dockerBuildArgs.groovy b/vars/dockerBuildArgs.groovy index 883c6df07..5186198a8 100644 --- a/vars/dockerBuildArgs.groovy +++ b/vars/dockerBuildArgs.groovy @@ -1,5 +1,9 @@ /* groovylint-disable DuplicateStringLiteral, VariableName */ // vars/dockerBuildArgs.groovy +/* + * Copyright 2020-2024 Intel Corporation + * Copyright 2025 Hewlett Packard Enterprise Development LP + */ Integer num_proc() { return sh(label: 'Get number of processors online', @@ -31,7 +35,6 @@ Integer num_proc() { String call(Map config = [:]) { Boolean cachebust = config.get('cachebust', true) - Boolean add_repos = config.get('add_repos', true) Boolean deps_build = config.get('deps_build', false) Boolean parallel_build = config.get('parallel_build', false) @@ -55,12 +58,22 @@ String call(Map config = [:]) { } // pass through env. var.s - ['DAOS_LAB_CA_FILE_URL', 'REPO_FILE_URL', 'HTTP_PROXY', 'HTTPS_PROXY'].each { var -> + ['DAOS_LAB_CA_FILE_URL', 'REPO_FILE_URL', 'HTTP_PROXY'].each { var -> if (env."$var") { ret_str += ' --build-arg ' + var + '="' + env."$var" + '"' } } + String https_proxy = '' + if (env.DAOS_HTTPS_PROXY) { + https_proxy = env.DAOS_HTTPS_PROXY + } else if (env.HTTPS_PROXY) { + https_proxy = env.HTTPS_PROXY + } + if (https_proxy) { + ret_str += ' --build-arg HTTPS_PROXY' + '="' + https_proxy + '"' + } + if (config['qb']) { ret_str += ' --build-arg QUICKBUILD=true --build-arg DAOS_DEPS_BUILD=no' } else { diff --git a/vars/functionalTest.groovy b/vars/functionalTest.groovy index 78e221983..09f9689ee 100755 --- a/vars/functionalTest.groovy +++ b/vars/functionalTest.groovy @@ -1,5 +1,9 @@ /* groovylint-disable VariableName */ // vars/functionalTest.groovy +/* + * Copyright 2020-2024 Intel Corporation + * Copyright 2025 Hewlett Packard Enterprise Development LP + */ /** * functionalTest step method @@ -110,8 +114,17 @@ Map call(Map config = [:]) { run_test_config['context'] = context run_test_config['description'] = description - sh label: 'Install Launchable', - script: '''if ! pip3 install --upgrade --upgrade-strategy only-if-needed launchable; then + String https_proxy = '' + if (env.DAOS_HTTPS_PROXY) { + https_proxy = "${env.DAOS_HTTPS_PROXY}" + } else if (env.HTTPS_PROXY) { + https_proxy = "${env.HTTPS_PROXY}" + } + String script = 'if ! pip3 install' + if (https_proxy) { + script += ' --proxy "' + https_proxy + '"' + } + script += ''' --upgrade --upgrade-strategy only-if-needed launchable; then set +e echo "Failed to install launchable" id @@ -125,6 +138,8 @@ Map call(Map config = [:]) { fi pip3 list --user || true ''' + sh label: 'Install Launchable', + script: script try { withCredentials([string(credentialsId: 'launchable-test', variable: 'LAUNCHABLE_TOKEN')]) { diff --git a/vars/functionalTestPostV2.groovy b/vars/functionalTestPostV2.groovy index 0ee061542..42369091d 100755 --- a/vars/functionalTestPostV2.groovy +++ b/vars/functionalTestPostV2.groovy @@ -98,8 +98,21 @@ void call(Map config = [:]) { script: 'ci/functional/launchable_analysis "' + fileName + '"') } + String https_proxy = '' + if (env.DAOS_HTTPS_PROXY) { + https_proxy = "${env.DAOS_HTTPS_PROXY}" + } else if (env.HTTPS_PROXY) { + https_proxy = "${env.HTTPS_PROXY}" + } + String script = 'pip3 install' + if (https_proxy) { + script += ' --proxy "' + https_proxy + '"' + } + script += ' --user --upgrade launchable~=1.0' + + sh(label: 'Install Launchable', - script: 'pip3 install --user --upgrade launchable~=1.0') + script: script) try { withCredentials([string(credentialsId: 'launchable-test', variable: 'LAUNCHABLE_TOKEN')]) { diff --git a/vars/packageBuildingPipeline.groovy b/vars/packageBuildingPipeline.groovy index 28ca90140..09c3f841e 100644 --- a/vars/packageBuildingPipeline.groovy +++ b/vars/packageBuildingPipeline.groovy @@ -1,6 +1,6 @@ #!/usr/bin/groovy /* groovylint-disable DuplicateMapLiteral, DuplicateStringLiteral, NestedBlockDepth */ -/* Copyright (C) 2019-2023 Intel Corporation +/* Copyright 2019-2023 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/vars/packageBuildingPipelineDAOS.groovy b/vars/packageBuildingPipelineDAOS.groovy index 3353f6d86..353ba420b 100644 --- a/vars/packageBuildingPipelineDAOS.groovy +++ b/vars/packageBuildingPipelineDAOS.groovy @@ -1,6 +1,6 @@ #!/usr/bin/groovy /* groovylint-disable DuplicateMapLiteral, DuplicateStringLiteral, NestedBlockDepth, VariableName */ -/* Copyright (C) 2019-2023 Intel Corporation +/* Copyright 2019-2023 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/vars/packageBuildingPipelineDAOSTest.groovy b/vars/packageBuildingPipelineDAOSTest.groovy index 1842b8fac..a732db4de 100644 --- a/vars/packageBuildingPipelineDAOSTest.groovy +++ b/vars/packageBuildingPipelineDAOSTest.groovy @@ -1,7 +1,7 @@ #!/usr/bin/groovy /* groovylint-disable DuplicateMapLiteral, DuplicateStringLiteral, NestedBlockDepth, VariableName */ -/* Copyright (C) 2019-2024 Intel Corporation - * Copyright (C) 2025 Hewlett Packard Enterprise Development LP +/* Copyright 2019-2024 Intel Corporation + * Copyright 2025 Hewlett Packard Enterprise Development LP * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/vars/provisionNodes.groovy b/vars/provisionNodes.groovy index f8d9ef6b9..eb213d483 100644 --- a/vars/provisionNodes.groovy +++ b/vars/provisionNodes.groovy @@ -1,5 +1,9 @@ /* groovylint-disable DuplicateNumberLiteral, DuplicateStringLiteral, VariableName */ // vars/provisionNodes.groovy +/* + * Copyright 2020-2024 Intel Corporation + * Copyright 2025 Hewlett Packard Enterprise Development LP + */ /** * provisionNodes.groovy @@ -155,6 +159,12 @@ Map call(Map config = [:]) { default: error "Unsupported distro type: ${distro_type}/distro: ${distro}" } + String https_proxy = '' + if (env.DAOS_HTTPS_PROXY) { + https_proxy = "${env.DAOS_HTTPS_PROXY}" + } else if (env.HTTPS_PROXY) { + https_proxy = "${env.HTTPS_PROXY}" + } provision_script += ' ' + 'NODESTRING=' + nodeString + ' ' + 'CONFIG_POWER_ONLY=' + config_power_only + ' ' + @@ -164,6 +174,7 @@ Map call(Map config = [:]) { // https://issues.jenkins.io/browse/JENKINS-55819 'CI_RPM_TEST_VERSION="' + (params.CI_RPM_TEST_VERSION ?: '') + '" ' + 'CI_PR_REPOS="' + (params.CI_PR_REPOS ?: '') + '" ' + + 'HTTPS_PROXY="' + https_proxy + '" ' + 'ci/provisioning/post_provision_config.sh' new_config['post_restore'] = provision_script try {