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: fix apply #2116

Merged
merged 1 commit into from
Mar 17, 2023
Merged

bugfix: fix apply #2116

merged 1 commit into from
Mar 17, 2023

Conversation

starnop
Copy link
Collaborator

@starnop starnop commented Mar 15, 2023

Describe what this PR does / why we need it

Fix the following two issues:

  1. apply with mode loadImage will also launch the app
  2. apply with no node scale will launch the apps and do not distribute the image rootfs

Does this pull request fix one issue?

Describe how you did it

Describe how to verify it

Special notes for reviews

@starnop starnop force-pushed the fix-apply branch 2 times, most recently from 106accf to 9be5901 Compare March 16, 2023 03:04
@codecov-commenter
Copy link

codecov-commenter commented Mar 16, 2023

Codecov Report

Patch coverage: 58.33% and project coverage change: -6.37 ⚠️

Comparison is base (9bb277b) 18.87% compared to head (8dd54f2) 12.51%.

📣 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    #2116      +/-   ##
==========================================
- Coverage   18.87%   12.51%   -6.37%     
==========================================
  Files          95      258     +163     
  Lines        8899    22196   +13297     
==========================================
+ Hits         1680     2778    +1098     
- Misses       6991    19035   +12044     
- Partials      228      383     +155     
Flag Coverage Δ
e2e-tests 8.23% <ø> (?)
unit-tests 18.90% <58.33%> (?)

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

Impacted Files Coverage Δ
pkg/application/v2app.go 29.31% <44.44%> (-0.03%) ⬇️
cmd/sealer/cmd/utils/application.go 60.00% <100.00%> (ø)
pkg/imageengine/buildah/inspect.go 38.14% <100.00%> (+1.30%) ⬆️

... and 163 files with indirect coverage changes

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 in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -127,12 +127,13 @@ func NewApplyCmd() *cobra.Command {
return applyClusterWithNew(cf, applyMode, imageEngine, imageSpec)
}

if err := applyClusterWithExisted(cf, client, imageEngine, imageSpec); err != nil {
updated, err := applyClusterWithExisted(cf, client, imageEngine, imageSpec)
Copy link
Member

Choose a reason for hiding this comment

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

updated is too large to understand . Or i thought should we move those run app logic to applyClusterWithExisted.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have changed updated to clusterUpdated.

As with other comments, we should split run/apply to these steps:

  1. distribute rootfs
  2. apply/run cluster
  3. app/run application

And then, something just like clusterUpdated, skipPrepareAppMaterials will not be needed.

And we should do these code optimization ASAP.

@@ -127,12 +127,13 @@ func NewApplyCmd() *cobra.Command {
return applyClusterWithNew(cf, applyMode, imageEngine, imageSpec)
Copy link
Member

Choose a reason for hiding this comment

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

applyClusterFileWithNew ? clusterfile contains app and cluster. so maybe it is better for us to use apply clusterfile ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

in fact, it‘s just the part relevant to the cluster.

And as for what you said about the app, that's really unreasonable. And I have added a comment TODO: decouple the cluster installation and application installation, and we should fix it in a separate PR.

return err
}
// NOTE: we should continue to apply application after the cluster is applied successfully
// And it's not needed to prepare the app file repeatedly
ignorePrepareAppMaterials = true
ignorePrepareAppMaterials = updated
Copy link
Member

Choose a reason for hiding this comment

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

i am ok with you that we need this flag . while, we usually use ignore with a noun or a thing, skip is used with some process ? so SkipPrepareAppMaterials ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

DONE

@kakaZhou719 kakaZhou719 added this to the release-0.9.3 milestone Mar 17, 2023
@starnop starnop force-pushed the fix-apply branch 2 times, most recently from 39f6594 to 8dd54f2 Compare March 17, 2023 05:57
Signed-off-by: 煜星 <yuxing.lyx@alibaba-inc.com>
Copy link
Member

@kakaZhou719 kakaZhou719 left a comment

Choose a reason for hiding this comment

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

LGTM

@kakaZhou719 kakaZhou719 merged commit b964a4d into sealerio:main Mar 17, 2023
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.

None yet

3 participants