Skip to content
GitLab
Next
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 50,597
    • Issues 50,597
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,553
    • Merge requests 1,553
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #39057
Closed
Open
Issue created Dec 09, 2019 by Shinya Maeda@shinya.maeda💡Maintainer

Support Resource Group for cross-project and parent-child pipelines

Problem to solve

As a user who is using parent-child pipelines, and needed to limit the number of consecutive deployments to a resource group, I need a way to define the lock for downstream pipeline.

Further Details:

In our case deployment process is done in child pipelines. Deployment process contains multiple stages and multiple jobs. Currently resource groups can be defined only standalone job, instead of bridge-type job that triggers downstream pipeline. It would be very convenient if the full deployment process could be locked by using resource groups. So basically it would be good to have a possibility to define resource group for a triggered child pipeline. Provide the possibility to define resource group for trigger job.

Proposal

When resource_group is defined in cross-project pipelines context, the bridge job obtains the resource lock. This resource lock is released when the downstream pipeline has finished.

We extend the Resource Group architecture to Ci::Bridge (trigger).

The full implementation details are captured in the PoC MR.

Example: Parent-Child Pipelines

# .gitlab-ci.yml (parent)

deploy-downstream:
  trigger:
    include: child.gitlab-ci.yml
    strategy: depend
  resource_group: iOS                # New
# child.gitlab-ci.yml (child)

deployment:
  script: sleep 5s

Bridge jobs (concurrent deployment pipelines) are correctly waiting for the current deployment pipeline has finished.

screenshot_229

screenshot_230

Example: Cross-Project Pipelines

# .gitlab-ci.yml (upstream project)

deploy-downstream:
  trigger:
    project: root/cross-project-resource-group-downstream
    strategy: depend
  resource_group: iOS
# .gitlab-ci.yml (downstream project)

deployment:
  script: sleep 5s

Bridge jobs (concurrent deployment pipelines) are correctly waiting for the current deployment pipeline has finished.

screenshot_232

Documentation

  • !51880 (comment 494047587)

Out of Scope

  • Triggering multi-project pipelines through API. It won't define the upstream job as bridge-job.

References

  • !20903 (comment 255287277)
Edited Jan 26, 2021 by Shinya Maeda
Assignee
Assign to
Time tracking