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

Use multi-stage builds to unzip and copy jars #118

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

Conversation

bradbown
Copy link
Contributor

@bradbown bradbown commented Sep 30, 2024

This PR implements issue(s) #

Multi stage reduces size of image by 110MB.
Removes unnecessary libs depending on architecture.

Checklist

  • I wrote new tests for my new core changes.
  • I have successfully ran tests, style checker and build against my new changes locally.
  • I have informed the team of any breaking changes if there are any.

Copy link

github-actions bot commented Sep 30, 2024

Delta Summary - Kotlin Code Coverage

Generated on: 10/01/2024 - 12:55
Description Previous Current Delta
Coverage date: 10/01/2024 - 12:55 10/01/2024 - 12:55
Tag: 588_11125691323 588_11125691323
Line coverage: 27.3% 27.3% 0.0%
Covered lines: 25673 25673 0
Coverable lines: 93723 93723 0
Total lines: 132974 132974 0
Branch coverage: 10.4% 10.4% 0.0%
Covered branches: 5529 5529 0
Total branches: 52680 52680 0
Method coverage: Feature is only available for sponsors

@bradbown bradbown requested review from a team September 30, 2024 17:41
coordinator/Dockerfile Outdated Show resolved Hide resolved
@bradbown bradbown force-pushed the docker-coordinator-image-size-reduction branch from 9c21d00 to 39ebe00 Compare October 1, 2024 09:54
@bradbown bradbown force-pushed the docker-coordinator-image-size-reduction branch from 39ebe00 to 509c849 Compare October 1, 2024 09:55
coordinator/Dockerfile Outdated Show resolved Hide resolved
coordinator/Dockerfile Outdated Show resolved Hide resolved
coordinator/Dockerfile Outdated Show resolved Hide resolved
coordinator/Dockerfile Outdated Show resolved Hide resolved
coordinator/Dockerfile Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Oct 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.35%. Comparing base (ca278a0) to head (7093f1d).
Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #118      +/-   ##
============================================
- Coverage     70.36%   70.35%   -0.02%     
  Complexity     1040     1040              
============================================
  Files           282      282              
  Lines         11316    11316              
  Branches       1083     1083              
============================================
- Hits           7963     7961       -2     
  Misses         2886     2886              
- Partials        467      469       +2     
Flag Coverage Δ *Carryforward flag
hardhat 98.70% <ø> (ø) Carriedforward from da905b6
kotlin 67.82% <ø> (-0.02%) ⬇️

*This pull request uses carry forward flags. Click here to find out more.

see 2 files with indirect coverage changes

@bradbown bradbown force-pushed the docker-coordinator-image-size-reduction branch from d472ac4 to da905b6 Compare October 10, 2024 11:31

RUN case $(uname -m) in \
x86_64) \
rm -rf /libs/coordinator/lib/unpacked-blob-compressor/darwin-**; \
Copy link
Contributor

@jonesho jonesho Oct 14, 2024

Choose a reason for hiding this comment

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

Can this be moved out from the switch case here? Seems they would be removed regardless of the case, or can we use a local label to replace the the switch case to avoid repeated commands? sth like:

...
rm -rf /libs/coordinator/lib/unpacked-blob-compressor/linux-$MACHINE_TYPE/; \
...
rm -rf /libs/coordinator/lib/unpacked-blob-shnarf-calculator/linux-$MACHINE_TYPE/;

COPY --from=zip ./coordinator.zip /src

RUN unzip /src/coordinator.zip -d /libs

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest to add the below line here to avoid the repeated prefix in paths:

WORKDIR /libs/coordinator/lib/

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.

4 participants