Commit Graph

27 Commits

Author SHA1 Message Date
teor a763eec9f3
fix(ci): Fix network parameter in continous-delivery.yml, and add network labels to GCP jobs (#5710)
* chore: add Network as a label

* Fix network parameter in continous-delivery.yml

* Standardise network usage in zcashd-manual-deploy

* Use lowercase network labels

* Fix some shellcheck errors

* Hard-code a Mainnet default to support contexts where env is not available

* Fix string syntax

* Fix more shellcheck errors

* Update .github/workflows/zcashd-manual-deploy.yml

Co-authored-by: Gustavo Valverde <gustavo@iterativo.do>
Co-authored-by: Arya <aryasolhi@gmail.com>
2022-11-25 21:11:22 +00:00
Gustavo Valverde c7745415b6
feat(gcp): add label to instances for cost and logs grouping (#5693)
* feat(gcp): add label to instances for cost and logs grouping

Previous behavior:
We couldn't search GCP logs using the instance name if that instance was
already deleted. And if we want to know how we're spending our budget its
also difficult to know if specific tests or type of instances are the one
responsible for a certain % of the costs

Fixes #5153
Fixses #5543

Expected behavior:
Be able to search logs using the test ID or at least the github reference,
and be able to group GCP costs by labels

Solution:
- Add labels to instances

* chore: add Network as a label

* Revert "chore: add Network as a label"

This reverts commit 146f747d50.

* Update .github/workflows/zcashd-manual-deploy.yml

Co-authored-by: teor <teor@riseup.net>

Co-authored-by: teor <teor@riseup.net>
2022-11-24 03:34:31 +00:00
Gustavo Valverde ae86678034
fix(cd): allow deploying instance templates without disk errors (#5697)
* fix(cd): allow deploying instance templates without disk errors

Motivation:

PR #5670 failed in `main` as it was tested with `gcloud compute instances create-with-container`
and even the manual deployment uses `instances`, and it works.

But the one that failed uses `gcloud compute instance-templates create-with-container`
using `instance-template` and it's complaining with: `When attaching or creating a disk that is also being mounted to a container, must specify the disk name`

Based on the documentation, the name is optional when using `create-with-container`,
for both `instances` and `instance-templates`

Source: https://cloud.google.com/sdk/gcloud/reference/compute/instance-templates/create-with-container#--container-mount-disk

Solution:

Revert this specific job as how it was, and do not scale the instances
above 1, as this would cause the following error:
`Instance template specifies a disk with a custom name. This will cause instance group not to scale beyond 1 instance per zone.`

* chore: reduce diff
2022-11-22 22:20:47 +00:00
Gustavo Valverde f99a051302
fix(deploy): no dot name instance template disks to allow scaling (#5670)
* chore(disk): use specific API nomenclature

* fix(deploy): instance templates are not deploying correctly

* chore: missing extra parameter
2022-11-22 21:03:30 +00:00
Gustavo Valverde 7b73aa0c84
ci: use Container-Optimized OS public image on the VM (#5617)
* ci(compute): use debian public image on the VM, not the container

Previous behavior:

We were pulling the debian image the wrong way, as this was being used
as a container but it was meant to be the VM image

The image being pulled to create the internal container has been causing
crashes as this images do not exists on Google's container repositories

Expected behavior:

Use a public image as debian-11 to get multiple benefits from it, as being
able to use machine-images (#5615) and automatic disk resizing (which
is now possible as we're using COS images, but those are more restrictive)

Solution

Add `--image-project=debian-cloud` and `--image-family=debian-11` as
stated in the official documentation: https://cloud.google.com/sdk/gcloud/reference/compute/instances/create-with-container#--image-project

More info: https://cloud.google.com/compute/docs/images/os-details#import

* fix: use a public image with docker on the host

* fix(logs): missing sudo before docker command

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-11-16 23:08:28 +00:00
dependabot[bot] cbc2e393ca
build(deps): bump google-github-actions/setup-gcloud from 1.0.0 to 1.0.1 (#5614)
Bumps [google-github-actions/setup-gcloud](https://github.com/google-github-actions/setup-gcloud) from 1.0.0 to 1.0.1.
- [Release notes](https://github.com/google-github-actions/setup-gcloud/releases)
- [Changelog](https://github.com/google-github-actions/setup-gcloud/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google-github-actions/setup-gcloud/compare/v1.0.0...v1.0.1)

---
updated-dependencies:
- dependency-name: google-github-actions/setup-gcloud
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-10 17:16:52 +00:00
Gustavo Valverde a815e9d252
fix(gcloud): setup the GCP CLI after authenticating (#5606)
Previous behavior:
`gcloud` commands have been running without an appropiate authentication
as the `auth` auction was sucessfully executed, but the actual gcloud
CLI being used in further jobs was not using the correct configuration
nor credentials

Expected behavior:
All `gcloud` commands should be properly configured and authenticated.

Solution:
Add the `google-github-actions/setup-gcloud` action after each
`google-github-actions/auth` invocation, and before running any `gcloud`
command.

Remove the need of an OAuth Access token when not required by following
steps
2022-11-10 06:32:21 +00:00
dependabot[bot] be24a364da
build(deps): bump google-github-actions/auth from 0.8.3 to 1.0.0 (#5596)
Bumps [google-github-actions/auth](https://github.com/google-github-actions/auth) from 0.8.3 to 1.0.0.
- [Release notes](https://github.com/google-github-actions/auth/releases)
- [Changelog](https://github.com/google-github-actions/auth/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google-github-actions/auth/compare/v0.8.3...v1.0.0)

---
updated-dependencies:
- dependency-name: google-github-actions/auth
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-10 00:12:39 +00:00
teor 26698bf2c4
fix(ci): Run required jobs on dependent PRs (#5550)
* Run CI jobs on dependent PRs

* Change job names to be unique

* Fix outdated workflow name

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-11-07 11:59:32 +10:00
dependabot[bot] 3cbf8dafaf
build(deps): bump google-github-actions/auth from 0.8.2 to 0.8.3 (#5413)
Bumps [google-github-actions/auth](https://github.com/google-github-actions/auth) from 0.8.2 to 0.8.3.
- [Release notes](https://github.com/google-github-actions/auth/releases)
- [Changelog](https://github.com/google-github-actions/auth/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google-github-actions/auth/compare/v0.8.2...v0.8.3)

---
updated-dependencies:
- dependency-name: google-github-actions/auth
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-17 21:54:05 +00:00
dependabot[bot] 291b85d8ec
build(deps): bump google-github-actions/auth from 0.8.1 to 0.8.2 (#5404)
Bumps [google-github-actions/auth](https://github.com/google-github-actions/auth) from 0.8.1 to 0.8.2.
- [Release notes](https://github.com/google-github-actions/auth/releases)
- [Changelog](https://github.com/google-github-actions/auth/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google-github-actions/auth/compare/v0.8.1...v0.8.2)

---
updated-dependencies:
- dependency-name: google-github-actions/auth
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-16 12:34:36 +00:00
Gustavo Valverde 25b46ea0ec
ci(disk): use an official GCP image on CI VMs for disk auto-resizing, make CI & CD disks 300GB (#5371)
* Revert "ci(ssh): connect using `ssh-compute` action by Google (#5330)"

This reverts commit b366d6e7bb.

* ci(ssh): use sudo for docker commands if user is not root

* ci(ssh): specify the service account to connect with

* ci(ssh): increase the Google Cloud instance sshd connection limit

* chore: add a new line at the end of the script

* chore: update our VM image to bullseye

* chore: fix `tj-actions/changed-files` file comparison

* ci(disk): use an official image on CI VMs for disk auto-resizing

Previous behavior:
We've presented issues in the past with resizing as the device is busy,
for example:

```
e2fsck: Cannot continue, aborting.
/dev/sdb is in use.
```

Expected behavior:
We've been manually resizing the disk as this task was not being done
automatically, but having an official Public Image from GCP would make
this easier (automatic) and it also integrates better with other GCP
services

Configuration differences: https://cloud.google.com/compute/docs/images/os-details#notable-difference-debian

Solution:
- Use `debian-11` from the official public images https://cloud.google.com/compute/docs/images/os-details#debian
- Remove the manual disk resizing from the pipeline

* ci: increase VM disk size to fit future cached states sizes

Some GCP disk images are 160 GB, which means they could get to the current
200 GB size soon.
2022-10-16 08:01:59 -04:00
dependabot[bot] a524816e14
build(deps): bump actions/github-script from 6.3.2 to 6.3.3 (#5409)
Bumps [actions/github-script](https://github.com/actions/github-script) from 6.3.2 to 6.3.3.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6.3.2...v6.3.3)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-14 20:22:59 +00:00
dependabot[bot] 8646a03e03
build(deps): bump actions/github-script from 6.3.1 to 6.3.2 (#5387)
Bumps [actions/github-script](https://github.com/actions/github-script) from 6.3.1 to 6.3.2.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6.3.1...v6.3.2)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-12 19:32:55 +00:00
dependabot[bot] d8f803a826
build(deps): bump actions/github-script from 6.3.0 to 6.3.1 (#5317)
Bumps [actions/github-script](https://github.com/actions/github-script) from 6.3.0 to 6.3.1.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6.3.0...v6.3.1)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-03 17:50:10 +00:00
dependabot[bot] 84d79ecda6
build(deps): bump actions/github-script from 6.2.0 to 6.3.0 (#5271)
Bumps [actions/github-script](https://github.com/actions/github-script) from 6.2.0 to 6.3.0.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6.2.0...v6.3.0)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-09-27 21:22:30 +00:00
teor c081fd9873
fix(cd): Use 200GB disks for managed instances (#5084)
* Use 200GB disks for managed instances

* Fix a typo
2022-09-06 00:23:25 +00:00
dependabot[bot] 594f4c41cf
build(deps): bump google-github-actions/auth from 0.8.0 to 0.8.1 (#5029)
Bumps [google-github-actions/auth](https://github.com/google-github-actions/auth) from 0.8.0 to 0.8.1.
- [Release notes](https://github.com/google-github-actions/auth/releases)
- [Changelog](https://github.com/google-github-actions/auth/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google-github-actions/auth/compare/v0.8.0...v0.8.1)

---
updated-dependencies:
- dependency-name: google-github-actions/auth
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-01 23:48:28 +00:00
Gustavo Valverde c85e482fa0
ci(concurrency)!: run a single CI workflow as required (#4981)
* ci(concurrency)!: run a single CI workflow as required

Previous behavior:
Multiple Mainnet full syncs were able to run on the main branch at the
same time, and pushing multiple commits to the same branch would run
multiple CI workflows, when only the run from last commit was relevant

Expected behavior:
Ensure that only a single CI workflow runs at the same time in PRs.
The latest commit should cancel any previous running workflows from the
same PR.

Solution:
Use GitHub actions concurrency feature https://docs.github.com/en/actions/using-jobs/using-concurrency

Fixes https://github.com/ZcashFoundation/zebra/issues/4977
Fixes https://github.com/ZcashFoundation/zebra/issues/4857

* docs: typo

* ci(concurrency): do not cancel running full syncs

Co-authored-by: teor <teor@riseup.net>

* fix(concurrency): explain the behavior better & add new ones

Co-authored-by: teor <teor@riseup.net>
2022-08-30 00:11:05 +00:00
dependabot[bot] e5c0e10887
build(deps): bump actions/github-script from 6.1.0 to 6.2.0 (#4986)
Bumps [actions/github-script](https://github.com/actions/github-script) from 6.1.0 to 6.2.0.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6.1.0...v6.2.0)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-29 22:52:29 +00:00
Gustavo Valverde 58c4a62d2f
ci(deploy): do not run `versioning` job when pushing to `main` (#4970)
Previous behavior:
When a push was detected in the `main` branch, the workflow would run the
`versioning` job and crash trying to detect the version being deployed as
there was none.

Expected behavior:
Do not fail the `versioning` job when pushing to `main`

Solution:
Limit the `versioning` job to only run when a release event is triggered
and allow the `deploy-nodes` job to run even if `versioning` is skipped
2022-08-28 23:56:58 +00:00
Gustavo Valverde 8227dabe56
ci(build): deploy long running node instances on release (#4939)
* feat(build): deploy long running instances on release

Previous behavior:
Each time we merged to main new nodes would be deployed, this is an
expected behavior as we need to ensure nodes get deployed and run
without issues, but this could also replace nodes very hastily.

Expected behavior:
We want instances which would run for a longer time, to allow us to
troubleshoot issues or inspect the behavior of this instances for longer
periods of time (2+ weeks)

Applied solution:
Deploy a versioned manage instance group (MiG) using the major version
of the release semver. We just use the first part of the version to
replace old instances, and change it when a major version is released
to keep a segregation between new and old versions.

* ci(build): allow v0 as a major version tag

* fix(build): use rust conventions for versioning

* fix(deploy): improve documentation and trigger on release

* Update .github/workflows/continous-delivery.yml

Co-authored-by: teor <teor@riseup.net>

* fix(versioning): typo

* fix(deploy): use `zebrad-v1` as the instance name, with no SHA

* fix(deploy): create and update MiG must use the same name

* docs(deployments): add Continuous Delivery process

Co-authored-by: teor <teor@riseup.net>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-08-28 12:46:21 +00:00
Gustavo Valverde bcc325d7f8
ci(auth): retry GCP authentication if fails (#4940)
Previous behavior:
Sometimes Google Cloud authentication fails, this might happen before
IAM permissions are fully propagated

Expected behavior:
If the authentication fails, retry at least 3 times before exiting with
a non zero exit code

Applied solution:
Google GitHub Actions for auth recently added this a `retries` feature
which is now implemented to workaround this issue.

Note: 95a6bc2a27

Fixes https://github.com/ZcashFoundation/zebra/issues/4846
2022-08-24 03:49:55 +00:00
dependabot[bot] 703e621734
build(deps): bump google-github-actions/auth from 0.7.3 to 0.8.0 (#4478)
Bumps [google-github-actions/auth](https://github.com/google-github-actions/auth) from 0.7.3 to 0.8.0.
- [Release notes](https://github.com/google-github-actions/auth/releases)
- [Changelog](https://github.com/google-github-actions/auth/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google-github-actions/auth/compare/v0.7.3...v0.8.0)

---
updated-dependencies:
- dependency-name: google-github-actions/auth
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-24 19:16:18 +00:00
dependabot[bot] 2d7b7c2c5b
build(deps): bump google-github-actions/auth from 0.7.2 to 0.7.3 (#4419)
Bumps [google-github-actions/auth](https://github.com/google-github-actions/auth) from 0.7.2 to 0.7.3.
- [Release notes](https://github.com/google-github-actions/auth/releases)
- [Changelog](https://github.com/google-github-actions/auth/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google-github-actions/auth/compare/v0.7.2...v0.7.3)

---
updated-dependencies:
- dependency-name: google-github-actions/auth
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-18 21:38:39 +00:00
dependabot[bot] acccb9896c
build(deps): bump google-github-actions/auth from 0.7.1 to 0.7.2 (#4404)
Bumps [google-github-actions/auth](https://github.com/google-github-actions/auth) from 0.7.1 to 0.7.2.
- [Release notes](https://github.com/google-github-actions/auth/releases)
- [Changelog](https://github.com/google-github-actions/auth/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google-github-actions/auth/compare/v0.7.1...v0.7.2)

---
updated-dependencies:
- dependency-name: google-github-actions/auth
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-17 20:28:38 +00:00
Gustavo Valverde 228f16be50
refactor(actions): rename workflow files (#3941)
* refactor(actions): rename workflow files

* refactor(worflows): change files according new approach
2022-05-09 15:54:16 -04:00