Skip to content

Commit

Permalink
Add s390x arch support (rancher#36034)
Browse files Browse the repository at this point in the history
* Add s390x drone pipelines

* Increase kustomize version to v4.4.1

* Install golang 1.16 using zypper

* Increase loglevel version to v0.1.4

* Add rancher system agent for s390x

* Add unsupported arch env for s390x

* Increase telemetry version

* Add tini for s390x

* Skip integration tests for s390x

* Skip helm v2 instalation since s390x is not supported

* Skip k3s installation for s390x arch

* Remove helm & tiller from jailer for s390x

* Update shell image which supports s390x

* Add failure:ignore to drone s390x pipelines

This is to ensure that if any step of s390x pipeline fails, other steps or pipelines like manifest do not fail. So added ignore missing to manifest step pipeline

* Skip k3s

* Get k3s binaries from k3s-root for s390x as k3s is not available

* Remove duplicated code in Dockerfile

* Set K3S_BUILDER default value to rancher/k3s:v1.22.5-k3s1

Co-authored-by: raulcabello <[email protected]>
  • Loading branch information
rohitsakala and raulcabello authored Jan 21, 2022
1 parent cf64177 commit 1949f73
Show file tree
Hide file tree
Showing 15 changed files with 377 additions and 33 deletions.
261 changes: 261 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,214 @@ volumes:
host:
path: /var/run/docker.sock

trigger:
event:
exclude:
- promote
---
kind: pipeline
name: default-linux-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
failure: ignore
commands:
- K3S_BUILDER=k3s_root dapper ci
privileged: true
volumes:
- name: docker
path: /var/run/docker.sock
when:
event:
- push
- pull_request
- tag

- name: stage-binaries
image: rancher/dapper:v0.5.8
failure: ignore
commands:
- "cp -r ./bin/* ./package/"
when:
event:
- push
- tag

- name: docker-publish-head
image: rancher/drone-docker-image-digests:v0.0.13
failure: ignore
volumes:
- name: docker
path: /var/run/docker.sock
settings:
purge: false
build_args:
- ARCH=s390x
- VERSION=${DRONE_BRANCH/release\//}-${DRONE_COMMIT}-head
- K3S_BUILDER=k3s_root
context: package/
custom_dns: 1.1.1.1
dockerfile: package/Dockerfile
tag: ${DRONE_BRANCH/release\//}-${DRONE_COMMIT}-linux-s390x
password:
from_secret: docker_password
repo: rancher/rancher
username:
from_secret: docker_username
when:
ref:
include:
- "refs/heads/master"
- "refs/heads/release/v*"
event:
- push

- name: docker-publish-head-installer
image: rancher/drone-images:docker-s390x
failure: ignore
volumes:
- name: docker
path: /var/run/docker.sock
settings:
purge: false
build_args:
- ARCH=s390x
- VERSION=${DRONE_BRANCH/release\//}-${DRONE_COMMIT}-head
- RANCHER_TAG=${DRONE_BRANCH/release\//}-${DRONE_COMMIT}-linux-s390x
context: package/
custom_dns: 1.1.1.1
dockerfile: package/Dockerfile.installer
tag: ${DRONE_BRANCH/release\//}-${DRONE_COMMIT}-linux-s390x
password:
from_secret: docker_password
repo: rancher/system-agent-installer-rancher
username:
from_secret: docker_username
when:
ref:
include:
- "refs/heads/master"
- "refs/heads/release/v*"
event:
- push

- name: docker-publish-head-agent
image: rancher/drone-images:docker-s390x
failure: ignore
volumes:
- name: docker
path: /var/run/docker.sock
settings:
purge: false
build_args:
- ARCH=s390x
- VERSION=${DRONE_BRANCH/release\//}-${DRONE_COMMIT}-head
- RANCHER_TAG=${DRONE_BRANCH/release\//}-${DRONE_COMMIT}-linux-s390x
context: package/
custom_dns: 1.1.1.1
dockerfile: package/Dockerfile.agent
tag: ${DRONE_BRANCH/release\//}-${DRONE_COMMIT}-linux-s390x
password:
from_secret: docker_password
repo: rancher/rancher-agent
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
failure: ignore
volumes:
- name: docker
path: /var/run/docker.sock
settings:
purge: false
build_args:
- ARCH=s390x
- "VERSION=${DRONE_TAG}"
context: package/
custom_dns: 1.1.1.1
dockerfile: package/Dockerfile
password:
from_secret: docker_password
repo: rancher/rancher
tag: "${DRONE_TAG}-linux-s390x"
username:
from_secret: docker_username
when:
event:
- tag

- name: docker-publish-installer
image: rancher/drone-images:docker-s390x
failure: ignore
volumes:
- name: docker
path: /var/run/docker.sock
settings:
purge: false
build_args:
- ARCH=s390x
- "VERSION=${DRONE_TAG}"
- "RANCHER_TAG=${DRONE_TAG}-linux-s390x"
context: package/
custom_dns: 1.1.1.1
dockerfile: package/Dockerfile.installer
password:
from_secret: docker_password
repo: rancher/system-agent-installer-rancher
tag: "${DRONE_TAG}-linux-s390x"
username:
from_secret: docker_username
when:
event:
- tag

- name: docker-publish-agent
image: rancher/drone-images:docker-s390x
failure: ignore
volumes:
- name: docker
path: /var/run/docker.sock
settings:
purge: false
build_args:
- ARCH=s390x
- "VERSION=${DRONE_TAG}"
- "RANCHER_TAG=${DRONE_TAG}-linux-s390x"
context: package/
custom_dns: 1.1.1.1
dockerfile: package/Dockerfile.agent
password:
from_secret: docker_password
repo: rancher/rancher-agent
tag: "${DRONE_TAG}-linux-s390x"
username:
from_secret: docker_username
when:
event:
- tag

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

trigger:
event:
exclude:
Expand Down Expand Up @@ -929,6 +1137,7 @@ steps:
password:
from_secret: docker_password
spec: manifest-installer.tmpl
ignore_missing: true
when:
instance:
include:
Expand All @@ -945,6 +1154,7 @@ steps:
password:
from_secret: docker_password
spec: manifest-installer-head.tmpl
ignore_missing: true
when:
instance:
include:
Expand All @@ -960,6 +1170,7 @@ steps:
password:
from_secret: docker_password
spec: manifest-agent.tmpl
ignore_missing: true
when:
instance:
include:
Expand All @@ -976,6 +1187,7 @@ steps:
password:
from_secret: docker_password
spec: manifest-agent-head.tmpl
ignore_missing: true
when:
instance:
include:
Expand All @@ -991,6 +1203,7 @@ steps:
password:
from_secret: docker_password
spec: manifest-head.tmpl
ignore_missing: true
when:
instance:
include:
Expand All @@ -1006,6 +1219,7 @@ steps:
password:
from_secret: docker_password
spec: manifest.tmpl
ignore_missing: true
when:
instance:
include:
Expand Down Expand Up @@ -1071,6 +1285,7 @@ trigger:
depends_on:
- default-linux-amd64
- default-linux-arm64
- default-linux-s390x
- default-windows-1809
- default-windows-20H2
- default-windows-ltsc2022
Expand Down Expand Up @@ -1159,6 +1374,52 @@ depends_on:
- default-linux-arm64
---
kind: pipeline
name: docker-image-digests-linux-s390x

platform:
os: linux
arch: amd64

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

steps:
- name: docker-image-digests
image: rancher/drone-docker-digests:s390x
failure: ignore
environment:
PLUGIN_GITHUB_REPOSITORY: "rancher/rancher"
PLUGIN_GITHUB_TOKEN:
from_secret: github_token
PLUGIN_GITHUB_TAG: "${DRONE_TAG}"
PLUGIN_INPUT_FILE: "rancher-images.txt"
PLUGIN_OUTPUT_FILE: "rancher-images-digests-linux-s390x.txt"
PLUGIN_REGISTRY: "docker.io"
volumes:
- name: docker
path: /var/run/docker.sock
when:
instance:
include:
- drone-publish.rancher.io
event:
- tag

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

trigger:
event:
exclude:
- promote

depends_on:
- default-linux-s390x
---
kind: pipeline
name: docker-image-digests-windows-1809

platform:
Expand Down
Loading

0 comments on commit 1949f73

Please sign in to comment.