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

Customization options for Containers #1868

Closed
4 tasks done
schewara opened this issue Jun 15, 2023 · 5 comments
Closed
4 tasks done

Customization options for Containers #1868

schewara opened this issue Jun 15, 2023 · 5 comments
Labels
feature add new functionality

Comments

@schewara
Copy link

schewara commented Jun 15, 2023

Clear and concise description of the problem

Currently the usage of images is very limited, which requires one to implement some workarounds like using custom images/plugins to play along with woodpecker and sometimes existing infrastructure requirements.

Therefore I would like to suggest to add support for the following options to not have to re-invent the weel every time when one wants to integrate a new tool/image which does not match the current limitations.

  • containerprefix
    currrently the name shows up like 0_338859503931012122_step_0 and defining a name or a static prefix would make it clearer which container to look for in case of a hanging job which needs to be investigated, or for monitoring exclusion.
  • labels/attributes
    would help in situations where external components rely on the existence of specific labels, like log collection/shipping, alerting rules, service discovery, ...
  • entrypoint
    some containers either have default entrypoints (e.g. trivy), which can not be used in a CI context or containers built from scratch which don't have a shell available would need a way to customize the the entrypoint to work properly out of the box.

This list is only my "Top 3" with potentially more options to follow, but these would already cover more then 90% of all my use cases.

Suggested solution

The ability to define specific options for images like:

pipeline:
  test:
    image:
      name: a-container:latest
      entrypoint: [""]
      pull_policy: [always, if-not-present, never]
      labels:
        key: value

or as backend_options

    image: my-container:latest
    backend_options:
      docker:
        prefix: my_prefix_
        entrypoint: [""]
        pull_policy: [always, if-not-present, never]
        labels:
          key: value

Alternative

Currently the only alternative I see, are custom images or plugins tailered to work with woodpecker.

Additional context

Validations

  • Checked that the feature isn't part of the next version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]
  • Read the Contributing Guidelines.
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
@schewara schewara added the feature add new functionality label Jun 15, 2023
@lafriks
Copy link
Contributor

lafriks commented Jun 18, 2023

if we add such docker backend options imho these should be server side configuration options not per pipeline (prefix and labels)

@anbraten
Copy link
Member

linking #278

@6543
Copy link
Member

6543 commented Jun 19, 2023

I would say that's are agent backend options ...

@6543
Copy link
Member

6543 commented Jun 19, 2023

or at least some of the proposals

@schewara
Copy link
Author

@6543, @lafriks
Completely agree with your comments, some options might be better suited for backend options, while others might be a better fit for the pipeline config.

I just wanted to provide an end-user view and would leave it to the experts to decide where the implementation would fit best, as they have a better overview of all the internals.

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

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
feature add new functionality
Projects
None yet
Development

No branches or pull requests

4 participants