Skip to content

Commit 86ad168

Browse files
committed
images: use pre-built terraform providers
Since openshift/release#39563 there should be now an `installer-terraform-providers` image in the CI namespace with pre-built terraform provider binaries. If no changes are detected from the last time the providers were built, we skip building the providers which can save us around 1h in the CI tests.
1 parent fd72112 commit 86ad168

File tree

6 files changed

+21
-0
lines changed

6 files changed

+21
-0
lines changed

images/baremetal/Dockerfile.ci

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33

44
ARG libvirt_version="8.0.0"
55

6+
FROM registry.ci.openshift.org/ocp/4.15:installer-terraform-providers as providers
7+
68
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.20-openshift-4.15 AS builder
79
ARG libvirt_version
810
ARG TAGS="libvirt baremetal"
911
RUN dnf install -y libvirt-devel-$libvirt_version && \
1012
dnf clean all && rm -rf /var/cache/yum/*
1113
WORKDIR /go/src/github.com/openshift/installer
1214
COPY . .
15+
COPY --from=providers /go/src/github.com/openshift/installer/terraform/bin/ terraform/bin/
1316
RUN DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh
1417

1518

images/installer-artifacts/Dockerfile.rhel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,34 @@
11
# This Dockerfile builds an image containing Mac and Linux/AMD64 versions of
22
# the installer layered on top of the cluster-native Linux installer image.
33

4+
FROM registry.ci.openshift.org/ocp/4.15:installer-terraform-providers as providers
5+
46
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.20-openshift-4.15 AS macbuilder
57
ARG TAGS=""
68
WORKDIR /go/src/github.com/openshift/installer
79
COPY . .
10+
COPY --from=providers /go/src/github.com/openshift/installer/terraform/bin/darwin_amd64 terraform/bin/darwin_amd64
811
RUN GOOS=darwin GOARCH=amd64 DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh
912

1013
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.20-openshift-4.15 AS macarmbuilder
1114
ARG TAGS=""
1215
WORKDIR /go/src/github.com/openshift/installer
1316
COPY . .
17+
COPY --from=providers /go/src/github.com/openshift/installer/terraform/bin/darwin_arm64 terraform/bin/darwin_arm64
1418
RUN GOOS=darwin GOARCH=arm64 DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh
1519

1620
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.20-openshift-4.15 AS linuxbuilder
1721
ARG TAGS=""
1822
WORKDIR /go/src/github.com/openshift/installer
1923
COPY . .
24+
COPY --from=providers /go/src/github.com/openshift/installer/terraform/bin/linux_amd64 terraform/bin/linux_amd64
2025
RUN GOOS=linux GOARCH=amd64 DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh
2126

2227
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.20-openshift-4.15 AS linuxarmbuilder
2328
ARG TAGS=""
2429
WORKDIR /go/src/github.com/openshift/installer
2530
COPY . .
31+
COPY --from=providers /go/src/github.com/openshift/installer/terraform/bin/linux_arm64 terraform/bin/linux_arm64
2632
RUN GOOS=linux GOARCH=arm64 DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh
2733

2834
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.20-openshift-4.15 AS builder

images/installer/Dockerfile.ci

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# This Dockerfile is used by CI to publish the installer image.
22
# It builds an image containing only the openshift-install.
33

4+
FROM registry.ci.openshift.org/ocp/4.15:installer-terraform-providers as providers
5+
46
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.20-openshift-4.15 AS builder
57
ARG TAGS=""
68
WORKDIR /go/src/github.com/openshift/installer
79
COPY . .
10+
COPY --from=providers /go/src/github.com/openshift/installer/terraform/bin/ terraform/bin/
811
RUN DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh
912
RUN go run -mod=vendor hack/build-coreos-manifest.go
1013

images/installer/Dockerfile.upi.ci

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
# It builds an image containing binaries like jq, terraform, awscli, oc, etc. to allow bringing up UPI infrastructure.
33
# It also contains the `upi` directory that contains various terraform and cloud formation templates that are used to create infrastructure resources.
44

5+
FROM registry.ci.openshift.org/ocp/4.15:installer-terraform-providers as providers
6+
57
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.20-openshift-4.14 AS builder
68
ARG TAGS=""
79
WORKDIR /go/src/github.com/openshift/installer
810
COPY . .
11+
COPY --from=providers /go/src/github.com/openshift/installer/terraform/bin/ terraform/bin/
912
RUN DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh
1013

1114
FROM registry.ci.openshift.org/ocp/4.15:cli as cli

images/libvirt/Dockerfile.ci

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# This Dockerfile is a used by CI to publish an installer image for creating libvirt clusters
22
# It builds an image containing openshift-install and nss-wrapper for remote deployments, as well as the google cloud-sdk for nested GCE environments.
33

4+
FROM registry.ci.openshift.org/ocp/4.15:installer-terraform-providers as providers
5+
46
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.20-openshift-4.14 AS builder
57
ARG TAGS="libvirt"
68
RUN yum install -y libvirt-devel && \
79
yum clean all && rm -rf /var/cache/yum/*
810
WORKDIR /go/src/github.com/openshift/installer
911
COPY . .
12+
COPY --from=providers /go/src/github.com/openshift/installer/terraform/bin/ terraform/bin/
1013
RUN DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh
1114

1215
FROM quay.io/centos/centos:stream

images/openstack/Dockerfile.ci

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# This Dockerfile is used by CI to test using OpenShift Installer against an OpenStack cloud.
22
# It builds an image containing the openshift-install command as well as the openstack cli.
3+
FROM registry.ci.openshift.org/ocp/4.15:installer-terraform-providers as providers
4+
35
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.20-openshift-4.14 AS builder
46
ARG TAGS=""
57
WORKDIR /go/src/github.com/openshift/installer
68
COPY . .
9+
COPY --from=providers /go/src/github.com/openshift/installer/terraform/bin/ terraform/bin/
710
RUN DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh
811

912
FROM registry.ci.openshift.org/ocp/4.15:cli AS cli

0 commit comments

Comments
 (0)