Skip to content

Commit 2fe48e9

Browse files
committed
Add binaries to iib worker Dockerfile and move iib_ocp_opm_mapping as default in config.py
Assisted-by: Cursor/ChatGPT [CLOUDDST-31191]
1 parent f08be8f commit 2fe48e9

2 files changed

Lines changed: 44 additions & 10 deletions

File tree

docker/Dockerfile-workers

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,37 @@ RUN dnf -y install \
2828
&& dnf update -y \
2929
&& dnf clean all
3030

31-
ADD https://github.com/operator-framework/operator-registry/releases/download/v1.26.4/linux-amd64-opm /usr/bin/opm-v1.26.4
32-
RUN chmod +x /usr/bin/opm-v1.26.4
33-
ADD https://github.com/operator-framework/operator-registry/releases/download/v1.40.0/linux-amd64-opm /usr/bin/opm-v1.40.0
34-
RUN chmod +x /usr/bin/opm-v1.40.0
35-
# Create a link for default opm
36-
RUN ln -s /usr/bin/opm-v1.26.4 /usr/bin/opm
37-
RUN chmod +x /usr/bin/opm
31+
# Install all opm variants,
32+
# then expose the default opm via symlink.
33+
RUN set -eux; \
34+
install_binary() { \
35+
local name="$1"; local url="$2"; local sha="$3"; \
36+
curl -fsSL "$url" -o "/usr/local/bin/${name}"; \
37+
echo "${sha} /usr/local/bin/${name}" | sha256sum -c -; \
38+
chmod 0555 "/usr/local/bin/${name}"; \
39+
}; \
40+
install_binary "opm-v1.26.4" "https://github.com/operator-framework/operator-registry/releases/download/v1.26.4/linux-amd64-opm" "cf94e9dbd58c338e1eed03ca50af847d24724b99b40980812abbe540e8c7ff8e"; \
41+
install_binary "opm-v1.28.0" "https://github.com/operator-framework/operator-registry/releases/download/v1.28.0/linux-amd64-opm" "e18e5abc8febb63c9dc76db0f33475553d98495465bd2dca81c39dcdbc875c08"; \
42+
install_binary "opm-v1.40.0" "https://github.com/operator-framework/operator-registry/releases/download/v1.40.0/linux-amd64-opm" "33eb929264a69f31895e1973248b7e97e3b6a862d7ca27f6892e158f79ad6aeb"; \
43+
install_binary "opm-v1.44.0" "https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/linux-amd64-opm" "21f0a423dfbfcddcffdde98266307a08d87b4db980be859b9e252a5a24df51bf"; \
44+
install_binary "opm-v1.48.0" "https://github.com/operator-framework/operator-registry/releases/download/v1.48.0/linux-amd64-opm" "0a301826baff730489162caff13e04f7dc16c1a79072cbcbdfc5379d95caef40"; \
45+
install_binary "opm-v1.50.0" "https://github.com/operator-framework/operator-registry/releases/download/v1.50.0/linux-amd64-opm" "d9bfdc08dd9640c1d9085d191f10f884f2ef29370db1ac097a73a0e23e803f95"; \
46+
install_binary "opm-v1.57.0" "https://github.com/operator-framework/operator-registry/releases/download/v1.57.0/linux-amd64-opm" "8d2f51f166f47f76eb6906c4de9af90462b7163cbacef6c932bda4829ec086c7"; \
47+
install_binary "opm-v1.61.0" "https://github.com/operator-framework/operator-registry/releases/download/v1.61.0/linux-amd64-opm" "c5701ef59e12c930337a9a9363cd44c2a4d9f64f6d4f96513d3511a36f81cf5d"; \
48+
install_binary "operator-sdk" "https://github.com/operator-framework/operator-sdk/releases/download/v1.15.0/operator-sdk_linux_amd64" "d2065f1f7a0d03643ad71e396776dac0ee809ef33195e0f542773b377bab1b2a" \
49+
# set default opm \
50+
ln -sfn /usr/local/bin/opm-v1.26.4 /usr/local/bin/opm
51+
3852
ADD https://github.com/fullstorydev/grpcurl/releases/download/v1.8.5/grpcurl_1.8.5_linux_x86_64.tar.gz /src/grpcurl_1.8.5_linux_x86_64.tar.gz
3953
RUN cd /usr/bin && tar -xf /src/grpcurl_1.8.5_linux_x86_64.tar.gz grpcurl && rm -f /src/grpcurl_1.8.5_linux_x86_64.tar.gz
40-
ADD https://github.com/operator-framework/operator-sdk/releases/download/v1.15.0/operator-sdk_linux_amd64 /usr/bin/operator-sdk
41-
RUN chmod +x /usr/bin/operator-sdk
4254

4355
RUN curl -L "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest-4.10/openshift-client-linux.tar.gz" -o /tmp/oc_client.tar.gz && \
4456
tar -xvzf /tmp/oc_client.tar.gz -C /usr/bin/ && \
4557
rm /tmp/oc_client.tar.gz /usr/bin/README.md
4658

4759
RUN curl -L "https://github.com/oras-project/oras/releases/download/v1.3.0/oras_1.3.0_linux_amd64.tar.gz" -o /tmp/oras.tar.gz && \
4860
tar -xvzf /tmp/oras.tar.gz -C /usr/bin/ && \
49-
rm /tmp/oc_client.tar.gz /usr/bin/LICENSE
61+
rm /tmp/oras.tar.gz /usr/bin/LICENSE
5062

5163
RUN git config --global user.email "[email protected]"
5264
RUN git config --global user.name "IIB dev-env"

iib/workers/config.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,28 @@ class Config(object):
4040
"opm_port": (50051, 50151),
4141
"opm_pprof_port": (50151, 50251),
4242
}
43+
iib_ocp_opm_mapping: Dict[str, str] = {
44+
# keep v0.0, v4.5 for iib-api-tests
45+
"v0.0": "opm-v1.28.0",
46+
"v4.5": "opm-v1.26.4",
47+
"v4.6": "opm-v1.26.4",
48+
"v4.7": "opm-v1.26.4",
49+
"v4.8": "opm-v1.26.4",
50+
"v4.9": "opm-v1.26.4",
51+
"v4.10": "opm-v1.26.4",
52+
"v4.11": "opm-v1.26.4",
53+
"v4.12": "opm-v1.26.4",
54+
"v4.13": "opm-v1.26.4",
55+
"v4.14": "opm-v1.26.4",
56+
"v4.15": "opm-v1.26.4",
57+
"v4.16": "opm-v1.26.4",
58+
"v4.17": "opm-v1.40.0",
59+
"v4.18": "opm-v1.44.0",
60+
"v4.19": "opm-v1.48.0",
61+
"v4.20": "opm-v1.50.0",
62+
"v4.21": "opm-v1.50.0",
63+
"v4.22": "opm-v1.61.0",
64+
}
4365
iib_opm_pprof_lock_required_min_version = "1.29.0"
4466
iib_image_push_template: str = '{registry}/iib-build:{request_id}'
4567
# Default registry for index.db ImageStream

0 commit comments

Comments
 (0)