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

Default to gcr.io/kpt-fn/ #2126

Merged
merged 19 commits into from Jul 8, 2021
Merged

Conversation

phanimarupaka
Copy link
Contributor

@phanimarupaka phanimarupaka commented May 27, 2021

Add default image prefix(gcr.io/kpt-fn/) if full path is not specified.
Introduce short form for --include-meta-resources, m flag.

@frankfarzan
Copy link
Contributor

e2e tests? docs?

@mikebz
Copy link
Contributor

mikebz commented May 29, 2021

I like this change a lot. It will help us with adoption of the pipeline in Skaffold. They are looking for simplicity @yuwenma .

@phanimarupaka
Copy link
Contributor Author

phanimarupaka commented May 31, 2021

e2e tests? docs?

Already added one e2e test and updated unit tests. Added reference docs.

@phanimarupaka phanimarupaka requested a review from mikebz May 31, 2021 04:54
thirdparty/cmdconfig/commands/cmdeval/cmdeval_test.go Outdated Show resolved Hide resolved
site/reference/fn/eval/README.md Outdated Show resolved Hide resolved
thirdparty/cmdconfig/commands/cmdeval/cmdeval.go Outdated Show resolved Hide resolved
@frankfarzan frankfarzan requested a review from droot June 1, 2021 22:29
@droot
Copy link
Contributor

droot commented Jun 2, 2021

@phanimarupaka I don't see the change implemented for fn render. Is that intentional ?

We can make this change in a central place in fnruntime/runner so that it is consistently applied to both eval and render.

@phanimarupaka phanimarupaka force-pushed the DefaultToGcrKptfn branch 2 times, most recently from 3775220 to e7ee118 Compare June 6, 2021 01:39
Copy link
Contributor

@droot droot left a comment

Choose a reason for hiding this comment

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

The change is looking good, but needs a rebase.

@phanimarupaka
Copy link
Contributor Author

The change is looking good, but needs a rebase.

@droot Done.

site/reference/cli/fn/doc/README.md Show resolved Hide resolved
site/reference/cli/fn/eval/README.md Show resolved Hide resolved
e2e/testdata/fn-render/basicpipeline/Kptfile Outdated Show resolved Hide resolved
@@ -197,6 +197,7 @@ func (f *ContainerFn) prepareImage() error {
// This can help to ensure we have the latest release for "moving tags" like
// v1 and v1.2. The performance cost is very minimal, since `docker pull`
// checks the SHA first and only pull the missing docker layer(s).
f.Image = AddDefaultImagePathPrefix(f.Image)
Copy link
Contributor

Choose a reason for hiding this comment

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

We probably want to resolve this at the higher layer. Look where we create containerRunner and functionRunner in runner.go because there might be other pieces where full name is probably desired ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is not propagating it in all places. It is safe to resolve it as places we make calls to docker cli and displaying results.

Copy link
Contributor

Choose a reason for hiding this comment

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

I looked at the code. There are two places where the changes will ensure that they are propagated in all places:

  • for fn eval, we should resolve this in the command runner itself like we are doing in the cmdfndoc.go
  • for fn render, doing it in fnChain function which will ensure it's propagated in all places. Another option is doing it in pkg.Pipeline() function.

Calling it individually where we make calls to docker or displayResults is not safe IMO.

package-examples/pipeline-validate/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@droot droot left a comment

Choose a reason for hiding this comment

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

I have a suggestion on where to resolve the image in the call stack. Happy to discuss.

site/reference/cli/fn/doc/README.md Outdated Show resolved Hide resolved
@@ -197,6 +197,7 @@ func (f *ContainerFn) prepareImage() error {
// This can help to ensure we have the latest release for "moving tags" like
// v1 and v1.2. The performance cost is very minimal, since `docker pull`
// checks the SHA first and only pull the missing docker layer(s).
f.Image = AddDefaultImagePathPrefix(f.Image)
Copy link
Contributor

Choose a reason for hiding this comment

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

I looked at the code. There are two places where the changes will ensure that they are propagated in all places:

  • for fn eval, we should resolve this in the command runner itself like we are doing in the cmdfndoc.go
  • for fn render, doing it in fnChain function which will ensure it's propagated in all places. Another option is doing it in pkg.Pipeline() function.

Calling it individually where we make calls to docker or displayResults is not safe IMO.

internal/fnruntime/runner.go Outdated Show resolved Hide resolved
internal/fnruntime/utils.go Outdated Show resolved Hide resolved
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.

Prepend gcr.io/kpt-fn/ prefix by default to image and short hand for include-meta-resources flag
5 participants