-
Notifications
You must be signed in to change notification settings - Fork 197
ci: add workflow to bump OpenTelemetry Kube Stack version #10620
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
base: main
Are you sure you want to change the base?
Conversation
This pull request does not have a backport label. Could you fix it @rogercoll? 🙏
|
matchpattern: "KubeStackChartVersion .*" | ||
replacepattern: 'KubeStackChartVersion = "{{ source "opentelemetry-kube-stack-helm" }}"' | ||
|
||
update-testdata: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elastic/observablt-ci Would you recommend any other way of running post-target commands? After the version has been updated in update-tested-kube-stack
, we need to run mage integration:buildKubernetesTestData
to update the local files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's possible, however you might need to configure the environment first:
- Install the tools as part of the script or the GitHub workflow, you choose
- Configure the env variables in the updatecli manifest. See https://www.updatecli.io/docs/plugins/resource/shell/#_environments
For instance, for the elastic/apm-server
you can see the below snippets (it configures the environment in the GitHub workflow):
- https://github.com/elastic/apm-server/blob/34e5414908094bd92d16f6c16134b87810b6bc38/.github/workflows/update-beats.yml#L41-L44
- https://github.com/elastic/apm-server/blob/34e5414908094bd92d16f6c16134b87810b6bc38/.ci/updatecli/update-beats.yml#L32-L42
I recommend to run those steps locally first, so if it works locally it should work with GH actions or any other CI vendor.
$ GITHUB_TOKEN=$(gh auth token) \
GITHUB_ACTOR=<your-user> \
updatecli diff \
--config ci/updatecli/updatecli-bump-kube-stack.yml \
--values .ci/updatecli/values.d/scm.yml
Then you can modify .ci/updatecli/values.d/scm.yml
and use your github-user in .scm.owner
and run:
$ GITHUB_TOKEN=$(gh auth token) \
GITHUB_ACTOR=<your-user> \
updatecli apply \
--config ci/updatecli/updatecli-bump-kube-stack.yml \
--values .ci/updatecli/values.d/scm.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was really valuable, thanks! Sample execution #10629
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
kind: file | ||
scmid: elastic-agent | ||
sourceid: opentelemetry-kube-stack-helm | ||
spec: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest using regex groups, then you don't need to worry about the spaces.
If you go to https://www.updatecli.io/docs/plugins/resource/file/#_file_target, you can see an example:
e.g this example updates the year on the "Copyright" substrings to 2021 while keeping the existing content such as contributors).:
targets:
updateCopyrightYear:
kind: file
sourceid: whateverSource # Will be ignored as `replacepattern` is specified
spec:
file: LICENSE
matchpattern: 'Copyright \(c\) (\d*) (.*)'
replacepattern: 'Copyright (c) 2021 $2'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea, capturing groups approach 34a766b
matchpattern: "KubeStackChartVersion .*" | ||
replacepattern: 'KubeStackChartVersion = "{{ source "opentelemetry-kube-stack-helm" }}"' | ||
|
||
update-testdata: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's possible, however you might need to configure the environment first:
- Install the tools as part of the script or the GitHub workflow, you choose
- Configure the env variables in the updatecli manifest. See https://www.updatecli.io/docs/plugins/resource/shell/#_environments
For instance, for the elastic/apm-server
you can see the below snippets (it configures the environment in the GitHub workflow):
- https://github.com/elastic/apm-server/blob/34e5414908094bd92d16f6c16134b87810b6bc38/.github/workflows/update-beats.yml#L41-L44
- https://github.com/elastic/apm-server/blob/34e5414908094bd92d16f6c16134b87810b6bc38/.ci/updatecli/update-beats.yml#L32-L42
I recommend to run those steps locally first, so if it works locally it should work with GH actions or any other CI vendor.
$ GITHUB_TOKEN=$(gh auth token) \
GITHUB_ACTOR=<your-user> \
updatecli diff \
--config ci/updatecli/updatecli-bump-kube-stack.yml \
--values .ci/updatecli/values.d/scm.yml
Then you can modify .ci/updatecli/values.d/scm.yml
and use your github-user in .scm.owner
and run:
$ GITHUB_TOKEN=$(gh auth token) \
GITHUB_ACTOR=<your-user> \
updatecli apply \
--config ci/updatecli/updatecli-bump-kube-stack.yml \
--values .ci/updatecli/values.d/scm.yml
@@ -0,0 +1,9 @@ | |||
#!/usr/bin/env bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say add an entry in the CODEOWNERS for this file, otherwise, robots-ci
will be the codeowners and we don't own it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, added an entry with @elastic/elastic-agent-control-plane as owners (please, let me know if another team should own this). 4a53ad5
Also, I changed the backport to active-9 for now. Otel components dependencies are only being updated in 9.1 and 9.2, which makes the alignment with the latest kube-stack versions harder.
Co-authored-by: Victor Martinez <[email protected]>
Co-authored-by: Victor Martinez <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I'd like @swiatekm to also take a look since it pertains to OTel Helm charts.
What does this PR do?
Automates the process of bumping the tested OpenTelemetry kube-stack Helm Chart version.
Why is it important?
Keep it up-to-date and catch breaking changes as released.
Checklist
./changelog/fragments
using the changelog toolDisruptive User Impact
How to test this PR locally
Related issues
Questions to ask yourself