Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Migrate to SLE BCI images (#193)
* migrate to SLE BCI images

* remove arm pipeline

We do not need to build for armv7 anymore and there are no SLE BCI images available for it.
  • Loading branch information
thomasferrandiz committed Apr 25, 2022
1 parent e29895b commit 27ff123
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 89 deletions.
67 changes: 0 additions & 67 deletions .drone.yml
Expand Up @@ -247,71 +247,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 @@ -331,7 +266,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 @@ -369,4 +303,3 @@ depends_on:
- amd64
- s390x
- arm64
- arm
9 changes: 7 additions & 2 deletions Dockerfile.dapper
@@ -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
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
@@ -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"
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
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
@@ -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

0 comments on commit 27ff123

Please sign in to comment.