Skip to content
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

re-adding linux/ppc64le support #173

Merged
merged 3 commits into from
Aug 2, 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
2 changes: 1 addition & 1 deletion .github/workflows/ci-goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
platforms: arm64,ppc64le
Copy link
Member

Choose a reason for hiding this comment

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

Can you also add in the readme, or in another place you find suitable, what needs to be done to add new platforms? This problem has happened already in the past with other platforms, and I think we could have prevented it if we had clear instructions on how to add new platforms.


- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
platforms: arm64,ppc64le

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
Expand Down
44 changes: 44 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ builds:
- "386"
- amd64
- arm64
- ppc64le
ignore:
- goos: darwin
goarch: "386"
Expand All @@ -32,6 +33,7 @@ builds:
- "386"
- amd64
- arm64
- ppc64le
ignore:
- goos: darwin
goarch: "386"
Expand Down Expand Up @@ -163,6 +165,24 @@ dockers:
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
- goos: linux
goarch: ppc64le
dockerfile: distributions/otelcol/Dockerfile
image_templates:
- otel/opentelemetry-collector:{{ .Version }}-ppc64le
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{
.Version }}-ppc64le
extra_files:
- configs/otelcol.yaml
build_flag_templates:
- --pull
- --platform=linux/ppc64le
- --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 @@ -217,12 +237,31 @@ dockers:
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
- goos: linux
goarch: ppc64le
dockerfile: distributions/otelcol-contrib/Dockerfile
image_templates:
- otel/opentelemetry-collector-contrib:{{ .Version }}-ppc64le
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{
.Version }}-ppc64le
extra_files:
- configs/otelcol-contrib.yaml
build_flag_templates:
- --pull
- --platform=linux/ppc64le
- --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:
- otel/opentelemetry-collector:{{ .Version }}-386
- otel/opentelemetry-collector:{{ .Version }}-amd64
- otel/opentelemetry-collector:{{ .Version }}-arm64
- otel/opentelemetry-collector:{{ .Version }}-ppc64le
- name_template: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{
.Version }}
image_templates:
Expand All @@ -232,11 +271,14 @@ docker_manifests:
.Version }}-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{
.Version }}-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{
.Version }}-ppc64le
- 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 }}-arm64
- otel/opentelemetry-collector-contrib:{{ .Version }}-ppc64le
- name_template: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{
.Version }}
image_templates:
Expand All @@ -246,3 +288,5 @@ docker_manifests:
.Version }}-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{
.Version }}-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{
.Version }}-ppc64le
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,13 @@ This is accomplished by installing [qemu](https://www.qemu.org/), and then [enab
apt-get install qemu binfmt-support qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
```

### Adding support for new platforms or architectures
Copy link
Member

Choose a reason for hiding this comment

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

I reworded this a bit. Please take a look and give your approval. Once it's done, I think this is ready to be merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

looks good to me.


When a new collector distribution image or binary is needed in a different platform or architecture, the following should be considered:

1. Add the new platform or architecture to the Continuous Integration test matrix for both the [core](https://github.com/open-telemetry/opentelemetry-collector) and [contrib](https://github.com/open-telemetry/opentelemetry-collector-contrib) repositories, to ensure they can be compiled with the new combination. Failing to do so will eventually cause the release to fail due to compilation failures on those uncovered platforms, resulting in them being removed from the release matrix.
2. In the `goreleaser/configure.go` file, add the new platform or architecture
3. Regenerate the `.goreleaser` (see [goreleaser](#goreleaser) above)
4. In the `.github/workflows/ci-goreleaser.yaml` file, under the "Setup QEMU" action, add the new platform and architecture
5. In the `.github/workflows/release.yaml` file, under the "Setup QEMU" action, add the new platform and architecture
2 changes: 1 addition & 1 deletion goreleaser/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

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

distsFlag = flag.String("d", "", "Collector distributions(s) to build, comma-separated")
)
Expand Down