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

Change build path for linux binaries to match GOARCH. #890

Merged
merged 1 commit into from Jan 19, 2022

Conversation

jefchien
Copy link
Member

Description: Simplifies the docker build process by changing the linux binary build paths to match GOARCH/TARGETARCH.

Link to tracking Issue: #880

Testing: Ran create_rpm.sh and create_deb.sh (partially). Ran make docker-build and make docker-build-arm.

@jefchien jefchien requested a review from a team as a code owner January 14, 2022 22:38
@jefchien jefchien linked an issue Jan 14, 2022 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Jan 14, 2022

Codecov Report

Merging #890 (989a774) into main (a849204) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #890   +/-   ##
=======================================
  Coverage   53.69%   53.69%           
=======================================
  Files          12       12           
  Lines         419      419           
=======================================
  Hits          225      225           
  Misses        177      177           
  Partials       17       17           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a849204...989a774. Read the comment docs.

@jefchien jefchien force-pushed the simplify-docker-build branch 2 times, most recently from fced26f to a094f16 Compare January 14, 2022 23:34
@@ -78,22 +78,22 @@ all-srcs:
.PHONY: build
build: install-tools lint multimod-verify
GOOS=darwin GOARCH=amd64 $(GOBUILD) $(LDFLAGS) -o ./build/darwin/aoc_darwin_amd64 ./cmd/awscollector
GOOS=linux GOARCH=amd64 $(GOBUILD) $(LDFLAGS) -o ./build/linux/aoc_linux_x86_64 ./cmd/awscollector
Copy link
Member

Choose a reason for hiding this comment

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

Have we talked with @alolita @anuraaga @Aneurysm9 that being backwards not compatible is okay here

Copy link
Member

Choose a reason for hiding this comment

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

Is this just an intermediate name used during the build process? Does the name of the executable included in the deb, rpm, or container image change?

Copy link
Member Author

@jefchien jefchien Jan 18, 2022

Choose a reason for hiding this comment

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

Yes, this is just an intermediate name. create_rpm.sh and create_deb.sh both copy the binary in and rename it to aws-otel-collector. The Dockerfile also renames it, but to awscollector.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah intermediate names should not need to be preserved.

While we're changing these, can we dedupe, and maybe simplify, by moving into the folder

./build/linux-amd64/aoc?

@@ -9,16 +9,13 @@ RUN apk --update add ca-certificates

WORKDIR /workspace

ARG TARGETPLATFORM
RUN echo "Target platform is $TARGETPLATFORM"
Copy link
Member

Choose a reason for hiding this comment

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

I think we should echo the target arch we are running for

Copy link
Member Author

Choose a reason for hiding this comment

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

Wouldn't the TARGETARCH just show up in the COPY instruction when it tries to find the file?

Copy link
Member

@Aneurysm9 Aneurysm9 left a comment

Choose a reason for hiding this comment

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

Is it possible to separate out the lint/formatting changes? They make it hard to have confidence that the functional changes have all been identified.

@@ -78,22 +78,22 @@ all-srcs:
.PHONY: build
build: install-tools lint multimod-verify
GOOS=darwin GOARCH=amd64 $(GOBUILD) $(LDFLAGS) -o ./build/darwin/aoc_darwin_amd64 ./cmd/awscollector
GOOS=linux GOARCH=amd64 $(GOBUILD) $(LDFLAGS) -o ./build/linux/aoc_linux_x86_64 ./cmd/awscollector
Copy link
Member

Choose a reason for hiding this comment

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

Is this just an intermediate name used during the build process? Does the name of the executable included in the deb, rpm, or container image change?

@jefchien
Copy link
Member Author

jefchien commented Jan 18, 2022

Is it possible to separate out the lint/formatting changes? They make it hard to have confidence that the functional changes have all been identified.

@Aneurysm9 I've removed the linting changes.

@sethAmazon sethAmazon merged commit f5dc1d8 into aws-observability:main Jan 19, 2022
@jefchien jefchien deleted the simplify-docker-build branch January 19, 2022 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Naming convention for binary
5 participants