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

Exclude 386 from opentelemetry-collector-contrib builds #83

Merged
merged 1 commit into from
Mar 17, 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
22 changes: 0 additions & 22 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ builds:
- linux
- windows
goarch:
- "386"
- amd64
- arm64
ignore:
Expand Down Expand Up @@ -159,24 +158,6 @@ dockers:
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
- goos: linux
goarch: "386"
dockerfile: distributions/otelcol-contrib/Dockerfile
image_templates:
- otel/opentelemetry-collector-contrib:{{ .Version }}-386
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{
.Version }}-386
extra_files:
- configs/otelcol-contrib.yaml
build_flag_templates:
- --pull
- --platform=linux/386
- --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: amd64
dockerfile: distributions/otelcol-contrib/Dockerfile
Expand Down Expand Up @@ -230,14 +211,11 @@ docker_manifests:
.Version }}-arm64
- 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
- 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:{{
Expand Down
15 changes: 11 additions & 4 deletions goreleaser/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,18 @@ import (

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

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

func architecturesForDist(dist string) []string {
architectures := []string{"386", "amd64", "arm64"}
if dist == "otelcol-contrib" {
Copy link
Member

Choose a reason for hiding this comment

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

This is a good solution for this release and for the time being, but this would need to go into a config somewhere. I would even argue that we can remove 386 entirely, not only for the contrib. But we can have this discussion after this release :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

IMO reintroducing 386 is fine (since the additional effort to support it is small) but we need to have CI tests first on core and contrib to prevent issues like the one on this release (I created open-telemetry/opentelemetry-collector/issues/5031 and open-telemetry/opentelemetry-collector-contrib/issues/8544 to track this)

architectures = []string{"amd64", "arm64"}
}
return architectures
}

func main() {
flag.Parse()

Expand Down Expand Up @@ -76,7 +83,7 @@ func Build(dist string) config.Build {
Ldflags: []string{"-s", "-w"},

Goos: []string{"darwin", "linux", "windows"},
Goarch: Architectures,
Goarch: architecturesForDist(dist),
Ignore: []config.IgnoredBuild{
{Goos: "windows", Goarch: "arm64"},
},
Expand Down Expand Up @@ -148,7 +155,7 @@ func Package(dist string) config.NFPM {

func DockerImages(imagePrefixes, dists []string) (r []config.Docker) {
for _, dist := range dists {
for _, arch := range Architectures {
for _, arch := range architecturesForDist(dist) {
r = append(r, DockerImage(imagePrefixes, dist, arch))
}
}
Expand Down Expand Up @@ -202,7 +209,7 @@ func DockerManifests(imagePrefixes, dists []string) (r []config.DockerManifest)
func DockerManifest(imagePrefixes []string, dist string) (manifests []config.DockerManifest) {
for _, prefix := range imagePrefixes {
var imageTemplates []string
for _, arch := range Architectures {
for _, arch := range architecturesForDist(dist) {
imageTemplates = append(
imageTemplates,
fmt.Sprintf("%s/%s:{{ .Version }}-%s", prefix, imageName(dist), arch),
Expand Down