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

Optimize CI pipeline #5451

Merged
merged 28 commits into from
Oct 13, 2022
Merged

Conversation

beni0888
Copy link
Collaborator

@beni0888 beni0888 commented Oct 11, 2022

Description of the change

This PR contains changes that make it possible to split the local_e2e_tests job into multiple parallelizable chunks. From now on, the e2e_test.sh script accepts an environment variable called TESTS_GROUPS that indicates the group of tests (the chunk) to execute and falls back to all the tests in case the env var is not provided. This way, all the bootstrapping part of the script is run for whatever group of tests we want to execute, but the specific test logic of every group is only executed in case we want to execute that group.

Benefits

With these changes, we can parallelize the execution of every group of tests and reduce the total amount of time consumed by the local_e2e_tests job, and in consequence, by the whole pipeline. So far, the execution time of the local_e2e_tests job (and the whole workflow) has been reduced by ~10min in the GHA workflow (the CircleCI pipeline has not been adapted to take advantage of these changes).

Possible drawbacks

The logic of the e2e_tests.sh script is slightly more complex.

Applicable issues

Additional information

Jesús Benito Calzada added 26 commits October 11, 2022 07:12
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
@netlify
Copy link

netlify bot commented Oct 11, 2022

Deploy Preview for kubeapps-dev canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit d40a654
🔍 Latest deploy log https://app.netlify.com/sites/kubeapps-dev/deploys/6347ba313f808c000a5e35c1

Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
@beni0888 beni0888 marked this pull request as ready for review October 11, 2022 16:48
Copy link
Contributor

@absoludity absoludity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @beni0888 , it'll be great to have faster CI! Code looks great, though my main question is: are the test groups running concurrently against the same cluster? If so, are we sure that they cannot interfere with each other? (ie. all namespaces/deployments etc. use unique identifiers).

@@ -7,6 +7,7 @@ on:
push:
branches:
- main
- optimize-ci-pipeline
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guessing this needs to be removed before you land? (assuming it's just for testing this branch?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, you're right

Comment on lines 34 to 40
group_is_supported=false
for group in "${SUPPORTED_TESTS_GROUPS[@]}"; do
if [[ "${TESTS_GROUP}" == "${group}" ]]; then
group_is_supported=true
break
fi
done
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be safe to use something like https://stackoverflow.com/a/15394738 rather than looping, shouldn't we?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think that way the code would be more concise. I didn't know about that solution for searching items in an array, thanks for sharing!

@beni0888
Copy link
Collaborator Author

Thanks @beni0888 , it'll be great to have faster CI! Code looks great, though my main question is: are the test groups running concurrently against the same cluster? If so, are we sure that they cannot interfere with each other? (ie. all namespaces/deployments etc. use unique identifiers).

The thing is, every test group runs in a different Kind cluster spun up in a different virtual machine, so there's no risk of interference between them.

Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
@beni0888 beni0888 merged commit ccb9080 into vmware-tanzu:main Oct 13, 2022
@beni0888 beni0888 deleted the optimize-ci-pipeline branch October 13, 2022 09:02
absoludity pushed a commit that referenced this pull request Jan 18, 2023
Bumps [axios](https://github.com/axios/axios) from 1.2.2 to 1.2.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/axios/axios/releases">axios's
releases</a>.</em></p>
<blockquote>
<h2>1.2.3</h2>
<h2>Release notes:</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>types:</strong> fixed AxiosRequestConfig header interface by
refactoring it to RawAxiosRequestConfig; (<a
href="https://github-redirect.dependabot.com/axios/axios/issues/5420">#5420</a>)
(<a
href="https://github.com/axios/axios/commit/08119634a22f1d5b19f5c9ea0adccb6d3eebc3bc">0811963</a>)</li>
</ul>
<h3>Contributors to this release</h3>
<ul>
<li><img
src="https://avatars.githubusercontent.com/u/12586868?v=4&amp;s=16"
alt="avatar" /> <a href="https://github.com/DigitalBrainJS"
title="+938/-442 ([#5456](axios/axios#5456)
[#5455](axios/axios#5455)
[#5453](axios/axios#5453)
[#5451](axios/axios#5451)
[#5449](axios/axios#5449)
[#5447](axios/axios#5447)
[#5446](axios/axios#5446)
[#5443](axios/axios#5443)
[#5442](axios/axios#5442)
[#5439](axios/axios#5439)
[#5420](axios/axios#5420) )">Dmitriy
Mozgovoy</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/axios/axios/blob/v1.x/CHANGELOG.md">axios's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/axios/axios/compare/1.2.2...1.2.3">1.2.3</a>
(2023-01-10)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>types:</strong> fixed AxiosRequestConfig header interface by
refactoring it to RawAxiosRequestConfig; (<a
href="https://github-redirect.dependabot.com/axios/axios/issues/5420">#5420</a>)
(<a
href="https://github.com/axios/axios/commit/08119634a22f1d5b19f5c9ea0adccb6d3eebc3bc">0811963</a>)</li>
</ul>
<h3>Contributors to this release</h3>
<ul>
<li><img
src="https://avatars.githubusercontent.com/u/12586868?v=4&amp;s=16"
alt="avatar" /> <a href="https://github.com/DigitalBrainJS"
title="+938/-442 ([#5456](axios/axios#5456)
[#5455](axios/axios#5455)
[#5453](axios/axios#5453)
[#5451](axios/axios#5451)
[#5449](axios/axios#5449)
[#5447](axios/axios#5447)
[#5446](axios/axios#5446)
[#5443](axios/axios#5443)
[#5442](axios/axios#5442)
[#5439](axios/axios#5439)
[#5420](axios/axios#5420) )">Dmitriy
Mozgovoy</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/axios/axios/commit/557ed0a7489b1bf62296ea34568eeea8975ff4f9"><code>557ed0a</code></a>
chore(ci): fixed publish action; (<a
href="https://github-redirect.dependabot.com/axios/axios/issues/5470">#5470</a>)</li>
<li><a
href="https://github.com/axios/axios/commit/484e0b6ed24745df9cadaacc0fbf129114e70d00"><code>484e0b6</code></a>
chore(release): v1.2.3 (<a
href="https://github-redirect.dependabot.com/axios/axios/issues/5459">#5459</a>)</li>
<li><a
href="https://github.com/axios/axios/commit/d83316db4a242252db3a2ed7728cb43f8f8f4189"><code>d83316d</code></a>
chore(ci): enabled npm publishing; (<a
href="https://github-redirect.dependabot.com/axios/axios/issues/5460">#5460</a>)</li>
<li><a
href="https://github.com/axios/axios/commit/d750901deda2994a2d89643e8f18723cfb6b2732"><code>d750901</code></a>
chore(ci): added an action to make GitHub &amp; NPM releases when
merging a relea...</li>
<li><a
href="https://github.com/axios/axios/commit/477c71427dc1d03e0f3dced0d65bd7c1b99fd900"><code>477c714</code></a>
chore(ci): fixed error in generating changelog with unnecessary spaces;
(<a
href="https://github-redirect.dependabot.com/axios/axios/issues/5455">#5455</a>)</li>
<li><a
href="https://github.com/axios/axios/commit/e2a1e280f6dfbb4f11ad541dec9541cdbf760ab1"><code>e2a1e28</code></a>
chore(ci): improved contributors &amp; PRs sections generator; (<a
href="https://github-redirect.dependabot.com/axios/axios/issues/5453">#5453</a>)</li>
<li><a
href="https://github.com/axios/axios/commit/18772ed8fdcd0768a9b520737d81283c04a273f8"><code>18772ed</code></a>
chore(ci): improved logging; (<a
href="https://github-redirect.dependabot.com/axios/axios/issues/5451">#5451</a>)</li>
<li><a
href="https://github.com/axios/axios/commit/259f5f5aaadfcaf7f3a3fe462d8b0dbbc8004962"><code>259f5f5</code></a>
chore(ci): added step of generating a list of contributors for
CHANELOG.md; (...</li>
<li><a
href="https://github.com/axios/axios/commit/d33a3deb82b808f109b598abbf39fd2a1f8da998"><code>d33a3de</code></a>
chore(ci): added commit message config; (<a
href="https://github-redirect.dependabot.com/axios/axios/issues/5447">#5447</a>)</li>
<li><a
href="https://github.com/axios/axios/commit/ebb9e814436d2f6c7cc65ffecb6ff013539ce961"><code>ebb9e81</code></a>
chore(deps): bump json5 from 1.0.1 to 1.0.2 (<a
href="https://github-redirect.dependabot.com/axios/axios/issues/5438">#5438</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/axios/axios/compare/1.2.2...v1.2.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=axios&package-manager=npm_and_yarn&previous-version=1.2.2&new-version=1.2.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
absoludity pushed a commit that referenced this pull request Jan 20, 2023
Bumps [axios](https://github.com/axios/axios) from 1.2.2 to 1.2.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/axios/axios/releases">axios's
releases</a>.</em></p>
<blockquote>
<h2>1.2.3</h2>
<h2>Release notes:</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>types:</strong> fixed AxiosRequestConfig header interface by
refactoring it to RawAxiosRequestConfig; (<a
href="https://github-redirect.dependabot.com/axios/axios/issues/5420">#5420</a>)
(<a
href="https://github.com/axios/axios/commit/08119634a22f1d5b19f5c9ea0adccb6d3eebc3bc">0811963</a>)</li>
</ul>
<h3>Contributors to this release</h3>
<ul>
<li><img
src="https://avatars.githubusercontent.com/u/12586868?v=4&amp;s=16"
alt="avatar" /> <a href="https://github.com/DigitalBrainJS"
title="+938/-442 ([#5456](axios/axios#5456)
[#5455](axios/axios#5455)
[#5453](axios/axios#5453)
[#5451](axios/axios#5451)
[#5449](axios/axios#5449)
[#5447](axios/axios#5447)
[#5446](axios/axios#5446)
[#5443](axios/axios#5443)
[#5442](axios/axios#5442)
[#5439](axios/axios#5439)
[#5420](axios/axios#5420) )">Dmitriy
Mozgovoy</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/axios/axios/blob/v1.x/CHANGELOG.md">axios's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/axios/axios/compare/1.2.2...1.2.3">1.2.3</a>
(2023-01-10)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>types:</strong> fixed AxiosRequestConfig header interface by
refactoring it to RawAxiosRequestConfig; (<a
href="https://github-redirect.dependabot.com/axios/axios/issues/5420">#5420</a>)
(<a
href="https://github.com/axios/axios/commit/08119634a22f1d5b19f5c9ea0adccb6d3eebc3bc">0811963</a>)</li>
</ul>
<h3>Contributors to this release</h3>
<ul>
<li><img
src="https://avatars.githubusercontent.com/u/12586868?v=4&amp;s=16"
alt="avatar" /> <a href="https://github.com/DigitalBrainJS"
title="+938/-442 ([#5456](axios/axios#5456)
[#5455](axios/axios#5455)
[#5453](axios/axios#5453)
[#5451](axios/axios#5451)
[#5449](axios/axios#5449)
[#5447](axios/axios#5447)
[#5446](axios/axios#5446)
[#5443](axios/axios#5443)
[#5442](axios/axios#5442)
[#5439](axios/axios#5439)
[#5420](axios/axios#5420) )">Dmitriy
Mozgovoy</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/axios/axios/commit/557ed0a7489b1bf62296ea34568eeea8975ff4f9"><code>557ed0a</code></a>
chore(ci): fixed publish action; (<a
href="https://github-redirect.dependabot.com/axios/axios/issues/5470">#5470</a>)</li>
<li><a
href="https://github.com/axios/axios/commit/484e0b6ed24745df9cadaacc0fbf129114e70d00"><code>484e0b6</code></a>
chore(release): v1.2.3 (<a
href="https://github-redirect.dependabot.com/axios/axios/issues/5459">#5459</a>)</li>
<li><a
href="https://github.com/axios/axios/commit/d83316db4a242252db3a2ed7728cb43f8f8f4189"><code>d83316d</code></a>
chore(ci): enabled npm publishing; (<a
href="https://github-redirect.dependabot.com/axios/axios/issues/5460">#5460</a>)</li>
<li><a
href="https://github.com/axios/axios/commit/d750901deda2994a2d89643e8f18723cfb6b2732"><code>d750901</code></a>
chore(ci): added an action to make GitHub &amp; NPM releases when
merging a relea...</li>
<li><a
href="https://github.com/axios/axios/commit/477c71427dc1d03e0f3dced0d65bd7c1b99fd900"><code>477c714</code></a>
chore(ci): fixed error in generating changelog with unnecessary spaces;
(<a
href="https://github-redirect.dependabot.com/axios/axios/issues/5455">#5455</a>)</li>
<li><a
href="https://github.com/axios/axios/commit/e2a1e280f6dfbb4f11ad541dec9541cdbf760ab1"><code>e2a1e28</code></a>
chore(ci): improved contributors &amp; PRs sections generator; (<a
href="https://github-redirect.dependabot.com/axios/axios/issues/5453">#5453</a>)</li>
<li><a
href="https://github.com/axios/axios/commit/18772ed8fdcd0768a9b520737d81283c04a273f8"><code>18772ed</code></a>
chore(ci): improved logging; (<a
href="https://github-redirect.dependabot.com/axios/axios/issues/5451">#5451</a>)</li>
<li><a
href="https://github.com/axios/axios/commit/259f5f5aaadfcaf7f3a3fe462d8b0dbbc8004962"><code>259f5f5</code></a>
chore(ci): added step of generating a list of contributors for
CHANELOG.md; (...</li>
<li><a
href="https://github.com/axios/axios/commit/d33a3deb82b808f109b598abbf39fd2a1f8da998"><code>d33a3de</code></a>
chore(ci): added commit message config; (<a
href="https://github-redirect.dependabot.com/axios/axios/issues/5447">#5447</a>)</li>
<li><a
href="https://github.com/axios/axios/commit/ebb9e814436d2f6c7cc65ffecb6ff013539ce961"><code>ebb9e81</code></a>
chore(deps): bump json5 from 1.0.1 to 1.0.2 (<a
href="https://github-redirect.dependabot.com/axios/axios/issues/5438">#5438</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/axios/axios/compare/1.2.2...v1.2.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=axios&package-manager=npm_and_yarn&previous-version=1.2.2&new-version=1.2.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants