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

Specify Command field for internal containers (creds-init, …) #605

Conversation

vdemeester
Copy link
Member

Changes

The entrypoint package will try to talk to the remotes for
containers that do not specify Command (aka Entrypoint in
image-spec).

  • This should not be required for internal containers as we are the
    one maintaining it. It should remove so registry call that aren't
    required.
  • It fails in some development mode (when using
    KO_DOCKER_REPO=ko.local), as the registry might not
    exists (ko.local) or not available from the
    cluster (localhost:5000, …)

This is a partial fix for #591 😅

Signed-off-by: Vincent Demeester vincent@sbr.pm

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide
for more details.

Release Notes

release-note

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Mar 11, 2019
@tekton-robot tekton-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 11, 2019
@vdemeester
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

@vdemeester
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

1 similar comment
@dlorenc
Copy link
Contributor

dlorenc commented Mar 11, 2019

/test pull-tekton-pipeline-integration-tests

@vdemeester vdemeester force-pushed the 591-use-command-for-internal-containers branch from b49cbfe to 2470d8e Compare March 13, 2019 14:21
@vdemeester
Copy link
Member Author

@imjasonh updated 👼

@imjasonh
Copy link
Member

Can you add docs to CONTRIBUTING or elsewhere that a recent version of ko is required? Just until we have a real ko release, then we can say "ko release >0.1 is required"

Otherwise lgtm

@vdemeester vdemeester force-pushed the 591-use-command-for-internal-containers branch 2 times, most recently from 0db2b1d to d22e22b Compare March 13, 2019 17:15
[google/go-containerregistry#380](https://github.com/google/go-containerregistry/pull/380))
is required for `pipeline` to work correctly.

won't work).
Copy link
Collaborator

Choose a reason for hiding this comment

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

i think there's a typo here, won't work seems like extra text?

@bobcatfish
Copy link
Collaborator

bobcatfish commented Mar 13, 2019

I looked at the failures a bit and I think the path to the executable for the "bash" image might be wrong:

I0313 18:08:19.629]     - args:
I0313 18:08:19.629]       - -wait_file
I0313 18:08:19.629]       - ""
I0313 18:08:19.629]       - -post_file
I0313 18:08:19.629]       - /builder/tools/0
I0313 18:08:19.629]       - -entrypoint
I0313 18:08:19.629]       - /ko-app/nop
I0313 18:08:19.629]       - --
I0313 18:08:19.630]       - -args
I0313 18:08:19.630]       - mkdir -p /workspace/workspace
I0313 18:08:19.630]       command:
I0313 18:08:19.630]       - /builder/tools/entrypoint
I0313 18:08:19.630]       env:
I0313 18:08:19.630]       - name: HOME
I0313 18:08:19.630]         value: /builder/home
I0313 18:08:19.631]       image: gcr.io/tekton-prow-3/kpipeline-e2e-img/bash-e

Instead of /ko-app/nop i think maybe it should be something like /ko-app/bash?

It looks like the variable and flag we use to control the name of this image included "noop" from the beginning but im not sure why (accident maybe?), seems like that is causing some confusion!

@bobcatfish
Copy link
Collaborator

helping
😇

@bobcatfish
Copy link
Collaborator

Specify Command field for internal containers (creds-init, …)

one more thought here, and maybe this is something you are already planning to do @vdemeester : what do you think about excluding the internal containers from passing through the logic that tries to determine the entrypoint? (i.e. only apply that logic to containers specified by the user)

@vdemeester
Copy link
Member Author

one more thought here, and maybe this is something you are already planning to do @vdemeester : what do you think about excluding the internal containers from passing through the logic that tries to determine the entrypoint? (i.e. only apply that logic to containers specified by the user)

Right, I thought about that. This means we would have to add a special case in the entrypoint package and act differently for a given list of image. I choose the path of less special case (but actually more changes 😅). To be honest I would be ok with both solutions.

Instead of /ko-app/nop i think maybe it should be something like /ko-app/bash?

Yeah i thought I messed some 😅

It looks like the variable and flag we use to control the name of this image included "noop" from the beginning but im not sure why (accident maybe?), seems like that is causing some confusion!

Not sure either but it definitely cause confusion 😹

The `entrypoint` package will try to talk to the remotes for
containers that do not specify `Command` (aka `Entrypoint` in
image-spec).

- This should not be required for internal containers as we are the
  one maintaining it. It should remove so registry call that aren't
  required.
- It fails in some development mode (when using
  `KO_DOCKER_REPO=ko.local`), as the registry might not
  exists (`ko.local`) or not available from the
  cluster (`localhost:5000`, …)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
@vdemeester vdemeester force-pushed the 591-use-command-for-internal-containers branch from d22e22b to d130fa3 Compare March 14, 2019 10:23
@bobcatfish
Copy link
Collaborator

This means we would have to add a special case in the entrypoint package and act differently for a given list of image

If you decide to go this route, id make the decision about what to pass to entrypoint before calling it - only call entrypoint with the container specs you want to redirect :D

@bobcatfish
Copy link
Collaborator

Let's go ahead with this for now and if we feel like coming back to the logic and improving it later we can :D

/lgtm
/meow space

@bobcatfish bobcatfish closed this Mar 15, 2019
@tekton-robot
Copy link
Collaborator

@bobcatfish: cat image

In response to this:

Let's go ahead with this for now and if we feel like coming back to the logic and improving it later we can :D

/lgtm
/meow space

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@bobcatfish bobcatfish reopened this Mar 15, 2019
@bobcatfish
Copy link
Collaborator

oh hahaha nice, tide thinks this is a totally new PR....

/lgtm
/meow space

@tekton-robot
Copy link
Collaborator

@bobcatfish: cat image

In response to this:

oh hahaha nice, tide thinks this is a totally new PR....

/lgtm
/meow space

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 15, 2019
@tekton-robot tekton-robot merged commit a08252f into tektoncd:master Mar 15, 2019
@vdemeester vdemeester deleted the 591-use-command-for-internal-containers branch March 15, 2019 17:34
vdemeester added a commit to vdemeester/tektoncd-pipeline that referenced this pull request Mar 27, 2019
In tektoncd#605, we required that `ko` was recent enough to be *guaranteed* to
have `/ko-app/{app}` (see google/go-containerregistry#380). As we now
point to `google/ko` and as we have a `ko` release (v0.1), we can
require this version for development.

Given the requirement above, we can simplify the `entrypoint` copy
container `args`.

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
tekton-robot pushed a commit that referenced this pull request Mar 27, 2019
In #605, we required that `ko` was recent enough to be *guaranteed* to
have `/ko-app/{app}` (see google/go-containerregistry#380). As we now
point to `google/ko` and as we have a `ko` release (v0.1), we can
require this version for development.

Given the requirement above, we can simplify the `entrypoint` copy
container `args`.

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
piyush-garg pushed a commit to piyush-garg/pipeline that referenced this pull request Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants