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

Bugfix multi image support #2019

Merged
merged 2 commits into from
Feb 13, 2023

Conversation

kakaZhou719
Copy link
Member

Describe what this PR does / why we need it

Kubefile:

FROM registry.cn-qingdao.aliyuncs.com/sealer-io/ackdistro-multi:v0.4.0
COPY ${ARCH}/bin bin
APP myapp local://app.yaml
LAUNCH myapp

build context

├── amd64
│   ├── bin
│   │   └── sealer
│   └── i_am_amd64
├── app.yaml
├── arm64
│   ├── bin
│   │   └── armbin
│   └── i_am_arm
├── imagelist
└── Kubefile

build multi image:

sealer build -f Kubefile -t my-kubernetes:1.19.8 --platform linux/amd64,linux/arm64

tag and push all images to docker hub:

sealer tag my-kubernetes:1.19.8 kakazhou719/multi-images:v2
sealer push kakazhou719/multi-images:v2

Does this pull request fix one issue?

Describe how you did it

Describe how to verify it

Special notes for reviews

@github-actions github-actions bot added ImageBuilding related to all staff with image building test labels Feb 7, 2023
@codecov-commenter
Copy link

codecov-commenter commented Feb 7, 2023

Codecov Report

Base: 18.40% // Head: 18.34% // Decreases project coverage by -0.06% ⚠️

Coverage data is based on head (07f273b) compared to base (f983d9b).
Patch coverage: 6.66% of modified lines in pull request are covered.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2019      +/-   ##
==========================================
- Coverage   18.40%   18.34%   -0.06%     
==========================================
  Files         101      101              
  Lines        9201     9225      +24     
==========================================
- Hits         1693     1692       -1     
- Misses       7277     7302      +25     
  Partials      231      231              
Impacted Files Coverage Δ
build/kubefile/parser/line_parsers.go 18.40% <ø> (-0.41%) ⬇️
pkg/imageengine/buildah/build.go 0.00% <0.00%> (ø)
pkg/imageengine/buildah/rmi.go 0.00% <ø> (ø)
build/kubefile/parser/kubefile.go 33.20% <7.14%> (-3.62%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@kakaZhou719 kakaZhou719 force-pushed the bufix-multi-image-support branch 2 times, most recently from 59b037e to b37db58 Compare February 7, 2023 08:29
@Stevent-fei
Copy link
Collaborator

pls rebase commits

@kakaZhou719 kakaZhou719 force-pushed the bufix-multi-image-support branch 2 times, most recently from 83519b0 to b790c77 Compare February 8, 2023 02:41
Copy link
Collaborator

@VinceCui VinceCui left a comment

Choose a reason for hiding this comment

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

LGTM

// if arch is amd64
// `COPY ${ARCH}/* .` will be mutated to `COPY amd64/* .`
// `COPY $ARCH/* .` will be mutated to `COPY amd64/* .`
_, arch, _, err := parse2.Platform(kp.platform)
Copy link
Collaborator

@starnop starnop Feb 8, 2023

Choose a reason for hiding this comment

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

could we add unit tests for these logic?

@@ -53,6 +53,6 @@ func NewPushCmd() *cobra.Command {
// tls-verify is not working currently
pushCmd.Flags().BoolVar(&pushOpts.TLSVerify, "tls-verify", true, "require HTTPS and verify certificates when accessing the registry. TLS verification cannot be used when talking to an insecure registry. (not work currently)")
pushCmd.Flags().BoolVarP(&pushOpts.Quiet, "quiet", "q", false, "don't output progress information when pushing images")
pushCmd.Flags().BoolVar(&pushOpts.All, "all", false, "also push the images in the list")
pushCmd.Flags().BoolVar(&pushOpts.All, "all", true, "also push the images in the list")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this compatible?

Copy link
Member Author

Choose a reason for hiding this comment

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

it is just push command, i thought there will be no impact.

@starnop
Copy link
Collaborator

starnop commented Feb 8, 2023

Could you please add e2e tests for this PR?

@github-actions github-actions bot added the e2e-test it needs to run e2e test label Feb 9, 2023
return filepath.Join(settings.DefaultTestEnvDir, "suites", "build", "fixtures")
// GetBuildImageName return specific image name for sealer build test
func GetBuildImageName() string {
return "docker.io/sealerio/forbuildtest:v1"
Copy link
Member Author

Choose a reason for hiding this comment

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

@starnop , @VinceCui , do we have a better name? this image will be used to push to our repository .

Copy link
Collaborator

Choose a reason for hiding this comment

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

docker.io/sealerio/build-test:v1 is OK

kakzhou719 added 2 commits February 13, 2023 18:15
bugfix: not panic if user wite invalid copy

fix lint

add e2e test for sealer build

disable wrapper.IgnoreFile for build
@starnop
Copy link
Collaborator

starnop commented Feb 13, 2023

/test all

@VinceCui VinceCui merged commit 462034d into sealerio:main Feb 13, 2023
@kakaZhou719 kakaZhou719 deleted the bufix-multi-image-support branch June 28, 2023 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e-test it needs to run e2e test ImageBuilding related to all staff with image building test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants