-
Notifications
You must be signed in to change notification settings - Fork 198
[CI] Stable stack version override #8352
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
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
694fed2
[CI] Stable stack version override
pazone 1ac46a5
Update stable version
pazone 644aa37
Added UpdateCLI config
pazone 8ec05c7
Added UpdateCLI config
pazone eef9c87
Applied proposed changes
pazone 8b15a98
Update branch filter
pazone 6fc3c33
Update branch filter
pazone 5a568ee
Added th action
pazone b3fa97a
Improved PR description
pazone e6655a9
improve PR message
pazone 2fa292e
Pin version in create_deployment_csp_configuration
pazone fd55061
Added control plane team label
pazone 9d82bc1
Remove redundant :
pazone 4f72813
Applied proposed changes
pazone c96c563
Update test_infra/ess/deployment.tf
pazone 6e7319c
Added fallback to stack_version for docker images
pazone cbd9e02
Merge branch 'ci_stable_ess_version_autoupdate' of github.com:elastic…
pazone 1fbe12b
build to .build
pazone cef082d
Added pipelineid and force
pazone 8620dd0
force: false
pazone c25a8a1
Enabled automerge
pazone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # update-cli configuration for automated go updates | ||
| --- | ||
| name: Bump ESS snapshots | ||
pazone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| pipelineid: 'bump-ess-snapshot-{{ requiredEnv "BRANCH" }}' | ||
|
|
||
| scms: | ||
| githubConfig: | ||
| kind: github | ||
| spec: | ||
| user: '{{ requiredEnv "GITHUB_ACTOR" }}' | ||
| username: '{{ requiredEnv "GITHUB_ACTOR" }}' | ||
| owner: "{{ .scm.owner }}" | ||
| repository: "{{ .scm.repository }}" | ||
| token: '{{ requiredEnv "GITHUB_TOKEN" }}' | ||
| branch: '{{ requiredEnv "BRANCH_NAME" }}' | ||
| commitusingapi: true | ||
| force: false | ||
|
|
||
| sources: | ||
| lastStableStackSnapshot: | ||
| name: "Latest Stable ESS snapshot for current branch" | ||
| kind: json | ||
| spec: | ||
| file: 'https://storage.googleapis.com/artifacts-api/channels/{{ requiredEnv "BRANCH_NAME" }}.json' | ||
| key: .build | ||
| targets: | ||
| updateStackImages: | ||
| name: "Update create_deployment_csp_configuration.yaml" | ||
| sourceid: lastStableStackSnapshot | ||
| scmid: githubConfig | ||
| kind: file | ||
| spec: | ||
| file: "pkg/testing/ess/create_deployment_csp_configuration.yaml" | ||
| matchpattern: '(\S*_image: ".*docker.*):(.+)"' | ||
| replacepattern: '$1:{{ source "lastStableStackSnapshot" }}-SNAPSHOT"' | ||
pazone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| actions: | ||
| elastic-agent: | ||
| kind: github/pullrequest | ||
| scmid: githubConfig | ||
| sourceid: lastStableStackSnapshot | ||
| spec: | ||
| automerge: true | ||
pkoutsovasilis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| labels: | ||
| - dependencies | ||
pazone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - backport-skip | ||
| - skip-changelog | ||
| - "Team:Elastic-Agent-Control-Plane" | ||
| title: '[{{ requiredEnv "BRANCH_NAME" }}][Automation] Bump stack images versions to {{ source "lastStableStackSnapshot" }}' | ||
| description: | | ||
| Updates `create_deployment_csp_configuration.yml`. It is used to pin stable images versions for integration tests. | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| --- | ||
| name: update-stable-snapshot | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| schedule: | ||
| - cron: "0 0 * * *" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
|
|
||
| jobs: | ||
| filter: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 1 | ||
| outputs: | ||
| matrix: ${{ steps.generator.outputs.matrix }} | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - id: generator | ||
| uses: elastic/oblt-actions/elastic/active-branches@v1 | ||
| with: | ||
| filter-branches: true | ||
|
|
||
| update-stable-snapshot: | ||
| runs-on: ubuntu-latest | ||
| needs: [filter] | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: ${{ fromJson(needs.filter.outputs.matrix) }} | ||
| steps: | ||
| # We have same behavior for all branches. | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Run UpdateCLI in Apply mode | ||
| uses: elastic/oblt-actions/updatecli/run@v1 | ||
| with: | ||
| command: apply --config .ci/updatecli/updatecli-bump-stack-version.yml --values .ci/updatecli/values.d/scm.yml | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| BRANCH_NAME: ${{ matrix.branch }} | ||
|
|
||
| - if: ${{ failure() }} | ||
| uses: elastic/oblt-actions/slack/send@v1 | ||
| with: | ||
| bot-token: ${{ secrets.SLACK_BOT_TOKEN }} | ||
| channel-id: "#ingest-notifications" | ||
| message: ":traffic_cone: Update Stable snapshot: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, `@agent-team` and @robots-ci please look what's going on <${{ env.JOB_URL }}|here>" | ||
pazone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| ## Terraform-managed Elastic Stack deployment for integration tests | ||
|
|
||
| ### Required variables | ||
| `stack_version` - The version of the Elastic Stack to deploy, e.g., `9.1.0-SNAPSHOT`. | ||
pazone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ### Stable snapshots and images override | ||
| This deployment uses the latest tested snapshots of the Elastic Stack components by default. However, you can override the Docker images used for the integration server, Elasticsearch, and Kibana. | ||
|
|
||
| `create_deployment_csp_configuration.yaml` contains the default configuration for the deployment, including the Docker images for the integration server, Elasticsearch, and Kibana. These images are automatically updated to the latest tested snapshots of the Elastic Stack components. | ||
| * `integration_server_image` - The Docker image for the integration server | ||
| * `elasticsearch_docker_image` - The Docker image for Elasticsearch | ||
| * `kibana_docker_image` - The Docker image for Kibana | ||
|
|
||
| Alternatively, you can override these images by setting terraform variables by setting the following variables in your local `terraform.tfvars` file: | ||
| ```hcl | ||
| integration_server_docker_image = "docker.elastic.co/cloud-release/elastic-agent-cloud:9.1.0-48398db3-SNAPSHOT" | ||
| elasticsearch_docker_image = "docker.elastic.co/cloud-release/elasticsearch-cloud-ess:9.1.0-48398db3-SNAPSHOT" | ||
| kibana_docker_image = "docker.elastic.co/cloud-release/kibana-cloud:9.1.0-48398db3-SNAPSHOT" | ||
| ``` | ||
|
|
||
| or by setting the environment variables: | ||
| ```bash | ||
| export TF_VAR_integration_server_docker_image="docker.elastic.co/cloud-release/elastic-agent-cloud:9.1.0-48398db3-SNAPSHOT" | ||
| export TF_VAR_elasticsearch_docker_image="docker.elastic.co/cloud-release/elasticsearch-cloud-ess:9.1.0-48398db3-SNAPSHOT" | ||
| export TF_VAR_kibana_docker_image="docker.elastic.co/cloud-release/kibana-cloud:9.1.0-48398db3-SNAPSHOT" | ||
| ``` | ||
|
|
||
| Note: terraform variables take precedence over `create_deployment_csp_configuration.yaml` docker images configuration. Use `terraform.tfvars` and `TF_VAR_` environment variables to override the images if you don't want to modify the `create_deployment_csp_configuration.yaml` file. | ||
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.
Uh oh!
There was an error while loading. Please reload this page.