chore(ci): define a pipeline with multiple gates#1414
Merged
mdelapenya merged 18 commits intotestcontainers:mainfrom Aug 4, 2023
Merged
chore(ci): define a pipeline with multiple gates#1414mdelapenya merged 18 commits intotestcontainers:mainfrom
mdelapenya merged 18 commits intotestcontainers:mainfrom
Conversation
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
To match with the generated pipeline for new modules
It will allow each template to process the list of modules correctly
eddumelendez
reviewed
Aug 3, 2023
| matrix: | ||
| go-version: [1.19.x, 1.x] | ||
| platform: [ubuntu-latest, macos-latest] | ||
| module: [compose, couchbase, k3s, localstack, mysql, neo4j, postgres, pulsar, redis, redpanda, vault] |
Member
There was a problem hiding this comment.
I was wondering if we can auto discover the folders under modules to build the matrix automatically
Member
Author
There was a problem hiding this comment.
This file is autogenerated by the modules generator
Member
Author
|
I need to adjust the repository settings for the gh check |
* main: chore(deps): bump github.com/hashicorp/consul/api in /examples/consul (testcontainers#1381) chore(deps): bump github.com/twmb/franz-go in /modules/redpanda (testcontainers#1387) chore(deps): bump github.com/nats-io/nats.go in /examples/nats (testcontainers#1389) feat(redpanda): Add option to enable topic auto-creation (testcontainers#1360) chore(deps): bump golang.org/x/text from 0.9.0 to 0.11.0 in /modulegen (testcontainers#1388) chore(deps): bump google.golang.org/api from 0.125.0 to 0.134.0 in /examples (testcontainers#1412) chore(deps): bump golang.org/x/mod and github.com/aws/aws-sdk-go-v2/config in /modules/localstack (testcontainers#1410) test: fix TestGetDockerConfig (testcontainers#1413)
|
Kudos, SonarCloud Quality Gate passed!
|
This was referenced Aug 4, 2023
This was referenced Aug 4, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.








What does this PR do?
This PR refactors all the CI infrastructure, having one big workflow file instead of multiple ones. After these changes, the
ci.ymlfile is the single source of truth in terms of CI pipelines, defining multiple what I call "quality gates", which is nothing than different gates in the pipeline that will have more importance depending on when they are run in the pipeline: those to the left in the diagram will run earlier because they have more priority.In this big workflow we will define dependency relationships, leveraging the
needskeyword from GH actions, therefore one "stage" o GH job, won't be triggered until its needed job has finished with success. The proposed pipeline defines:flowchart TD Zero( Start ) Zero --> Core Zero --> ModuleGen Core[Core Library] -->|ubuntu - macos\nGo 1.19.x, 1.20.x| B[Go Modules] Core[Core Library] -->|ubuntu\nGo 1.19.x, 1.20.x| Ryuk[Ryuk Disabled] Core[Core Library] -->|ubuntu\nGo 1.19.x, 1.20.x| Rootless[Docker Rootless] B[Core Library] --> |ubuntu - macos\nGo 1.19.x, 1.20.x| Examples[Example Modules] ModuleGen[Module Generator] ModuleGen --> |ubuntu - macos\nGo 1.19.x, 1.20.x| End( End ) Ryuk --> |ubuntu\nGo 1.19.x, 1.20.x| End( End ) Rootless --> |ubuntu\nGo 1.19.x, 1.20.x| End( End ) Examples --> |ubuntu - macos\nGo 1.19.x, 1.20.x| End( End )At the same time, we have created a reusable workflow to run the Go tests (see
ci-test-go.ymlfile) to run the Go tests. It will receive certain input parameters to configure the execution:TESTCONTAINERS_RYUK_DISABLEDenvironment variableAn example usage of this reusable module:
As a result, we will be able to run the tests for the core library, the different Docker configs (e.g. rootless), tests for each Go module, with a single reusable workflow, which will define a proper visual name, based on the input parameters used to call it.
Finally, and because creating a new module using the module generator tool created a workflow for each module, we modified the code generator to generate the new pipeline file, adding a list of modules/examples to the matrix of modules/examples.
Why is it important?
We have experimented many situations where our CI jobs take a lot of time to be processed, mainly after an updates wave from @dependabot. This happens basically because the jobs get queued because the number of allocated CI workers is passing the limit of workers in the entire @testcontainers organisation!! AND THIS IS AN ISSUE AS WE WERE IMPACTING OTHER TC-LANG PROJECTS.
With this new approach, we will reduce the number of workers needed by each "gate", reducing the workers that are needed at the same time. From an initial ramp up of +90 workers, we will have:
allowing more granularity when new PRs (in any repo of the org) come to grab a free worker.
How to test this PR
The result in the GH actions UI will be: https://github.com/testcontainers/testcontainers-go/actions/runs/5750784979?pr=1414