Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

RFC: pipeline compile step #1400

Closed
6543 opened this issue Nov 6, 2022 · 10 comments
Closed

RFC: pipeline compile step #1400

6543 opened this issue Nov 6, 2022 · 10 comments
Labels
feature add new functionality pipeline-config related to pipeline config files (.yaml)
Milestone

Comments

@6543
Copy link
Member

6543 commented Nov 6, 2022

Add a own section called compile into pipeline config.

witch use normal workflow logic (default or custom clone) ... but it's output is no log but an pipeline config.

tldr: with way we could support starlark, jsonnet (#1396), drone >= 1.0, ... without needing to add it to woodpecker core

details

we either could make a special compile pipeline, and show it as own entry, witch trigger the actual pipeline with its config
(if we do so, we need to somehow link them UI/UX wise ...)
or we just use our multi workflow approach ... where one workflow (eventually with a different icon) is the compile and all generated workflows from it are also i it ... (as a compile could create one or more workflows)

we need to make sure we dont have a recursion in it -> see permutate example

example:

compile:
  image: wp/jsonnet
  settings:
    file: woodpecker.jsonnet
compile:
  image: wp/replace-image # permutate normal wp pipeline config

pipeline:
  normal-steps:
...

workaround:

use a Configuration Service

@6543 6543 added feature add new functionality pipeline-config related to pipeline config files (.yaml) rfc labels Nov 6, 2022
@6543
Copy link
Member Author

6543 commented Nov 6, 2022

be aware as we would support with multible workflows multible compiles ... that this get's complicated quite fast

@6543
Copy link
Member Author

6543 commented Nov 6, 2022

we also might add a server flag to ignore this feature

@anbraten
Copy link
Member

seems pretty similar to #53

@anbraten anbraten mentioned this issue Nov 26, 2022
31 tasks
@gapodo
Copy link
Contributor

gapodo commented Nov 29, 2022

I like the idea, this would also allow one to "emulate" some of the features of GitHub workflows by basically overriding a step declared with just a name and e.g. "fake" image with a step with all settings prepared (basically a plugin + the necessary config / commands)... which would increase code reusability and also ease updating a step in all repos (e.g. switching to a newer buildx plugin or changing defaults like proxy settings to match the environment)

@lafriks
Copy link
Contributor

lafriks commented Nov 30, 2022

would be nice to be able to specify global (or org wide) permutate image that would by applied than to all respective pipelines

@wiktor-k
Copy link

This feature looks really great! Even if it was super-simple: generating entire woodpecker.yml using a docker image this would already provide enough tooling to write virtually any integration one can imagine. Thanks for thinking ahead and for your work 👍

@6543 6543 added this to the 1.1.0 milestone Mar 21, 2023
@bkleiner
Copy link
Contributor

What would be the input/output scheme of this compile step?
stdin/stdout seems like a obvious choice, however would prevent the compile step outputting logs to the user and would make it rather hard to take advantage of multi-workflows.

maybe an approach to how github workflows handles output could be taken, eg:

the env-var $COMPILE_INPUT holds the regular pipeline for mutation.
$COMPILE_OUTPUT holds the path to a folder where the compile-step can write files to, which then are handled the same way as the .woodpecker folder normally would, basically overwriting what is delivered by the csv.

adding this feature would make woodpicker a viable alternative for us, as we rely on jsonnet for some of our pipelines.

@ambroisie
Copy link
Contributor

stdin/stdout seems like a obvious choice, however would prevent the compile step outputting logs to the user and would make it rather hard to take advantage of multi-workflows.

The standard is to use stderr for user-oriented output in that case.

adding this feature would make woodpicker a viable alternative for us, as we rely on jsonnet for some of our pipelines.

I had a good experience using the matrix builds in tandem with the when.evaluate option to replace jsonnet in my use-case. But that doesn't get you very far.

@bkleiner
Copy link
Contributor

The standard is to use stderr for user-oriented output in that case.

well, yeah, in theory, tho i think you gonna have a very hard time to make all programs a user would potentially want to use comply with that.

@pinpox
Copy link
Contributor

pinpox commented May 8, 2023

well, yeah, in theory, tho i think you gonna have a very hard time to make all programs a user would potentially want to use comply with that.

Isn't that something that can be solved with redirection for non-complying programs?

@woodpecker-ci woodpecker-ci locked and limited conversation to collaborators Aug 20, 2023
@anbraten anbraten converted this issue into discussion #2254 Aug 20, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
feature add new functionality pipeline-config related to pipeline config files (.yaml)
Projects
None yet
Development

No branches or pull requests

8 participants