Skip to content

Commit c85760d

Browse files
authored
Upgrade Debian version in test runner image (#5400)
1 parent 9aacb08 commit c85760d

File tree

5 files changed

+22
-19
lines changed

5 files changed

+22
-19
lines changed

tools/cloud-build/daily-tests/ansible_playbooks/base-integration-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
ansible.builtin.add_host:
144144
hostname: "{{ remote_ip }}"
145145
groups: [remote_host]
146-
when: remote_ip | ansible.utils.ipaddr
146+
when: (remote_ip | default('')) | ansible.utils.ipaddr != false
147147

148148
- name: Wait for host tasks
149149
ansible.builtin.include_tasks: tasks/wait-for-host.yml

tools/cloud-build/daily-tests/ansible_playbooks/htcondor-integration-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
ansible.builtin.add_host:
7171
hostname: "{{ access_ip.stdout }}"
7272
groups: [remote_host]
73-
when: access_ip.stdout | ansible.utils.ipaddr
73+
when: (access_ip.stdout | default('')) | ansible.utils.ipaddr != false
7474
## Setup firewall for cloud build
7575
- name: Create firewall rule
7676
register: fw_result

tools/cloud-build/daily-tests/ansible_playbooks/slurm-integration-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
ansible.builtin.add_host:
174174
hostname: "{{ login_ip }}"
175175
groups: [remote_host]
176-
when: login_ip | ansible.utils.ipaddr
176+
when: (login_ip | default('')) | ansible.utils.ipaddr != false
177177

178178
- name: Wait for host tasks
179179
ansible.builtin.include_tasks: tasks/wait-for-host.yml

tools/cloud-build/daily-tests/ansible_playbooks/tasks/get_instance_ids.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
---
1616
- name: Gather instance information
1717
delegate_to: localhost
18-
when: deployment_name is defined and deployment_name | string
18+
when: deployment_name is defined and deployment_name | length > 0
1919
changed_when: false
2020
register: instances
2121
until: instances.rc == 0
@@ -30,7 +30,7 @@
3030
ansible.builtin.debug:
3131
var: instances.stdout
3232
- name: Print Cloud Logging command
33-
when: instances is defined and instances.stdout | list
33+
when: instances is defined and (instances.stdout | from_json | length > 0)
3434
ansible.builtin.debug:
3535
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
36-
loop: "{{ instances.stdout }}"
36+
loop: "{{ instances.stdout | from_json | default([]) }}"

tools/cloud-build/images/test-runner/Dockerfile

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,43 +12,46 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang:bullseye
15+
FROM golang:1.26.1-trixie
1616

1717
ENV GOCACHE=/ghpc_go_cache
1818

1919
# copy the source code, to build the binary
2020
# use `/workspace` to match path in cache for future builds
2121
COPY ./ /workspace
2222

23-
RUN curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - && \
24-
apt-get -y update && apt-get -y install \
25-
# `software-properties-common` providers `add-apt-repository`
26-
software-properties-common \
23+
RUN apt-get -y update && apt-get -y install \
24+
gnupg \
2725
keychain \
2826
# `dnsutils` provides `dig` used by integration tests
2927
dnsutils && \
3028
# install terraform and packer
31-
apt-add-repository "deb [arch=$(dpkg --print-architecture)] https://apt.releases.hashicorp.com bullseye main" && \
29+
curl -fsSL https://apt.releases.hashicorp.com/gpg | gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg && \
30+
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 && \
3231
apt-get -y update && \
3332
# Pin Terraform version to 1.12.2
34-
apt-get install -y unzip python3-pip python3-netaddr terraform=1.12.2-1 packer jq && \
33+
apt-get install -y unzip python3-pip python3-venv terraform=1.12.2-1 packer jq && \
3534
# install gcloud
35+
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg && \
3636
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" \
3737
| tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
38-
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg \
39-
| apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && \
4038
apt-get -y update && apt-get -y install google-cloud-sdk && \
4139
apt-get -y install kubectl && \
4240
# following is required to execute kubectl commands
4341
apt-get -y install google-cloud-cli-gke-gcloud-auth-plugin && \
4442
apt-get clean && rm -rf /var/lib/apt/lists/* && \
43+
# create virtual environment
44+
python3 -m venv /opt/venv && \
4545
# install ansible and python dependencies
46-
pip install --no-cache-dir --upgrade pip && \
47-
pip install --no-cache-dir -r https://raw.githubusercontent.com/GoogleCloudPlatform/slurm-gcp/master/scripts/requirements.txt && \
48-
pip install --no-cache-dir ansible && \
49-
pip install --no-cache-dir paramiko && \
46+
/opt/venv/bin/pip install --no-cache-dir --upgrade pip && \
47+
/opt/venv/bin/pip install --no-cache-dir -r https://raw.githubusercontent.com/GoogleCloudPlatform/slurm-gcp/master/scripts/requirements.txt && \
48+
/opt/venv/bin/pip install --no-cache-dir ansible && \
49+
/opt/venv/bin/pip install --no-cache-dir paramiko && \
50+
/opt/venv/bin/pip install --no-cache-dir netaddr && \
5051
rm -rf ~/.cache/pip/* && \
5152
# compile the binary to warm up `/ghpc_go_cache`
5253
cd /workspace && make gcluster && \
5354
# remove /workspace to reduce image size
5455
rm -rf /workspace
56+
57+
ENV PATH="/opt/venv/bin:$PATH"

0 commit comments

Comments
 (0)