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

change(ci): Generate mainnet checkpoints in CI #6550

Merged
merged 40 commits into from
Apr 27, 2023
Merged

Conversation

teor2345
Copy link
Contributor

@teor2345 teor2345 commented Apr 20, 2023

Motivation

In #6367 we want to generate checkpoints in CI. This is the mainnet CI and Rust test harness part of that ticket.

Complex Code or Requirements

This is just test code.

Solution

CI workflow:

Rust test harness:

Docker test harness:

zebra-checkpoints binary:

Logging:

Related changes:

And a bunch of minor fixes.

Review

This is a routine CI change.

Reviewer Checklist

  • Will the PR name make sense to users?
    • Does it need extra CHANGELOG info? (new features, breaking changes, large changes)
  • Are the PR labels correct?
  • Does the code do what the ticket and PR says?
    • Does it change concurrent code, unsafe code, or consensus rules?
  • How do you know it works? Does it have tests?

Follow Up Work

  • Admin: Require the new mainnet job to pass before a PR can merge

Next PR:

  • Add a workflow for testnet

@teor2345 teor2345 added A-consensus Area: Consensus rule updates A-devops Area: Pipelines, CI/CD and Dockerfiles P-Medium ⚡ C-testing Category: These are tests A-rpc Area: Remote Procedure Call interfaces labels Apr 20, 2023
@teor2345 teor2345 requested a review from a team as a code owner April 20, 2023 01:10
@teor2345 teor2345 self-assigned this Apr 20, 2023
@teor2345 teor2345 requested a review from a team as a code owner April 20, 2023 01:10
@teor2345 teor2345 requested review from arya2 and removed request for a team April 20, 2023 01:10
@github-actions github-actions bot added C-enhancement Category: This is an improvement C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG labels Apr 20, 2023
@codecov
Copy link

codecov bot commented Apr 20, 2023

Codecov Report

Merging #6550 (c311186) into main (d3ce022) will decrease coverage by 0.07%.
The diff coverage is 77.77%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6550      +/-   ##
==========================================
- Coverage   77.96%   77.89%   -0.07%     
==========================================
  Files         307      307              
  Lines       40261    40273      +12     
==========================================
- Hits        31388    31372      -16     
- Misses       8873     8901      +28     

docker/entrypoint.sh Outdated Show resolved Hide resolved
zebrad/tests/common/checkpoints.rs Outdated Show resolved Hide resolved
docker/Dockerfile Show resolved Hide resolved
zebrad/tests/acceptance.rs Show resolved Hide resolved
@teor2345 teor2345 force-pushed the checkpoints-direct-rpc branch from d78be65 to 75f342f Compare April 21, 2023 00:03
@teor2345 teor2345 requested a review from a team as a code owner April 21, 2023 00:03
@teor2345 teor2345 marked this pull request as draft April 21, 2023 00:03
@teor2345 teor2345 force-pushed the ci-checkpoints-mainnet branch from b1e8361 to bb18be3 Compare April 21, 2023 00:46
@teor2345 teor2345 marked this pull request as ready for review April 21, 2023 00:56
@teor2345 teor2345 requested a review from arya2 April 21, 2023 00:56
@teor2345
Copy link
Contributor Author

This works locally for me, using the same entrypoint.sh script.

There have been some weird issues where there's no zebra-checkpoints process output. I've seen it occasionally locally, and a lot in CI. They are a bit hard to diagnose, because the process doesn't fail. It just runs and exits, without any other output.

I've just pushed a workaround.

It should look something like:
Screenshot 2023-04-21 at 15 47 55

Screenshot 2023-04-21 at 15 48 27

@teor2345
Copy link
Contributor Author

teor2345 commented Apr 23, 2023

This is really strange - the test harness works locally, but in Docker + Google Cloud, zebra-checkpoints seems to immediately close its standard error as soon as it launches. (Or possibly never launch?)

