Skip to content

Migrate to SLE BCI images #193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 0 additions & 67 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,71 +250,6 @@ volumes:
host:
path: /var/run/docker.sock

---
kind: pipeline
name: arm

platform:
os: linux
arch: arm

steps:
- name: build
image: rancher/dapper:v0.5.0
commands:
- dapper ci
volumes:
- name: docker
path: /var/run/docker.sock

- name: upload-artifacts
image: plugins/github-release
settings:
api_key:
from_secret: github_token
prerelease: true
checksum:
- sha256
checksum_file: CHECKSUMsum-arm.txt
checksum_flatten: true
files:
- "dist/artifacts/*"
when:
instance:
- drone-publish.rancher.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag

- name: push-controller
image: plugins/docker
settings:
dockerfile: package/Dockerfile
build_args:
- ARCH=arm
- TAG=${DRONE_TAG}-arm
password:
from_secret: docker_password
repo: "rancher/system-upgrade-controller"
tag: "${DRONE_TAG}-arm"
username:
from_secret: docker_username
when:
instance:
- drone-publish.rancher.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag

volumes:
- name: docker
host:
path: /var/run/docker.sock

---
kind: pipeline
name: manifest
Expand All @@ -334,7 +269,6 @@ steps:
platforms:
- linux/amd64
- linux/arm64
- linux/arm
- linux/s390x
target: "rancher/system-upgrade-controller:${DRONE_TAG}"
template: "rancher/system-upgrade-controller:${DRONE_TAG}-ARCH"
Expand Down Expand Up @@ -372,4 +306,3 @@ depends_on:
- amd64
- s390x
- arm64
- arm
9 changes: 7 additions & 2 deletions Dockerfile.dapper
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
ARG KUBECTL=rancher/kubectl:v1.21.9
FROM ${KUBECTL} AS kubectl

FROM golang:1.16-alpine3.14
FROM registry.suse.com/bci/golang:1.17-11.33

COPY --from=kubectl /bin/kubectl /usr/local/bin/kubectl
# COPY --from=sonobuoy /sonobuoy /usr/local/bin/sonobuoy

ARG DAPPER_HOST_ARCH
ENV ARCH $DAPPER_HOST_ARCH

RUN apk -U add coreutils bash expect git gcc jq musl-dev docker docker-compose vim less file curl wget ca-certificates iproute2
RUN zypper -n install expect git jq docker vim less file curl wget iproute2 gawk
# Manual install of docker-compose, only needed for e2e tests on amd64
RUN if [ "${ARCH}" == "amd64" ]; then \
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64" -o /usr/local/bin/docker-compose && \
chmod +x /usr/local/bin/docker-compose; \
fi
RUN go install github.com/mgechev/revive@v1.1.1 && \
rm -rf /go/src /go/pkg
RUN go install golang.org/x/tools/cmd/goimports@latest && \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ spec:
tolerations:
- {key: kubernetes.io/arch, effect: NoSchedule, operator: Equal, value: amd64}
- {key: kubernetes.io/arch, effect: NoSchedule, operator: Equal, value: arm64}
- {key: kubernetes.io/arch, effect: NoSchedule, operator: Equal, value: arm}
- {key: kubernetes.io/arch, effect: NoSchedule, operator: Equal, value: s390x}

# The prepare init container, if specified, is run before cordon/drain which is run before the upgrade container.
# Shares the same format as the `upgrade` container.
Expand Down
7 changes: 3 additions & 4 deletions e2e/cluster/local/images/k3s/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Install the all-in-one binary so we can copy our run-time images into the image
# which helps avoid pulling them when running e2e tests.
ARG ALPINE="library/alpine:3.14"
FROM ${ALPINE} AS k3s
ARG SLES="registry.suse.com/suse/sle15:15.3"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why SLES here instead of BCI? Unpacked on my system, the SLES image is 7 times larger than Alpine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact it looks like bci-base and sle15 images are identical.
If you check here, they have the same digest:
https://registry.suse.com/static/suse/sle15sp3/index.html
https://registry.suse.com/static/bci/bci-base/index.html

