Skip to content

Commit

Permalink
Runner + RPC (#203)
Browse files Browse the repository at this point in the history
Includes:

* restructure main
* separate logger interface for rolling files vs stdout (all async
nonblocking)
* tarpc (non-proto) Server/Client implementation to "speak" RPC to the
Runner
* db initialization cleanup
* Lots of channel scaffolding and reliance
* CLI output with tables and diagnostic error(s)
* Make resolve take an async closure and work via async_recursion
* ability to run homestar runner/server in daemon mode
* docker cleanup and now having an entrypoint w/ homestar start
* cargo-nextest configuration
* CLI / e2e RPC tests in serial mode
* build.rs for compile-time pending migrations (if not run previously)
* handle ports correctly for parallel tests
* prep for worker set and delayqueue
* ARCify your demons
* proper use of spawn and block_on within a Runner's (tokio) runtime
* rwlock for linkmap (cross-thread)
  • Loading branch information
Zeeshan Lakhani authored Jul 21, 2023
1 parent d8aa18f commit 312a7af
Show file tree
Hide file tree
Showing 42 changed files with 2,051 additions and 583 deletions.
20 changes: 20 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[profile.default]
retries = 0
test-threads = "num-cpus"
threads-required = 1

[profile.ci]
retries = { backoff = "exponential", count = 3, delay = "30s", jitter = true, max-delay = "300s" }
failure-output = "immediate-final"
fail-fast = false

[test-groups]
serial = { max-threads = 1 }

[[profile.default.overrides]]
filter = 'test(/_serial$/)'
test-group = 'serial'

[[profile.ci.overrides]]
filter = 'test(/_serial$/)'
test-group = 'serial'
5 changes: 3 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

!**/Cargo.toml
!**/Cargo.lock
!**/build.rs
!**/src
!**/config
!**/migrations
!.env
!diesel.toml
!**/wits

homestar-functions/src
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use_flake

export RUST_LOG=homestar_runtime=debug,libp2p=info,libp2p_gossipsub::behaviour=debug
export RUST_LOG=homestar_runtime=debug,libp2p=info,libp2p_gossipsub::behaviour=debug,tarpc=info,tower_http=debug
export RUST_BACKTRACE=full
export RUSTFLAGS="--cfg tokio_unstable"
25 changes: 5 additions & 20 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,11 @@ jobs:
- name: Cache Project
uses: Swatinem/rust-cache@v2

- name: Generate Code coverage
env:
CARGO_INCREMENTAL: '0'
LLVM_PROFILE_FILE: "homestar-%p-%m.profraw"
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
# covering nexttest's doc-test issue
run: cargo test --all-features

- name: Install grcov
run: "curl -L https://github.com/mozilla/grcov/releases/download/v0.8.12/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf -"

- name: Run grcov
run: "./grcov . --llvm --binary-path target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '/*' -o lcov.info"

- name: Install covfix
run: cargo install --force rust-covfix

- name: Run covfix
run: rust-covfix lcov.info -o lcov.info --verbose
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov

- name: Generate Code Coverage
run: cargo llvm-cov --all-features --workspace --doctests --lcov --output-path lcov.info

- name: Upload to codecov.io
uses: codecov/codecov-action@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests_and_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
uses: taiki-e/install-action@nextest

- name: Run Tests
run: cargo nextest run --all-features
run: cargo nextest run --profile ci --all-features

- name: Run Doc Tests
run: cargo test --doc
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
uses: taiki-e/install-action@nextest

- name: Run Tests
run: cargo nextest run --no-default-features
run: cargo nextest run --profile ci --no-default-features

run-docs:
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,10 @@ private
homestar-guest-wasm/out
homestar-wasm/out

# daemon
homestar.err
homestar.out
homestar.pid

# locks
homestar-wasm/Cargo.lock
Loading

0 comments on commit 312a7af

Please sign in to comment.