From c4d2739a3a674768e828a1b8a87252a6fe10bb58 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Fri, 12 Jan 2024 15:17:58 -0300 Subject: [PATCH 01/16] Changes the SSH key type that packer creates to communicate with nodes. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima This is a test to see if the packer-build-provision-testing-image pipeline works with Debian 12 & Ubuntu 22.04, that seem to have deprecated RSA SSH key types for authentication. No issue # --- jenkins/packer-images/jenkins-image-provision.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jenkins/packer-images/jenkins-image-provision.json b/jenkins/packer-images/jenkins-image-provision.json index 0ff59ce..3e83822 100644 --- a/jenkins/packer-images/jenkins-image-provision.json +++ b/jenkins/packer-images/jenkins-image-provision.json @@ -14,7 +14,8 @@ "disk_size": "20", "image_name": "jenkins-image-provision-{{user `distro`}}-{{isotime \"20060102150405\"}}", "image_family": "jenkins", - "ssh_username": "jenkins" + "ssh_username": "jenkins", + "temporary_key_pair_type" : "ed25519" } ], "provisioners": [ -- 2.30.2 From f31b52388c880ae04a321835887136d18396a001 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Tue, 16 Jan 2024 15:33:17 -0500 Subject: [PATCH 02/16] increase fs.inotify.max_user_watches to run wb2 tests refs #21393 Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- jenkins/packer-images/jenkins-image-arvados-tests.sh | 4 ++++ jenkins/packer-images/jenkins-image-with-docker.sh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/jenkins/packer-images/jenkins-image-arvados-tests.sh b/jenkins/packer-images/jenkins-image-arvados-tests.sh index 5fadb5d..5736ed1 100755 --- a/jenkins/packer-images/jenkins-image-arvados-tests.sh +++ b/jenkins/packer-images/jenkins-image-arvados-tests.sh @@ -36,6 +36,10 @@ sudo go run ./cmd/arvados-server install -type test # This is used in our test suite. echo user_allow_other | sudo tee -a /etc/fuse.conf +# React uses a lot of filesystem watchers (via inotify). Increase the default +# so we have a higher limit at runtime. +echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf + # Our Jenkins jobs use this directory to store the temporary files for the tests mkdir /home/jenkins/tmp diff --git a/jenkins/packer-images/jenkins-image-with-docker.sh b/jenkins/packer-images/jenkins-image-with-docker.sh index cb27956..a24c23d 100755 --- a/jenkins/packer-images/jenkins-image-with-docker.sh +++ b/jenkins/packer-images/jenkins-image-with-docker.sh @@ -20,3 +20,7 @@ sudo mv packer /usr/local/bin/ cd /usr/local sudo git clone --depth 1 https://github.com/arvados/arvados-dev sudo chown -R jenkins:jenkins /usr/local/arvados-dev/ + +# React uses a lot of filesystem watchers (via inotify). Increase the default +# so we have a higher limit at runtime. +echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf -- 2.30.2 From 6facdd63defe8f1d58c136881424c1d05f5b0c71 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Wed, 21 Feb 2024 11:28:32 -0300 Subject: [PATCH 03/16] Updates WB2 image building script for Jenkins. Refs #21461 Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- jenkins/packer-images/jenkins-image-workbench2.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jenkins/packer-images/jenkins-image-workbench2.sh b/jenkins/packer-images/jenkins-image-workbench2.sh index af4d708..1bc15ff 100755 --- a/jenkins/packer-images/jenkins-image-workbench2.sh +++ b/jenkins/packer-images/jenkins-image-workbench2.sh @@ -6,10 +6,10 @@ set -eo pipefail -# Get the wb2 repository +# Get the arvados repository cd /usr/src -sudo git clone https://git.arvados.org/arvados-workbench2.git -cd arvados-workbench2 +sudo git clone https://git.arvados.org/arvados.git +cd arvados/services/workbench2 if [[ "$GIT_HASH" != "" ]]; then echo "GIT_HASH is set to $GIT_HASH, checking out that revision..." @@ -23,5 +23,5 @@ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf # Build the workbench2-build docker image sudo make workbench2-build-image -cd .. -sudo rm -rf arvados-workbench2 +cd ../../../ +sudo rm -rf arvados -- 2.30.2 From 837d63cd0fa33bbed08c2e2d3b84b3d29756c50c Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Wed, 21 Feb 2024 11:36:57 -0300 Subject: [PATCH 04/16] Uses Debian Bullseye as a base for wb2 jenkins image. Refs #21461 Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- jenkins/packer-images/jenkins-image-workbench2.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/packer-images/jenkins-image-workbench2.json b/jenkins/packer-images/jenkins-image-workbench2.json index e916979..7a4369c 100644 --- a/jenkins/packer-images/jenkins-image-workbench2.json +++ b/jenkins/packer-images/jenkins-image-workbench2.json @@ -8,7 +8,7 @@ "type": "googlecompute", "account_file": "{{user `key_file` }}", "project_id": "phoenix-project-42-ci", - "source_image": "debian-10-buster-v20210916", + "source_image": "debian-11-bullseye-v20231010", "zone": "us-central1-b", "disk_size": "20", "image_name": "jenkins-image-workbench2-{{isotime \"20060102150405\"}}", -- 2.30.2 From 442871402fb876dc83a85361ca0403ecdd62dc5d Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Wed, 21 Feb 2024 14:53:15 -0300 Subject: [PATCH 05/16] Applies settings from sysctl conf file. Refs #21461 Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- jenkins/packer-images/jenkins-image-with-docker.sh | 1 + jenkins/packer-images/jenkins-image-workbench2.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/jenkins/packer-images/jenkins-image-with-docker.sh b/jenkins/packer-images/jenkins-image-with-docker.sh index a24c23d..fbc2e93 100755 --- a/jenkins/packer-images/jenkins-image-with-docker.sh +++ b/jenkins/packer-images/jenkins-image-with-docker.sh @@ -24,3 +24,4 @@ sudo chown -R jenkins:jenkins /usr/local/arvados-dev/ # React uses a lot of filesystem watchers (via inotify). Increase the default # so we have a higher limit at runtime. echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf +sysctl -p \ No newline at end of file diff --git a/jenkins/packer-images/jenkins-image-workbench2.sh b/jenkins/packer-images/jenkins-image-workbench2.sh index 1bc15ff..8a97448 100755 --- a/jenkins/packer-images/jenkins-image-workbench2.sh +++ b/jenkins/packer-images/jenkins-image-workbench2.sh @@ -19,6 +19,7 @@ fi # React uses a lot of filesystem watchers (via inotify). Increase the default # so we have a higher limit at runtime. echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf +sysctl -p # Build the workbench2-build docker image sudo make workbench2-build-image -- 2.30.2 From 6960cfa8745ebf897d4bef2ad11d58899549eea8 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Wed, 21 Feb 2024 15:10:43 -0300 Subject: [PATCH 06/16] Fixes sysctl call on provisioning scripts. Refs #21461 Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- jenkins/packer-images/jenkins-image-with-docker.sh | 2 +- jenkins/packer-images/jenkins-image-workbench2.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jenkins/packer-images/jenkins-image-with-docker.sh b/jenkins/packer-images/jenkins-image-with-docker.sh index fbc2e93..81aa244 100755 --- a/jenkins/packer-images/jenkins-image-with-docker.sh +++ b/jenkins/packer-images/jenkins-image-with-docker.sh @@ -24,4 +24,4 @@ sudo chown -R jenkins:jenkins /usr/local/arvados-dev/ # React uses a lot of filesystem watchers (via inotify). Increase the default # so we have a higher limit at runtime. echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf -sysctl -p \ No newline at end of file +sudo sysctl -p \ No newline at end of file diff --git a/jenkins/packer-images/jenkins-image-workbench2.sh b/jenkins/packer-images/jenkins-image-workbench2.sh index 8a97448..d014d7a 100755 --- a/jenkins/packer-images/jenkins-image-workbench2.sh +++ b/jenkins/packer-images/jenkins-image-workbench2.sh @@ -19,7 +19,7 @@ fi # React uses a lot of filesystem watchers (via inotify). Increase the default # so we have a higher limit at runtime. echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf -sysctl -p +sudo sysctl -p # Build the workbench2-build docker image sudo make workbench2-build-image -- 2.30.2 From 6aa98a3217018b2f1b070bf9984b34ad30134e78 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Wed, 21 Feb 2024 17:26:40 -0300 Subject: [PATCH 07/16] Allow requesting a specific arvados commit hash for image buildind. Refs #21461 Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- jenkins/packer-images/jenkins-image-arvados-tests.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jenkins/packer-images/jenkins-image-arvados-tests.sh b/jenkins/packer-images/jenkins-image-arvados-tests.sh index 5736ed1..1dd0f36 100755 --- a/jenkins/packer-images/jenkins-image-arvados-tests.sh +++ b/jenkins/packer-images/jenkins-image-arvados-tests.sh @@ -17,6 +17,11 @@ sudo usermod -a -G docker jenkins cd /usr/src sudo git clone arvados.git +if [[ "$GIT_HASH" != "" ]]; then + echo "GIT_HASH is set to $GIT_HASH, checking out that revision..." + sudo git checkout $GIT_HASH +fi + # Install the correct version of Go GO_VERSION=`grep 'const goversion =' /usr/src/arvados/lib/install/deps.go |awk -F'"' '{print $2}'` cd /usr/src -- 2.30.2 From 99ed01f5903bcfa801061c3c4887a62f11f24103 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Wed, 21 Feb 2024 19:13:09 -0300 Subject: [PATCH 08/16] Passes arvados git hash as a envvar to the packer script. Refs #21461 Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- jenkins/packer-images/jenkins-image-arvados-tests.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jenkins/packer-images/jenkins-image-arvados-tests.json b/jenkins/packer-images/jenkins-image-arvados-tests.json index cb41e12..2dd1cae 100644 --- a/jenkins/packer-images/jenkins-image-arvados-tests.json +++ b/jenkins/packer-images/jenkins-image-arvados-tests.json @@ -1,6 +1,7 @@ { "variables": { - "key_file": "{{env `packerbuildkey`}}" + "key_file": "{{env `packerbuildkey`}}", + "git_hash": "{{env `git_hash`}}" }, "builders": [ { -- 2.30.2 From bbf5a4e4610b7adf7053d5a375294ea5267a09ed Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Wed, 21 Feb 2024 19:46:48 -0300 Subject: [PATCH 09/16] Further fixes on envvar passthrough on packer scripts. Refs #21461 Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- jenkins/packer-images/jenkins-image-arvados-tests.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jenkins/packer-images/jenkins-image-arvados-tests.json b/jenkins/packer-images/jenkins-image-arvados-tests.json index 2dd1cae..609b21a 100644 --- a/jenkins/packer-images/jenkins-image-arvados-tests.json +++ b/jenkins/packer-images/jenkins-image-arvados-tests.json @@ -28,6 +28,9 @@ }, { "type": "shell", + "environment_vars": [ + "GIT_HASH={{ user `git_hash` }}" + ], "script": "./jenkins-image-arvados-tests.sh" } ] -- 2.30.2 From f7e69d6afd2aeea724f66329a55ba69f4764beb4 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Wed, 21 Feb 2024 19:53:17 -0300 Subject: [PATCH 10/16] Fixes in git checkout call. Refs #21461 Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- jenkins/packer-images/jenkins-image-arvados-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/packer-images/jenkins-image-arvados-tests.sh b/jenkins/packer-images/jenkins-image-arvados-tests.sh index 1dd0f36..6055c22 100755 --- a/jenkins/packer-images/jenkins-image-arvados-tests.sh +++ b/jenkins/packer-images/jenkins-image-arvados-tests.sh @@ -19,7 +19,7 @@ sudo git clone arvados.git if [[ "$GIT_HASH" != "" ]]; then echo "GIT_HASH is set to $GIT_HASH, checking out that revision..." - sudo git checkout $GIT_HASH + (cd arvados && sudo git checkout $GIT_HASH) fi # Install the correct version of Go -- 2.30.2 From e172b06c0080c34b8d110675bda710011567de17 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Tue, 2 Apr 2024 09:23:15 -0300 Subject: [PATCH 11/16] Uses createrepo_c instead of createrepo. Refs #21616 Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- jenkins/run_upload_packages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/run_upload_packages.py b/jenkins/run_upload_packages.py index d199197..c6949e8 100755 --- a/jenkins/run_upload_packages.py +++ b/jenkins/run_upload_packages.py @@ -245,7 +245,7 @@ cd "$1"; shift REPODIR=$1; shift rpmsign --addsign "$@" Date: Fri, 5 Apr 2024 16:20:37 -0400 Subject: [PATCH 12/16] Add set-sprint subcommand to 'art', no issue # Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- cmd/art/redmine.go | 61 +++++++++++++++++++++++++++++++++++++++++++ lib/redmine/issues.go | 14 ++++++++++ 2 files changed, 75 insertions(+) diff --git a/cmd/art/redmine.go b/cmd/art/redmine.go index 1ad293b..a170a6e 100644 --- a/cmd/art/redmine.go +++ b/cmd/art/redmine.go @@ -44,6 +44,19 @@ func init() { } issuesCmd.AddCommand(associateIssueCmd) + + setIssueSprintCmd.Flags().IntP("sprint", "r", 0, "Redmine sprint ID") + err = setIssueSprintCmd.MarkFlagRequired("sprint") + if err != nil { + log.Fatalf(err.Error()) + } + setIssueSprintCmd.Flags().IntP("issue", "i", 0, "Redmine issue ID") + err = setIssueSprintCmd.MarkFlagRequired("issue") + if err != nil { + log.Fatalf(err.Error()) + } + issuesCmd.AddCommand(setIssueSprintCmd) + associateOrphans.Flags().IntP("release", "r", 0, "Redmine release ID") err = associateOrphans.MarkFlagRequired("release") if err != nil { @@ -312,6 +325,54 @@ var associateIssueCmd = &cobra.Command{ }, } + +var setIssueSprintCmd = &cobra.Command{ + Use: "set-sprint", + Short: "Set sprint for issue", + Long: "Set the sprint for an issue.\n" + + "\nThe REDMINE_ENDPOINT environment variable must be set to the base URL of your redmine server." + + "\nThe REDMINE_APIKEY environment variable must be set to your redmine API key.", + Run: func(cmd *cobra.Command, args []string) { + issueID, err := cmd.Flags().GetInt("issue") + if err != nil { + fmt.Printf("Error converting Redmine issue ID to integer: %s", err) + os.Exit(1) + } + + sprintID, err := cmd.Flags().GetInt("sprint") + if err != nil { + fmt.Printf("Error converting Redmine sprint ID to integer: %s", err) + os.Exit(1) + } + + redmine := redmine.NewClient(conf.Endpoint, conf.Apikey) + + i, err := redmine.GetIssue(issueID) + if err != nil { + fmt.Printf("%s\n", err.Error()) + os.Exit(1) + } + + var setIt bool + if i.FixedVersion == nil { + setIt = true + } else if i.FixedVersion.ID != sprintID { + setIt = true + } + if setIt { + err = redmine.SetSprint(*i, sprintID) + if err != nil { + fmt.Printf("%s\n", err.Error()) + os.Exit(1) + } else { + fmt.Printf("[changed] sprint for issue %d set to %d\n", i.ID, sprintID) + } + } else { + fmt.Printf("[ok] sprint for issue %d was already set to %d, not updating\n", i.ID, i.FixedVersion.ID) + } + }, +} + func checkError(err error) { if err != nil { fmt.Printf("%s\n", err.Error()) diff --git a/lib/redmine/issues.go b/lib/redmine/issues.go index ea2f584..5e02272 100644 --- a/lib/redmine/issues.go +++ b/lib/redmine/issues.go @@ -233,3 +233,17 @@ func (c *Client) SetRelease(issue Issue, release int) error { issue.Release = nil return c.UpdateIssue(issue) } + +// SetSprint updates the sprint (fixed_version) for an issue +func (c *Client) SetSprint(issue Issue, version int) error { + issue.FixedVersionID = version + issue.FixedVersion = nil + return c.UpdateIssue(issue) +} + +// SetStatus updates the status for an issue +func (c *Client) SetStatus(issue Issue, status int) error { + issue.StatusID = status + issue.Status = nil + return c.UpdateIssue(issue) +} -- 2.30.2 From 5620086aae58a7f13773fce775aef1b57a3b770c Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Thu, 11 Apr 2024 09:16:35 -0400 Subject: [PATCH 13/16] Use createrepo_c, no issue # Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- jenkins/testing_to_stable_publish_packages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/testing_to_stable_publish_packages.sh b/jenkins/testing_to_stable_publish_packages.sh index a06a920..053ac7d 100755 --- a/jenkins/testing_to_stable_publish_packages.sh +++ b/jenkins/testing_to_stable_publish_packages.sh @@ -71,7 +71,7 @@ if ( echo ${DIST_LIST} |grep -q -E '(centos|rocky)' ); then fi done echo "Recreating repo CentOS/${DIST_DIR_PROD} ..." - createrepo ${RPM_REPO_BASE_DIR}/CentOS/${DIST_DIR_PROD} + createrepo_c ${RPM_REPO_BASE_DIR}/CentOS/${DIST_DIR_PROD} done else for DISTNAME in ${DIST_LIST}; do -- 2.30.2 From 349808c1a4afd4741e9687894bfef063d9fd3413 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Thu, 11 Apr 2024 09:35:11 -0400 Subject: [PATCH 14/16] Fix package publishing script to handle both deb and rpm in one command no issue # Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- jenkins/testing_to_stable_publish_packages.sh | 101 +++++++++--------- jenkins/upload_packages_testing_to_stable.sh | 13 ++- 2 files changed, 60 insertions(+), 54 deletions(-) diff --git a/jenkins/testing_to_stable_publish_packages.sh b/jenkins/testing_to_stable_publish_packages.sh index 053ac7d..835a269 100755 --- a/jenkins/testing_to_stable_publish_packages.sh +++ b/jenkins/testing_to_stable_publish_packages.sh @@ -45,58 +45,55 @@ DIST_LIST=$(echo ${distros} | sed s/,/' '/g |tr '[:upper:]' '[:lower:]') CENTOS_PACKAGES=$(echo ${packages} | sed 's/\([a-z-]*\):[[:blank:]]*\([0-9.-]*\)/\1*\2*/g; s/,/ /g;') DEBIAN_PACKAGES=$(echo ${packages} | sed 's/\([a-z-]*\):[[:blank:]]*\([0-9.-]*\)/\1 (= \2)/g;') -if ( echo ${DIST_LIST} |grep -q -E '(centos|rocky)' ); then - for DISTNAME in ${DIST_LIST}; do - case ${DISTNAME} in - 'centos7') - DIST_DIR_TEST='7/testing/x86_64' - DIST_DIR_PROD='7/os/x86_64' - ;; - 'rocky8') - DIST_DIR_TEST='8/testing/x86_64' - DIST_DIR_PROD='8/os/x86_64' - ;; - *) - echo "Only centos7 and rocky8 are accepted right now" - exit 253 - ;; - esac - cd ${RPM_REPO_BASE_DIR} - mkdir -p ${RPM_REPO_BASE_DIR}/CentOS/${DIST_DIR_PROD} - echo "Copying packages ..." - for P in ${CENTOS_PACKAGES}; do - cp ${RPM_REPO_BASE_DIR}/CentOS/${DIST_DIR_TEST}/${P} ${RPM_REPO_BASE_DIR}/CentOS/${DIST_DIR_PROD}/ - if [ $? -ne 0 ]; then - FAILED_PACKAGES="${FAILED_PACKAGES} ${P}" - fi - done - echo "Recreating repo CentOS/${DIST_DIR_PROD} ..." - createrepo_c ${RPM_REPO_BASE_DIR}/CentOS/${DIST_DIR_PROD} - done -else - for DISTNAME in ${DIST_LIST}; do - ADDED=() - echo "Copying packages ..." - OLDIFS=$IFS - IFS=$',' - for P in ${DEBIAN_PACKAGES}; do - aptly repo search ${DISTNAME}-testing "${P}" - if [ $? -ne 0 ]; then - echo "ERROR: unable to find a match for '${P}' in ${DISTNAME}-testing" - FAILED_PACKAGES="${FAILED_PACKAGES} ${DISTNAME}-testing:${P}" - else - aptly repo copy ${DISTNAME}-testing ${DISTNAME} "${P}" - if [ $? -ne 0 ]; then - echo "ERROR: unable to copy '${P}' from ${DISTNAME}-testing to ${DISTNAME}" - FAILED_PACKAGES="${FAILED_PACKAGES} ${DISTNAME}-testing:${P}" - fi - fi - done - IFS=$OLDIFS - echo "Publishing ${DISTNAME} repository..." - aptly publish update ${DISTNAME} filesystem:${DISTNAME}: - done -fi +for DISTNAME in ${DIST_LIST}; do + if ( echo ${DISTNAME} |grep -q -E '(centos|rocky)' ); then + case ${DISTNAME} in + 'centos7') + DIST_DIR_TEST='7/testing/x86_64' + DIST_DIR_PROD='7/os/x86_64' + ;; + 'rocky8') + DIST_DIR_TEST='8/testing/x86_64' + DIST_DIR_PROD='8/os/x86_64' + ;; + *) + echo "Only centos7 and rocky8 are accepted right now" + exit 253 + ;; + esac + cd ${RPM_REPO_BASE_DIR} + mkdir -p ${RPM_REPO_BASE_DIR}/CentOS/${DIST_DIR_PROD} + echo "Copying packages ..." + for P in ${CENTOS_PACKAGES}; do + cp ${RPM_REPO_BASE_DIR}/CentOS/${DIST_DIR_TEST}/${P} ${RPM_REPO_BASE_DIR}/CentOS/${DIST_DIR_PROD}/ + if [ $? -ne 0 ]; then + FAILED_PACKAGES="${FAILED_PACKAGES} ${P}" + fi + done + echo "Recreating repo CentOS/${DIST_DIR_PROD} ..." + createrepo_c ${RPM_REPO_BASE_DIR}/CentOS/${DIST_DIR_PROD} + else + echo "Copying packages ..." + OLDIFS=$IFS + IFS=$',' + for P in ${DEBIAN_PACKAGES}; do + aptly repo search ${DISTNAME}-testing "${P}" + if [ $? -ne 0 ]; then + echo "ERROR: unable to find a match for '${P}' in ${DISTNAME}-testing" + FAILED_PACKAGES="${FAILED_PACKAGES} ${DISTNAME}-testing:${P}" + else + aptly repo copy ${DISTNAME}-testing ${DISTNAME} "${P}" + if [ $? -ne 0 ]; then + echo "ERROR: unable to copy '${P}' from ${DISTNAME}-testing to ${DISTNAME}" + FAILED_PACKAGES="${FAILED_PACKAGES} ${DISTNAME}-testing:${P}" + fi + fi + done + IFS=$OLDIFS + echo "Publishing ${DISTNAME} repository..." + aptly publish update ${DISTNAME} filesystem:${DISTNAME}: + fi +done if [ "${FAILED_PACKAGES}" != "" ]; then echo "PACKAGES THAT FAILED TO PUBLISH" diff --git a/jenkins/upload_packages_testing_to_stable.sh b/jenkins/upload_packages_testing_to_stable.sh index b7cff37..4cf3737 100755 --- a/jenkins/upload_packages_testing_to_stable.sh +++ b/jenkins/upload_packages_testing_to_stable.sh @@ -23,7 +23,7 @@ fi if [ -z "${LSB_DISTRIB_CODENAMES}" ]; then echo "You must provide a space-separated list of LSB distribution codenames to which you want to publish to, ie." echo "* Debian/Ubuntu: buster, bullseye, focal" - echo "* Centos: centos7 (the only one currently supported.)" + echo "* Redhat: centos7 rocky8" exit 255 fi @@ -52,11 +52,20 @@ else REPO_SERVER=${APT_REPO_SERVER} fi -REMOTE_CMD="/usr/local/bin/testing_to_stable_publish_packages.sh --distros ${DISTROS} --packages ${PACKAGES_LIST}" +# Make sure jenkins scripts are up to date +ssh -t \ + -l jenkinsapt \ + -p $SSH_PORT \ + -o "StrictHostKeyChecking no" \ + -o "ConnectTimeout 5" \ + ${REPO_SERVER} \ + "cd ~/arvados-dev && git fetch -a && git reset --hard origin/main" # Now we execute it remotely TMP_FILE=`mktemp` +REMOTE_CMD="~/arvados-dev/jenkins/testing_to_stable_publish_packages.sh --distros ${DISTROS} --packages ${PACKAGES_LIST}" + ssh -t \ -l jenkinsapt \ -p $SSH_PORT \ -- 2.30.2 From f3e97f6cba1ef643c126f1d73f5d2d9d956ea62a Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Thu, 11 Apr 2024 09:46:24 -0400 Subject: [PATCH 15/16] Add a banner to the package promotion logging. no issue # Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- jenkins/testing_to_stable_publish_packages.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jenkins/testing_to_stable_publish_packages.sh b/jenkins/testing_to_stable_publish_packages.sh index 835a269..ecf918e 100755 --- a/jenkins/testing_to_stable_publish_packages.sh +++ b/jenkins/testing_to_stable_publish_packages.sh @@ -46,6 +46,9 @@ CENTOS_PACKAGES=$(echo ${packages} | sed 's/\([a-z-]*\):[[:blank:]]*\([0-9.-]*\) DEBIAN_PACKAGES=$(echo ${packages} | sed 's/\([a-z-]*\):[[:blank:]]*\([0-9.-]*\)/\1 (= \2)/g;') for DISTNAME in ${DIST_LIST}; do + echo + echo "### Publishing packages for ${DISTNAME} ###" + echo if ( echo ${DISTNAME} |grep -q -E '(centos|rocky)' ); then case ${DISTNAME} in 'centos7') -- 2.30.2 From fb2bb48b6bcf4884d016ec4ce5d87363d51c6ebe Mon Sep 17 00:00:00 2001 From: Brett Smith Date: Fri, 19 Apr 2024 16:06:05 -0400 Subject: [PATCH 16/16] 21662: Refine distro detection in jenkins-image-common * Use ID_LIKE to identify distros rather than having whole lists. * Only install buster-backports when we're actually on buster. Refs #21662. Arvados-DCO-1.1-Signed-off-by: Brett Smith --- jenkins/packer-images/jenkins-image-common.sh | 48 ++++++++++--------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/jenkins/packer-images/jenkins-image-common.sh b/jenkins/packer-images/jenkins-image-common.sh index e68b092..9f3c461 100755 --- a/jenkins/packer-images/jenkins-image-common.sh +++ b/jenkins/packer-images/jenkins-image-common.sh @@ -11,29 +11,31 @@ sudo su -c "echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCfRJenfxGPFuJ/W2KUs6Wf0wa sudo su -c "echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDH8swFWEfEfHhA+C5ezV8SXO/PkzGD1SH5VAQP/XDIrtnUocBZ3CE30lSyqYJI/EVKVqVa/ICQ0YpUwiMK6+3Jr9QQJwVyTmPji2nY3InL+1XAucN6HFJGKY9bYSsNOuKooj22GwBWw3gfJNLg/8qtpVykEq1yRpyh6pGsXT+J5nUZ723vZZTh//sxdN4CM8D8zoDgHc4RbL+zvESnCDrDbtMhg2u1h14RWiFOBAnzYuWcgtVDy2HA9iS0hJFB2UOV50byXLrEetxJ84PTwRsV2irq1y63g58VxwYOUrVZ08MY5qFvHExBjPqeqhRMzE7GufWM5F1CcUuGviOGFWfqMnfG4VOirPkFtRoK2oKRxH+NVPoUXWWxItJQ1dZ9hLDDWgAbxAvLS4Nnl2hvOVAbC7RVpXfoAhIPpL48oS1UprbsZIMxk2ZmRSJB1ykD3aLUvoO4zoD6xADt8uLiPvVYgFWUy1doLxHZqdY1Omc91owgQVPKvQ4vhqsJehQl4ZDS+O+8S7aC5m8sQ/V+NqiiXLH22vN58K7qNrkHWdb1n+rhilMbA5zp3cSKBgwmmNdupyPkJOKvf3IS7i4El+c8RFmRQv4FzGrdjGXAP8LPtt1dWPgHTFYjmrkOHLmfWM/y8cuyPWW/HEp3Y/msPQRlS3Gymce//vAWgN4T9yN46w== lucas@notebook" >> /home/jenkins/.ssh/authorized_keys # Install a few dependency packages -# First, let's figure out the OS we're working on -OS_ID=$(grep ^ID= /etc/os-release |cut -f 2 -d \" | cut -f 2 -d = ) -echo "Detected distro: ${OS_ID}" - -case ${OS_ID} in - centos) - PREINSTALL_CMD="/bin/true" - INSTALL_CMD="yum install -y" - POSTINSTALL_CMD="/bin/true" - PKGS="git nmap-ncat java-11-openjdk" - ;; - debian|ubuntu) - if [ ${OS_ID} = "debian" ]; then - echo "deb http://deb.debian.org/debian buster-backports main" | sudo tee /etc/apt/sources.list.d/buster-backports.list - fi - PREINSTALL_CMD="DEBIAN_FRONTEND=noninteractive apt-get update" - INSTALL_CMD="DEBIAN_FRONTEND=noninteractive apt-get install -y" - POSTINSTALL_CMD="DEBIAN_FRONTEND=noninteractive apt-get purge --autoremove -y" - # SUFFIX packages with - to remove them - # Remove unattended-upgrades so that it doesn't interfere with our nodes at startup - PKGS="git netcat-traditional default-jdk unattended-upgrades-" - ;; -esac +. /etc/os-release +PREINSTALL_CMD='echo "error: unknown distro" >&2; false' +for OS_ID in ${ID:-} ${ID_LIKE:-}; do + case ${OS_ID} in + rhel) + PREINSTALL_CMD="/bin/true" + INSTALL_CMD="yum install -y" + POSTINSTALL_CMD="/bin/true" + PKGS="git nmap-ncat java-11-openjdk" + break + ;; + debian) + if [[ "$VERSION_CODENAME" == buster ]]; then + echo "deb http://deb.debian.org/debian buster-backports main" | sudo tee /etc/apt/sources.list.d/buster-backports.list + fi + PREINSTALL_CMD="DEBIAN_FRONTEND=noninteractive apt-get update" + INSTALL_CMD="DEBIAN_FRONTEND=noninteractive apt-get install -y" + POSTINSTALL_CMD="DEBIAN_FRONTEND=noninteractive apt-get purge --autoremove -y" + # SUFFIX packages with - to remove them + # Remove unattended-upgrades so that it doesn't interfere with our nodes at startup + PKGS="git netcat-traditional default-jdk unattended-upgrades-" + break + ;; + esac +done sudo su -c "${PREINSTALL_CMD}" sudo su -c "${INSTALL_CMD} ${PKGS}" -- 2.30.2