Skip to content

Commit db42980

Browse files
committed
Merge branch 'bugfix/fix-build-with-new-docker' into tmp/octopus/w/131.0/bugfix/fix-build-with-new-docker
2 parents eeba084 + ff5ebde commit db42980

File tree

8 files changed

+59
-39
lines changed

8 files changed

+59
-39
lines changed

buildchain/buildchain/docker_command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ def docker_pull(
294294
# For some reason, the repository must include the image name…
295295
f"{repository}/{name}",
296296
tag=version,
297+
platform="linux/amd64",
297298
)
298299
if digest and pulled.id != digest:
299300
raise ValueError(

buildchain/buildchain/versions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ def _version_prefix(version: str, prefix: str = "v") -> str:
199199
Image(
200200
name="pause",
201201
version="3.10",
202-
digest="sha256:873ed75102791e5b0b8a7fcd41606c92fcec98d56d05ead4ac5131650004c136",
202+
# Do not check the digest for this image, since this one is re-published
203+
# several times with the same tag
204+
digest=None,
203205
),
204206
Image(
205207
name="prometheus",

buildchain/requirements.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
-c platform-requirements.txt
2-
doit ~= 0.34.0
3-
docker ~= 4.1.0
4-
PyYAML ~= 5.3.1
2+
doit ~= 0.36.0
3+
docker ~= 7.1.0
4+
PyYAML ~= 6.0.3

buildchain/requirements.txt

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,33 @@
11
#
2-
# This file is autogenerated by pip-compile
3-
# To update, run:
2+
# This file is autogenerated by pip-compile with Python 3.10
3+
# by the following command:
44
#
5-
# tox -e pip-compile
5+
# tox -e pip-compile-buildchain
66
#
7-
certifi==2021.10.8
7+
certifi==2026.1.4
88
# via requests
9-
charset-normalizer==2.0.10
9+
charset-normalizer==3.4.4
1010
# via requests
11-
cloudpickle==2.0.0
11+
cloudpickle==3.1.2
1212
# via doit
13-
docker==4.1.0
14-
# via -r requirements.in
15-
doit==0.34.0
16-
# via -r requirements.in
17-
idna==3.7
13+
docker==7.1.0
14+
# via -r /workspaces/metalk8s/buildchain/requirements.in
15+
doit==0.36.0
16+
# via -r /workspaces/metalk8s/buildchain/requirements.in
17+
idna==3.11
1818
# via requests
19-
pyinotify==0.9.6 ; sys_platform == "linux"
20-
# via
21-
# -c platform-requirements.txt
22-
# doit
23-
pyyaml==5.3.1
24-
# via -r requirements.in
25-
requests==2.27.1
26-
# via docker
27-
six==1.16.0
28-
# via docker
29-
urllib3==1.26.8
30-
# via requests
31-
websocket-client==1.2.3
19+
importlib-metadata==8.7.1
20+
# via doit
21+
pyyaml==6.0.3
22+
# via -r /workspaces/metalk8s/buildchain/requirements.in
23+
requests==2.32.5
3224
# via docker
25+
urllib3==2.6.3
26+
# via
27+
# docker
28+
# requests
29+
zipp==3.23.0
30+
# via importlib-metadata
31+
# Note: these come from 'buildchain/platform-requirements.txt'
32+
macfsevents==0.8.1; sys_platform=="darwin" # via doit
33+
pyinotify==0.9.6; sys_platform=="linux" # via doit

doit.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
OSTYPE="$(uname -s)"
44
# System-wide Python 3 command.
55
PYTHON_SYS="${PYTHON_SYS:-python3}"
6-
MINIMUM_PYTHON_VERSION='(3, 6)'
6+
MINIMUM_PYTHON_VERSION='(3, 10)'
77
# Buildchain location.
88
BUILDCHAIN=buildchain
99
# Location of the virtual environment for the buildchain.
@@ -26,7 +26,7 @@ EOF
2626

2727
if [ "$?" -eq 1 ];
2828
then
29-
echo "$($PYTHON_SYS -V) too old, 3.6 minimum is required" >&2
29+
echo "$($PYTHON_SYS -V) too old, 3.10 minimum is required" >&2
3030
exit 1
3131
fi
3232

salt/_modules/containerd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def load_cri_image(path, fullname=None):
2626
Path of the Docker image archive to load
2727
"""
2828
log.info('Importing image from "%s" into CRI cache', path)
29-
cmd = f'ctr --debug -n k8s.io image import "{path}"'
29+
cmd = f'ctr --debug -n k8s.io image import --platform "linux/amd64" "{path}"'
3030
if fullname:
3131
cmd += f' --index-name "{fullname}"'
3232
return __salt__["cmd.run_all"](cmd)

salt/tests/unit/modules/test_containerd.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ def test_load_cri_image(self, path):
3737
with patch.dict(containerd.__salt__, {"cmd.run_all": mock_cmd}):
3838
self.assertEqual(containerd.load_cri_image(path), cmd)
3939
mock_cmd.assert_called_once_with(
40-
'ctr --debug -n k8s.io image import "{}"'.format(path)
40+
'ctr --debug -n k8s.io image import --platform "linux/amd64" "{}"'.format(
41+
path
42+
)
4143
)
4244

4345
def test_load_cri_image_with_fullname(self):
@@ -61,5 +63,5 @@ def test_load_cri_image_with_fullname(self):
6163
cmd,
6264
)
6365
mock_cmd.assert_called_once_with(
64-
'ctr --debug -n k8s.io image import "/tmp/toto.tar" --index-name "abc.def/my-image:3.5"'
66+
'ctr --debug -n k8s.io image import --platform "linux/amd64" "/tmp/toto.tar" --index-name "abc.def/my-image:3.5"'
6567
)

tox.ini

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,19 @@ skip_install = true
1212
setenv =
1313
VIRTUALENV_NO_DOWNLOAD=1
1414

15-
[testenv:pip-compile]
15+
[testenv:pip-compile-buildchain]
1616
description =
17-
Update the requirements.txt files.
18-
basepython = python3.6
17+
Update the requirements.txt file for the buildchain.
18+
basepython = python3
19+
# Ensure it's a Python 3.10+ environment
20+
commands_pre =
21+
python -c "import sys; assert sys.version_info >= (3, 10), f'Python >= 3.10 required, got {sys.version_info}'"
1922
skip_install = true
2023
deps =
21-
pip==20.3.3
22-
pip-tools==5.4.0
24+
pip~=26.0.0
25+
pip-tools~=7.5.0
2326
setenv =
24-
CUSTOM_COMPILE_COMMAND = tox -e pip-compile
27+
CUSTOM_COMPILE_COMMAND = tox -e pip-compile-buildchain
2528
allowlist_externals =
2629
gawk
2730
bash
@@ -37,6 +40,17 @@ commands =
3740
# Add pyinotify and macfsevents from platform-requirements.txt
3841
bash -c 'cat "{toxinidir}/buildchain/platform-requirements.txt" >> "{toxinidir}/buildchain/requirements.txt"'
3942

43+
[testenv:pip-compile]
44+
description =
45+
Update the requirements.txt files.
46+
basepython = python3.6
47+
skip_install = true
48+
deps =
49+
pip==20.3.3
50+
pip-tools==5.4.0
51+
setenv =
52+
CUSTOM_COMPILE_COMMAND = tox -e pip-compile
53+
commands =
4054
pip-compile \
4155
--emit-index-url --emit-trusted-host --annotate \
4256
--allow-unsafe \

0 commit comments

Comments
 (0)