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

fix: allow build on macos via docker #20881

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

thoro
Copy link
Contributor

@thoro thoro commented Aug 27, 2024

Comprehensive Summary of your change

Add the option to define the platform inside the Makefile, it defaults to linux and the corresponding arch where the Makefile is executed. For macos M1+ that would be arm64 - this requires the arch binary.

This is only intended for testing builds on macos / arm and not for running harbor on mac as a hosting platform

Updated the spectral version to the newest version (6.11.1) which provides an arm64 image.

Issue being fixed

Fixes #20852 #17016 #15928 (and probably others)
Improves #19688

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. "release-note/ignore-for-release, release-note/new-feature, release-note/update, release-note/enhancement, release-note/community, release-note/breaking-change, release-note/docs, release-note/infra, release-note/deprecation"
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

@thoro thoro requested a review from a team as a code owner August 27, 2024 13:51
@thoro thoro force-pushed the fix-macos-build branch 6 times, most recently from 57279f8 to dff81a4 Compare August 27, 2024 16:21
Copy link

codecov bot commented Aug 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.10%. Comparing base (c8c11b4) to head (0ddbf8e).
Report is 294 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main   #20881       +/-   ##
===========================================
+ Coverage   45.36%   66.10%   +20.73%     
===========================================
  Files         244     1049      +805     
  Lines       13333   114602   +101269     
  Branches     2719     2856      +137     
===========================================
+ Hits         6049    75756    +69707     
- Misses       6983    34706    +27723     
- Partials      301     4140     +3839     
Flag Coverage Δ
unittests 66.10% <ø> (+20.73%) ⬆️

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

see 1288 files with indirect coverage changes

@Vad1mo Vad1mo enabled auto-merge (squash) August 30, 2024 10:15
@Vad1mo Vad1mo added the release-note/infra Infra related changes e.g. release, test, ship etc... label Aug 30, 2024
Copy link
Member

@Vad1mo Vad1mo left a comment

Choose a reason for hiding this comment

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

I am giving your changes a test, I also have a few other macos related PRs open.

@Vad1mo
Copy link
Member

Vad1mo commented Aug 30, 2024

Contains PR #20506

@tpoxa
Copy link
Contributor

tpoxa commented Sep 2, 2024

A similar approach helped me to build images on my Mac a few months ago. Recently I discovered that environment variable does a similar job.

DOCKER_DEFAULT_PLATFORM: linux/amd64

Tested only with gitlab runner on Mac.

@thoro
Copy link
Contributor Author

thoro commented Sep 2, 2024

This is definitely good to know, I wasn't aware about DOCKER_DEFAULT_PLATFORM.

But maybe being explicit about it isn't that bad.

@MinerYang MinerYang assigned chlins and unassigned zyyw Sep 26, 2024
@chlins
Copy link
Member

chlins commented Sep 26, 2024

@thoro Hi, please rebase the main branch and resolve the conflicts.

Signed-off-by: Thomas Rosenstein <thomas@thoro.at>
@thoro
Copy link
Contributor Author

thoro commented Sep 26, 2024

@chlins done

@chlins
Copy link
Member

chlins commented Sep 27, 2024

@chlins done

I've verified this PR in my laptop M3 mac, running make package_offline and deploy the harbor, but got the following error.

find: '/etc/harbor/ssl': No such file or directory
Internal tls trust CA appending is Done.
/harbor/entrypoint.sh: line 7: /harbor/harbor_core: cannot execute: required file not found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/infra Infra related changes e.g. release, test, ship etc...
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to build locally?
8 participants