Skip to content

feat: new exec command to execute a custom action #8696

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

Merged
merged 9 commits into from
Apr 26, 2023

Conversation

renzodavid9
Copy link
Contributor

Fixes: #8628

Description
This PR adds the logic to include the new exec command to execute a Custom Action together with the new v2 events to communicate the state of an exec run.

@renzodavid9 renzodavid9 changed the title Ca feature 8628 feat: new exec command to execute a custom action Apr 20, 2023
@codecov
Copy link

codecov bot commented Apr 20, 2023

Codecov Report

Merging #8696 (da83ca4) into main (290280e) will decrease coverage by 6.05%.
The diff coverage is 49.59%.

@@            Coverage Diff             @@
##             main    #8696      +/-   ##
==========================================
- Coverage   70.48%   64.44%   -6.05%     
==========================================
  Files         515      617     +102     
  Lines       23150    31168    +8018     
==========================================
+ Hits        16317    20085    +3768     
- Misses       5776     9577    +3801     
- Partials     1057     1506     +449     
Impacted Files Coverage Δ
cmd/skaffold/app/cmd/completion.go 13.04% <0.00%> (-1.25%) ⬇️
cmd/skaffold/app/cmd/config/list.go 65.21% <ø> (ø)
cmd/skaffold/app/cmd/config/set.go 88.72% <ø> (ø)
cmd/skaffold/app/cmd/config/util.go 54.28% <ø> (ø)
cmd/skaffold/app/cmd/credits.go 100.00% <ø> (ø)
cmd/skaffold/app/cmd/credits/export.go 0.00% <0.00%> (ø)
cmd/skaffold/app/cmd/deploy.go 40.90% <0.00%> (-12.94%) ⬇️
cmd/skaffold/app/cmd/generate_pipeline.go 60.00% <ø> (ø)
cmd/skaffold/app/cmd/inspect_modules.go 65.00% <ø> (ø)
cmd/skaffold/app/cmd/inspect_profiles.go 66.66% <ø> (ø)
... and 40 more

... and 406 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@renzodavid9 renzodavid9 marked this pull request as ready for review April 20, 2023 19:19
@renzodavid9 renzodavid9 added the kokoro:force-run forces a kokoro re-run on a PR label Apr 24, 2023
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Apr 24, 2023
return withRunner(ctx, out, func(r runner.Runner, configs []util.VersionedConfig) error {
buildArtifacts, err := getBuildArtifactsAndSetTagsForAction(configs, r.ApplyDefaultRepo, args[0])
if err != nil {
tips.PrintUseRunVsDeploy(out)
Copy link
Contributor

@aaron-prindle aaron-prindle Apr 26, 2023

Choose a reason for hiding this comment

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

this tip message "run vs deploy" is likely not correct for the exec command. Should likely be changed to a more appropriate err msg

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! I added a new tip message explaining how to use images from previous builds. Thanks!

@aaron-prindle
Copy link
Contributor

nit: I believe everytime 2+ actions are run together there will be a warning in stdout that liely shouldn't be there:

WARN[0009] action-succeeded cleanup error:removing stopped container: Error: No such container: 3d3a3398da733805ae819738f9fbce90ef04906ad50e16966681bafe531af372  subtask=-1 task=DevLoop

I think this is related to the docker purge issue we mentioned in the past, forget the status of that

Doesn't have to be addressed here, just wanted to point out this UX issue

@aaron-prindle
Copy link
Contributor

Just tried it out, works great!

@renzodavid9
Copy link
Contributor Author

nit: I believe everytime 2+ actions are run together there will be a warning in stdout that liely shouldn't be there:

WARN[0009] action-succeeded cleanup error:removing stopped container: Error: No such container: 3d3a3398da733805ae819738f9fbce90ef04906ad50e16966681bafe531af372  subtask=-1 task=DevLoop

I think this is related to the docker purge issue we mentioned in the past, forget the status of that

Doesn't have to be addressed here, just wanted to point out this UX issue

Yes! That's exactly what's happening. I have a branch with the changes to improve this for the custom actions case (renzodavid9/skaffold@ca-feature-8628...renzodavid9:skaffold:ca-issue-prune-err) where I split the docker client logic in another method so we don't run prune. This is to improve the custom actions case, but for a long term solution the idea is to use docker labels to know what to prune. My idea is to create the PR with the changes once this one gets merged.

Copy link
Contributor

@aaron-prindle aaron-prindle left a comment

Choose a reason for hiding this comment

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

LGTM!

@aaron-prindle aaron-prindle merged commit e1014dd into GoogleContainerTools:main Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Custom Actions] Create new exec command
3 participants