-
-
Notifications
You must be signed in to change notification settings - Fork 370
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
Rework entrypoints #3269
Rework entrypoints #3269
Conversation
Deployment of preview was successful: https://woodpecker-ci-woodpecker-pr-3269.surge.sh |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3269 +/- ##
==========================================
- Coverage 35.91% 35.90% -0.02%
==========================================
Files 233 233
Lines 15670 15667 -3
==========================================
- Hits 5628 5625 -3
Misses 9619 9619
Partials 423 423 ☔ View full report in Codecov by Sentry. |
LGTM. Build image, please, I'll test in Kubernetes. |
Will be done when I push next time (probably the next merge from main). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also against adding another config flat
what about, if the custom entrypint is set, thread comments as arguments. this way you can make both usages work: entrypoint:
- /usr/bin/curl
commands:
- "-v"
- "--insecure"
- https://google.com entrypoint:
- /bin/bash
commands:
- "-x"
- "-e"
- "-c 'echo Hello'; printenv" |
That's an option. What's about "magic" aspect then? Also, we have to find and provide entrypoint for each "scratch" image. We cannot use default image's entrypoint: steps:
build:
image: gcr.io/kaniko-project/executor:v1.18.0
args:
- --context
- ./
- --destination
- harbor.domain.net/project/image:123 Anyway, this would be better than |
☝️ should my soulution not work in this way also ?!? |
In general, this should work, but I don't like it. Commands are commands and not arguments. If we change this behavior, it wouldn't be possible anymore to use a different shell as entrypoint. And, if we change it there's also a completely different handling of commands: if using without entrypoint, the commands are executed one after each other, otherwise they're executed at the same (all as args of one command). Probably the only way to fix this is to change how the backends work, there shouldn't be a script anymore. In this case, this could be implemented in a similar way. |
We / I had a look at that approach some time ago as well, but actually stopped as there seems to be no smart way of doing this. My first idea was to simply execute commands one by one using sth like |
@woodpecker-ci/maintainers @zc-devs Would it be possible to limit I.e. if you have: entrypoint:
- /bin/some-bin
- --some-arg
- ./
- --some-flag set |
Of course, yes.
|
Yes, that would be my idea. |
I updated the complete feature now, please take a look. @zc-devs Unfortunately, custom shell is currently only possible if you specify the script execution yourself. entrypoint: ["/bin/sh", "-c", "echo $CI_SCRIPT | base64 -d | /bin/sh -e"] However, I wouldn't try supporting this in this PR, but rather in a new one. |
Seems, doesn't work. Image: docker.io/woodpeckerci/woodpecker-agent@sha256:25d4d4871ec16155e1cc7991141e277089dc9ec1f0a4922c789fd00863ec59a5 Pipeline: skip_clone: true
steps:
server:
image: quay.io/curl/curl
entrypoint:
- /usr/bin/curl
- -v
- google.com Output:
Warnings:
|
skip_clone: true
steps:
server:
image: quay.io/curl/curl
entrypoint:
- /usr/bin/curl
- -v
- -k
- https://google.com
pod-entrypoint-only.yaml skip_clone: true
steps:
server:
image: debian
entrypoint:
- /bin/bash
- -c
- echo $CI_SCRIPT | base64 -d | /bin/bash -e
commands:
- echo $SHELL
- test=(1 2 4 8 16 32 64 128); echo $${test[@]};
pod-custom-shell.yaml skip_clone: true
steps:
server:
image: debian
commands:
- echo $SHELL
- test=(1 2 4 8 16 32 64 128); echo $${test[@]};
|
Co-authored-by: Thomas Anderson <127358482+zc-devs@users.noreply.github.com>
So the reason for requesting changes (#3269 (review)) was the additional config option, that one is resolved, however, the solution in #3269 (comment) is not how it's done now as entrypoint and arguments are in one config option now… So I can't tell you |
In that case it would be fair to wait for the approval. |
@6543 can you take a look here? You requested changes so we cant merge without your approval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will make it so we can not pass arguments ... but It's probably the best we can do as of now :/
Co-authored-by: Thomas Anderson <127358482+zc-devs@users.noreply.github.com> Co-authored-by: 6543 <m.huber@kithara.com>
Closes #3263
Closes #3477