Skip to content

Commit 965302d

Browse files
committed
Remove create and push manifests
1 parent 92d62fa commit 965302d

File tree

1 file changed

+2
-48
lines changed

1 file changed

+2
-48
lines changed

scripts/release/atomic_pipeline.py

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,16 @@
66
import json
77
import os
88
import shutil
9-
import subprocess
10-
import time
119
from concurrent.futures import ProcessPoolExecutor
1210
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
1412

1513
import requests
1614
import semver
1715
from opentelemetry import trace
1816
from packaging.version import Version
1917

20-
import docker
18+
2119
from lib.base_logger import logger
2220
from scripts.evergreen.release.agent_matrix import (
2321
get_supported_operator_versions,
@@ -71,50 +69,6 @@ def load_release_file() -> Dict:
7169
return json.load(release)
7270

7371

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-
11872
@TRACER.start_as_current_span("sonar_build_image")
11973
def pipeline_process_image(
12074
image_name: str,

0 commit comments

Comments
 (0)