Skip to content

Commit

Permalink
ci: add arm64 and s390x support
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Chiu <yang.chiu@suse.com>
  • Loading branch information
yangchiu authored and bk201 committed Nov 23, 2022
1 parent e8c9422 commit ff3d3e0
Show file tree
Hide file tree
Showing 3 changed files with 186 additions and 22 deletions.
186 changes: 182 additions & 4 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ platform:

steps:
- name: build
image: rancher/dapper:v0.4.1
image: rancher/dapper:v0.5.8
commands:
- dapper ci
volumes:
Expand All @@ -25,7 +25,7 @@ steps:
password:
from_secret: docker_password
repo: "rancher/support-bundle-kit"
tag: ${DRONE_BRANCH}-head
tag: "${DRONE_BRANCH}-head-amd64"
username:
from_secret: docker_username
when:
Expand All @@ -43,14 +43,13 @@ steps:
password:
from_secret: docker_password
repo: "rancher/support-bundle-kit"
tag: "${DRONE_TAG}"
tag: "${DRONE_TAG}-amd64"
username:
from_secret: docker_username
when:
instance:
- drone-publish.rancher.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag
Expand All @@ -59,3 +58,182 @@ volumes:
- name: docker
host:
path: /var/run/docker.sock
---
kind: pipeline
name: arm64

platform:
os: linux
arch: arm64

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

- name: docker-publish-master
image: plugins/docker
settings:
build_args:
- ARCH=arm64
- VERSION=${DRONE_BRANCH}-${DRONE_COMMIT_SHA:0:8}-head
dockerfile: package/Dockerfile
password:
from_secret: docker_password
repo: "rancher/support-bundle-kit"
tag: "${DRONE_BRANCH}-head-arm64"
username:
from_secret: docker_username
when:
ref:
include:
- "refs/heads/master"
- "refs/heads/release/v*"
event:
- push

- name: docker-publish
image: plugins/docker
settings:
dockerfile: package/Dockerfile
password:
from_secret: docker_password
repo: "rancher/support-bundle-kit"
tag: "${DRONE_TAG}-arm64"
username:
from_secret: docker_username
when:
instance:
- drone-publish.rancher.io
ref:
- refs/tags/*
event:
- tag

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

platform:
os: linux
arch: amd64

# Hack needed for s390x: https://gist.github.com/colstrom/c2f359f72658aaabb44150ac20b16d7c#gistcomment-3858388
node:
arch: s390x

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

- name: docker-publish-master
image: rancher/drone-images:docker-s390x
settings:
build_args:
- ARCH=s390x
- VERSION=${DRONE_BRANCH}-${DRONE_COMMIT_SHA:0:8}-head
dockerfile: package/Dockerfile
password:
from_secret: docker_password
repo: "rancher/support-bundle-kit"
tag: "${DRONE_BRANCH}-head-s390x"
username:
from_secret: docker_username
when:
ref:
include:
- "refs/heads/master"
- "refs/heads/release/v*"
event:
- push

- name: docker-publish
image: rancher/drone-images:docker-s390x
settings:
dockerfile: package/Dockerfile
password:
from_secret: docker_password
repo: "rancher/support-bundle-kit"
tag: "${DRONE_TAG}-s390x"
username:
from_secret: docker_username
when:
instance:
- drone-publish.rancher.io
ref:
- refs/tags/*
event:
- tag

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

platform:
os: linux
arch: amd64

steps:
- name: manifest-master
image: plugins/manifest:1
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
platforms:
- linux/amd64
- linux/arm64
- linux/s390x
target: "rancher/support-bundle-kit:${DRONE_BRANCH}-head"
template: "rancher/support-bundle-kit:${DRONE_BRANCH}-head-ARCH"
when:
ref:
include:
- "refs/heads/master"
- "refs/heads/release/v*"
event:
- push

- name: manifest-tag
image: plugins/manifest:1
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
platforms:
- linux/amd64
- linux/arm64
- linux/s390x
target: "rancher/support-bundle-kit:${DRONE_TAG}"
template: "rancher/support-bundle-kit:${DRONE_TAG}-ARCH"
when:
instance:
- drone-publish.rancher.io
ref:
- refs/tags/*
event:
- tag

depends_on:
- amd64
- arm64
- s390x
20 changes: 3 additions & 17 deletions Dockerfile.dapper
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
FROM golang:1.18
FROM registry.suse.com/bci/golang:1.18

ARG DAPPER_HOST_ARCH
ENV ARCH $DAPPER_HOST_ARCH

# -- for make rules
## install docker client
RUN apt-get update -qq && apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release \
rsync \
&& rm -rf /var/lib/apt/lists/* \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg \
&& echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \
&& apt-get update -qq && apt-get install -y --no-install-recommends \
docker-ce docker-ce-cli containerd.io \
&& rm -rf /var/lib/apt/lists/*
RUN zypper -n install ca-certificates awk lsb-release rsync docker containerd

## install golangci
RUN if [ "${ARCH}" = "amd64" ]; then \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$(go env GOPATH)/bin" v1.50.1; \
fi
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$(go env GOPATH)/bin" v1.50.1;

## install k8s.io and generate openapi spec
RUN mkdir -p /go/src/github.com/kubernetes && \
Expand Down
2 changes: 1 addition & 1 deletion scripts/validate
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ if [[ -z "$(command -v golangci-lint)" ]]; then
fi

echo "Running: golangci-lint run"
golangci-lint run --timeout 5m
golangci-lint run --timeout 10m

0 comments on commit ff3d3e0

Please sign in to comment.