|
6 | 6 | import json |
7 | 7 | import os |
8 | 8 | import shutil |
9 | | -import subprocess |
10 | | -import time |
11 | 9 | from concurrent.futures import ProcessPoolExecutor |
12 | 10 | from queue import Queue |
13 | | -from typing import Callable, Dict, Iterable, List, Optional, Tuple, Union |
| 11 | +from typing import Callable, Dict, List, Optional, Tuple, Union |
14 | 12 |
|
15 | 13 | import requests |
16 | 14 | import semver |
17 | 15 | from opentelemetry import trace |
18 | 16 | from packaging.version import Version |
19 | 17 |
|
20 | | -import docker |
| 18 | + |
21 | 19 | from lib.base_logger import logger |
22 | 20 | from scripts.evergreen.release.agent_matrix import ( |
23 | 21 | get_supported_operator_versions, |
@@ -71,50 +69,6 @@ def load_release_file() -> Dict: |
71 | 69 | return json.load(release) |
72 | 70 |
|
73 | 71 |
|
74 | | -def create_and_push_manifest(image: str, tag: str, architectures: list[str]) -> None: |
75 | | - """ |
76 | | - Generates docker manifests by running the following commands: |
77 | | - 1. Clear existing manifests |
78 | | - docker manifest rm config.repo_url/image:tag |
79 | | - 2. Create the manifest |
80 | | - docker manifest create config.repo_url/image:tag --amend config.repo_url/image:tag-amd64 --amend config.repo_url/image:tag-arm64 |
81 | | - 3. Push the manifest |
82 | | - docker manifest push config.repo_url/image:tag |
83 | | -
|
84 | | - This method calls docker directly on the command line, this is different from the rest of the code which uses |
85 | | - Sonar as an interface to docker. We decided to keep this asymmetry for now, as Sonar will be removed soon. |
86 | | - """ |
87 | | - logger.debug(f"image: {image}, tag: {tag}, architectures: {architectures}") |
88 | | - final_manifest = image |
89 | | - logger.debug(f"push_manifest - final_manifest={final_manifest}") |
90 | | - |
91 | | - args = [ |
92 | | - "docker", |
93 | | - "manifest", |
94 | | - "create", |
95 | | - final_manifest, |
96 | | - ] |
97 | | - |
98 | | - for arch in architectures: |
99 | | - logger.debug(f"push_manifest - amending {final_manifest}:{tag}-{arch}") |
100 | | - args.extend(["--amend", f"{final_manifest}:{tag}-{arch}"]) |
101 | | - |
102 | | - args_str = " ".join(args) |
103 | | - logger.debug(f"creating new manifest: {args_str}") |
104 | | - cp = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
105 | | - |
106 | | - if cp.returncode != 0: |
107 | | - raise Exception(cp.stderr) |
108 | | - |
109 | | - args = ["docker", "manifest", "push", final_manifest] |
110 | | - args_str = " ".join(args) |
111 | | - logger.info(f"pushing new manifest: {args_str}") |
112 | | - cp = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
113 | | - |
114 | | - if cp.returncode != 0: |
115 | | - raise Exception(cp.stderr) |
116 | | - |
117 | | - |
118 | 72 | @TRACER.start_as_current_span("sonar_build_image") |
119 | 73 | def pipeline_process_image( |
120 | 74 | image_name: str, |
|
0 commit comments