-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Create initial Coordinator V2 service (#444)
This PR adds the initial Coordinator V2 service, which acts as the main driver for the Control Plane. ## Coordinator Overview Coordinator V2 will exist as a new standalone service with it's primary goal being ensuring the current registry configuration is mapped to the system. It's core logic is just an infinite loop which reads the registry, and sends necessary requests to the Block Streamer and Runner services to synchronise that config. ## Block Streamer Changes Some changes have been made to Block Streamer to enable the above: 1. `version` and `redis_stream` have been added to the proto so that Coordinator can configure them. 2. Support for `ActionFunctionCall` has been added - Initially I thought only `ActionAny` allowed, but the current registry has `ActionFunctionCall` and therefore needs to be supported. 3. `last_published_block` is now written to Redis to enable "Start from interruption" ## What's not been done I wanted to limit the scope of this PR as it was starting to get big, I'll address these tasks in follow up PRs: - Provisioning - Coordinator should check the status of provisioning, and act when the state isn't as expected. This can be done after #426 is implemented. - Retry recoverable errors - Any error will be propagated cause the error to exit, this includes connection errors to the Block Streamer and Runner services. As these are very likely to occur (across restarts) we should retry these errors. - Environment configuration - There are many hard coded values (endpoints, registry contract, etc.) which should be configurable via the environment. - Logging and Metrics
- Loading branch information
1 parent
7655aef
commit b76fac0
Showing
15 changed files
with
5,797 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Coordinator | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- "coordinator/**" | ||
pull_request: | ||
paths: | ||
- "coordinator/**" | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Protoc | ||
uses: arduino/setup-protoc@v2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Check | ||
working-directory: ./coordinator | ||
run: cargo check | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Protoc | ||
uses: arduino/setup-protoc@v2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Test | ||
working-directory: ./coordinator | ||
run: cargo test | ||
|
||
|
||
format: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Install Protoc | ||
uses: arduino/setup-protoc@v2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: 1.70.0 | ||
override: true | ||
profile: minimal | ||
components: rustfmt | ||
- name: Check formatting | ||
working-directory: ./coordinator | ||
run: | | ||
cargo fmt -- --check | ||
clippy: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Install Protoc | ||
uses: arduino/setup-protoc@v2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: 1.70.0 | ||
override: true | ||
profile: minimal | ||
components: clippy | ||
- name: Clippy check | ||
working-directory: ./coordinator | ||
run: | | ||
cargo clippy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.