Skip to content

Commit

Permalink
Add support for linux/s390x architecture
Browse files Browse the repository at this point in the history
This commit enables platform support for the `linux/s390x` architecture
in the CI pipeline.

Signed-off-by: Bjoern Walk <[email protected]>
  • Loading branch information
bwalk-at-ibm committed Aug 28, 2023
1 parent eea27d9 commit 77e6966
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 5 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci-goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,20 @@ jobs:
strategy:
matrix:
GOOS: [linux, windows, darwin]
GOARCH: ["386", amd64, arm64, ppc64le, arm]
GOARCH: ["386", amd64, arm64, ppc64le, arm, s390x]
exclude:
- GOOS: darwin
GOARCH: "386"
- GOOS: darwin
GOARCH: s390x
- GOOS: windows
GOARCH: arm64
- GOOS: darwin
GOARCH: arm
- GOOS: windows
GOARCH: arm
- GOOS: windows
GOARCH: s390x
runs-on: ubuntu-20.04

steps:
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@ jobs:
strategy:
matrix:
GOOS: [linux, windows, darwin]
GOARCH: ["386", amd64, arm64, ppc64le, arm]
GOARCH: ["386", amd64, arm64, ppc64le, arm, s390x]
exclude:
- GOOS: darwin
GOARCH: "386"
- GOOS: darwin
GOARCH: s390x
- GOOS: windows
GOARCH: arm64
- GOOS: darwin
GOARCH: arm
- GOOS: windows
GOARCH: arm
- GOOS: windows
GOARCH: s390x
runs-on: ubuntu-20.04

steps:
Expand All @@ -30,7 +34,7 @@ jobs:

- uses: docker/setup-qemu-action@v2
with:
platforms: arm64,ppc64le,linux/arm/v7
platforms: arm64,ppc64le,linux/arm/v7,s390x

- uses: docker/setup-buildx-action@v2

Expand Down Expand Up @@ -98,7 +102,7 @@ jobs:

- uses: docker/setup-qemu-action@v2
with:
platforms: arm64,ppc64le
platforms: arm64,ppc64le,s390x

- uses: docker/setup-buildx-action@v2

Expand Down
56 changes: 56 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,22 @@ builds:
- arm
- arm64
- ppc64le
- s390x
goarm:
- "7"
ignore:
- goos: darwin
goarch: "386"
- goos: darwin
goarch: arm
- goos: darwin
goarch: s390x
- goos: windows
goarch: arm
- goos: windows
goarch: arm64
- goos: windows
goarch: s390x
dir: distributions/otelcol/_build
binary: otelcol
ldflags:
Expand All @@ -44,17 +49,22 @@ builds:
- arm
- arm64
- ppc64le
- s390x
goarm:
- "7"
ignore:
- goos: darwin
goarch: "386"
- goos: darwin
goarch: arm
- goos: darwin
goarch: s390x
- goos: windows
goarch: arm
- goos: windows
goarch: arm64
- goos: windows
goarch: s390x
dir: distributions/otelcol-contrib/_build
binary: otelcol-contrib
ldflags:
Expand Down Expand Up @@ -221,6 +231,25 @@ dockers:
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
- goos: linux
goarch: s390x
dockerfile: distributions/otelcol/Dockerfile
image_templates:
- otel/opentelemetry-collector:{{ .Version }}-s390x
- otel/opentelemetry-collector:latest-s390x
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{ .Version }}-s390x
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:latest-s390x
extra_files:
- configs/otelcol.yaml
build_flag_templates:
- --pull
- --platform=linux/s390x
- --label=org.opencontainers.image.created={{.Date}}
- --label=org.opencontainers.image.name={{.ProjectName}}
- --label=org.opencontainers.image.revision={{.FullCommit}}
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
- goos: linux
goarch: "386"
dockerfile: distributions/otelcol-contrib/Dockerfile
Expand Down Expand Up @@ -317,6 +346,25 @@ dockers:
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
- goos: linux
goarch: s390x
dockerfile: distributions/otelcol-contrib/Dockerfile
image_templates:
- otel/opentelemetry-collector-contrib:{{ .Version }}-s390x
- otel/opentelemetry-collector-contrib:latest-s390x
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{ .Version }}-s390x
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest-s390x
extra_files:
- configs/otelcol-contrib.yaml
build_flag_templates:
- --pull
- --platform=linux/s390x
- --label=org.opencontainers.image.created={{.Date}}
- --label=org.opencontainers.image.name={{.ProjectName}}
- --label=org.opencontainers.image.revision={{.FullCommit}}
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
docker_manifests:
- name_template: otel/opentelemetry-collector:{{ .Version }}
image_templates:
Expand All @@ -325,52 +373,60 @@ docker_manifests:
- otel/opentelemetry-collector:{{ .Version }}-armv7
- otel/opentelemetry-collector:{{ .Version }}-arm64
- otel/opentelemetry-collector:{{ .Version }}-ppc64le
- otel/opentelemetry-collector:{{ .Version }}-s390x
- name_template: otel/opentelemetry-collector:latest
image_templates:
- otel/opentelemetry-collector:latest-386
- otel/opentelemetry-collector:latest-amd64
- otel/opentelemetry-collector:latest-armv7
- otel/opentelemetry-collector:latest-arm64
- otel/opentelemetry-collector:latest-ppc64le
- otel/opentelemetry-collector:latest-s390x
- name_template: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{ .Version }}
image_templates:
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{ .Version }}-386
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{ .Version }}-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{ .Version }}-armv7
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{ .Version }}-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{ .Version }}-ppc64le
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{ .Version }}-s390x
- name_template: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:latest
image_templates:
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:latest-386
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:latest-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:latest-armv7
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:latest-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:latest-ppc64le
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:latest-s390x
- name_template: otel/opentelemetry-collector-contrib:{{ .Version }}
image_templates:
- otel/opentelemetry-collector-contrib:{{ .Version }}-386
- otel/opentelemetry-collector-contrib:{{ .Version }}-amd64
- otel/opentelemetry-collector-contrib:{{ .Version }}-armv7
- otel/opentelemetry-collector-contrib:{{ .Version }}-arm64
- otel/opentelemetry-collector-contrib:{{ .Version }}-ppc64le
- otel/opentelemetry-collector-contrib:{{ .Version }}-s390x
- name_template: otel/opentelemetry-collector-contrib:latest
image_templates:
- otel/opentelemetry-collector-contrib:latest-386
- otel/opentelemetry-collector-contrib:latest-amd64
- otel/opentelemetry-collector-contrib:latest-armv7
- otel/opentelemetry-collector-contrib:latest-arm64
- otel/opentelemetry-collector-contrib:latest-ppc64le
- otel/opentelemetry-collector-contrib:latest-s390x
- name_template: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{ .Version }}
image_templates:
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{ .Version }}-386
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{ .Version }}-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{ .Version }}-armv7
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{ .Version }}-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{ .Version }}-ppc64le
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{ .Version }}-s390x
- name_template: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest
image_templates:
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest-386
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest-armv7
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest-ppc64le
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest-s390x
4 changes: 3 additions & 1 deletion cmd/goreleaser/internal/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const ArmArch = "arm"

var (
ImagePrefixes = []string{"otel", "ghcr.io/open-telemetry/opentelemetry-collector-releases"}
Architectures = []string{"386", "amd64", "arm", "arm64", "ppc64le"}
Architectures = []string{"386", "amd64", "arm", "arm64", "ppc64le", "s390x"}
ArmVersions = []string{"7"}
)

Expand Down Expand Up @@ -76,8 +76,10 @@ func Build(dist string) config.Build {
Ignore: []config.IgnoredBuild{
{Goos: "darwin", Goarch: "386"},
{Goos: "darwin", Goarch: "arm"},
{Goos: "darwin", Goarch: "s390x"},
{Goos: "windows", Goarch: "arm"},
{Goos: "windows", Goarch: "arm64"},
{Goos: "windows", Goarch: "s390x"},
},
}
}
Expand Down

0 comments on commit 77e6966

Please sign in to comment.