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

VAULT-28638: Cost optimize the Security scan workflow #28067

Merged
merged 1 commit into from
Aug 14, 2024
Merged

Conversation

ryancragun
Copy link
Collaborator

@ryancragun ryancragun commented Aug 13, 2024

Description

Optimize the cost of the Security scan workflow by utilizing a
different runner. Previously this workflow would use the
custom-linux-xl in vault vs. the c6a.4xlarge on-demand runner in
vault-enterprise. This resulted in the vault workflow costing an
order of magnitude more each month.

I tested with the following instances sizes to compare cost to execution
time:

Runnner Estimated Time Cost Factor Cost Score
ubuntu-latest 19m 1 19
custom-linux-small 21.5m 2 43
custom-linux-medium 11.5m 4 46
custom-linux-xl 8.5m 16 136

Currently the CI and build require workflows take anywhere from
16-20 minutes on vault. Our goal is to not exceed that.

At this time we're going to try out ubuntu-latest as it gives us ~85%
savings and by far the best bang for our buck. If it ends up being a
burden we can switch to custom-linux-medium for ~66% cost savings but
still a reasonable runtime.

TODO only if you're a HashiCorp employee

  • Labels: If this PR is the CE portion of an ENT change, and that ENT change is
    getting backported to N-2, use the new style backport/ent/x.x.x+ent labels
    instead of the old style backport/x.x.x labels.
  • Labels: If this PR is a CE only change, it can only be backported to N, so use
    the normal backport/x.x.x label (there should be only 1).
  • ENT Breakage: If this PR either 1) removes a public function OR 2) changes the signature
    of a public function, even if that change is in a CE file, double check that
    applying the patch for this PR to the ENT repo and running tests doesn't
    break any tests. Sometimes ENT only tests rely on public functions in CE
    files.
  • Jira: If this change has an associated Jira, it's referenced either
    in the PR description, commit message, or branch name.
  • RFC: If this change has an associated RFC, please link it in the description.
  • ENT PR: If this change has an associated ENT PR, please link it in the
    description. Also, make sure the changelog is in this PR, not in your ENT PR.

@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Aug 13, 2024
Copy link

CI Results:
All Go tests succeeded! ✅

@ryancragun ryancragun force-pushed the vault-29893 branch 2 times, most recently from e6f4fdb to b45d080 Compare August 13, 2024 18:28
Optimize the cost of the Security `scan` workflow by utilizing a
different runner. Previously this workflow would use the
`custom-linux-xl` in `vault` vs. the `c6a.4xlarge` on-demand runner in
`vault-enterprise. This resulted in the `vault` workflow costing an
order of magnitude more each month.

I tested with the following instances sizes to compare cost to execution
time:

| Runnner | Estimated Time | Cost Factor | Cost Score |
|---------|-----------------|-------------|-------------|
|ubuntu-latest|19m|1|19|
|custom-linux-small|21.5m|2|43|
|custom-linux-medium|11.5m|4|46|
|custom-linux-xl|8.5m|16|136|

Currently the `CI` and `build` require workflows take anywhere from
16-20 minutes on `vault`. Our goal is to not exceed that.

At this time we're going to try out `ubuntu-latest` as it gives us ~85%
savings and by far the best bang for our buck. If it ends up being a
burden we can switch to `custom-linux-medium` for ~66% cost savings but
still a reasonable runtime.

Signed-off-by: Ryan Cragun <me@ryan.ec>
@ryancragun ryancragun marked this pull request as ready for review August 13, 2024 22:02
@ryancragun ryancragun requested a review from a team as a code owner August 13, 2024 22:02
Copy link

Build Results:
All builds succeeded! ✅

@ryancragun ryancragun changed the title VAULT-28638: Cost optimize the security-scan workflow VAULT-28638: Cost optimize the Security scan workflow Aug 13, 2024
@ryancragun ryancragun added backport/ent/1.15.x+ent Changes are backported to 1.15.x+ent backport/ent/1.16.x+ent Changes are backported to 1.16.x+ent and removed backport/ent/1.15.x+ent Changes are backported to 1.15.x+ent backport/ent/1.16.x+ent Changes are backported to 1.16.x+ent labels Aug 14, 2024
@ryancragun
Copy link
Collaborator Author

I ended up deciding to backport this to 1.15.x+ent and 1.16.x+ent just to keep things in sync, not because it was really necessary

@ryancragun ryancragun merged commit aff0eae into main Aug 14, 2024
112 of 124 checks passed
@ryancragun ryancragun deleted the vault-29893 branch August 14, 2024 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/ent/1.15.x+ent Changes are backported to 1.15.x+ent backport/ent/1.16.x+ent Changes are backported to 1.16.x+ent backport/1.17.x hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed pr/no-changelog pr/no-milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants