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

Align downstream dockerfile with the upstream one #557

Conversation

OlivierCazade
Copy link
Contributor

Description

This fix the multiarch build with konflux.

Dependencies

n/a

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • Will this change affect NetObserv / Network Observability operator? If not, you can ignore the rest of this checklist.
  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
    • If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
    • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
    • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
    • Standard QE validation, with pre-merge tests unless stated otherwise.
    • Regression tests only (e.g. refactoring with no user-facing change).
    • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

Copy link

codecov bot commented Feb 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 27.61%. Comparing base (933a294) to head (c798bf6).
Report is 1 commits behind head on release-1.8.

Additional details and impacted files
@@               Coverage Diff               @@
##           release-1.8     #557      +/-   ##
===============================================
+ Coverage        27.48%   27.61%   +0.12%     
===============================================
  Files               46       46              
  Lines             4940     4940              
===============================================
+ Hits              1358     1364       +6     
+ Misses            3478     3473       -5     
+ Partials           104      103       -1     
Flag Coverage Δ
unittests 27.61% <ø> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 2 files with indirect coverage changes

@@ -1,27 +1,27 @@
ARG TARGETARCH

# Build the manager binary
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:v1.23 as builder
Copy link
Contributor

Choose a reason for hiding this comment

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

don't u need --platform=linux/$TARGETARCH here as well ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added it, thanks!

@@ -1,27 +1,27 @@
ARG TARGETARCH
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if you don't also need to add ARG COMMIT here, and also, move the one line 8 to the next layer after line 24
I'm comparing this file with https://github.com/netobserv/flowlogs-pipeline/blob/main/contrib/docker/Dockerfile.downstream

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also added it, thanks!

@OlivierCazade OlivierCazade force-pushed the fix-downstream-multiarch branch 2 times, most recently from 42d1184 to 4074757 Compare February 11, 2025 17:10
@@ -1,27 +1,30 @@
ARG TARGETARCH
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
ARG TARGETARCH
ARG TARGETARCH
ARG COMMIT

Shouldn't it be on the top ? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Thanks

Dockerfile.downstream Outdated Show resolved Hide resolved
@OlivierCazade OlivierCazade force-pushed the fix-downstream-multiarch branch from 4074757 to 33eec8a Compare February 11, 2025 17:19
ARG VERSION="unknown"
ARG COMMIT
ARG LDFLAGS
Copy link
Contributor

@msherif1234 msherif1234 Feb 11, 2025

Choose a reason for hiding this comment

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

hmm who set that argument I checked flp and operator they don't seem to use it ? does konflux pipeline set it ? I don't think so

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The updstream Dockerfile for the ebpf agent is using one:

This is to align with it.

Copy link
Contributor

@msherif1234 msherif1234 Feb 11, 2025

Choose a reason for hiding this comment

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

but its set in the Makefile I am not sure if konflux pipeline will set tbh ? pls check konflux build log to see if its set

Copy link
Contributor

Choose a reason for hiding this comment

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


# Build
RUN make compile
RUN GOARCH=$TARGETARCH go build -ldflags "$LDFLAGS" -mod vendor -a -o bin/netobserv-ebpf-agent cmd/netobserv-ebpf-agent.go
Copy link
Member

Choose a reason for hiding this comment

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

If you don't mind to fix FIPS at the same time :-)

Suggested change
RUN GOARCH=$TARGETARCH go build -ldflags "$LDFLAGS" -mod vendor -a -o bin/netobserv-ebpf-agent cmd/netobserv-ebpf-agent.go
ENV GOEXPERIMENT strictfipsruntime
RUN GOARCH=$TARGETARCH go build -tags strictfipsruntime -ldflags "$LDFLAGS" -mod vendor -a -o bin/netobserv-ebpf-agent cmd/netobserv-ebpf-agent.go

@OlivierCazade OlivierCazade force-pushed the fix-downstream-multiarch branch from 8c98a1e to a8a940a Compare February 11, 2025 18:10
Co-authored-by: Julien Pinsonneau <[email protected]>
@OlivierCazade OlivierCazade force-pushed the fix-downstream-multiarch branch from a8a940a to c798bf6 Compare February 11, 2025 18:29
@msherif1234
Copy link
Contributor

/lgtm

@OlivierCazade
Copy link
Contributor Author

/approve

Copy link

openshift-ci bot commented Feb 11, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: OlivierCazade

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit ba3e933 into netobserv:release-1.8 Feb 11, 2025
10 checks passed
OlivierCazade added a commit to OlivierCazade/netobserv-agent that referenced this pull request Feb 12, 2025
* Align downstream dockerfile with the upstream one

* Update Dockerfile.downstream

Co-authored-by: Julien Pinsonneau <[email protected]>

---------

Co-authored-by: Julien Pinsonneau <[email protected]>
jotak pushed a commit that referenced this pull request Feb 12, 2025
* Align downstream dockerfile with the upstream one (#557)

* Align downstream dockerfile with the upstream one

* Update Dockerfile.downstream

Co-authored-by: Julien Pinsonneau <[email protected]>

---------

Co-authored-by: Julien Pinsonneau <[email protected]>

* Fix arg usage for downstream builds (#558)

---------

Co-authored-by: Julien Pinsonneau <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants