Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Design: split build/deploy and test topics #533

Closed
ace-n opened this issue Jun 10, 2022 · 2 comments
Closed

Design: split build/deploy and test topics #533

ace-n opened this issue Jun 10, 2022 · 2 comments
Labels
ignore-for-release priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@ace-n
Copy link
Contributor

ace-n commented Jun 10, 2022

Context

Emblem has several CI processes that run on a nightly basis. These are triggered by Cloud Scheduler, which sends a message to Pub/Sub that in turn triggers Cloud Build:

flowchart LR
    A["Cloud Scheduler"]-- messages -->B["Cloud Pub/Sub"]-- triggers -->C["Cloud Build"]
Loading

Problem Statement

Currently, we use one Pub/Sub topic (nightly) to trigger both builds/deploys and tests.

This means that artifact builds/deploys and tests are triggered [by Cloud Scheduler] simultaneously. Simultaneous triggering can lead to race conditions, wherein tests on day n will test day n-1's deployment artifacts.

Proposed Fix

To mitigate this, we should create two Pub/Sub topics:

  • nightly-builds: build artifacts
  • nightly-tests: run tests

The build topic (nightly-builds) will run slightly (e.g. 1 hour) before the testing topic (nightly-tests). This should give the builds enough time to update the deployed artifacts.

Note: if any deployment steps fail, then the tests will automatically "fall back" to the previous day's artifacts.

Implementation

To implement this change, we'll need to do the following:

  1. Create two new Pub/Sub topics in Terraform (nightly-builds and nightly-tests)
  2. Migrate build/test processes over to their appropriate topics
  3. Remove the old (nightly) Pub/Sub topic and any references to it.

Tip: each of these should be one PR, for three PRs total.

@ace-n ace-n added good first issue This issue is a good place to started contributing to this repository. help wanted We'd love to have community involvement on this issue. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. priority: p2 Moderately-important priority. Fix may not be included in next release. ignore-for-release labels Jun 10, 2022
@grayside grayside removed good first issue This issue is a good place to started contributing to this repository. help wanted We'd love to have community involvement on this issue. labels Jun 10, 2022
@grayside
Copy link
Collaborator

Not sure we're aligned on what needs to happen here yet, so removing the help wanted and good first issue labels for now. Thanks for filing!

@ace-n
Copy link
Contributor Author

ace-n commented Jun 10, 2022

Closed in favor of #536.

@ace-n ace-n closed this as completed Jun 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ignore-for-release priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

2 participants