Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 54 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ permissions:
contents: read

jobs:
remote-net-test:
remote-net-test-service:
runs-on: ubuntu-latest-8-cores
timeout-minutes: 40

Expand All @@ -61,7 +61,59 @@ jobs:
cargo run --features storage-service --bin linera -- net up --storage service:tcp:localhost:1235:table --policy-config testnet --path /tmp/local-linera-net --validators 4 --shards 4 &
- name: Create two epochs and run the faucet
run: |
cargo build --bin linera
cargo run --bin linera -- resource-control-policy --block 0.0000001
cargo run --bin linera -- resource-control-policy --block 0.000000
cargo run --bin linera -- faucet --amount 1000 --port 8079 a3edc33d8e951a1139333be8a4b56646b5598a8f51216e86592d881808972b07 &
- name: Run the remote-net tests
run: |
cargo test -p linera-service remote_net_grpc --features remote-net

remote-net-test-scylladb:
runs-on: ubuntu-latest-8-cores
timeout-minutes: 40

steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup local ScyllaDB instance
run: |
docker run --name my_scylla_container -d -p 9042:9042 scylladb/scylla:6.1
- name: Run the validators
run: |
cargo build --features scylladb
mkdir /tmp/local-linera-net
cargo run --features scylladb --bin linera -- net up --storage scylladb:tcp:localhost:9042 --policy-config testnet --path /tmp/local-linera-net --validators 4 --shards 4 &
- name: Create two epochs and run the faucet
run: |
cargo run --bin linera -- resource-control-policy --block 0.0000001
cargo run --bin linera -- resource-control-policy --block 0.000000
cargo run --bin linera -- faucet --amount 1000 --port 8079 a3edc33d8e951a1139333be8a4b56646b5598a8f51216e86592d881808972b07 &
- name: Run the remote-net tests
run: |
cargo test -p linera-service remote_net_grpc --features remote-net

remote-net-test-rocksdb:
runs-on: ubuntu-latest-8-cores
timeout-minutes: 40

steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run the validators
run: |
cargo build --features rocksdb
mkdir /tmp/local-linera-net
cargo run --features rocksdb --bin linera -- net up --storage rocksdb:/tmp/local-linera-net/linera.db --policy-config testnet --path /tmp/local-linera-net --validators 4 --shards 4 &
- name: Create two epochs and run the faucet
run: |
cargo run --bin linera -- resource-control-policy --block 0.0000001
cargo run --bin linera -- resource-control-policy --block 0.000000
cargo run --bin linera -- faucet --amount 1000 --port 8079 a3edc33d8e951a1139333be8a4b56646b5598a8f51216e86592d881808972b07 &
Expand Down
23 changes: 20 additions & 3 deletions linera-service/src/cli_wrappers/local_net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@
use linera_core::node::ValidatorNodeProvider;
#[cfg(all(feature = "storage-service", with_testing))]
use linera_storage_service::common::storage_service_test_endpoint;
#[cfg(all(feature = "rocksdb", feature = "scylladb", with_testing))]
use linera_views::rocks_db::{RocksDbSpawnMode, RocksDbStore};
#[cfg(all(feature = "scylladb", with_testing))]
use linera_views::{scylla_db::ScyllaDbStore, store::TestKeyValueStore as _};
use linera_views::scylla_db::ScyllaDbStore;
#[cfg(all(feature = "rocksdb", with_testing))]
use linera_views::{
rocks_db::{RocksDbSpawnMode, RocksDbStore},
store::TestKeyValueStore as _,
};
use tempfile::{tempdir, TempDir};
use tokio::process::{Child, Command};
use tonic::transport::{channel::ClientTlsConfig, Endpoint};
Expand Down Expand Up @@ -89,7 +92,7 @@
Database::ScyllaDb => {
#[cfg(feature = "scylladb")]
{
let config = ScyllaDbStore::new_test_config().await?;

Check failure on line 95 in linera-service/src/cli_wrappers/local_net.rs

View workflow job for this annotation

GitHub Actions / lint-check-all-features

no function or associated item named `new_test_config` found for struct `MeteredStore` in the current scope
Ok(StorageConfig::ScyllaDb {
uri: config.inner_config.uri,
})
Expand All @@ -97,6 +100,19 @@
#[cfg(not(feature = "scylladb"))]
panic!("Database::ScyllaDb is selected without the feature scylladb");
}
Database::RocksDb => {
#[cfg(feature = "rocksdb")]
{
let config = RocksDbStore::new_test_config().await?;
let spawn_mode = RocksDbSpawnMode::get_spawn_mode_from_runtime();
Ok(StorageConfig::RocksDb {
path: config.inner_config.path_with_guard.path_buf,
spawn_mode,
})
}
#[cfg(not(feature = "rocksdb"))]
panic!("Database::RocksDb is selected without the feature rocksdb");
}
Database::DualRocksDbScyllaDb => {
#[cfg(all(feature = "rocksdb", feature = "scylladb"))]
{
Expand Down Expand Up @@ -210,6 +226,7 @@
Service,
DynamoDb,
ScyllaDb,
RocksDb,
DualRocksDbScyllaDb,
}

Expand Down
2 changes: 1 addition & 1 deletion linera-service/src/linera/net_up_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl StorageConfigProvider {
match self.storage.storage_config {
StorageConfig::Memory => anyhow::bail!("Not possible to work with memory"),
#[cfg(feature = "rocksdb")]
StorageConfig::RocksDb { .. } => anyhow::bail!("Not possible to work with RocksDB"),
StorageConfig::RocksDb { .. } => Ok(Database::RocksDb),
#[cfg(feature = "storage-service")]
StorageConfig::Service { .. } => Ok(Database::Service),
#[cfg(feature = "dynamodb")]
Expand Down
Loading