Skip to content

Commit 071ddf0

Browse files
MaciejKarasfealebenpae
authored andcommitted
Fixed failing periodic builds due to docker issues (#4119)
# Summary Previously[ daily builds](https://spruce.mongodb.com/version/67b7fa4285130c00073afdeb/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC&variant=%5Eperiodic_build%24) and particularly `enable_QEMU` evergreen function was failing with error: ``` [2025/02/21 11:23:21.026] docker: Error response from daemon: Head "REDACTED no basic auth credentials. ``` The issue happens because we have updated recently worker hosts for periodic_build to ubuntu2204 and `sudo docker` command started to look for credentials in`/etc/docker/config.json` and not in home directory. - Stop using `sudo docker`, because it looks for credentials in `/etc/docker/config.json` - Fix exception handling in `pipeline.py` ## Proof of Work `enable_QEMU` is successful -> https://spruce.mongodb.com/task/ops_manager_kubernetes_periodic_build_periodic_build_agent_1_patch_2d49e03a3eab83762cea9f325a55701f6babc0a7_67b863e3c4435e0007d35254_25_02_21_11_30_44/logs?execution=0. pipeline.py is failing, because we run it in patch, but there is no reason it should not work. ## Checklist - [ ] Have you linked a jira ticket and/or is the ticket in the title? - [x] Have you checked whether your jira ticket required DOCSP changes? - [x] Have you checked for release_note changes? ## Reminder (Please remove this when merging) - Please try to Approve or Reject Changes the PR, keep PRs in review as short as possible - Our Short Guide for PRs: [Link](REDACTED) - Remember the following Communication Standards - use comment prefixes for clarity: * **blocking**: Must be addressed before approval. * **follow-up**: Can be addressed in a later PR or ticket. * **q**: Clarifying question. * **nit**: Non-blocking suggestions. * **note**: Side-note, non-actionable. Example: Praise * --> no prefix is considered a question
1 parent 53552b9 commit 071ddf0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.evergreen-functions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ functions:
393393
working_dir: src/github.com/10gen/ops-manager-kubernetes
394394
script: |
395395
echo "Enabling QEMU building for Docker"
396-
sudo docker run --rm --privileged 268558157000.dkr.ecr.eu-west-1.amazonaws.com/docker-hub-mirrors/multiarch/qemu-user-static --reset -p yes
396+
docker run --rm --privileged 268558157000.dkr.ecr.eu-west-1.amazonaws.com/docker-hub-mirrors/multiarch/qemu-user-static --reset -p yes
397397
398398
upload_dockerfiles:
399399
- command: s3.put

pipeline.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import time
1717
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
1818
from dataclasses import dataclass
19-
from datetime import datetime, timedelta
19+
from datetime import datetime, timedelta, timezone
2020
from queue import Queue
2121
from typing import Callable, Dict, Iterable, List, Optional, Set, Tuple, Union
2222

@@ -215,7 +215,7 @@ def should_pin_at() -> Optional[Tuple[str, str]]:
215215
raise MissingEnvironmentVariable(f"pin_tag_at environment variable does not exist, but is required")
216216
if is_patch:
217217
if pinned == "00:00":
218-
raise "Pinning to midnight during a patch is not supported. Please pin to another date!"
218+
raise Exception("Pinning to midnight during a patch is not supported. Please pin to another date!")
219219

220220
hour, _, minute = pinned.partition(":")
221221
return hour, minute
@@ -239,7 +239,7 @@ def build_id() -> str:
239239
240240
"""
241241

242-
date = datetime.utcnow()
242+
date = datetime.now(timezone.utc)
243243
try:
244244
created_at = os.environ["created_at"]
245245
date = datetime.strptime(created_at, "%y_%m_%d_%H_%M_%S")

0 commit comments

Comments
 (0)