But I agree it is unfortunate that they are so large.

There are also bci-minimal and bci-micro images which are small but they are still in Tech Preview.
As I understand, @macedogm is preparing a proposal to use them with sidecars but I don't know if we can use that yet.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm discussing internally about which image to "standardize". I don't believe that we will follow with the idea of the sidecar, but actually with a mix of bci-micro and bci-base/sle15 (when really needed). Let's see how it'll progress.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

registry.suse.com/suse/sle15:15.3 is sle-bci, not full SLES.

FROM ${SLES} AS k3s
ARG ARCH
ARG K3S_VERSION="v1.21.9+k3s1"
RUN set -x \
&& apk --no-cache add \
bash \
&& zypper -n in \
ca-certificates \
curl \
&& if [ "${ARCH?required}" != "amd64" ]; then \
Expand Down
8 changes: 4 additions & 4 deletions e2e/cluster/local/scripts/cluster-prepare
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

: "${ARCH?required}"
: "${DIST?required}"
: "${ALPINE_TAG:=3.14}"
: "${SLES_TAG:=15.3}"
: "${KUBECTL_TAG:=v1.21.9}"
: "${SONOBUOY_TAG:=v0.56.2}"

Expand All @@ -15,15 +15,15 @@ docker-image-save() {
echo "Tagging '$1:$2' as '$1:latest' ..."
docker image tag "$1:$2" "$1:latest"

echo "Saving '$1' images to '$(dirname $0)/../images/k3s/scratch/${1/\//-}-${ARCH}.tar' ..."
docker image save --output "$(dirname $0)/../images/k3s/scratch/${1/\//-}-${ARCH}.tar" "$1:$2" "$1:latest"
echo "Saving '$1' images to '$(dirname $0)/../images/k3s/scratch/${1//\//-}-${ARCH}.tar' ..."
docker image save --output "$(dirname $0)/../images/k3s/scratch/${1//\//-}-${ARCH}.tar" "$1:$2" "$1:latest"
}

rm -rf $(dirname $0)/../images/*/scratch/*

cp -vf "${DIST}/system-upgrade-controller-${ARCH}.tar" $(dirname $0)/../images/k3s/scratch/
cp -vf "${DIST}/system-upgrade-controller-e2e-tests-${ARCH}.tar" $(dirname $0)/../images/k3s/scratch/

docker-image-save "library/alpine" "${ALPINE_TAG}"
docker-image-save "registry.suse.com/suse/sle15" "${SLES_TAG}"
docker-image-save "rancher/kubectl" "${KUBECTL_TAG}"
docker-image-save "sonobuoy/sonobuoy" "${SONOBUOY_TAG}"
17 changes: 6 additions & 11 deletions package/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
ARG ALPINE=alpine:3.14
ARG GOLANG=golang:1.16-alpine3.14
ARG SLES=registry.suse.com/suse/sle15:15.3
ARG GOLANG=registry.suse.com/bci/golang:1.17-11.33

FROM ${GOLANG} AS e2e-ginkgo
ENV GOBIN=/bin
RUN set -x \
&& apk add --no-cache \
ca-certificates \
git \
&& go install github.com/onsi/ginkgo/ginkgo@v1.16.4
RUN go install github.com/onsi/ginkgo/ginkgo@v1.16.4

FROM ${ALPINE} AS e2e-tests
FROM ${SLES} AS e2e-tests
ARG ARCH
ARG REPO=rancher
ARG TAG
ENV SYSTEM_UPGRADE_CONTROLLER_IMAGE=${REPO}/system-upgrade-controller:${TAG}
RUN set -x \
&& apk add --no-cache \
bash
COPY --from=e2e-ginkgo /bin/ginkgo /bin/ginkgo
COPY dist/artifacts/system-upgrade-controller.test-${ARCH} /bin/system-upgrade-controller.test
COPY e2e/plugin/run.sh /run.sh
RUN set -x \
&& chmod +x /run.sh
RUN set -x \
&& zypper -n in tar gzip
ENTRYPOINT ["/run.sh"]

FROM scratch AS controller
Expand Down