diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ffce06d1bfd9..5e34403cf033 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -40,7 +40,7 @@ permissions: contents: read jobs: - remote-net-test: + remote-net-test-service: runs-on: ubuntu-latest-8-cores timeout-minutes: 40 @@ -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 & diff --git a/linera-service/src/cli_wrappers/local_net.rs b/linera-service/src/cli_wrappers/local_net.rs index addff1f8deb5..5a65125c3d9f 100644 --- a/linera-service/src/cli_wrappers/local_net.rs +++ b/linera-service/src/cli_wrappers/local_net.rs @@ -26,10 +26,13 @@ use linera_client::{ 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}; @@ -97,6 +100,19 @@ async fn make_testing_config(database: Database) -> Result { #[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"))] { @@ -210,6 +226,7 @@ pub enum Database { Service, DynamoDb, ScyllaDb, + RocksDb, DualRocksDbScyllaDb, } diff --git a/linera-service/src/linera/net_up_utils.rs b/linera-service/src/linera/net_up_utils.rs index f72b8407c831..77590abcebe7 100644 --- a/linera-service/src/linera/net_up_utils.rs +++ b/linera-service/src/linera/net_up_utils.rs @@ -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")]