-
Notifications
You must be signed in to change notification settings - Fork 102
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
feat(cd): deploy instances with attached cached states #8868
Merged
Conversation
This file contains 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
We've been using multiple approaches to locate and retrieve cached states in GCP. However, this has made it difficult to reuse the same methods across new workflows or different scenarios. To address this, we've streamlined the process to make it more reusable in other contexts. This change will support deploying instances from both the `main` branch and `release`, simplifying future implementations and speeding up the process. Changes: - Use a single bash script (`gcp-get-cached-disks.sh`) to get cached states names and availability - Move script logic from `sub-find-cached-disks.yml` to `gcp-get-cached-disks.sh` and adapt `sub-find-cached-disks.yml` to allow to output available disks and disks names. - Simplify parameters usage in `sub-deploy-integration-tests-gcp.yml` and convert the `Find ${{ inputs.test_id }} cached state disk` step into an independent job, to be able to use the `sub-find-cached-disks.yml` reusable workflow - Remove repetition in `sub-ci-integration-tests-gcp.yml`
We had a technical debt with some tests using a hardcoded value for the cache directory (`/zebrad-cache`), which generated inconsistency across disks and cached states directories. Changes: - Allow sync tests to use the `ZEBRA_CACHED_STATE_DIR` as the cache directory, if specified - Update the `entrypoint.sh` to reflect this change - Add the `ZEBRA_CACHED_STATE_DIR` variable to the missing tests in `sub-ci-integration-tests-gcp.yml`, and remove extra parameters to call reusable workflows.
gustavovalverde
added
A-infrastructure
Area: Infrastructure changes
A-devops
Area: Pipelines, CI/CD and Dockerfiles
I-usability
Zebra is hard to understand or use
C-feature
Category: New features
C-tech-debt
Category: Code maintainability issues
P-High 🔥
labels
Sep 17, 2024
github-actions
bot
added
the
C-trivial
Category: A trivial change that is not worth mentioning in the CHANGELOG
label
Sep 17, 2024
gustavovalverde
changed the title
feat(cd): deploy instances with cached states
feat(cd): deploy instances with attached cached states
Sep 17, 2024
gustavovalverde
requested review from
oxarbitrage
and removed request for
a team
September 17, 2024 18:34
oxarbitrage
previously approved these changes
Sep 19, 2024
mergify
bot
dismissed
oxarbitrage’s stale review
September 19, 2024 12:31
The base branch was changed.
mergify
bot
requested review from
oxarbitrage
and removed request for
a team
September 19, 2024 12:31
oxarbitrage
approved these changes
Sep 19, 2024
dmidem
pushed a commit
to QED-it/zebra
that referenced
this pull request
Oct 29, 2024
…on#8868) * ref(ci): consolidate cached states workflows and scripts We've been using multiple approaches to locate and retrieve cached states in GCP. However, this has made it difficult to reuse the same methods across new workflows or different scenarios. To address this, we've streamlined the process to make it more reusable in other contexts. This change will support deploying instances from both the `main` branch and `release`, simplifying future implementations and speeding up the process. Changes: - Use a single bash script (`gcp-get-cached-disks.sh`) to get cached states names and availability - Move script logic from `sub-find-cached-disks.yml` to `gcp-get-cached-disks.sh` and adapt `sub-find-cached-disks.yml` to allow to output available disks and disks names. - Simplify parameters usage in `sub-deploy-integration-tests-gcp.yml` and convert the `Find ${{ inputs.test_id }} cached state disk` step into an independent job, to be able to use the `sub-find-cached-disks.yml` reusable workflow - Remove repetition in `sub-ci-integration-tests-gcp.yml` * ref(tests): Use the `ZEBRA_CACHED_STATE_DIR` env var across tests We had a technical debt with some tests using a hardcoded value for the cache directory (`/zebrad-cache`), which generated inconsistency across disks and cached states directories. Changes: - Allow sync tests to use the `ZEBRA_CACHED_STATE_DIR` as the cache directory, if specified - Update the `entrypoint.sh` to reflect this change - Add the `ZEBRA_CACHED_STATE_DIR` variable to the missing tests in `sub-ci-integration-tests-gcp.yml`, and remove extra parameters to call reusable workflows. * feat(cd): deploy instances with cached states * fix(cd): allow deploying from branch * fix(cd): add missing `CACHED_DISK_NAME` env
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-devops
Area: Pipelines, CI/CD and Dockerfiles
A-infrastructure
Area: Infrastructure changes
C-feature
Category: New features
C-tech-debt
Category: Code maintainability issues
C-trivial
Category: A trivial change that is not worth mentioning in the CHANGELOG
I-usability
Zebra is hard to understand or use
P-High 🔥
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.
Motivation
We need to have long-live instances deployed, but we need to deploy instances beforehand with the cached state attached when merging PRs into the
main
branch, to test instances are syncing and running correctly.Fixes: #6894
Specifications & References
This is based in the refactor made in:
Solution
main
branchmain
branch cached states, usingsub-find-cached-disks.yml
"${DISK_PARAMS}"
as we do in CIgcloud
parameters into a more logical wayTests
Follow-up Work
mainnet
andtestnet
infra#15PR Author's Checklist
PR Reviewer's Checklist