Fri, 21 Apr 2023 07:29:09 GMT 2023-04-21T07:29:09.014654Z  INFO spawn_zebra_checkpoints_direct{network=Mainnet test_type=UpdateZebraCachedStateWithRpc zebrad_rpc_address=127.0.0.1:36529 last_checkpoint="2056451"}: Trying to launch zebra-checkpoints from cargo path... zebra_checkpoints_path="/opt/zebrad/target/release/zebra-checkpoints" args=Arguments({"--transport": Some("direct"), "--addr": Some("127.0.0.1:36529"), "--last-checkpoint": Some("2056451")})
Fri, 21 Apr 2023 07:29:09 GMT
Fri, 21 Apr 2023 07:29:09 GMT Child Stderr:
Fri, 21 Apr 2023 07:29:09 GMT [sentry] initialized disabled sentry client due to disabled or invalid DSN
Fri, 21 Apr 2023 07:29:09 GMT
Fri, 21 Apr 2023 07:29:09 GMT Error: 
Fri, 21 Apr 2023 07:29:09 GMT    0: stderr of command did not log any matches for the given regex,
Fri, 21 Apr 2023 07:29:09 GMT       within the 11h command timeout
Fri, 21 Apr 2023 07:29:09 GMT
Fri, 21 Apr 2023 07:29:09 GMT Location:
Fri, 21 Apr 2023 07:29:09 GMT    /opt/zebrad/zebra-test/src/command.rs:923
Fri, 21 Apr 2023 07:29:09 GMT
Fri, 21 Apr 2023 07:29:09 GMT Match Regex:
Fri, 21 Apr 2023 07:29:09 GMT    [
Fri, 21 Apr 2023 07:29:09 GMT        "calculating checkpoints",
Fri, 21 Apr 2023 07:29:09 GMT    ]
Fri, 21 Apr 2023 07:29:09 GMT
Fri, 21 Apr 2023 07:29:09 GMT Command:
Fri, 21 Apr 2023 07:29:09 GMT    "/opt/zebrad/target/release/zebra-checkpoints" "--transport" "direct" "--addr" "127.0.0.1:36529" "--last-checkpoint" "2056451"

https://github.com/ZcashFoundation/zebra/actions/runs/4762133164/jobs/8464755724?pr=6550#step:8:218

@teor2345 teor2345 force-pushed the checkpoints-direct-rpc branch from 75f342f to 838a98d Compare April 23, 2023 21:53
@teor2345 teor2345 force-pushed the ci-checkpoints-mainnet branch 2 times, most recently from 3a01761 to 81d50a3 Compare April 23, 2023 23:26
@teor2345
Copy link
Contributor Author

teor2345 commented Apr 24, 2023

When I run zebra-checkpoints --help locally, it gives me usage info. But when I run it in CI I get no output:

2023-04-24T01:28:34.846314Z INFO spawn_zebra_checkpoints_direct{network=Mainnet test_type=UpdateZebraCachedStateWithRpc zebrad_rpc_address=127.0.0.1:41547 last_checkpoint="2056451"}: Trying to launch zebra-checkpoints by searching system $PATH... zebra_checkpoints_path="zebra-checkpoints" args=Arguments({"--transport": Some("direct"), "--addr": Some("127.0.0.1:41547"), "--last-checkpoint": Some("2056451")}) temp_dir="/tmp/zebrad_testsQtGqof" system_path=Ok("/opt/zebrad/.cargo/bin:/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin") usr_local_zebra_checkpoints_info=Ok(Metadata { file_type: FileType(FileType { mode: 33261 }), is_dir: false, is_file: true, permissions: Permissions(FilePermissions { mode: 33261 }), modified: Ok(SystemTime { tv_sec: 1682299330, tv_nsec: 0 }), accessed: Ok(SystemTime { tv_sec: 1682299330, tv_nsec: 0 }), created: Ok(SystemTime { tv_sec: 1682299613, tv_nsec: 482256533 }), .. })

(usage output should be here)

https://github.com/ZcashFoundation/zebra/actions/runs/4781308585/jobs/8500061799#step:8:179

It seems like there's something wrong with the zebra-checkpoints binary, or with the test harness. I'll run the test Docker image locally to find out.

@teor2345
Copy link
Contributor Author

@Mergifyio refresh

@mergify
Copy link
Contributor

mergify bot commented Apr 26, 2023

refresh

✅ Pull request refreshed

@teor2345
Copy link
Contributor Author

Anyone can re-approve this PR, I just rebased it after PR #6516 merged.

Copy link
Member

@gustavovalverde gustavovalverde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approving

mergify bot added a commit that referenced this pull request Apr 27, 2023
@mergify mergify bot merged commit 1461c91 into main Apr 27, 2023
@mergify mergify bot deleted the ci-checkpoints-mainnet branch April 27, 2023 04:39
@oxarbitrage oxarbitrage mentioned this pull request May 9, 2023
38 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-consensus Area: Consensus rule updates A-devops Area: Pipelines, CI/CD and Dockerfiles A-rpc Area: Remote Procedure Call interfaces C-enhancement Category: This is an improvement C-testing Category: These are tests C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants