Commit Graph

6 Commits

Author SHA1 Message Date
Gustavo Valverde fbd6b0f8b3
ref(docker): combine test and prod entrypoints into one (#7660)
* ref(docker): combine test and prod entrypoints into one

This makes the following changes
- Uses `-x` instead of echoing the variables values
- Sets default values where required
- Create a function to list directories
- Create a function to run cargo tests
- Use a better approach to handle different options in the `case` manegement for tests and production
- Replaces all instances of `runtime-entrypoint.sh` with `entrypoint.sh`

* chore: use 2 spaces insted of 4 for indentation

* fix: add missing `test-threads` to `fully_synced_rpc_`

* fix: allow 3 arguments instead of 2 to handle `fully_synced_rpc_` correctly

* chore: remove extra file

* chore: add comments to main parts of the file

* fix(ci): just create the `$ZEBRA_CONF_PATH` if `$ENTRYPOINT_FEATURES` is not set

* fix(entrypoint): just print ${ZEBRA_CONF_PATH} if exists

* fix: missing condition

* ref: handle tests better if `$ENTRYPOINT_FEATURES` is set

* fix(ci): We just want `ZEBRA_CONF_PATH` to be set in the `release` image

* fix(entrypoint): fix the overall `case` logic

* fix(ci): allos to run with custom config in CI image

* fix(ci): more edgecases

* fix: we don't need to find files, but subdirectories

* fix(ci): handle Signal Forwarding and exit codes for `cargo`

* fix(ci): parse `fully_synced_rpc_` test correctly

* chore: add missing cache dir variable for LWD

* fix(entrypoint): handle an arbitrary number of arguments

* fix(entrypoint): handle features list

* fix(entrypoint): typo

* chore: typo
2023-10-11 19:04:45 +00:00
teor d9add4a01f
change(cd): Deploy testnet instances for every main branch push and release (#6842) 2023-06-08 15:44:30 +10:00
Gustavo Valverde 8b68651ba8
fix(build): avoid docker cache contamination and invalidation (#4254)
* imp(build): reduce docker cache invalidation

Use scoped caching and more file ignores to reduce cache invalidation

* fix(build): add entrypoint.sh as a required file

* fix(build): do not logout if the build takes too long

* Add 'doc comment' about .dockerignore

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2022-05-03 10:13:28 -04:00
Gustavo Valverde 47c1c01fcf
refactor(ci): use distinctive names for cached state disks (#4073)
* fix(ci): correctly use lowered network caps

In the Test workflow we were using a different approach than the one being used in the Full sync test.

Also, in the Full sync test the variable was LOWER_NET_NAME, but NETWORK was being used in the disk name, with caps.

* imp(ci): get state version from local constants.rs

* imp(ci): use the same get name approach

* fix(ci): use the correct name for state version variable

* imp(ci)!: use different disk names for cached states

Disk states synced to canopy and synced to the chain tip should have different names to reference correctly on actual and coming tests the needed disk.

* imp(ci): test-stateful-sync no longer depends on regenerate-stateful-disks

* Apply suggestions from code review

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>

* fix(ci): use a better name for network string conversion

* Revert "Apply suggestions from code review"

This reverts commit cbbfaf4e9c.

* fix: do not get log information if sync was skipped

* fix(ci): do not lower the variable name

* fix(ci): use the same lowering case for network everywhere

* test: more .dockerignore conditions

* fix: use the right approach to lower caps

* remove extra .dockerignore

* trigger a change for stateful disk regeneration

* imp(ci): use `checkpoint` as the disk reference

* revert wrong delete

* fix(ci): add INSTANCE_ID and correct logging message

* imp(ci): add `v` prefix to state version number

* fix(ci): remove typo from logging message to get the height

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2022-04-12 05:34:15 +00:00
Gustavo Valverde 44cb35c320
fix(ci): validate tests exit code after reading the container logs (#3968)
* fix(ci): validate exit code

* fix(ci): use a single step

* fix: run from gcp command

* fix: remove variable substitution

* fix: escaping characters

* fix: handle bash issues with variable expansion

* fix: seggregate execution into multiple steps

* fix: the command is a string

* fix: move docker ignore to use caching

* revert panic

* fix: add panic and fix exit code command

* revert: remove panic

* fix: apply the exit code to all gcp tests

* imp(ci): use single line exit

* Clean up the CODEOWNERS file

We moved the dockerignore file into the docker directory,
so it doesn't need a separate entry any more.

Co-authored-by: teor <teor@riseup.net>
2022-04-07 23:16:40 +00:00
Gustavo Valverde a872f1727a
refactor(cd): improve Docker and gcloud usage without Cloud Build (#3431)
* refactor (cd): overall pipeline improvement

- Use a more ENV configurable Dockerfile
- Remove cloudbuild dependency
- Use compute optimized machine types
- Use SSD instead of normal hard drives
- Move Sentry endpoint to secrets
- Use a single yml for auto & manual deploy
- Migrate to Google Artifact Registry

* refactor (cd): overall pipeline improvement

- Use a more ENV configurable Dockerfile
- Remove cloudbuild dependency
- Use compute optimized machine types
- Use SSD instead of normal hard drives
- Move Sentry endpoint to secrets
- Use a single yml for auto & manual deploy
- Migrate to Google Artifact Registry

* refactor (cd): use newer google auth action

* fix (cd): use newer secret as gcp credential

* fix (docker): do not create extra directories

* fix (docker): ignore .github for caching purposes

* fix (docker): use latest rust

* fix: use a better name for manual deployment

* refactor (docker): use standard directories for executable

* fix (cd): most systems expect a "latest" tag

Caching from the latest image is one of the main reasons to add this extra tag. Before this commit, the inline cache was not being used.

* fix (cd): push the build image and the cache separately

The inline cache exporter only supports `min` cache mode. To enable `max` cache mode, push the image and the cache separately by using the registry cache exporter.

This also allows for smaller release images.

* fix (cd): remove unused GHA cache

We're leveraging the registry to cache the actions, instead of using the 10GB limits from Github Actions cache storage

* refactor (cd): use cargo-chef for caching rust deps

* fix (release): use newer debian to reduce vulnerabilities

* fix (cd): use same zone, region and service accounts

* fix (cd): use same disk size and type for all deployments

* refactor (cd): activate interactive shells

Use interactive shells for manual and test deployments. This allow greater flexibility if troubleshooting is needed inside the machines

* fix (docker): do not build with different settings

Compiling might be slow because different steps are compiling the same code 2-4 times because of the variations

* fix(cd): use Mainnet instead of mainnet

* fix(docker): remove tests as a runtime dependency

* fix(cd): use default service account with cloud-platform scope

* fix(cd): keep compatibility with gcr.io

To prevent conflicts between registries, and migrate when the time is right, we'll keep pushing to both registries and use github actions cache to prevent conflicts between artifacts.

* fix(docker): do not download zcash params twice

* feat(docker): add google OS Config agent

Use a separate step to have better flexibility in case a better approach is available

* fix(docker): allow to use zebrad as a command

* feat: add an image to inherit from with zcash params

* refactor(docker): use cached zcash params from previous build

* imp(cd): add double safety measure for production
2022-02-08 20:50:13 -04:00