From 853ea7b93fec7827186026fd71f78524e9debccb Mon Sep 17 00:00:00 2001 From: Parul Bajaj Date: Wed, 25 Mar 2026 09:30:47 +0000 Subject: [PATCH 1/3] Upgrade golang version in test runner image --- .../base-integration-test.yml | 2 +- .../htcondor-integration-test.yml | 2 +- .../slurm-integration-test.yml | 2 +- .../tasks/get_instance_ids.yml | 6 +++--- .../cloud-build/images/test-runner/Dockerfile | 21 ++++++++++--------- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/tools/cloud-build/daily-tests/ansible_playbooks/base-integration-test.yml b/tools/cloud-build/daily-tests/ansible_playbooks/base-integration-test.yml index 3b7649187a..b5131a4ac4 100644 --- a/tools/cloud-build/daily-tests/ansible_playbooks/base-integration-test.yml +++ b/tools/cloud-build/daily-tests/ansible_playbooks/base-integration-test.yml @@ -143,7 +143,7 @@ ansible.builtin.add_host: hostname: "{{ remote_ip }}" groups: [remote_host] - when: remote_ip | ansible.utils.ipaddr + when: (remote_ip | default('')) | ansible.utils.ipaddr != false - name: Wait for host tasks ansible.builtin.include_tasks: tasks/wait-for-host.yml diff --git a/tools/cloud-build/daily-tests/ansible_playbooks/htcondor-integration-test.yml b/tools/cloud-build/daily-tests/ansible_playbooks/htcondor-integration-test.yml index fb28ceb58b..4a71e601d5 100644 --- a/tools/cloud-build/daily-tests/ansible_playbooks/htcondor-integration-test.yml +++ b/tools/cloud-build/daily-tests/ansible_playbooks/htcondor-integration-test.yml @@ -70,7 +70,7 @@ ansible.builtin.add_host: hostname: "{{ access_ip.stdout }}" groups: [remote_host] - when: access_ip.stdout | ansible.utils.ipaddr + when: (access_ip.stdout | default('')) | ansible.utils.ipaddr != false ## Setup firewall for cloud build - name: Create firewall rule register: fw_result diff --git a/tools/cloud-build/daily-tests/ansible_playbooks/slurm-integration-test.yml b/tools/cloud-build/daily-tests/ansible_playbooks/slurm-integration-test.yml index 24abd4b0f6..d30f844417 100644 --- a/tools/cloud-build/daily-tests/ansible_playbooks/slurm-integration-test.yml +++ b/tools/cloud-build/daily-tests/ansible_playbooks/slurm-integration-test.yml @@ -173,7 +173,7 @@ ansible.builtin.add_host: hostname: "{{ login_ip }}" groups: [remote_host] - when: login_ip | ansible.utils.ipaddr + when: (login_ip | default('')) | ansible.utils.ipaddr != false - name: Wait for host tasks ansible.builtin.include_tasks: tasks/wait-for-host.yml diff --git a/tools/cloud-build/daily-tests/ansible_playbooks/tasks/get_instance_ids.yml b/tools/cloud-build/daily-tests/ansible_playbooks/tasks/get_instance_ids.yml index b06d12e8f7..5d36fdcfb3 100644 --- a/tools/cloud-build/daily-tests/ansible_playbooks/tasks/get_instance_ids.yml +++ b/tools/cloud-build/daily-tests/ansible_playbooks/tasks/get_instance_ids.yml @@ -15,7 +15,7 @@ --- - name: Gather instance information delegate_to: localhost - when: deployment_name is defined and deployment_name | string + when: deployment_name is defined and deployment_name | length > 0 changed_when: false register: instances until: instances.rc == 0 @@ -30,7 +30,7 @@ ansible.builtin.debug: var: instances.stdout - name: Print Cloud Logging command - when: instances is defined and instances.stdout | list + when: instances is defined and (instances.stdout | from_json | length > 0) ansible.builtin.debug: msg: gcloud logging --project {{ project }} read 'logName="projects/{{ project }}/logs/google_metadata_script_runner" AND resource.labels.instance_id="{{ item.id }}"' --format="table(timestamp, jsonPayload.message)" --freshness 24h | tac - loop: "{{ instances.stdout }}" + loop: "{{ instances.stdout | from_json | default([]) }}" diff --git a/tools/cloud-build/images/test-runner/Dockerfile b/tools/cloud-build/images/test-runner/Dockerfile index a9d1639dff..ac3ad2abaa 100644 --- a/tools/cloud-build/images/test-runner/Dockerfile +++ b/tools/cloud-build/images/test-runner/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:bullseye +FROM golang:bookworm ENV GOCACHE=/ghpc_go_cache @@ -20,33 +20,34 @@ ENV GOCACHE=/ghpc_go_cache # use `/workspace` to match path in cache for future builds COPY ./ /workspace -RUN curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - && \ - apt-get -y update && apt-get -y install \ +RUN apt-get -y update && apt-get -y install \ + gnupg \ # `software-properties-common` providers `add-apt-repository` software-properties-common \ keychain \ # `dnsutils` provides `dig` used by integration tests dnsutils && \ # install terraform and packer - apt-add-repository "deb [arch=$(dpkg --print-architecture)] https://apt.releases.hashicorp.com bullseye main" && \ + curl -fsSL https://apt.releases.hashicorp.com/gpg | gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg && \ + echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg arch=$(dpkg --print-architecture)] https://apt.releases.hashicorp.com bookworm main" | tee /etc/apt/sources.list.d/hashicorp.list && \ apt-get -y update && \ # Pin Terraform version to 1.12.2 apt-get install -y unzip python3-pip python3-netaddr terraform=1.12.2-1 packer jq && \ # install gcloud + curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg && \ echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" \ | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \ - curl https://packages.cloud.google.com/apt/doc/apt-key.gpg \ - | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && \ apt-get -y update && apt-get -y install google-cloud-sdk && \ apt-get -y install kubectl && \ # following is required to execute kubectl commands apt-get -y install google-cloud-cli-gke-gcloud-auth-plugin && \ apt-get clean && rm -rf /var/lib/apt/lists/* && \ # install ansible and python dependencies - pip install --no-cache-dir --upgrade pip && \ - pip install --no-cache-dir -r https://raw.githubusercontent.com/GoogleCloudPlatform/slurm-gcp/master/scripts/requirements.txt && \ - pip install --no-cache-dir ansible && \ - pip install --no-cache-dir paramiko && \ + pip install --break-system-packages --no-cache-dir --upgrade pip && \ + pip install --break-system-packages --no-cache-dir -r https://raw.githubusercontent.com/GoogleC + loudPlatform/slurm-gcp/master/scripts/requirements.txt && \ + pip install --break-system-packages --no-cache-dir ansible && \ + pip install --break-system-packages --no-cache-dir paramiko && \ rm -rf ~/.cache/pip/* && \ # compile the binary to warm up `/ghpc_go_cache` cd /workspace && make gcluster && \ From da548290e3a5a16e7344b715b563fce479492123 Mon Sep 17 00:00:00 2001 From: Parul Bajaj Date: Thu, 26 Mar 2026 08:57:44 +0000 Subject: [PATCH 2/3] Upgrade image to Debian 13 (Trixie) --- .../cloud-build/images/test-runner/Dockerfile | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tools/cloud-build/images/test-runner/Dockerfile b/tools/cloud-build/images/test-runner/Dockerfile index ac3ad2abaa..a70845daa6 100644 --- a/tools/cloud-build/images/test-runner/Dockerfile +++ b/tools/cloud-build/images/test-runner/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:bookworm +FROM golang:trixie ENV GOCACHE=/ghpc_go_cache @@ -22,17 +22,15 @@ COPY ./ /workspace RUN apt-get -y update && apt-get -y install \ gnupg \ - # `software-properties-common` providers `add-apt-repository` - software-properties-common \ keychain \ # `dnsutils` provides `dig` used by integration tests dnsutils && \ # install terraform and packer curl -fsSL https://apt.releases.hashicorp.com/gpg | gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg && \ - echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg arch=$(dpkg --print-architecture)] https://apt.releases.hashicorp.com bookworm main" | tee /etc/apt/sources.list.d/hashicorp.list && \ + echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg arch=$(dpkg --print-architecture)] https://apt.releases.hashicorp.com trixie main" | tee /etc/apt/sources.list.d/hashicorp.list && \ apt-get -y update && \ # Pin Terraform version to 1.12.2 - apt-get install -y unzip python3-pip python3-netaddr terraform=1.12.2-1 packer jq && \ + apt-get install -y unzip python3-pip python3-venv terraform=1.12.2-1 packer jq && \ # install gcloud curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg && \ echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" \ @@ -42,14 +40,18 @@ RUN apt-get -y update && apt-get -y install \ # following is required to execute kubectl commands apt-get -y install google-cloud-cli-gke-gcloud-auth-plugin && \ apt-get clean && rm -rf /var/lib/apt/lists/* && \ + # create virtual environment + python3 -m venv /opt/venv && \ # install ansible and python dependencies - pip install --break-system-packages --no-cache-dir --upgrade pip && \ - pip install --break-system-packages --no-cache-dir -r https://raw.githubusercontent.com/GoogleC - loudPlatform/slurm-gcp/master/scripts/requirements.txt && \ - pip install --break-system-packages --no-cache-dir ansible && \ - pip install --break-system-packages --no-cache-dir paramiko && \ + /opt/venv/bin/pip install --no-cache-dir --upgrade pip && \ + /opt/venv/bin/pip install --no-cache-dir -r https://raw.githubusercontent.com/GoogleCloudPlatform/slurm-gcp/master/scripts/requirements.txt && \ + /opt/venv/bin/pip install --no-cache-dir ansible && \ + /opt/venv/bin/pip install --no-cache-dir paramiko && \ + /opt/venv/bin/pip install --no-cache-dir netaddr && \ rm -rf ~/.cache/pip/* && \ # compile the binary to warm up `/ghpc_go_cache` cd /workspace && make gcluster && \ # remove /workspace to reduce image size rm -rf /workspace + +ENV PATH="/opt/venv/bin:$PATH" From 4a84b633b9a05e51fcd8f3c6c6ba671dd164b49f Mon Sep 17 00:00:00 2001 From: Parul Bajaj Date: Mon, 30 Mar 2026 08:00:30 +0000 Subject: [PATCH 3/3] Update to a versioned image 1.26.1-trixie --- tools/cloud-build/images/test-runner/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cloud-build/images/test-runner/Dockerfile b/tools/cloud-build/images/test-runner/Dockerfile index a70845daa6..19824a3fc7 100644 --- a/tools/cloud-build/images/test-runner/Dockerfile +++ b/tools/cloud-build/images/test-runner/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:trixie +FROM golang:1.26.1-trixie ENV GOCACHE=/ghpc_go_cache