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

Allow to define which services a step uses and deprecate detached #3411

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

qwerty287
Copy link
Contributor

@qwerty287 qwerty287 commented Feb 19, 2024

Add a new uses that allows to define the services a step uses to not run services the whole time (for now it's similar to detached).

Example

steps:
  - name: x
    image: alpine
  - name: y
    image: alpine
  - name: z
    image: alpine
    uses: [ some_service ]
services:
  - name: some_service
    image: mysql

Order/stages:

  1. x
  2. y, and some_service is started
  3. z

TODO:

  • testing
  • kill services once their steps finished
  • allow services to define uses so they can use other services
  • allow services to define depends_on so they can depends on steps
  • docs

closes #2495

@qwerty287 qwerty287 added enhancement improve existing features pipeline-config related to pipeline config files (.yaml) labels Feb 19, 2024
@qwerty287 qwerty287 added this to the 2.x.x milestone Feb 19, 2024
@qwerty287 qwerty287 mentioned this pull request Feb 19, 2024
@6543
Copy link
Member

6543 commented Feb 20, 2024

it does not solve the thing detatched was able to and is now supposed to remove :/

I still if following the KISS principe detatched is the best way to do so.

yes the proposed feature here would have other benefits through ;)

PS: if service is not registered at a single step -> always run; else only if step is also exec ...

@qwerty287
Copy link
Contributor Author

qwerty287 commented Feb 20, 2024

it does not solve the thing detatched was able to and is now supposed to remove :/

Why? The service is started when the step it needs is started. If you have other steps running before it, the service can use the artifacts of this step. We could also try to extend this by allowing depends_on for services and also allow referencing pipeline steps there.

I still if following the KISS principe detatched is the best way to do so.

But this mixes serviced and pipeline steps. You shouldn't be able to define services in the steps section.

PS: if service is not registered at a single step -> always run; else only if step is also exec ...

No, it should fail, just like depends_on.

@qwerty287 qwerty287 changed the title Allow to define which services a step uses Allow to define which services a step uses and deprecate detached Mar 29, 2024
@woodpecker-bot
Copy link
Collaborator

woodpecker-bot commented Mar 29, 2024

Deployment of preview was successful: https://woodpecker-ci-woodpecker-pr-3411.surge.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improve existing features pipeline-config related to pipeline config files (.yaml)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to assign steps to services
3 participants