From f29de4ad83a703c023cca7cae877c047e9fa7183 Mon Sep 17 00:00:00 2001 From: Sehyo Chang Date: Tue, 24 Aug 2021 23:29:47 +0000 Subject: [PATCH 01/18] Fix Smoke Test Fetch error (#1484) Resolves #1454. This was caused by timing problem in the Multiplexor when serial request was sent. Listner should have been set up before request send. Various improvement in logging and remove sleep in the test which is no longer needed with this fix --- .github/workflows/cd_dev.yaml | 3 - .github/workflows/ci.yml | 84 ++++++++++++------- CHANGELOG.md | 1 + Cargo.lock | 12 +-- src/cli/Cargo.toml | 4 +- src/client/Cargo.toml | 2 +- src/client/src/fluvio.rs | 6 +- src/client/src/sockets.rs | 2 +- src/cluster/Cargo.toml | 2 +- src/cluster/src/start/mod.rs | 2 +- src/runner/Cargo.toml | 6 +- src/sc/Cargo.toml | 4 +- src/sc/src/controllers/spus/controller.rs | 7 +- src/sc/src/core/dispatcher.rs | 2 +- .../services/private_api/private_server.rs | 20 ++--- src/sc/src/stores/spu.rs | 18 ++++ src/service/Cargo.toml | 3 +- src/service/src/lib.rs | 2 +- src/service/src/server.rs | 2 +- src/socket/src/multiplexing.rs | 62 +++++++++----- src/socket/src/socket.rs | 8 +- src/socket/src/stream.rs | 34 ++++++-- src/spu/Cargo.toml | 4 +- src/spu/src/control_plane/dispatcher.rs | 12 ++- src/spu/src/core/global_context.rs | 1 + src/spu/src/core/store.rs | 2 +- src/spu/src/services/public/service_impl.rs | 13 +-- tests/runner/src/main.rs | 2 +- tests/runner/src/tests/concurrent/producer.rs | 2 +- tests/runner/src/tests/producer_stress.rs | 2 +- tests/runner/src/tests/smoke/consume.rs | 39 ++------- tests/runner/src/tests/smoke/mod.rs | 6 ++ tests/runner/src/tests/smoke/produce.rs | 24 +++++- .../src/utils/test_runner/test_driver/mod.rs | 38 ++++----- tests/upgrade-test.sh | 7 +- 35 files changed, 255 insertions(+), 183 deletions(-) diff --git a/.github/workflows/cd_dev.yaml b/.github/workflows/cd_dev.yaml index e342a30165..e6ab9c9580 100644 --- a/.github/workflows/cd_dev.yaml +++ b/.github/workflows/cd_dev.yaml @@ -74,11 +74,8 @@ jobs: fi sleep 30 fluvio version - sleep ${{ env.SLEEP }} fluvio topic create ${{ env.TOPIC }} - sleep ${{ env.SLEEP }} echo foo | fluvio produce ${{ env.TOPIC }} - sleep ${{ env.SLEEP }} fluvio consume ${{ env.TOPIC }} -o 0 -d | grep -F -w "foo" # Delete the topic afterword but this looks to not work right now. # fluvio topic delete "${{ env.TOPIC }}" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 06c8bb1568..3d8c81e224 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,7 +73,7 @@ jobs: run: ./actions/zig-install.sh ${{ matrix.os }} - uses: Swatinem/rust-cache@v1 with: - key: ${{ matrix.os }}-${{ matrix.rust-target }}-${{ matrix.binary }} + key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}-${{ matrix.binary }} - name: Build fluvio if: ${{ matrix.binary == 'fluvio' }} @@ -193,6 +193,7 @@ jobs: # Run all checks and unit test. This always run on debug mode check: name: Rust check ${{ matrix.check }} (${{ matrix.rust-target }}) + # if: ${{ false }} runs-on: ${{ matrix.os }} strategy: matrix: @@ -235,6 +236,7 @@ jobs: check_wasm: name: Build WASM crates (${{ matrix.wasm-crate }}) + # if: ${{ false }} runs-on: ${{ matrix.os }} strategy: matrix: @@ -266,6 +268,7 @@ jobs: check_windows: name: Check Windows for crates (${{ matrix.crate }}) + # if: ${{ false }} runs-on: ${{ matrix.os }} strategy: matrix: @@ -296,16 +299,17 @@ jobs: run: cargo test --manifest-path ./src/${{matrix.crate}}/Cargo.toml local_cluster_test: - name: Local cluster test + name: Local cluster test run (${{ matrix.run }}) runs-on: ${{ matrix.os }} - if: ${{ false }} + # if: ${{ false }} needs: build_primary_binaries strategy: + fail-fast: false matrix: os: [ubuntu-latest] + # run: [r1, r2, r3, r4, r5, r6, r7, r8, r9, r10,r11,r12,r13,r14,r15,r16,r17] + run: [r1] rust: [stable] - env: - FLV_SOCKET_WAIT: 600 steps: - uses: actions/checkout@v2 - uses: nolar/setup-k3d-k3s@v1 @@ -326,26 +330,43 @@ jobs: name: flv-test-x86_64-unknown-linux-musl path: . - name: Print artifacts and mark executable - run: ls -la . && chmod +x ./fluvio ./flv-test && ./fluvio version && ./flv-test -h + run: chmod +x ./fluvio ./flv-test && ./fluvio version + - name: Set up cluster + run: ./k8-util/cluster/reset-k3d.sh - name: Run smoke-test - uses: nick-invision/retry@v2 - with: - timeout_minutes: 5 - max_attempts: 3 - command: | - ./k8-util/cluster/reset-k3d.sh - make FLUVIO_BIN=./fluvio TEST_BIN=./flv-test UNINSTALL=noclean smoke-test-tls-root + timeout-minutes: 2 + run: | + date + make FLUVIO_BIN=./fluvio TEST_BIN=./flv-test SERVER_LOG=info UNINSTALL=noclean EXTRA_ARG=--keep-cluster smoke-test-tls-root + date + kubectl get partitions + kubectl get partitions -o=jsonpath='{.items[0].status.leader.leo}' | grep 100 + echo "done" + # make RUST_LOG=flv_test=debug,fluvio_test=debug,fluvio_socket=trace,fluvio::consumer=debug,fluvio::producer=debug DEFAULT_ITERATION=10 DEFAULT_SPU=1 REPL=1 FLUVIO_BIN=./fluvio TEST_BIN=./flv-test UNINSTALL=noclean smoke-test-local + - - name: Upload SC log + - name: Save logs + if: failure() + run: | + date + uname -a + kubectl get spu + kubectl get statefulset + kubectl get topics + kubectl get partitions + ps -ef | grep fluvio + + - name: Upload Logs uses: actions/upload-artifact@v2 timeout-minutes: 5 if: failure() with: - name: fluvio-sc-logs - path: /tmp/flv_sc.log + name: fluvio-${{ matrix.run }}-logs + path: /tmp/*.log build_image: name: Build Fluvio Docker image + # if: ${{ false }} needs: build_primary_binaries runs-on: ${{ matrix.os }} strategy: @@ -381,15 +402,16 @@ jobs: path: /tmp/infinyon-fluvio-${{ matrix.rust-target }}.tar k8_cluster_test: - name: Kubernetes cluster test + name: Kubernetes cluster test run (${{ matrix.run }}) + # if: ${{ false }} needs: build_image runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest] + run: [r1] rust: [stable] - env: - FLV_SOCKET_WAIT: 600 steps: - uses: actions/checkout@v2 - uses: nolar/setup-k3d-k3s@v1 @@ -457,15 +479,15 @@ jobs: path: /tmp/flv_sc.log k8_upgrade_test: - name: Upgrade cluster test + name: Upgrade cluster test on (${{ matrix.run }}) + # if: ${{ false }} needs: build_image runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest] - rust: [stable] - env: - FLV_SOCKET_WAIT: 600 + run: [r1] steps: - uses: actions/checkout@v2 - uses: nolar/setup-k3d-k3s@v1 @@ -494,8 +516,10 @@ jobs: - name: Export Docker Image to tarball run: docker image save infinyon/fluvio:${{ github.sha }} --output /tmp/infinyon-fluvio.tar - + - name: Set up k3d + run: ./k8-util/cluster/reset-k3d.sh - name: Run upgrade test with CI artifacts + timeout-minutes: 5 env: TEST_DATA_BYTES: 10000 uses: nick-invision/retry@v2 @@ -537,9 +561,9 @@ jobs: - check_wasm - check_windows - build_image -# - local_cluster_test + - local_cluster_test - k8_cluster_test - - k8_upgrade_test + # - k8_upgrade_test runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -579,7 +603,7 @@ jobs: bump_github_release: name: Bump dev tag if: github.event_name == 'push' && github.ref == 'refs/heads/staging' - needs: + needs: - docker_push runs-on: ubuntu-latest permissions: write-all @@ -608,7 +632,7 @@ jobs: - name: Login GH CLI run: gh auth login --with-token < <(echo ${{ secrets.GITHUB_TOKEN }}) - name: package helm - run: make helm_pkg + run: make helm_pkg - name: Publish artifact run: | gh release upload -R infinyon/fluvio --clobber dev k8-util/helm/pkg_app/*.* @@ -617,7 +641,7 @@ jobs: publish_github_binaries: name: Publish to GitHub Releases dev (${{ matrix.artifact }}-${{ matrix.rust-target }}) if: github.event_name == 'push' && github.ref == 'refs/heads/staging' - needs: + needs: - bump_github_release runs-on: ubuntu-latest strategy: @@ -659,7 +683,7 @@ jobs: done: name: Done if: github.event_name == 'push' && github.ref == 'refs/heads/staging' - needs: [publish_github_binaries,publish_github_helm_pkg] + needs: [publish_github_binaries, publish_github_helm_pkg] runs-on: ubuntu-latest steps: - name: Done diff --git a/CHANGELOG.md b/CHANGELOG.md index a79797e74d..9a745e9f46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Do not panic when trying to create topic with space in the name. ([#1448](https://github.com/infinyon/fluvio/pull/1448)) * Deprecate consumer fetch API ([#957](https://github.com/infinyon/fluvio/issues/957)) * Gracefully handle error when trying to install plugins or update. ([#1434](https://github.com/infinyon/fluvio/pull/1434)) +* Fix timing issue in Multiplexor Socket ([#1484](https://github.com/infinyon/fluvio/pull/1484)) ## Platform Version 0.9.3 - 2021-08-19 * Fix Replication timing. ([#1439](https://github.com/infinyon/fluvio/pull/1439)) diff --git a/Cargo.lock b/Cargo.lock index 8e1b84a3a9..ae9cb690fd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1386,7 +1386,7 @@ dependencies = [ [[package]] name = "fluvio-cli" -version = "0.6.1" +version = "0.0.0" dependencies = [ "async-h1", "atty", @@ -1430,7 +1430,7 @@ dependencies = [ [[package]] name = "fluvio-cluster" -version = "0.9.3" +version = "0.0.0" dependencies = [ "async-channel", "async-trait", @@ -1681,7 +1681,7 @@ dependencies = [ [[package]] name = "fluvio-run" -version = "0.2.1" +version = "0.0.0" dependencies = [ "fluvio-extension-common", "fluvio-future", @@ -1697,7 +1697,7 @@ dependencies = [ [[package]] name = "fluvio-sc" -version = "0.6.5" +version = "0.0.0" dependencies = [ "async-channel", "async-lock", @@ -1753,7 +1753,7 @@ dependencies = [ [[package]] name = "fluvio-service" -version = "0.6.1" +version = "0.0.0" dependencies = [ "async-trait", "fluvio-future", @@ -1812,7 +1812,7 @@ dependencies = [ [[package]] name = "fluvio-spu" -version = "0.5.1" +version = "0.0.0" dependencies = [ "adaptive_backoff", "anyhow", diff --git a/src/cli/Cargo.toml b/src/cli/Cargo.toml index 095c8c3574..44d73446ef 100644 --- a/src/cli/Cargo.toml +++ b/src/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fluvio-cli" -version = "0.6.1" +version = "0.0.0" edition = "2018" authors = ["Fluvio Contributors "] description = "Fluvio CLI" @@ -66,7 +66,7 @@ content_inspector = { version = "0.2.4", optional = true} # Fluvio dependencies k8-config = { version = "1.3.0", optional = true} k8-client = { version = "5.0.0", optional = true} -fluvio-cluster = { version = "0.9.1", path = "../cluster", default-features = false, features = ["cli"], optional = true } +fluvio-cluster = { version = "0.0.0", path = "../cluster", default-features = false, features = ["cli"], optional = true } fluvio = { version = "0.9.0", path = "../client", default-features = false } fluvio-command = { version = "0.2.0" } diff --git a/src/client/Cargo.toml b/src/client/Cargo.toml index 0e3c282258..9c722e355b 100644 --- a/src/client/Cargo.toml +++ b/src/client/Cargo.toml @@ -43,7 +43,7 @@ derive_builder = "0.10" fluvio-future = { version = "0.3.5", features = ["task", "openssl_tls", "task_unstable"] } fluvio-types = { version = "0.2.1", features = ["events"], path = "../types" } fluvio-sc-schema = { version = "0.9.0", path = "../sc-schema", default-features = false } -fluvio-socket = { path = "../socket", version = "0.9" } +fluvio-socket = { path = "../socket", version = "0.9.1" } fluvio-protocol = { path = "../protocol", version = "0.6" } dataplane = { version = "0.6.0", path = "../dataplane-protocol", package = "fluvio-dataplane-protocol" } diff --git a/src/client/src/fluvio.rs b/src/client/src/fluvio.rs index 529bb082d3..d53569d8c0 100644 --- a/src/client/src/fluvio.rs +++ b/src/client/src/fluvio.rs @@ -15,7 +15,7 @@ use crate::PartitionConsumer; use crate::FluvioError; use crate::FluvioConfig; use crate::spu::SpuPool; -use crate::sockets::{ClientConfig, Versions, SerialFrame, VersionedSerialSocket}; +use crate::sockets::{ClientConfig, Versions, VersionedSerialSocket}; use crate::sync::MetadataStores; /// An interface for interacting with Fluvio streaming @@ -63,19 +63,19 @@ impl Fluvio { /// # Ok(()) /// # } /// ``` - #[instrument(skip(config))] pub async fn connect_with_config(config: &FluvioConfig) -> Result { let connector = DomainConnector::try_from(config.tls.clone())?; Self::connect_with_connector(connector, config).await } + #[instrument(skip(connector))] pub async fn connect_with_connector( connector: DomainConnector, config: &FluvioConfig, ) -> Result { let config = ClientConfig::new(&config.endpoint, connector); let inner_client = config.connect().await?; - debug!("connected to cluster at: {}", inner_client.config().addr()); + debug!("connected to cluster"); let (socket, config, versions) = inner_client.split(); debug!(platform = %versions.platform_version(),"checking platform version"); diff --git a/src/client/src/sockets.rs b/src/client/src/sockets.rs index 8b3b9faba3..f806b21de3 100644 --- a/src/client/src/sockets.rs +++ b/src/client/src/sockets.rs @@ -188,7 +188,7 @@ pub struct VersionedSerialSocket { impl fmt::Display for VersionedSerialSocket { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "config {}", self.config) + write!(f, "config: {}, {:?}", self.config, self.socket) } } unsafe impl Send for VersionedSerialSocket {} diff --git a/src/cluster/Cargo.toml b/src/cluster/Cargo.toml index b2c0255402..9400f9a312 100644 --- a/src/cluster/Cargo.toml +++ b/src/cluster/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fluvio-cluster" -version = "0.9.3" +version = "0.0.0" edition = "2018" license = "Apache-2.0" authors = ["Fluvio Contributors "] diff --git a/src/cluster/src/start/mod.rs b/src/cluster/src/start/mod.rs index ea1cec0449..7f389d54db 100644 --- a/src/cluster/src/start/mod.rs +++ b/src/cluster/src/start/mod.rs @@ -10,6 +10,6 @@ mod constants { /// maximum time waiting for network check, DNS or network pub static MAX_SC_NETWORK_LOOP: Lazy = Lazy::new(|| { let var_value = env::var("FLV_CLUSTER_MAX_SC_NETWORK_LOOP").unwrap_or_default(); - var_value.parse().unwrap_or(60) + var_value.parse().unwrap_or(10) }); } diff --git a/src/runner/Cargo.toml b/src/runner/Cargo.toml index 6a5c382449..f5f88c8911 100644 --- a/src/runner/Cargo.toml +++ b/src/runner/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fluvio-run" -version = "0.2.1" +version = "0.0.0" edition = "2018" authors = ["Fluvio Contributors "] description = "Fluvio Engine Runner" @@ -33,6 +33,6 @@ serde_json = "1.0.64" # regardless of TLS, sc and spu always use openssl_tls for now because we need cert API fluvio-future = { version = "0.3.0", features = ["subscriber"] } -fluvio-sc = { version = "0.6.4", path = "../sc" } -fluvio-spu = { version = "0.5.1", path = "../spu" } +fluvio-sc = { version = "0.0.0", path = "../sc" } +fluvio-spu = { version = "0.0.0", path = "../spu" } fluvio-extension-common = { version = "0.5.0", path = "../extension-common" } diff --git a/src/sc/Cargo.toml b/src/sc/Cargo.toml index 2d8e2d305b..1d626362b2 100644 --- a/src/sc/Cargo.toml +++ b/src/sc/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "fluvio-sc" edition = "2018" -version = "0.6.5" +version = "0.0.0" authors = ["fluvio.io"] description = "Fluvio Stream Controller" repository = "https://github.com/infinyon/fluvio" @@ -57,7 +57,7 @@ fluvio-protocol = { path = "../protocol", version = "0.6" } k8-types = { version = "0.2.7", features = ["app"] } fluvio-socket = { path = "../socket", version = "0.9" } dataplane = { version = "0.6.0", path = "../dataplane-protocol", package = "fluvio-dataplane-protocol" } -fluvio-service = { path = "../service", version = "0.6.0" } +fluvio-service = { path = "../service", version = "0.0.0" } flv-tls-proxy = { version = "0.5.0" } [dev-dependencies] diff --git a/src/sc/src/controllers/spus/controller.rs b/src/sc/src/controllers/spus/controller.rs index 3d26f14864..e1e584bdae 100644 --- a/src/sc/src/controllers/spus/controller.rs +++ b/src/sc/src/controllers/spus/controller.rs @@ -5,8 +5,7 @@ use std::collections::HashMap; use std::time::Instant; use std::time::Duration; -use tracing::{debug, error, warn, info}; -use tracing::instrument; +use tracing::{debug, error, warn, info, instrument}; use async_channel::Receiver; @@ -35,7 +34,7 @@ impl SpuOnlineStatus { } } -/// Keep track of SPU status. This only updates SPU status. +/// Reconcile SPU health status with Meta data /// if SPU has not send heart beat within a period, it is considered down pub struct SpuController { spus: StoreContext, @@ -51,11 +50,13 @@ impl SpuController { status: HashMap::new(), }; + debug!("starting spu controller"); spawn(async move { controller.dispatch_loop().await; }); } + #[instrument(skip(self))] async fn dispatch_loop(mut self) { use tokio::select; use fluvio_future::timer::sleep; diff --git a/src/sc/src/core/dispatcher.rs b/src/sc/src/core/dispatcher.rs index a9c6f422cd..ea8f9131e5 100644 --- a/src/sc/src/core/dispatcher.rs +++ b/src/sc/src/core/dispatcher.rs @@ -28,7 +28,7 @@ pub fn run(receiver: Receiver, sc_controller: ScController) { info!("start SC[{}] dispatcher", sc_controller.id()); - spawn(sc_request_loop(receiver, sc_controller); + spawn(sc_request_loop(receiver, sc_controller)); } /// SC dispatcher request loop, waits for a request request and dispatchers diff --git a/src/sc/src/services/private_api/private_server.rs b/src/sc/src/services/private_api/private_server.rs index 96e793bffc..43f12f5062 100644 --- a/src/sc/src/services/private_api/private_server.rs +++ b/src/sc/src/services/private_api/private_server.rs @@ -6,7 +6,7 @@ use std::time::Duration; use std::time::Instant; use tracing::error; -use tracing::{debug, info, trace, instrument}; +use tracing::{debug, info, instrument}; use async_trait::async_trait; use async_channel::Sender; use futures_util::stream::Stream; @@ -92,6 +92,7 @@ impl FlvService for ScInternalService { format!("unable to send health status: {}", err), ) })?; + debug!("send connection health up"); if let Err(err) = dispatch_loop(context, spu_id, api_stream, sink, health_sender.clone()).await @@ -99,7 +100,7 @@ impl FlvService for ScInternalService { error!("error with SPU <{}>, error: {}", spu_id, err); } - info!(spu_id, "SPU connection will terminate"); + info!(spu_id, "SPU terminated"); health_sender .send(SpuAction::down(spu_id)) @@ -111,15 +112,14 @@ impl FlvService for ScInternalService { ) })?; + debug!("send connection health down"); + Ok(()) } } // perform internal dispatch -#[instrument( - name = "ScInternalService", - skip(context, api_stream, sink, health_sender) -)] +#[instrument(name = "ScInternalService", skip(context, api_stream, health_sender))] async fn dispatch_loop( context: SharedContext, spu_id: SpuId, @@ -147,7 +147,7 @@ async fn dispatch_loop( send_spu_spec_changes(&mut spu_spec_listener, &mut sink, spu_id).await?; send_replica_spec_changes(&mut partition_spec_listener, &mut sink, spu_id).await?; - trace!("waiting for events"); + debug!("waiting for events"); select! { @@ -315,10 +315,10 @@ async fn send_spu_spec_changes( message.get_mut_header().set_client_id("sc"); debug!( - "sending to spu: {}, all: {}, changes: {}", spu_id, - message.request.all.len(), - message.request.changes.len() + all = message.request.all.len(), + changes = message.request.changes.len(), + "sending to spu", ); sink.send_request(&message).await?; Ok(()) diff --git a/src/sc/src/stores/spu.rs b/src/sc/src/stores/spu.rs index 669d3da06f..6655c582a1 100644 --- a/src/sc/src/stores/spu.rs +++ b/src/sc/src/stores/spu.rs @@ -22,3 +22,21 @@ pub async fn is_conflict( } None } + +mod health_check { + use std::{collections::HashMap, ops::Deref}; + + use async_lock::RwLock; + use fluvio_types::SpuId; + + /// Stores Curret Health Check Data + pub struct HealthCheck(RwLock>); + + impl Deref for HealthCheck { + type Target = RwLock>; + + fn deref(&self) -> &Self::Target { + &self.0 + } + } +} diff --git a/src/service/Cargo.toml b/src/service/Cargo.toml index 422767dcde..dbd9a5b206 100644 --- a/src/service/Cargo.toml +++ b/src/service/Cargo.toml @@ -1,12 +1,13 @@ [package] edition = "2018" name = "fluvio-service" -version = "0.6.1" +version = "0.0.0" authors = ["Fluvio Contributors "] description = "Provide TCP service wrapper over fluvio protocol" repository = "https://github.com/infinyon/fluvio-socket" license = "Apache-2.0" categories = ["encoding"] +publish = false [lib] name = "fluvio_service" diff --git a/src/service/src/lib.rs b/src/service/src/lib.rs index 7dd988fe8e..13b6b58b51 100644 --- a/src/service/src/lib.rs +++ b/src/service/src/lib.rs @@ -16,7 +16,7 @@ macro_rules! call_service { let response = $handler.await?; tracing::trace!("send back response: {:#?}", &response); $sink.send_response(&response, version).await?; - tracing::trace!("finish send"); + tracing::debug!("finished handler"); } }}; diff --git a/src/service/src/server.rs b/src/service/src/server.rs index be735cb26c..1c4911526c 100644 --- a/src/service/src/server.rs +++ b/src/service/src/server.rs @@ -110,7 +110,7 @@ where async fn run_shutdown(self, shutdown_signal: Arc) { match TcpListener::bind(&self.addr).await { Ok(listener) => { - debug!("starting event loop"); + debug!(addr = %self.addr, "starting event loop"); self.event_loop(listener, shutdown_signal).await; } Err(err) => { diff --git a/src/socket/src/multiplexing.rs b/src/socket/src/multiplexing.rs index 40dd700a8f..4ee2f636f0 100644 --- a/src/socket/src/multiplexing.rs +++ b/src/socket/src/multiplexing.rs @@ -7,7 +7,7 @@ use std::marker::PhantomData; use std::pin::Pin; use std::sync::Arc; use std::time::Duration; -use std::fmt::Debug; +use std::fmt; use async_channel::bounded; use async_channel::Receiver; @@ -15,6 +15,7 @@ use async_channel::Sender; use async_lock::Mutex; use bytes::BytesMut; use event_listener::Event; +use fluvio_future::net::ConnectionFd; use futures_util::stream::{Stream, StreamExt}; use pin_project::{pin_project, pinned_drop}; use tokio::select; @@ -61,8 +62,8 @@ pub struct MultiplexerSocket { terminate: Arc, } -impl Debug for MultiplexerSocket { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl fmt::Debug for MultiplexerSocket { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "MultiplexerSocket {}", self.sink.id()) } } @@ -81,7 +82,11 @@ impl MultiplexerSocket { /// create new multiplexer socket, this always starts with correlation id of 1 /// correlation id of 0 means shared + #[allow(clippy::clone_on_copy)] pub fn new(socket: FluvioSocket) -> Self { + let id = socket.id().clone(); + debug!(socket = %id, "spawning dispatcher"); + let (sink, stream) = socket.split(); let multiplexer = Self { @@ -92,6 +97,7 @@ impl MultiplexerSocket { }; MultiPlexingResponseDispatcher::run( + id, stream, multiplexer.senders.clone(), multiplexer.terminate.clone(), @@ -107,7 +113,7 @@ impl MultiplexerSocket { } /// create socket to perform request and response - #[instrument(skip(self, req_msg))] + #[instrument(skip(req_msg))] pub async fn send_and_receive( &self, mut req_msg: RequestMessage, @@ -130,29 +136,29 @@ impl MultiplexerSocket { req_msg.header.set_correlation_id(correlation_id); - trace!("senders trying lock"); + trace!(correlation_id, "senders trying lock"); let mut senders = self.senders.lock().await; senders.insert(correlation_id, SharedSender::Serial(bytes_lock.clone())); drop(senders); - debug!( - "serial multiplexing: sending request: {} id: {}", - R::API_KEY, - correlation_id - ); - self.sink.send_request(&req_msg).await?; - - trace!("inserts shared sender"); let (msg, msg_event) = bytes_lock; + // make sure we set up listener, otherwise dispatcher may notify before + let listener = msg_event.listen(); + + debug!(api = R::API_KEY, correlation_id, "sending request"); + self.sink.send_request(&req_msg).await?; + trace!(correlation_id, "waiting"); select! { + _ = sleep(Duration::from_secs(*MAX_WAIT_TIME)) => { + trace!("serial socket for: {} timeout happen, id: {}", R::API_KEY, correlation_id); // clean channel let mut senders = self.senders.lock().await; senders.remove(&correlation_id); drop(senders); - debug!("serial socket for: {} timeout happen, id: {}", R::API_KEY, correlation_id); + Err(IoError::new( ErrorKind::TimedOut, @@ -160,9 +166,10 @@ impl MultiplexerSocket { ).into()) }, - _ = msg_event.listen() => { + _ = listener => { // clean channel + trace!(correlation_id,"msg event"); let mut senders = self.senders.lock().await; senders.remove(&correlation_id); drop(senders); @@ -172,7 +179,7 @@ impl MultiplexerSocket { if let Some(response_bytes) = &*guard { - debug!("receive serial socket id: {}, bytes: {}", correlation_id, response_bytes.len()); + debug!(correlation_id, len = response_bytes.len(),"receive serial message"); let response = R::Response::decode_from( &mut Cursor::new(&response_bytes), req_msg.header.api_version(), @@ -312,21 +319,31 @@ impl Stream for AsyncResponse { /// This decodes fluvio protocol based streams and multiplex into different slots struct MultiPlexingResponseDispatcher { + id: ConnectionFd, senders: Senders, terminate: Arc, } +impl fmt::Debug for MultiPlexingResponseDispatcher { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "MultiplexDisp({})", self.id) + } +} + impl MultiPlexingResponseDispatcher { - pub fn run(stream: FluvioStream, senders: Senders, terminate: Arc) { + pub fn run(id: ConnectionFd, stream: FluvioStream, senders: Senders, terminate: Arc) { use fluvio_future::task::spawn; - let dispatcher = Self { senders, terminate }; + let dispatcher = Self { + id, + senders, + terminate, + }; - debug!("dispatcher: spawning dispatcher loop"); spawn(dispatcher.dispatcher_loop(stream)); } - #[instrument(name = "loop", skip(self, stream))] + #[instrument(skip(stream))] async fn dispatcher_loop(mut self, mut stream: FluvioStream) { let frame_stream = stream.get_mut_tcp_stream(); @@ -391,7 +408,7 @@ impl MultiPlexingResponseDispatcher { /// send message to correct receiver #[instrument(skip(self, msg),fields( msg = msg.len()))] - pub async fn send(&mut self, correlation_id: i32, msg: BytesMut) -> Result<(), SocketError> { + async fn send(&mut self, correlation_id: i32, msg: BytesMut) -> Result<(), SocketError> { let mut senders = self.senders.lock().await; if let Some(sender) = senders.get_mut(&correlation_id) { match sender { @@ -403,6 +420,7 @@ impl MultiPlexingResponseDispatcher { *guard = Some(msg); drop(guard); // unlock serial_sender.1.notify(1); + trace!("found serial"); Ok(()) } @@ -417,7 +435,7 @@ impl MultiPlexingResponseDispatcher { } } SharedSender::Queue(queue_sender) => { - trace!("found queue"); + trace!("found stream"); queue_sender.send(Some(msg)).await.map_err(|err| { IoError::new( ErrorKind::BrokenPipe, diff --git a/src/socket/src/socket.rs b/src/socket/src/socket.rs index a9925e3611..686ded002c 100644 --- a/src/socket/src/socket.rs +++ b/src/socket/src/socket.rs @@ -23,7 +23,7 @@ pub struct FluvioSocket { impl fmt::Debug for FluvioSocket { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "fd({})", self.id()) + write!(f, "Socket({})", self.id()) } } @@ -75,12 +75,16 @@ impl FluvioSocket { } impl FluvioSocket { + #[allow(clippy::clone_on_copy)] pub fn from_stream( write: BoxWriteConnection, read: BoxReadConnection, fd: ConnectionFd, ) -> Self { - Self::new(FluvioSink::new(write, fd), FluvioStream::new(read)) + Self::new( + FluvioSink::new(write, fd.clone()), + FluvioStream::new(fd, read), + ) } /// connect to target address with connector diff --git a/src/socket/src/stream.rs b/src/socket/src/stream.rs index 76d242d681..74825f792e 100644 --- a/src/socket/src/stream.rs +++ b/src/socket/src/stream.rs @@ -1,8 +1,10 @@ +use std::fmt; use std::fmt::Debug; use std::io::Cursor; use std::io::Error as IoError; use std::io::ErrorKind; +use fluvio_future::net::ConnectionFd; use fluvio_future::net::{BoxReadConnection}; use fluvio_protocol::api::{ApiMessage, Request, RequestMessage, ResponseMessage}; use fluvio_protocol::codec::FluvioCodec; @@ -19,15 +21,27 @@ use crate::SocketError; type FrameStream = FramedRead, FluvioCodec>; /// inner flv stream which is generic over stream -pub struct FluvioStream(FrameStream); +pub struct FluvioStream { + inner: FrameStream, + id: ConnectionFd, +} + +impl Debug for FluvioStream { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "Stream({})", self.id) + } +} impl FluvioStream { - pub fn new(stream: BoxReadConnection) -> Self { - Self(FramedRead::new(stream.compat(), FluvioCodec::new())) + pub fn new(id: ConnectionFd, stream: BoxReadConnection) -> Self { + Self { + inner: FramedRead::new(stream.compat(), FluvioCodec::new()), + id, + } } pub fn get_mut_tcp_stream(&mut self) -> &mut FrameStream { - &mut self.0 + &mut self.inner } /// as server, get stream of request coming from client @@ -37,7 +51,7 @@ impl FluvioStream { where RequestMessage: FluvioDecoder + Debug, { - (&mut self.0).map(|req_bytes_r| match req_bytes_r { + (&mut self.inner).map(|req_bytes_r| match req_bytes_r { Ok(req_bytes) => { let mut src = Cursor::new(&req_bytes); let msg: RequestMessage = RequestMessage::decode_from(&mut src, 0)?; @@ -65,7 +79,7 @@ impl FluvioStream { R: Request, { trace!(api = R::API_KEY, "waiting for response"); - let next = self.0.next().await; + let next = self.inner.next().await; if let Some(result) = next { match result { Ok(req_bytes) => { @@ -93,7 +107,7 @@ impl FluvioStream { R: ApiMessage, A: FluvioDecoder + Debug, { - (&mut self.0).map(|req_bytes_r| match req_bytes_r { + (&mut self.inner).map(|req_bytes_r| match req_bytes_r { Ok(req_bytes) => { trace!("received bytes from client len: {}", req_bytes.len()); let mut src = Cursor::new(&req_bytes); @@ -120,7 +134,7 @@ impl FluvioStream { R: Request, { let version = req_msg.header.api_version(); - (&mut self.0).filter_map(move |req_bytes| async move { + (&mut self.inner).filter_map(move |req_bytes| async move { match req_bytes { Ok(mut bytes) => match ResponseMessage::decode_from(&mut bytes, version) { Ok(res_msg) => { @@ -141,8 +155,10 @@ impl FluvioStream { } } +/* impl From for FluvioStream { fn from(stream: FrameStream) -> Self { - FluvioStream(stream) + FluvioStream {stream) } } +*/ diff --git a/src/spu/Cargo.toml b/src/spu/Cargo.toml index db490caa6e..6fdf327707 100644 --- a/src/spu/Cargo.toml +++ b/src/spu/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "fluvio-spu" edition = "2018" -version = "0.5.1" +version = "0.0.0" authors = ["fluvio.io"] description = "Fluvio Stream Processing Unit" repository = "https://github.com/infinyon/fluvio" @@ -53,7 +53,7 @@ fluvio-spu-schema = { version = "0.8.0", path = "../spu-schema", features = ["fi fluvio-protocol = { path = "../protocol", version = "0.6" } fluvio-socket = { path = "../socket", version = "0.9", features = ["file"] } dataplane = { version = "0.6.0", path = "../dataplane-protocol", package = "fluvio-dataplane-protocol" , features=["file"]} -fluvio-service = { path = "../service", version = "0.6.0" } +fluvio-service = { path = "../service", version = "0.0.0" } flv-tls-proxy = { version = "0.5.0" } flv-util = { version = "0.5.0" } fluvio-future = { version = "0.3.8", features = ["subscriber", "openssl_tls", "zero_copy"] } diff --git a/src/spu/src/control_plane/dispatcher.rs b/src/spu/src/control_plane/dispatcher.rs index fb50d87eb5..d906368ba1 100644 --- a/src/spu/src/control_plane/dispatcher.rs +++ b/src/spu/src/control_plane/dispatcher.rs @@ -128,6 +128,8 @@ impl ScDispatcher { let mut status_timer = Timer::interval(MIN_SC_SINK_TIME); loop { + debug!("waiting"); + select! { _ = status_timer.next() => { @@ -139,7 +141,7 @@ impl ScDispatcher { }, sc_request = api_stream.next() => { - trace!("got requests from sc"); + debug!("got requests from sc"); match sc_request { Some(Ok(InternalSpuRequest::UpdateReplicaRequest(request))) => { self.counter.replica_changes += 1; @@ -172,10 +174,11 @@ impl ScDispatcher { } /// send status back to sc, if there is error return false + #[instrument(skip(self))] async fn send_status_back_to_sc(&mut self, sc_sink: &mut FluvioSink) -> bool { let requests = self.status_update.remove_all().await; if !requests.is_empty() { - trace!(requests = ?requests, "sending status back to sc"); + debug!(requests = ?requests, "sending status back to sc"); let message = RequestMessage::new_request(UpdateLrsRequest::new(requests)); if let Err(err) = sc_sink.send_request(&message).await { @@ -268,6 +271,7 @@ impl ScDispatcher { /// /// Follower Update Handler sent by a peer Spu /// + #[instrument(skip(self, req_msg))] async fn handle_update_replica_request( &mut self, req_msg: RequestMessage, @@ -304,7 +308,7 @@ impl ScDispatcher { ) -> Result<(), IoError> { let (_, request) = req_msg.get_header_request(); - debug!( message = ?request,"spu request"); + debug!( message = ?request,"starting spu update"); let _actions = if !request.all.is_empty() { debug!( @@ -326,6 +330,8 @@ impl ScDispatcher { self.ctx.sync_follower_update().await; + trace!("finish spu update"); + Ok(()) } } diff --git a/src/spu/src/core/global_context.rs b/src/spu/src/core/global_context.rs index d892e97fe7..647220f657 100644 --- a/src/spu/src/core/global_context.rs +++ b/src/spu/src/core/global_context.rs @@ -120,6 +120,7 @@ where } /// notify all follower handlers with SPU changes + #[instrument(skip(self))] pub async fn sync_follower_update(&self) { self.spu_followers .sync_from_spus(self.spu_localstore(), self.local_spu_id()) diff --git a/src/spu/src/core/store.rs b/src/spu/src/core/store.rs index 93448b0cf3..e1003a4d7f 100644 --- a/src/spu/src/core/store.rs +++ b/src/spu/src/core/store.rs @@ -129,7 +129,7 @@ where let mut local_keys = self.all_keys(); let mut actions = Actions::default(); - debug!("sync all"); + debug!(local_keys = local_keys.len(), "sync all"); // debug!( // spec_label = S::LABEL, // command_count = source_specs.len(), diff --git a/src/spu/src/services/public/service_impl.rs b/src/spu/src/services/public/service_impl.rs index eb42acf9e2..70ba349d8a 100644 --- a/src/spu/src/services/public/service_impl.rs +++ b/src/spu/src/services/public/service_impl.rs @@ -33,7 +33,7 @@ impl FlvService for PublicService { type Context = DefaultSharedGlobalContext; type Request = SpuServerRequest; - #[instrument(skip(self, context, socket))] + #[instrument(skip(self, context))] async fn respond( self: Arc, context: DefaultSharedGlobalContext, @@ -47,6 +47,7 @@ impl FlvService for PublicService { let end_event = SimpleEvent::shared(); loop { + debug!("waiting"); select! { _ = end_event.listen() => { @@ -59,7 +60,7 @@ impl FlvService for PublicService { if let Some(msg) = api_msg { if let Ok(req_message) = msg { - debug!(sink = s_sink.id(),"received request"); + debug!("received request"); trace!("conn: {}, received request: {:#?}",s_sink.id(),req_message); match req_message { SpuServerRequest::ApiVersionsRequest(request) => call_service!( @@ -74,7 +75,7 @@ impl FlvService for PublicService { request, handle_produce_request(request,context.clone()), s_sink, - "roduce request handler" + "produce" ), SpuServerRequest::FileFetchRequest(request) => handle_fetch_request(request,context.clone(),s_sink.clone()).await?, @@ -106,11 +107,11 @@ impl FlvService for PublicService { } } else { - tracing::debug!("conn: {} msg can't be decoded, ending connection",s_sink.id()); + debug!("conn: {} msg can't be decoded, ending connection",s_sink.id()); break; } } else { - tracing::debug!("conn: {}, no content, end of connection", s_sink.id()); + debug!("conn: {}, no content, end of connection", s_sink.id()); break; } @@ -121,7 +122,7 @@ impl FlvService for PublicService { end_event.notify(); - debug!("conn: {}, loop terminated ", s_sink.id()); + debug!("service terminated"); Ok(()) } } diff --git a/tests/runner/src/main.rs b/tests/runner/src/main.rs index 1119ab45e2..a938851b4d 100644 --- a/tests/runner/src/main.rs +++ b/tests/runner/src/main.rs @@ -133,7 +133,7 @@ async fn cluster_setup(option: &EnvironmentSetup) -> Arc> { }; Arc::new(RwLock::new(TestDriver { - client: fluvio_client, + admin_client: fluvio_client, topic_num: 0, producer_num: 0, consumer_num: 0, diff --git a/tests/runner/src/tests/concurrent/producer.rs b/tests/runner/src/tests/concurrent/producer.rs index a71db36ab7..257f1ba157 100644 --- a/tests/runner/src/tests/concurrent/producer.rs +++ b/tests/runner/src/tests/concurrent/producer.rs @@ -15,7 +15,7 @@ pub async fn producer( let mut lock = test_driver.write().await; let producer = lock - .get_producer(option.environment.topic_name.as_str()) + .create_producer(option.environment.topic_name.as_str()) .await; // Iterations ranging approx. 5000 - 20_000 diff --git a/tests/runner/src/tests/producer_stress.rs b/tests/runner/src/tests/producer_stress.rs index dcce29ff7f..e9d7c87a7e 100644 --- a/tests/runner/src/tests/producer_stress.rs +++ b/tests/runner/src/tests/producer_stress.rs @@ -73,7 +73,7 @@ pub async fn run( let mut producers = Vec::new(); for _ in 0..test_case.option.producers { let mut lock = test_driver.write().await; - let producer = lock.get_producer(&topic_name).await; + let producer = lock.create_producer(&topic_name).await; producers.push(producer); } diff --git a/tests/runner/src/tests/smoke/consume.rs b/tests/runner/src/tests/smoke/consume.rs index 1e05a5582b..0219c621ab 100644 --- a/tests/runner/src/tests/smoke/consume.rs +++ b/tests/runner/src/tests/smoke/consume.rs @@ -19,12 +19,6 @@ use super::message::*; type Offsets = HashMap; -/// total time allotted for consumer test -fn consume_wait_timeout() -> u64 { - let var_value = std::env::var("FLV_TEST_CONSUMER_WAIT").unwrap_or_default(); - var_value.parse().unwrap_or(30000) // 30 seconds -} - /// verify consumers pub async fn validate_consume_message( test_driver: Arc>, @@ -104,28 +98,12 @@ async fn validate_consume_message_api( let mut total_records: u16 = 0; - // add 30 seconds per 1000 - let cycle = producer_iteration / 1000 + 1; - let timer_wait = cycle as u64 * consume_wait_timeout(); - info!("total cycle: {}, timer wait: {}", cycle, timer_wait); - let mut timer = sleep(Duration::from_millis(timer_wait)); + let mut chunk_time = SystemTime::now(); loop { let now = SystemTime::now(); select! { - _ = &mut timer => { - println!("Timeout in timer"); - debug!("timer expired"); - panic!("timer expired"); - }, - - // max time for each read - _ = sleep(Duration::from_secs(30)) => { - println!("Timeout in read"); - panic!("no consumer read iter: current {}",producer_iteration); - }, - stream_next = stream.next() => { if let Some(Ok(record)) = stream_next { @@ -152,14 +130,17 @@ async fn validate_consume_message_api( lock.consume_latency_record(consume_time as u64).await; lock.consume_bytes_record(bytes.len()).await; - debug!("Consume stat updates: {:?} {:?}", lock.consumer_latency_histogram, lock.consumer_bytes); + // debug!("Consume stat updates: {:?} {:?}", lock.consumer_latency_histogram, lock.consumer_bytes); + debug!(consumer_bytes = lock.consumer_bytes, "Consume stat updates"); drop(lock); // for each if total_records % 100 == 0 { - println!("processed records: {}",total_records); + let elapsed_chunk_time = chunk_time.elapsed().clone().unwrap().as_secs_f32(); + println!("total processed records: {} chunk time: {:.1} secs",total_records,elapsed_chunk_time); info!(total_records,"processed records"); + chunk_time = SystemTime::now(); } if total_records == producer_iteration { @@ -184,7 +165,7 @@ async fn validate_consume_message_api( sleep(Duration::from_secs(5)).await; let lock = test_driver.write().await; - let TestDriverType::Fluvio(fluvio_client) = lock.client.as_ref(); + let TestDriverType::Fluvio(fluvio_client) = lock.admin_client.as_ref(); let admin = fluvio_client.admin().await; let partitions = admin .list::(vec![]) @@ -240,12 +221,6 @@ async fn validate_consume_message_api( loop { select! { - // max time for each read - _ = sleep(Duration::from_millis(5000)) => { - println!("Timeout in read"); - panic!("no consumer read iter: current {}",producer_iteration); - }, - stream_next = stream.next() => { let record = stream_next.expect("some").expect("records"); diff --git a/tests/runner/src/tests/smoke/mod.rs b/tests/runner/src/tests/smoke/mod.rs index 2fcf85f3a9..7e66f4efd9 100644 --- a/tests/runner/src/tests/smoke/mod.rs +++ b/tests/runner/src/tests/smoke/mod.rs @@ -4,6 +4,7 @@ pub mod message; use std::any::Any; use std::sync::Arc; + use structopt::StructOpt; use fluvio_integration_derive::fluvio_test; @@ -73,8 +74,13 @@ pub async fn smoke( mut test_driver: Arc>, mut test_case: TestCase, ) -> TestResult { + println!("Starting smoke test"); let smoke_test_case = test_case.into(); let start_offsets = produce::produce_message(test_driver.clone(), &smoke_test_case).await; + // println!("start sleeping"); + // fluvio_future::timer::sleep(Duration::from_secs(40)).await; + // sleep(Duration::from_secs(40)); + // println!("end sleeping"); consume::validate_consume_message(test_driver.clone(), &smoke_test_case, start_offsets).await; } diff --git a/tests/runner/src/tests/smoke/produce.rs b/tests/runner/src/tests/smoke/produce.rs index 6fe8898af5..e5bd5455be 100644 --- a/tests/runner/src/tests/smoke/produce.rs +++ b/tests/runner/src/tests/smoke/produce.rs @@ -1,8 +1,9 @@ use std::sync::Arc; use std::collections::HashMap; +use std::time::SystemTime; use fluvio_test_util::test_runner::test_driver::{TestDriver, TestDriverType}; -use tracing::info; +use tracing::{info, debug}; use super::SmokeTestCase; use super::message::*; @@ -61,7 +62,7 @@ mod offsets { let mut offsets = HashMap::new(); - let TestDriverType::Fluvio(fluvio_client) = test_driver.client.as_ref(); + let TestDriverType::Fluvio(fluvio_client) = test_driver.admin_client.as_ref(); let mut admin = fluvio_client.admin().await; for _i in 0..partition { @@ -117,15 +118,20 @@ pub async fn produce_message_with_api( let base_offset = *offsets.get(&topic_name).expect("offsets"); let mut lock = test_driver.write().await; - let producer = lock.get_producer(&topic_name).await; + let producer = lock.create_producer(&topic_name).await; drop(lock); + debug!(base_offset, "created producer"); + + let mut chunk_time = SystemTime::now(); for i in 0..produce_iteration { let offset = base_offset + i as i64; let message = generate_message(offset, &test_case); let len = message.len(); - info!("trying send: {}, iteration: {}", topic_name, i); + info!(topic = %topic_name, iteration = i, "trying send"); + let mut lock = test_driver.write().await; + lock.send_count( &producer, RecordKey::NULL, @@ -136,10 +142,20 @@ pub async fn produce_message_with_api( panic!("send record failed for replication: {} iteration: {}", r, i) }); drop(lock); + + if i % 100 == 0 { + let elapsed_chunk_time = chunk_time.elapsed().clone().unwrap().as_secs_f32(); + println!( + "total records sent: {} chunk time: {:.1} secs", + i, elapsed_chunk_time + ); + chunk_time = SystemTime::now(); + } info!( "completed send iter: {}, offset: {},len: {}", topic_name, offset, len ); + sleep(Duration::from_millis(10)).await; } } diff --git a/tests/runner/src/utils/test_runner/test_driver/mod.rs b/tests/runner/src/utils/test_runner/test_driver/mod.rs index b32a178a85..a6c00595ca 100644 --- a/tests/runner/src/utils/test_runner/test_driver/mod.rs +++ b/tests/runner/src/utils/test_runner/test_driver/mod.rs @@ -9,18 +9,16 @@ use std::sync::Arc; use fluvio::metadata::topic::TopicSpec; use hdrhistogram::Histogram; use fluvio::{TopicProducer, RecordKey, PartitionConsumer}; -use std::time::Duration; use futures_lite::stream::StreamExt; use tracing::debug; use fluvio::Offset; -use fluvio_future::timer::sleep; pub enum TestDriverType { Fluvio(Fluvio), } #[derive(Clone)] pub struct TestDriver { - pub client: Arc, + pub admin_client: Arc, pub topic_num: usize, pub producer_num: usize, pub consumer_num: usize, @@ -37,23 +35,18 @@ impl TestDriver { } // Wrapper to getting a producer. We keep track of the number of producers we create - pub async fn get_producer(&mut self, topic: &str) -> TopicProducer { - let TestDriverType::Fluvio(fluvio_client) = self.client.as_ref(); + pub async fn create_producer(&mut self, topic: &str) -> TopicProducer { + debug!(topic, "creating producer"); + let fluvio_client = self.create_client().await.expect("cant' create client"); match fluvio_client.topic_producer(topic).await { Ok(client) => { self.producer_num += 1; - return client; + client } Err(err) => { - println!( - "unable to get producer to topic: {}, error: {} sleeping 10 second ", - topic, err - ); - sleep(Duration::from_secs(10)).await; + panic!("could not create producer: {:#?}", err); } } - - panic!("can't get producer"); } // Wrapper to producer send. We measure the latency and accumulation of message payloads sent. @@ -86,22 +79,16 @@ impl TestDriver { } pub async fn get_consumer(&mut self, topic: &str) -> PartitionConsumer { - let TestDriverType::Fluvio(fluvio_client) = self.client.as_ref(); + let fluvio_client = self.create_client().await.expect("cant' create client"); match fluvio_client.partition_consumer(topic.to_string(), 0).await { Ok(client) => { self.consumer_num += 1; - return client; + client } Err(err) => { - println!( - "unable to get consumer to topic: {}, error: {} sleeping 10 second ", - topic, err - ); - sleep(Duration::from_secs(10)).await; + panic!("can't create consumer: {:#?}", err); } } - - panic!("can't get consumer"); } pub async fn stream_count(&mut self, consumer: PartitionConsumer, offset: Offset) { @@ -152,7 +139,7 @@ impl TestDriver { println!("Creating the topic: {}", &option.topic_name); - let TestDriverType::Fluvio(fluvio_client) = self.client.as_ref(); + let TestDriverType::Fluvio(fluvio_client) = self.admin_client.as_ref(); let admin = fluvio_client.admin().await; let topic_spec = @@ -200,4 +187,9 @@ impl TestDriver { true } + + /// create new fluvio client + async fn create_client(&self) -> Result { + Fluvio::connect().await + } } diff --git a/tests/upgrade-test.sh b/tests/upgrade-test.sh index 1f9ed984ce..5c68e19d75 100755 --- a/tests/upgrade-test.sh +++ b/tests/upgrade-test.sh @@ -49,12 +49,7 @@ function cleanup() { # If we're in CI, we want to slow down execution # to give CPU some time to rest, so we don't time out function ci_check() { - if [[ ! -z "$CI" ]]; - then - echo "[CI MODE] Pausing for ${CI_SLEEP} second(s)"; - w | head -1 - sleep ${CI_SLEEP}; - fi + : } # This function is intended to be run second after the Stable-1 validation From de7e6cf57c6907915a1a8107e7eb70e16b1a99f7 Mon Sep 17 00:00:00 2001 From: Sehyo Chang Date: Wed, 25 Aug 2021 01:43:33 +0000 Subject: [PATCH 02/18] add back dependency on upgrade test for docker push (#1500) --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d8c81e224..8764d81375 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -304,7 +304,7 @@ jobs: # if: ${{ false }} needs: build_primary_binaries strategy: - fail-fast: false + # fail-fast: false matrix: os: [ubuntu-latest] # run: [r1, r2, r3, r4, r5, r6, r7, r8, r9, r10,r11,r12,r13,r14,r15,r16,r17] @@ -407,7 +407,7 @@ jobs: needs: build_image runs-on: ${{ matrix.os }} strategy: - fail-fast: false + # fail-fast: false matrix: os: [ubuntu-latest] run: [r1] @@ -484,7 +484,7 @@ jobs: needs: build_image runs-on: ${{ matrix.os }} strategy: - fail-fast: false + # fail-fast: false matrix: os: [ubuntu-latest] run: [r1] @@ -561,9 +561,10 @@ jobs: - check_wasm - check_windows - build_image + - build_binaries - local_cluster_test - k8_cluster_test - # - k8_upgrade_test + - k8_upgrade_test runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From d24f890606362328f468a201ccfd03061cbcf829 Mon Sep 17 00:00:00 2001 From: "T.J. Telan" Date: Wed, 25 Aug 2021 02:02:41 +0000 Subject: [PATCH 03/18] Add matrix vars for CD_Dev installer_check (#1498) Fix the error in CD_Dev due to missing var `os` --- .github/workflows/cd_dev.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cd_dev.yaml b/.github/workflows/cd_dev.yaml index e6ab9c9580..a6437ca68c 100644 --- a/.github/workflows/cd_dev.yaml +++ b/.github/workflows/cd_dev.yaml @@ -153,6 +153,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: + os: [ubuntu-latest] version: [latest] steps: - uses: actions/checkout@v2 From 353bd458e5e86f665146cb909190c85e2b9a9bd4 Mon Sep 17 00:00:00 2001 From: tomindisguise <89169004+tomindisguise@users.noreply.github.com> Date: Wed, 25 Aug 2021 15:43:36 +0000 Subject: [PATCH 04/18] feat: compress WASM binaries (SmartStream) (fixes #1140) (#1468) - added Gzip variant to `SmartStreamWasm` and conversion methods - bumped the default protocol API version - compression/decompression using the `flate2` crate with the default pure Rust backend --- CHANGELOG.md | 1 + Cargo.lock | 3 +- src/cli/Cargo.toml | 4 +- src/client/src/consumer.rs | 14 +++-- src/cluster/Cargo.toml | 4 +- src/extension-common/Cargo.toml | 2 +- src/sc-schema/Cargo.toml | 2 +- src/sc/Cargo.toml | 2 +- src/spu-schema/Cargo.toml | 1 + src/spu-schema/src/server/stream_fetch.rs | 70 ++++++++++++++++++++- src/spu/src/services/public/stream_fetch.rs | 7 +-- 11 files changed, 93 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a745e9f46..6916371077 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Deprecate consumer fetch API ([#957](https://github.com/infinyon/fluvio/issues/957)) * Gracefully handle error when trying to install plugins or update. ([#1434](https://github.com/infinyon/fluvio/pull/1434)) * Fix timing issue in Multiplexor Socket ([#1484](https://github.com/infinyon/fluvio/pull/1484)) +* Compress WASM binaries. ([#1468](https://github.com/infinyon/fluvio/pull/1468)) ## Platform Version 0.9.3 - 2021-08-19 * Fix Replication timing. ([#1439](https://github.com/infinyon/fluvio/pull/1439)) diff --git a/Cargo.lock b/Cargo.lock index ae9cb690fd..896d2b24a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1738,7 +1738,7 @@ dependencies = [ [[package]] name = "fluvio-sc-schema" -version = "0.9.0" +version = "0.9.1" dependencies = [ "fluvio-controlplane-metadata", "fluvio-dataplane-protocol", @@ -1859,6 +1859,7 @@ name = "fluvio-spu-schema" version = "0.8.0" dependencies = [ "bytes", + "flate2", "fluvio-dataplane-protocol", "fluvio-protocol", "log", diff --git a/src/cli/Cargo.toml b/src/cli/Cargo.toml index 44d73446ef..fb54b9e90c 100644 --- a/src/cli/Cargo.toml +++ b/src/cli/Cargo.toml @@ -68,7 +68,7 @@ k8-config = { version = "1.3.0", optional = true} k8-client = { version = "5.0.0", optional = true} fluvio-cluster = { version = "0.0.0", path = "../cluster", default-features = false, features = ["cli"], optional = true } -fluvio = { version = "0.9.0", path = "../client", default-features = false } +fluvio = { version = "0.9.1", path = "../client", default-features = false } fluvio-command = { version = "0.2.0" } fluvio-package-index = { version = "0.5.0", path = "../package-index" } fluvio-extension-common = { version = "0.5.0", path = "../extension-common", features = ["target"]} @@ -78,7 +78,7 @@ k8-types = { version = "0.2.0", features = ["core"]} # Optional Fluvio dependencies fluvio-types = { version = "0.2.0" , path = "../types", optional = true} fluvio-future = { version = "0.3.0", features = ["fs", "io", "subscriber", "native2_tls"], optional = true } -fluvio-sc-schema = { version = "0.9.0", path = "../sc-schema", features = ["use_serde"], optional = true } +fluvio-sc-schema = { version = "0.9.1", path = "../sc-schema", features = ["use_serde"], optional = true } [dev-dependencies] fluvio-future = { version = "0.3.0", features = ["fixture"] } diff --git a/src/client/src/consumer.rs b/src/client/src/consumer.rs index e498bf09ca..3cb27179e3 100644 --- a/src/client/src/consumer.rs +++ b/src/client/src/consumer.rs @@ -9,7 +9,7 @@ use futures_util::FutureExt; use fluvio_spu_schema::server::stream_fetch::{ DefaultStreamFetchRequest, DefaultStreamFetchResponse, SmartStreamPayload, SmartStreamWasm, - SmartStreamKind, WASM_MODULE_V2_API, + SmartStreamKind, WASM_MODULE_V2_API, GZIP_WASM_API, }; use dataplane::{Isolation, SmartStreamError}; use dataplane::ReplicaKey; @@ -426,7 +426,7 @@ impl PartitionConsumer { .lookup_version(DefaultStreamFetchRequest::API_KEY) .unwrap_or((WASM_MODULE_API - 1) as i16); - if let Some(module) = config.wasm_module { + if let Some(mut module) = config.wasm_module { if stream_fetch_version < WASM_MODULE_API as i16 { return Err(FluvioError::Other("SPU does not support WASM".to_owned())); } @@ -434,11 +434,17 @@ impl PartitionConsumer { if stream_fetch_version < WASM_MODULE_V2_API as i16 { // SmartStream V1 debug!("Using WASM V1 API"); - let SmartStreamWasm::Raw(wasm) = module.wasm; - stream_request.wasm_module = wasm; + let wasm = module.wasm.get_raw()?; + stream_request.wasm_module = wasm.into_owned(); } else { // SmartStream V2 debug!("Using WASM V2 API"); + if stream_fetch_version < GZIP_WASM_API as i16 { + module.wasm.to_raw()?; + } else { + debug!("Using compressed WASM API"); + module.wasm.to_gzip()?; + } stream_request.wasm_payload = Some(module); } } diff --git a/src/cluster/Cargo.toml b/src/cluster/Cargo.toml index 9400f9a312..a867c32a30 100644 --- a/src/cluster/Cargo.toml +++ b/src/cluster/Cargo.toml @@ -47,13 +47,13 @@ include_dir = "0.6.1" tempdir = "0.3.7" # Fluvio dependencies -fluvio = { version = "0.9.0", path = "../client", default-features = false } +fluvio = { version = "0.9.1", path = "../client", default-features = false } fluvio-helm = "0.4.1" fluvio-future = { version = "0.3.0" } fluvio-command = { version = "0.2.0" } fluvio-extension-common = { version = "0.5.0", path = "../extension-common", optional = true } fluvio-controlplane-metadata = { version = "0.10.0", path = "../controlplane-metadata", features = ["k8"] } -fluvio-sc-schema = { version = "0.9.0", path = "../sc-schema", default-features = false, optional = true } +fluvio-sc-schema = { version = "0.9.1", path = "../sc-schema", default-features = false, optional = true } flv-util = "0.5.2" k8-config = { version = "1.3.0" } k8-client = { version = "5.0.0" } diff --git a/src/extension-common/Cargo.toml b/src/extension-common/Cargo.toml index c6a62b4007..7352f3fc89 100644 --- a/src/extension-common/Cargo.toml +++ b/src/extension-common/Cargo.toml @@ -27,5 +27,5 @@ futures-lite = { version = "1.7.0" } thiserror = "1.0.20" semver = { version = "1.0.0", features = ["serde"] } -fluvio = { version = "0.9.0", path = "../client", optional = true } +fluvio = { version = "0.9.1", path = "../client", optional = true } fluvio-package-index = { version = "0.5", path = "../package-index" } diff --git a/src/sc-schema/Cargo.toml b/src/sc-schema/Cargo.toml index 3238a107f0..441ad0eed8 100644 --- a/src/sc-schema/Cargo.toml +++ b/src/sc-schema/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fluvio-sc-schema" -version = "0.9.0" +version = "0.9.1" edition = "2018" authors = ["Fluvio Contributors "] description = "Fluvio API for SC" diff --git a/src/sc/Cargo.toml b/src/sc/Cargo.toml index 1d626362b2..af435454a3 100644 --- a/src/sc/Cargo.toml +++ b/src/sc/Cargo.toml @@ -46,7 +46,7 @@ cfg-if = { version = "1.0.0" } fluvio-auth = { version = "0.6.1", path = "../auth" } fluvio-future = { version = "0.3.0", features = ["subscriber", "openssl_tls", "zero_copy"] } fluvio-types = { version = "0.2.0", path = "../types", features = ["events"] } -fluvio-sc-schema = { version = "0.9.0", path = "../sc-schema" } +fluvio-sc-schema = { version = "0.9.1", path = "../sc-schema" } fluvio-stream-model = { version = "0.5.0", path = "../stream-model" } fluvio-controlplane = { version = "0.8.0", path = "../controlplane" } fluvio-controlplane-metadata = { version = "0.10.1", features = ["k8", "serde"], path = "../controlplane-metadata" } diff --git a/src/spu-schema/Cargo.toml b/src/spu-schema/Cargo.toml index a77c99118b..025eab539f 100644 --- a/src/spu-schema/Cargo.toml +++ b/src/spu-schema/Cargo.toml @@ -15,6 +15,7 @@ path = "src/lib.rs" file = ["dataplane/file"] [dependencies] +flate2 = "1.0.20" log = "0.4.8" tracing = "0.1.19" bytes = "1.0.0" diff --git a/src/spu-schema/src/server/stream_fetch.rs b/src/spu-schema/src/server/stream_fetch.rs index 4740fe2462..b1c725978e 100644 --- a/src/spu-schema/src/server/stream_fetch.rs +++ b/src/spu-schema/src/server/stream_fetch.rs @@ -5,6 +5,8 @@ //! use std::fmt::Debug; use std::marker::PhantomData; +use std::io::{self, Read}; +use std::borrow::Cow; use dataplane::core::{Encoder, Decoder}; use dataplane::api::Request; @@ -12,6 +14,11 @@ use dataplane::fetch::FetchablePartitionResponse; use dataplane::record::RecordSet; use dataplane::Isolation; +use flate2::{ + Compression, + bufread::{GzEncoder, GzDecoder}, +}; + pub type DefaultStreamFetchResponse = StreamFetchResponse; pub type DefaultStreamFetchRequest = StreamFetchRequest; @@ -25,6 +32,9 @@ pub const WASM_MODULE_V2_API: i16 = 12; // version for aggregator smartstream pub const AGGREGATOR_API: i16 = 13; +// version for gzipped WASM payloads +pub const GZIP_WASM_API: i16 = 14; + /// Fetch records continuously /// Output will be send back as stream #[derive(Decoder, Encoder, Default, Debug)] @@ -49,7 +59,7 @@ where R: Debug + Decoder + Encoder, { const API_KEY: u16 = SpuServerApiKey::StreamFetch as u16; - const DEFAULT_API_VERSION: i16 = AGGREGATOR_API; + const DEFAULT_API_VERSION: i16 = GZIP_WASM_API; type Response = StreamFetchResponse; } @@ -86,10 +96,53 @@ impl Default for SmartStreamKind { #[derive(Debug, Clone, Encoder, Decoder)] pub enum SmartStreamWasm { Raw(Vec), + /// compressed WASM module payload using Gzip + #[fluvio(min_version = 14)] + Gzip(Vec), // TODO implement named WASM modules once we have a WASM store // Url(String), } +fn zip(raw: &[u8]) -> io::Result> { + let mut encoder = GzEncoder::new(raw, Compression::default()); + let mut buffer = Vec::with_capacity(raw.len()); + encoder.read_to_end(&mut buffer)?; + Ok(buffer) +} + +fn unzip(compressed: &[u8]) -> io::Result> { + let mut decoder = GzDecoder::new(compressed); + let mut buffer = Vec::with_capacity(compressed.len()); + decoder.read_to_end(&mut buffer)?; + Ok(buffer) +} + +impl SmartStreamWasm { + /// returns the gzip-compressed WASM module bytes + pub fn to_gzip(&mut self) -> io::Result<()> { + if let Self::Raw(raw) = self { + *self = Self::Gzip(zip(raw.as_ref())?); + } + Ok(()) + } + + /// returns the raw WASM module bytes + pub fn to_raw(&mut self) -> io::Result<()> { + if let Self::Gzip(gzipped) = self { + *self = Self::Raw(unzip(gzipped)?); + } + Ok(()) + } + + /// get the raw bytes of the WASM module + pub fn get_raw(&self) -> io::Result> { + Ok(match self { + Self::Raw(raw) => Cow::Borrowed(raw), + Self::Gzip(gzipped) => Cow::Owned(unzip(gzipped.as_ref())?), + }) + } +} + impl Default for SmartStreamWasm { fn default() -> Self { Self::Raw(Vec::new()) @@ -247,4 +300,19 @@ mod tests { assert_eq!(wasm, vec![0xde, 0xad, 0xbe, 0xef]); assert!(matches!(smartstream.kind, SmartStreamKind::Filter)); } + + #[test] + fn test_zip_unzip_works() { + const ORIG_LEN: usize = 1024; + let orig = SmartStreamWasm::Raw(vec![0x01; ORIG_LEN]); + let mut compressed = orig.clone(); + compressed.to_gzip().unwrap(); + assert!(matches!(&compressed, &SmartStreamWasm::Gzip(ref x) if x.len() < ORIG_LEN)); + let mut uncompressed = compressed.clone(); + uncompressed.to_raw().unwrap(); + assert!( + matches!((&uncompressed, &orig), (&SmartStreamWasm::Raw(ref x), &SmartStreamWasm::Raw(ref y)) if x == y ) + ); + assert_eq!(orig.get_raw().unwrap(), compressed.get_raw().unwrap()); + } } diff --git a/src/spu/src/services/public/stream_fetch.rs b/src/spu/src/services/public/stream_fetch.rs index 7d54945203..42df1a8512 100644 --- a/src/spu/src/services/public/stream_fetch.rs +++ b/src/spu/src/services/public/stream_fetch.rs @@ -19,8 +19,7 @@ use dataplane::{ use dataplane::{Offset, Isolation, ReplicaKey}; use dataplane::fetch::FilePartitionResponse; use fluvio_spu_schema::server::stream_fetch::{ - FileStreamFetchRequest, DefaultStreamFetchRequest, StreamFetchResponse, SmartStreamWasm, - SmartStreamKind, + FileStreamFetchRequest, DefaultStreamFetchRequest, StreamFetchResponse, SmartStreamKind, }; use fluvio_types::event::offsets::OffsetChangeListener; @@ -81,7 +80,7 @@ impl StreamFetchHandler { debug!("Has WASM payload: {}", msg.wasm_payload.is_some()); let smartstream = if let Some(payload) = msg.wasm_payload { - let SmartStreamWasm::Raw(wasm) = &payload.wasm; + let wasm = &payload.wasm.get_raw()?; let module = sm_engine.create_module_from_binary(wasm).map_err(|err| { SocketError::Io(IoError::new( ErrorKind::Other, @@ -618,7 +617,7 @@ mod test { }; use dataplane::fixture::{create_batch, TEST_RECORD}; use fluvio_spu_schema::server::update_offset::{UpdateOffsetsRequest, OffsetUpdate}; - + use fluvio_spu_schema::server::stream_fetch::SmartStreamWasm; use crate::core::GlobalContext; use crate::config::SpuConfig; use crate::replication::leader::LeaderReplicaState; From 974ac1abf79e33e9eac4451cabc0ee5d3386f8c6 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Thu, 26 Aug 2021 22:25:46 +0000 Subject: [PATCH 05/18] Add build_binaries dep to publish_github_binaries (#1512) Co-authored-by: Nick Cardin --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8764d81375..55a8b9cfa5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -606,6 +606,7 @@ jobs: if: github.event_name == 'push' && github.ref == 'refs/heads/staging' needs: - docker_push + - build_binaries runs-on: ubuntu-latest permissions: write-all steps: From 79857f6fd440784afb1180c63196435e85595a45 Mon Sep 17 00:00:00 2001 From: Nick Mosher Date: Thu, 26 Aug 2021 22:39:58 +0000 Subject: [PATCH 06/18] Generalize installer (#1508) Closes #1368 I think the bulk of #1368 was actually fixed by #1434, but these installer updates are needed to peel away the bandaid fixes that we had in place before the proper fixes landed. --- install.sh | 76 +++++------------------------------------------------- 1 file changed, 6 insertions(+), 70 deletions(-) diff --git a/install.sh b/install.sh index 513c4be27a..1a2ce7ec31 100755 --- a/install.sh +++ b/install.sh @@ -16,74 +16,19 @@ readonly FLUVIO_EXTENSIONS="${HOME}/.fluvio/extensions" # # @param $1: The target triple of this architecture # @return: Status 0 if the architecture is supported, exit if not -assert_supported_client_target() { +normalize_target() { local _target="$1"; shift # Match against all supported targets case $_target in - aarch64-apple-darwin) - echo "aarch64-apple-darwin" - return 0 - ;; - aarch64-unknown-linux-musl) - echo "aarch64-unknown-linux-musl" - return 0 - ;; - x86_64-apple-darwin) - echo "x86_64-apple-darwin" - return 0 - ;; - x86_64-unknown-linux-musl) - echo "x86_64-unknown-linux-musl" - return 0 - ;; x86_64-unknown-linux-gnu) echo "x86_64-unknown-linux-musl" return 0 ;; - arm-unknown-linux-gnueabihf) - echo "arm-unknown-linux-gnueabihf" - return 0 - ;; - armv7-unknown-linux-gnueabihf) - echo "armv7-unknown-linux-gnueabihf" - return 0 - ;; esac - err "Target '${_target}' is not supported" - err "Consider filing an issue to add support for this platform using the link below! 👇" - err " https://github.com/infinyon/fluvio/issues/new?title=Support+target+${_target}" - return 1 -} - -# Ensure that this target is supported for cluster builds and matches the -# naming convention of known platform releases in the registry -# -# @param $1: The target triple of this architecture -# @return: Status 0 if the architecture is supported, exit if not -assert_supported_cluster_target() { - local _target="$1"; shift - - # Match against all supported targets - case $_target in - x86_64-unknown-linux-musl) - echo "x86_64-unknown-linux-musl" - return 0 - ;; - x86_64-unknown-linux-gnu) - echo "x86_64-unknown-linux-musl" - return 0 - ;; - x86_64-apple-darwin) - echo "x86_64-apple-darwin" - return 0 - ;; - esac - - say "🥈 Target '${_target}' is not a Tier 1 or 2 platform target" - say "⏭ Skipping installation of cluster executable fluvio-run" - return 1 + echo "${_target}" + return 0 } # Fetch the tagged version of the given package @@ -516,7 +461,7 @@ main() { # Some architectures may be folded into a single 'target' distribution # e.g. x86_64-unknown-linux-musl and x86_64-unknown-linux-gnu both download # the musl target release. The _target here is used in the URL to download - _target=$(assert_supported_client_target ${_arch}) + _target=$(normalize_target ${_arch}) # If a VERSION env variable is set: if [ -n "${VERSION:-""}" ]; then @@ -575,17 +520,8 @@ main() { say "☁️ Installing Fluvio Cloud..." FLUVIO_BOOTSTRAP=true "${FLUVIO_BIN}/fluvio" install fluvio-cloud - set +e - _output=$(assert_supported_cluster_target "${_target}") - _status=$? - set -e - - if [ $_status -eq 0 ]; then - say "☁️ Installing Fluvio Runner..." - FLUVIO_BOOTSTRAP=true "${FLUVIO_BIN}/fluvio" install "${_fluvio_run}" - else - echo "${_output}" - fi + say "☁️ Installing Fluvio Runner..." + FLUVIO_BOOTSTRAP=true "${FLUVIO_BIN}/fluvio" install "${_fluvio_run}" say "🎉 Install complete!" remind_path From 7523d3bb4d59a08388c3923aac6157b9340a6698 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Thu, 26 Aug 2021 23:03:47 +0000 Subject: [PATCH 07/18] Release docker multi-arch manifest (#1510) Resolves https://github.com/infinyon/fluvio/issues/1503 Co-authored-by: Nick Cardin --- .github/workflows/ci.yml | 1 - .github/workflows/publish.yml | 7 ++++--- .github/workflows/release.yml | 7 ++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 55a8b9cfa5..a53b71e2fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -561,7 +561,6 @@ jobs: - check_wasm - check_windows - build_image - - build_binaries - local_cluster_test - k8_cluster_test - k8_upgrade_test diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 07e9ff640e..e56fbf8ec8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -34,9 +34,10 @@ jobs: run: | export VERSION="$(curl -fsS https://raw.githubusercontent.com/infinyon/fluvio/${{ github.sha }}/VERSION)" export TAG="${VERSION}-${{ github.sha }}" - docker pull "infinyon/fluvio:${TAG}" - docker tag "infinyon/fluvio:${TAG}" "infinyon/fluvio:latest" - docker push "infinyon/fluvio:latest" + docker manifest create "docker.io/infinyon/fluvio:latest" \ + "docker.io/infinyon/fluvio:${TAG}-amd64" \ + "docker.io/infinyon/fluvio:${TAG}-arm64v8" + docker manifest push "docker.io/infinyon/fluvio:latest" - name: Slack Notification uses: 8398a7/action-slack@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5971ff2547..a551edd588 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -144,9 +144,10 @@ jobs: [ ! -z "${{ env.FORCE_RELEASE }}" ] && echo "Release w/ force..." echo "Release image already exists"; else - docker pull "${{ env.LATEST_TAG }}" - docker tag "${{ env.LATEST_TAG }}" "${{ env.RELEASE_TAG }}" - docker push "${{ env.RELEASE_TAG }}" + docker manifest create "docker.io/${{ env.RELEASE_TAG }}" \ + "docker.io/${{ env.LATEST_TAG }}-amd64" \ + "docker.io/${{ env.LATEST_TAG }}-arm64v8" + docker manifest push "docker.io/${{ env.RELEASE_TAG }}" fi - name: Slack Notification From a84b9472528d0715e6516ca2e87641b41de69a39 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Thu, 26 Aug 2021 23:03:48 +0000 Subject: [PATCH 08/18] Update changelog for 0.9.4 (#1513) * Bump fluvio-spu-schema (already published) Co-authored-by: Nick Cardin --- CHANGELOG.md | 3 ++- Cargo.lock | 4 ++-- src/smartstream/Cargo.toml | 2 +- src/spu-schema/Cargo.toml | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6916371077..532f5820e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Release Notes -## Platform Version 0.9.4 - UNRELEASED +## Platform Version 0.9.5 - UNRELEASED +## Platform Version 0.9.4 - 2021-08-26 * Publish docker image for aarch64 #1389 ([#1389](https://github.com/infinyon/fluvio/pull/1389)) * Do not panic when trying to create topic with space in the name. ([#1448](https://github.com/infinyon/fluvio/pull/1448)) * Deprecate consumer fetch API ([#957](https://github.com/infinyon/fluvio/issues/957)) diff --git a/Cargo.lock b/Cargo.lock index 896d2b24a0..364a136d12 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1769,7 +1769,7 @@ dependencies = [ [[package]] name = "fluvio-smartstream" -version = "0.2.1" +version = "0.2.2" dependencies = [ "eyre", "fluvio-dataplane-protocol", @@ -1856,7 +1856,7 @@ dependencies = [ [[package]] name = "fluvio-spu-schema" -version = "0.8.0" +version = "0.8.1" dependencies = [ "bytes", "flate2", diff --git a/src/smartstream/Cargo.toml b/src/smartstream/Cargo.toml index 040804945d..9ddf62d216 100644 --- a/src/smartstream/Cargo.toml +++ b/src/smartstream/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fluvio-smartstream" -version = "0.2.1" +version = "0.2.2" edition = "2018" license = "Apache-2.0" authors = ["Fluvio Contributors "] diff --git a/src/spu-schema/Cargo.toml b/src/spu-schema/Cargo.toml index 025eab539f..cd5ad3ad3e 100644 --- a/src/spu-schema/Cargo.toml +++ b/src/spu-schema/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fluvio-spu-schema" -version = "0.8.0" +version = "0.8.1" edition = "2018" authors = ["Fluvio Contributors "] description = "Fluvio API for SPU" From 6a51d5ad7affc13c8809ea583bac9454107f8000 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Fri, 27 Aug 2021 00:57:15 +0000 Subject: [PATCH 09/18] Bump VERSION for 0.9.5 (#1518) Co-authored-by: Nick Cardin --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 2bd77c74f1..03834411d1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.4 \ No newline at end of file +0.9.5 \ No newline at end of file From 0f06b10a213769fdcfc72896682d1dc445470d07 Mon Sep 17 00:00:00 2001 From: Nick Mosher Date: Fri, 27 Aug 2021 03:41:59 +0000 Subject: [PATCH 10/18] Rename crates to match package names (#1509) Closes #1502. - Moves `src/` to `crates/` - Names each crate's directory exactly the same as the crate package name - Flattens all crates - no more nested crates from here on out I'll be interested to see if this passes CI --- .github/workflows/ci.yml | 48 ++++----- .github/workflows/ci_tier2.yaml | 14 +-- Cargo.lock | 100 +++++++++--------- Cargo.toml | 63 ++++++----- DEVELOPER.md | 2 +- Makefile | 12 +-- {src/auth => crates/fluvio-auth}/Cargo.toml | 10 +- .../fluvio-auth}/LICENSE-APACHE | 0 {src/auth => crates/fluvio-auth}/README.md | 0 {src/auth => crates/fluvio-auth}/src/error.rs | 0 {src/auth => crates/fluvio-auth}/src/lib.rs | 0 .../auth => crates/fluvio-auth}/src/policy.rs | 0 .../fluvio-auth}/src/x509/authenticator.rs | 0 .../fluvio-auth}/src/x509/identity.rs | 0 .../fluvio-auth}/src/x509/mod.rs | 0 .../fluvio-auth}/src/x509/request.rs | 0 {src/cli => crates/fluvio-cli}/Cargo.toml | 14 +-- {src/cli => crates/fluvio-cli}/LICENSE-APACHE | 0 {src/cli => crates/fluvio-cli}/README.md | 0 {src/cli => crates/fluvio-cli}/build.rs | 0 {src/cli => crates/fluvio-cli}/src/.gitignore | 0 .../cli => crates/fluvio-cli}/src/bin/main.rs | 0 .../fluvio-cli}/src/consume/mod.rs | 0 .../fluvio-cli}/src/consume/record_format.rs | 0 {src/cli => crates/fluvio-cli}/src/error.rs | 0 {src/cli => crates/fluvio-cli}/src/http.rs | 0 .../fluvio-cli}/src/install/mod.rs | 0 .../fluvio-cli}/src/install/plugins.rs | 0 .../fluvio-cli}/src/install/update.rs | 0 {src/cli => crates/fluvio-cli}/src/lib.rs | 0 .../cli => crates/fluvio-cli}/src/metadata.rs | 0 .../fluvio-cli}/src/partition/list.rs | 0 .../fluvio-cli}/src/partition/mod.rs | 0 .../fluvio-cli}/src/produce/mod.rs | 0 .../fluvio-cli}/src/profile/current.rs | 0 .../fluvio-cli}/src/profile/delete_cluster.rs | 0 .../fluvio-cli}/src/profile/delete_profile.rs | 0 .../fluvio-cli}/src/profile/list.rs | 0 .../fluvio-cli}/src/profile/mod.rs | 0 .../fluvio-cli}/src/profile/rename.rs | 0 .../fluvio-cli}/src/profile/switch.rs | 0 .../fluvio-cli}/src/profile/sync/k8.rs | 0 .../fluvio-cli}/src/profile/sync/local.rs | 0 .../fluvio-cli}/src/profile/sync/mod.rs | 0 .../fluvio-cli}/src/topic/create.rs | 0 .../fluvio-cli}/src/topic/delete.rs | 0 .../fluvio-cli}/src/topic/describe.rs | 0 .../fluvio-cli}/src/topic/list.rs | 0 .../fluvio-cli}/src/topic/mod.rs | 0 {src/cli => crates/fluvio-cli}/src/version.rs | 0 .../test-data/group-cfg/valid_config.json | 0 .../test-data/input-files/icon1.png | Bin .../test-data/input-files/icon2.png | Bin .../test-data/input-files/json-file.json | 0 .../test-data/input-files/text-file.txt | 0 .../test-data/topics/out_of_order.json | 0 .../test-data/topics/valid_assignment.json | 0 .../test-data/topics/valid_assignment1.json | 0 .../test-data/topics/valid_kf_assignment.json | 0 .../fluvio-cluster}/Cargo.toml | 8 +- .../fluvio-cluster}/LICENSE-APACHE | 0 .../fluvio-cluster}/Makefile | 0 .../fluvio-cluster}/build.rs | 0 .../fluvio-cluster}/src/charts/chart.rs | 0 .../fluvio-cluster}/src/charts/location.rs | 0 .../fluvio-cluster}/src/charts/mod.rs | 0 .../fluvio-cluster}/src/check/mod.rs | 0 .../fluvio-cluster}/src/check/render.rs | 0 .../fluvio-cluster}/src/cli/check.rs | 0 .../fluvio-cluster}/src/cli/delete.rs | 0 .../fluvio-cluster}/src/cli/error.rs | 0 .../fluvio-cluster}/src/cli/group/create.rs | 0 .../fluvio-cluster}/src/cli/group/delete.rs | 0 .../fluvio-cluster}/src/cli/group/list.rs | 0 .../fluvio-cluster}/src/cli/group/mod.rs | 0 .../fluvio-cluster}/src/cli/mod.rs | 0 .../fluvio-cluster}/src/cli/spu/display.rs | 0 .../fluvio-cluster}/src/cli/spu/list.rs | 0 .../fluvio-cluster}/src/cli/spu/mod.rs | 0 .../fluvio-cluster}/src/cli/spu/register.rs | 0 .../fluvio-cluster}/src/cli/spu/unregister.rs | 0 .../fluvio-cluster}/src/cli/start/k8.rs | 0 .../fluvio-cluster}/src/cli/start/local.rs | 0 .../fluvio-cluster}/src/cli/start/mod.rs | 0 .../fluvio-cluster}/src/cli/start/sys.rs | 0 .../fluvio-cluster}/src/cli/start/tls.rs | 0 .../fluvio-cluster}/src/cli/util.rs | 0 .../fluvio-cluster}/src/delete.rs | 0 .../fluvio-cluster}/src/error.rs | 0 .../fluvio-cluster}/src/lib.rs | 0 .../fluvio-cluster}/src/start/common.rs | 0 .../fluvio-cluster}/src/start/k8.rs | 0 .../fluvio-cluster}/src/start/local.rs | 0 .../fluvio-cluster}/src/start/mod.rs | 0 .../fluvio-controlplane-metadata}/Cargo.toml | 8 +- .../LICENSE-APACHE | 0 .../fluvio-controlplane-metadata}/README.md | 0 .../fluvio-controlplane-metadata}/src/lib.rs | 0 .../src/message/mod.rs | 0 .../src/message/msg_type.rs | 0 .../src/message/replica_msg.rs | 0 .../src/partition/k8.rs | 0 .../src/partition/mod.rs | 0 .../src/partition/policy.rs | 0 .../src/partition/replica.rs | 0 .../src/partition/spec.rs | 0 .../src/partition/status.rs | 0 .../src/partition/store.rs | 0 .../src/spg/k8/mod.rs | 0 .../src/spg/k8/spec.rs | 0 .../src/spg/mod.rs | 0 .../src/spg/spec.rs | 0 .../src/spg/status.rs | 0 .../src/spg/store.rs | 0 .../src/spu/k8.rs | 0 .../src/spu/mod.rs | 0 .../src/spu/spec.rs | 0 .../src/spu/status.rs | 0 .../src/spu/store.rs | 0 .../src/topic/k8.rs | 0 .../src/topic/mod.rs | 0 .../src/topic/spec.rs | 0 .../src/topic/status.rs | 0 .../src/topic/store.rs | 0 .../fluvio-controlplane}/Cargo.toml | 8 +- .../fluvio-controlplane}/LICENSE-APACHE | 0 .../fluvio-controlplane}/src/lib.rs | 0 .../fluvio-controlplane}/src/requests/mod.rs | 0 .../src/requests/register_spu.rs | 0 .../src/requests/remove.rs | 0 .../src/requests/update_lrs.rs | 0 .../src/requests/update_replica.rs | 0 .../src/requests/update_spu.rs | 0 .../fluvio-controlplane}/src/sc_api.rs | 0 .../fluvio-controlplane}/src/spu_api.rs | 0 .../fluvio-dataplane-protocol}/Cargo.toml | 4 +- .../fluvio-dataplane-protocol}/LICENSE-APACHE | 0 .../fluvio-dataplane-protocol}/README.md | 0 .../fluvio-dataplane-protocol}/src/batch.rs | 0 .../fluvio-dataplane-protocol}/src/common.rs | 0 .../src/error_code.rs | 0 .../src/fetch/mod.rs | 0 .../src/fetch/request.rs | 0 .../src/fetch/response.rs | 0 .../fluvio-dataplane-protocol}/src/fixture.rs | 0 .../fluvio-dataplane-protocol}/src/lib.rs | 0 .../src/produce/mod.rs | 0 .../src/produce/request.rs | 0 .../src/produce/response.rs | 0 .../fluvio-dataplane-protocol}/src/record.rs | 0 .../src/smartstream.rs | 0 .../src/versions.rs | 0 .../tests/file_fetch.rs | 0 .../tests/test_old_record_empty_key.bin | Bin .../fluvio-extension-common}/Cargo.toml | 4 +- .../fluvio-extension-common}/LICENSE-APACHE | 0 .../fluvio-extension-common}/README.md | 0 .../src/common/hex_dump.rs | 0 .../src/common/mod.rs | 0 .../fluvio-extension-common}/src/lib.rs | 0 .../src/output/describe.rs | 0 .../src/output/mod.rs | 0 .../src/output/serde.rs | 0 .../src/output/table.rs | 0 .../fluvio-extension-common}/src/tls.rs | 0 .../fluvio-package-index}/Cargo.toml | 0 .../fluvio-package-index}/LICENSE-APACHE | 0 .../fluvio-package-index}/build.rs | 0 .../fluvio-package-index}/src/error.rs | 0 .../fluvio-package-index}/src/http.rs | 0 .../fluvio-package-index}/src/lib.rs | 0 .../fluvio-package-index}/src/package.rs | 0 .../fluvio-package-index}/src/package_id.rs | 0 .../fluvio-package-index}/src/tags.rs | 0 .../fluvio-package-index}/src/target.rs | 0 .../fluvio-package-index}/src/version.rs | 0 .../fluvio-protocol-api/Cargo.toml | 0 .../fluvio-protocol-api}/LICENSE-APACHE | 0 .../fluvio-protocol-api/README.md | 0 .../fluvio-protocol-api/src/api.rs | 0 .../fluvio-protocol-api/src/lib.rs | 0 .../fluvio-protocol-api/src/request.rs | 0 .../fluvio-protocol-api/src/response.rs | 0 .../fluvio-protocol-codec/Cargo.lock | 0 .../fluvio-protocol-codec/Cargo.toml | 0 .../fluvio-protocol-codec}/LICENSE-APACHE | 0 .../fluvio-protocol-codec/README.md | 0 .../fluvio-protocol-codec/src/codec.rs | 0 .../fluvio-protocol-codec/src/lib.rs | 0 .../fluvio-protocol-core/Cargo.lock | 0 .../fluvio-protocol-core/Cargo.toml | 1 - .../fluvio-protocol-core}/LICENSE-APACHE | 0 .../fluvio-protocol-core/README.md | 0 .../fluvio-protocol-core/src/buffer.rs | 0 .../fluvio-protocol-core/src/decoder.rs | 0 .../fluvio-protocol-core/src/encoder.rs | 0 .../fluvio-protocol-core/src/lib.rs | 0 .../fluvio-protocol-core/src/varint.rs | 0 .../fluvio-protocol-core/src/zerocopy.rs | 0 .../fluvio-protocol-derive/Cargo.lock | 0 .../fluvio-protocol-derive/Cargo.toml | 2 +- .../fluvio-protocol-derive}/LICENSE-APACHE | 0 .../fluvio-protocol-derive/README.md | 0 .../fluvio-protocol-derive/rustfmt.toml | 0 .../fluvio-protocol-derive/src/api.rs | 0 .../src/ast/container.rs | 0 .../fluvio-protocol-derive/src/ast/enum.rs | 0 .../fluvio-protocol-derive/src/ast/mod.rs | 0 .../fluvio-protocol-derive/src/ast/prop.rs | 0 .../fluvio-protocol-derive/src/ast/struct.rs | 0 .../fluvio-protocol-derive/src/de.rs | 0 .../fluvio-protocol-derive/src/lib.rs | 0 .../fluvio-protocol-derive/src/ser.rs | 0 .../fluvio-protocol-derive/src/util.rs | 0 .../fluvio-protocol-derive/tests/parse.rs | 0 .../ui-tests/pass_derive_decode.rs | 0 .../ui-tests/pass_derive_encode.rs | 0 .../fluvio-protocol}/.github/workflows/ci.yml | 0 .../fluvio-protocol}/.gitignore | 0 .../fluvio-protocol}/CODE-OF-CONDUCT.md | 0 .../fluvio-protocol}/CONTRIBUTING.md | 0 .../fluvio-protocol}/Cargo.lock | 0 .../fluvio-protocol}/Cargo.toml | 14 +-- .../fluvio-protocol}/LICENSE-APACHE | 0 .../fluvio-protocol}/Makefile | 0 .../fluvio-protocol}/README.md | 0 .../fluvio-protocol}/send-b-client.sh | 0 .../fluvio-protocol}/src/lib.rs | 0 .../fluvio-protocol}/src/store.rs | 0 .../fluvio-protocol}/test-client.sh | 0 .../fluvio-protocol}/tests/api.rs | 0 .../fluvio-protocol}/tests/btreemap.rs | 0 .../fluvio-protocol}/tests/decode.rs | 0 .../fluvio-protocol}/tests/default.rs | 0 .../fluvio-protocol}/tests/encode.rs | 0 .../fluvio-protocol}/tests/enum.rs | 0 .../fluvio-protocol}/tests/generic.rs | 0 .../fluvio-protocol}/tests/option.rs | 0 .../fluvio-protocol}/tests/version.rs | 0 {src/runner => crates/fluvio-run}/Cargo.toml | 9 +- .../fluvio-run}/src/bin/main.rs | 0 .../runner => crates/fluvio-run}/src/error.rs | 0 {src/runner => crates/fluvio-run}/src/lib.rs | 0 .../fluvio-sc-schema}/Cargo.toml | 8 +- .../fluvio-sc-schema}/LICENSE-APACHE | 0 .../fluvio-sc-schema}/README.md | 0 .../fluvio-sc-schema}/src/apis.rs | 0 .../fluvio-sc-schema}/src/lib.rs | 0 .../fluvio-sc-schema}/src/objects/create.rs | 0 .../fluvio-sc-schema}/src/objects/delete.rs | 0 .../fluvio-sc-schema}/src/objects/list.rs | 0 .../fluvio-sc-schema}/src/objects/mod.rs | 0 .../fluvio-sc-schema}/src/objects/watch.rs | 0 .../fluvio-sc-schema}/src/partition/mod.rs | 0 .../fluvio-sc-schema}/src/request.rs | 0 .../fluvio-sc-schema}/src/response.rs | 0 .../fluvio-sc-schema}/src/spg/mod.rs | 0 .../fluvio-sc-schema}/src/spu/mod.rs | 0 .../fluvio-sc-schema}/src/topic/mod.rs | 0 .../fluvio-sc-schema}/src/versions.rs | 0 {src/sc => crates/fluvio-sc}/Cargo.toml | 22 ++-- .../fluvio-sc}/LICENSE-APACHE | 0 {src/sc => crates/fluvio-sc}/README.md | 0 {src/sc => crates/fluvio-sc}/build.rs | 0 {src/sc => crates/fluvio-sc}/src/bin/k8.rs | 0 {src/sc => crates/fluvio-sc}/src/cli.rs | 0 .../sc => crates/fluvio-sc}/src/config/mod.rs | 0 .../fluvio-sc}/src/config/sc_config.rs | 0 .../fluvio-sc}/src/controllers/mod.rs | 0 .../src/controllers/partitions/Test.MD | 0 .../src/controllers/partitions/controller.rs | 0 .../src/controllers/partitions/mod.rs | 0 .../src/controllers/partitions/reducer.rs | 0 .../src/controllers/spus/actions.rs | 0 .../src/controllers/spus/controller.rs | 0 .../fluvio-sc}/src/controllers/spus/mod.rs | 0 .../src/controllers/spus/reducer.rs | 0 .../src/controllers/topics/actions.rs | 0 .../src/controllers/topics/controller.rs | 0 .../fluvio-sc}/src/controllers/topics/mod.rs | 0 .../src/controllers/topics/policy.rs | 0 .../src/controllers/topics/reducer.rs | 0 .../fluvio-sc}/src/core/common/channels.rs | 0 .../fluvio-sc}/src/core/common/dispatcher.rs | 0 .../fluvio-sc}/src/core/common/mod.rs | 0 .../src/core/common/test_fixtures.rs | 0 .../fluvio-sc}/src/core/context.rs | 0 .../fluvio-sc}/src/core/dispatcher.rs | 0 {src/sc => crates/fluvio-sc}/src/core/mod.rs | 0 .../fluvio-sc}/src/core/world_store.rs | 0 {src/sc => crates/fluvio-sc}/src/error.rs | 0 {src/sc => crates/fluvio-sc}/src/init.rs | 0 .../fluvio-sc}/src/k8/controllers/mod.rs | 0 .../src/k8/controllers/spg_stateful.rs | 0 .../src/k8/controllers/spu_controller.rs | 0 .../src/k8/controllers/spu_service.rs | 0 {src/sc => crates/fluvio-sc}/src/k8/mod.rs | 0 .../fluvio-sc}/src/k8/objects/mod.rs | 0 .../fluvio-sc}/src/k8/objects/spg_group.rs | 0 .../fluvio-sc}/src/k8/objects/spg_service.rs | 0 .../src/k8/objects/spu_k8_config.rs | 0 .../fluvio-sc}/src/k8/objects/spu_service.rs | 0 .../fluvio-sc}/src/k8/objects/statefulset.rs | 0 {src/sc => crates/fluvio-sc}/src/lib.rs | 0 .../fluvio-sc}/src/services/auth/basic.rs | 0 .../fluvio-sc}/src/services/auth/mod.rs | 0 .../fluvio-sc}/src/services/mod.rs | 0 .../src/services/private_api/mod.rs | 0 .../services/private_api/private_server.rs | 0 .../src/services/public_api/api_version.rs | 0 .../src/services/public_api/create.rs | 0 .../src/services/public_api/delete.rs | 0 .../src/services/public_api/list.rs | 0 .../fluvio-sc}/src/services/public_api/mod.rs | 0 .../src/services/public_api/partition/mod.rs | 0 .../src/services/public_api/public_server.rs | 0 .../src/services/public_api/spg/create.rs | 0 .../src/services/public_api/spg/delete.rs | 0 .../src/services/public_api/spg/fetch.rs | 0 .../src/services/public_api/spg/mod.rs | 0 .../src/services/public_api/spu/fetch.rs | 0 .../src/services/public_api/spu/mod.rs | 0 .../spu/register_custom_spus_req.rs | 0 .../spu/unregister_custom_spus_req.rs | 0 .../src/services/public_api/spu/watch.rs | 0 .../src/services/public_api/topic/create.rs | 0 .../src/services/public_api/topic/delete.rs | 0 .../src/services/public_api/topic/fetch.rs | 0 .../src/services/public_api/topic/mod.rs | 0 .../src/services/public_api/watch.rs | 0 .../fluvio-sc}/src/services/send_channels.rs | 0 .../sc => crates/fluvio-sc}/src/stores/mod.rs | 0 .../fluvio-sc}/src/stores/partition.rs | 0 .../sc => crates/fluvio-sc}/src/stores/spg.rs | 0 .../sc => crates/fluvio-sc}/src/stores/spu.rs | 0 .../fluvio-sc}/src/stores/topic.rs | 0 .../fluvio-sc}/src/tests/TESTS.md | 0 .../fluvio-sc}/src/tests/fixture/generator.rs | 0 .../fluvio-sc}/src/tests/fixture/mock_cm.rs | 0 .../fluvio-sc}/src/tests/fixture/mock_kv.rs | 0 .../fluvio-sc}/src/tests/fixture/mock_spu.rs | 0 .../fluvio-sc}/src/tests/fixture/mod.rs | 0 .../src/tests/fixture/test_runner.rs | 0 {src/sc => crates/fluvio-sc}/src/tests/mod.rs | 0 .../fluvio-sc}/src/tests/suite/conn_test.rs | 0 .../fluvio-sc}/src/tests/suite/mod.rs | 0 .../src/tests/suite/partition_test.rs | 0 .../test-data/auth_config/policy.json | 0 .../test-data/auth_config/scopes.json | 0 .../test-data/config/sc_invalid.toml | 0 .../fluvio-sc}/test-data/config/sc_min.toml | 0 .../test-data/config/sc_server.toml | 0 .../fluvio-sc}/test-data/config/sc_tls.toml | 0 .../fluvio-service}/Cargo.toml | 6 +- .../fluvio-service}/LICENSE-APACHE | 0 .../fluvio-service}/src/lib.rs | 0 .../fluvio-service}/src/server.rs | 0 .../fluvio-service}/src/test_request.rs | 0 .../fluvio-smartstream-derive}/Cargo.toml | 2 +- .../fluvio-smartstream-derive}/src/ast.rs | 0 .../src/generator/aggregate.rs | 0 .../src/generator/filter.rs | 0 .../src/generator/map.rs | 0 .../src/generator/mod.rs | 0 .../fluvio-smartstream-derive}/src/lib.rs | 0 .../fluvio-smartstream-derive}/tests/parse.rs | 0 .../ui-tests/pass_filter.rs | 0 .../fluvio-smartstream}/Cargo.toml | 4 +- .../fluvio-smartstream}/LICENSE-APACHE | 0 .../fluvio-smartstream}/README.md | 0 .../examples/.cargo/config.toml | 0 .../fluvio-smartstream}/examples/.gitignore | 0 .../fluvio-smartstream}/examples/Cargo.lock | 0 .../fluvio-smartstream}/examples/Cargo.toml | 0 .../fluvio-smartstream}/examples/Makefile | 0 .../examples/aggregate-average/Cargo.toml | 0 .../examples/aggregate-average/src/lib.rs | 0 .../examples/aggregate-json/Cargo.toml | 0 .../examples/aggregate-json/src/lib.rs | 0 .../examples/aggregate-sum/Cargo.toml | 0 .../examples/aggregate-sum/src/lib.rs | 0 .../examples/aggregate/Cargo.toml | 0 .../examples/aggregate/src/lib.rs | 0 .../examples/filter/Cargo.toml | 0 .../examples/filter/src/lib.rs | 0 .../examples/filter_json/Cargo.toml | 0 .../examples/filter_json/src/lib.rs | 0 .../examples/filter_odd/Cargo.toml | 0 .../examples/filter_odd/src/lib.rs | 0 .../examples/filter_regex/Cargo.toml | 0 .../examples/filter_regex/src/lib.rs | 0 .../examples/map/Cargo.toml | 0 .../examples/map/src/lib.rs | 0 .../examples/map_double/Cargo.toml | 0 .../examples/map_double/src/lib.rs | 0 .../examples/map_json/Cargo.toml | 0 .../examples/map_json/src/lib.rs | 0 .../examples/map_regex/Cargo.toml | 0 .../examples/map_regex/src/lib.rs | 0 .../fluvio-smartstream}/src/lib.rs | 0 .../fluvio-socket}/Cargo.toml | 2 +- .../fluvio-socket}/LICENSE-APACHE | 0 .../socket => crates/fluvio-socket}/README.md | 0 .../fluvio-socket}/certs/.gitignore | 0 .../fluvio-socket}/certs/Makefile | 0 .../fluvio-socket}/certs/cert.conf | 0 .../fluvio-socket}/certs/certs/ca.crt | 0 .../fluvio-socket}/certs/certs/ca.key | 0 .../fluvio-socket}/certs/certs/ca.srl | 0 .../fluvio-socket}/certs/certs/client.crt | 0 .../fluvio-socket}/certs/certs/client.csr | 0 .../fluvio-socket}/certs/certs/client.key | 0 .../fluvio-socket}/certs/certs/client.pfx | Bin .../fluvio-socket}/certs/certs/server.crt | 0 .../fluvio-socket}/certs/certs/server.csr | 0 .../fluvio-socket}/certs/certs/server.key | 0 .../fluvio-socket}/certs/certs/server.pfx | Bin .../fluvio-socket}/certs/nginx.conf | 0 .../fluvio-socket}/certs/openssl-ca.cnf | 0 .../fluvio-socket}/certs/openssl.cnf | 0 .../fluvio-socket}/src/error.rs | 0 .../fluvio-socket}/src/lib.rs | 0 .../fluvio-socket}/src/multiplexing.rs | 0 .../fluvio-socket}/src/sink.rs | 0 .../fluvio-socket}/src/socket.rs | 0 .../fluvio-socket}/src/stream.rs | 0 .../fluvio-socket}/src/test_request.rs | 0 .../fluvio-socket}/tests/enum.rs | 0 .../fluvio-socket}/tests/test.txt | 0 .../fluvio-spu-schema}/Cargo.toml | 4 +- .../fluvio-spu-schema}/LICENSE-APACHE | 0 .../fluvio-spu-schema}/README.md | 0 .../fluvio-spu-schema}/src/client/api.rs | 0 .../fluvio-spu-schema}/src/client/api_key.rs | 0 .../fluvio-spu-schema}/src/client/mod.rs | 0 .../fluvio-spu-schema}/src/client/offset.rs | 0 .../fluvio-spu-schema}/src/lib.rs | 0 .../fluvio-spu-schema}/src/server/api.rs | 0 .../fluvio-spu-schema}/src/server/api_key.rs | 0 .../src/server/fetch_offset.rs | 0 .../fluvio-spu-schema}/src/server/mod.rs | 0 .../src/server/stream_fetch.rs | 0 .../src/server/update_offset.rs | 0 {src/spu => crates/fluvio-spu}/Cargo.toml | 20 ++-- .../fluvio-spu}/LICENSE-APACHE | 0 {src/spu => crates/fluvio-spu}/Makefile | 0 {src/spu => crates/fluvio-spu}/README.md | 0 .../fluvio-spu}/src/config/cli.rs | 0 .../fluvio-spu}/src/config/mod.rs | 0 .../fluvio-spu}/src/config/spu_config.rs | 0 .../fluvio-spu}/src/control_plane/action.rs | 0 .../src/control_plane/dispatcher.rs | 0 .../src/control_plane/message_sink.rs | 0 .../fluvio-spu}/src/control_plane/mod.rs | 0 .../fluvio-spu}/src/core/global_context.rs | 0 .../spu => crates/fluvio-spu}/src/core/mod.rs | 0 .../fluvio-spu}/src/core/replica/metadata.rs | 0 .../fluvio-spu}/src/core/replica/mod.rs | 0 .../fluvio-spu}/src/core/spus/metadata.rs | 0 .../fluvio-spu}/src/core/spus/mod.rs | 0 .../fluvio-spu}/src/core/storage/mod.rs | 0 .../fluvio-spu}/src/core/store.rs | 0 {src/spu => crates/fluvio-spu}/src/error.rs | 0 {src/spu => crates/fluvio-spu}/src/lib.rs | 0 {src/spu => crates/fluvio-spu}/src/main.rs | 0 .../src/replication/follower/api_key.rs | 0 .../src/replication/follower/controller.rs | 0 .../src/replication/follower/mod.rs | 0 .../src/replication/follower/peer_api.rs | 0 .../replication/follower/reject_request.rs | 0 .../src/replication/follower/state.rs | 0 .../src/replication/follower/sync.rs | 0 .../src/replication/leader/actions.rs | 0 .../src/replication/leader/api_key.rs | 0 .../src/replication/leader/connection.rs | 0 .../src/replication/leader/leaders_state.rs | 0 .../fluvio-spu}/src/replication/leader/mod.rs | 0 .../src/replication/leader/peer_api.rs | 0 .../src/replication/leader/replica_state.rs | 0 .../fluvio-spu}/src/replication/leader/spu.rs | 0 .../src/replication/leader/update_offsets.rs | 0 .../fluvio-spu}/src/replication/mod.rs | 0 .../fluvio-spu}/src/replication/test.rs | 0 .../fluvio-spu}/src/services/internal/api.rs | 0 .../services/internal/fetch_stream_request.rs | 0 .../fluvio-spu}/src/services/internal/mod.rs | 0 .../src/services/internal/service_impl.rs | 0 .../fluvio-spu}/src/services/mod.rs | 0 .../src/services/public/api_versions.rs | 0 .../src/services/public/fetch_handler.rs | 0 .../fluvio-spu}/src/services/public/mod.rs | 0 .../src/services/public/offset_request.rs | 0 .../src/services/public/produce_handler.rs | 0 .../src/services/public/service_impl.rs | 0 .../src/services/public/stream_fetch.rs | 2 +- .../fluvio-spu}/src/smart_stream/aggregate.rs | 0 .../src/smart_stream/file_batch.rs | 0 .../fluvio-spu}/src/smart_stream/filter.rs | 0 .../fluvio-spu}/src/smart_stream/map.rs | 0 .../fluvio-spu}/src/smart_stream/memory.rs | 0 .../fluvio-spu}/src/smart_stream/mod.rs | 0 {src/spu => crates/fluvio-spu}/src/start.rs | 0 .../fluvio-spu}/src/storage/mod.rs | 0 .../src/tests/fixture/generator.rs | 0 .../fluvio-spu}/src/tests/fixture/mock_sc.rs | 0 .../fluvio-spu}/src/tests/fixture/mod.rs | 0 .../src/tests/fixture/spu_client.rs | 0 .../src/tests/fixture/test_runner.rs | 0 .../fluvio-spu}/src/tests/mod.rs | 0 .../fluvio-spu}/src/tests/suites/mod.rs | 0 .../src/tests/suites/test_fetch.rs | 0 .../src/tests/suites/test_offsets.rs | 0 .../src/tests/suites/test_replication.rs | 0 .../fluvio-storage}/Cargo.toml | 10 +- .../fluvio-storage}/LICENSE-APACHE | 0 .../fluvio-storage}/README.md | 2 +- .../fluvio-storage}/src/batch.rs | 0 .../fluvio-storage}/src/batch_header.rs | 0 .../fluvio-storage}/src/bin/cli.rs | 0 .../fluvio-storage}/src/checkpoint.rs | 0 .../fluvio-storage}/src/config.rs | 0 .../fluvio-storage}/src/error.rs | 0 .../fluvio-storage}/src/fixture.rs | 0 .../fluvio-storage}/src/index.rs | 0 .../fluvio-storage}/src/lib.rs | 0 .../fluvio-storage}/src/mut_index.rs | 0 .../fluvio-storage}/src/mut_records.rs | 0 .../fluvio-storage}/src/range_map.rs | 0 .../fluvio-storage}/src/records.rs | 0 .../fluvio-storage}/src/replica.rs | 0 .../fluvio-storage}/src/segment.rs | 0 .../fluvio-storage}/src/util.rs | 0 .../fluvio-storage}/src/validator.rs | 0 .../fluvio-storage}/tests/replica_test.rs | 0 .../fluvio-stream-dispatcher}/Cargo.toml | 4 +- .../fluvio-stream-dispatcher}/LICENSE-APACHE | 0 .../fluvio-stream-dispatcher}/src/actions.rs | 0 .../src/dispatcher/k8_dispatcher.rs | 0 .../src/dispatcher/k8_ws_service.rs | 0 .../src/dispatcher/mod.rs | 0 .../fluvio-stream-dispatcher}/src/error.rs | 0 .../fluvio-stream-dispatcher}/src/lib.rs | 0 .../src/store/mod.rs | 0 .../fluvio-stream-model}/Cargo.toml | 1 - .../fluvio-stream-model}/LICENSE-APACHE | 0 .../fluvio-stream-model}/src/core.rs | 0 .../src/epoch/dual_epoch_map.rs | 0 .../src/epoch/epoch_map.rs | 0 .../fluvio-stream-model}/src/epoch/mod.rs | 0 .../fluvio-stream-model}/src/lib.rs | 0 .../fluvio-stream-model}/src/store/actions.rs | 0 .../src/store/concurrent_hashmap.rs | 0 .../src/store/dual_store.rs | 0 .../fluvio-stream-model}/src/store/event.rs | 0 .../fluvio-stream-model}/src/store/filter.rs | 0 .../fluvio-stream-model}/src/store/k8.rs | 0 .../src/store/metadata.rs | 0 .../fluvio-stream-model}/src/store/mod.rs | 0 .../fluvio-system-util}/Cargo.toml | 2 +- .../fluvio-system-util}/LICENSE-APACHE | 0 .../fluvio-system-util}/src/bin.rs | 0 .../fluvio-system-util}/src/config_helper.rs | 0 .../src/counters/counter_tbl.rs | 0 .../src/counters/counters.rs | 0 .../fluvio-system-util}/src/counters/mod.rs | 0 .../fluvio-system-util}/src/generators.rs | 0 .../fluvio-system-util}/src/lib.rs | 0 .../fluvio-test-derive}/Cargo.toml | 10 +- .../fluvio-test-derive}/src/lib.rs | 0 .../fluvio-test-derive}/tests/parse.rs | 0 .../ui-tests/fail_cluster_type.rs | 0 .../ui-tests/fail_invalid_key.rs | 0 .../ui-tests/fail_min_spu_type.rs | 0 .../ui-tests/fail_multi.rs | 0 .../fluvio-test-derive}/ui-tests/fail_name.rs | 0 .../ui-tests/fail_timeout.rs | 0 .../ui-tests/fail_topic_type.rs | 0 .../ui-tests/pass_cluster_type.rs | 0 .../ui-tests/pass_min_spu.rs | 0 .../ui-tests/pass_multi.rs | 0 .../fluvio-test-derive}/ui-tests/pass_name.rs | 0 .../ui-tests/pass_no_macro_args.rs | 0 .../ui-tests/pass_timeout.rs | 0 .../ui-tests/pass_topic.rs | 0 .../wip/fail_cluster_type.stderr | 13 +++ .../wip/fail_invalid_key.stderr | 7 ++ .../wip/fail_min_spu_type.stderr | 13 +++ .../fluvio-test-derive/wip/fail_multi.stderr | 5 + .../fluvio-test-derive/wip/fail_name.stderr | 13 +++ .../wip/fail_no_fn_args.stderr | 35 ++++++ .../wip/fail_timeout.stderr | 21 ++++ .../wip/fail_topic_type.stderr | 7 ++ .../fluvio-test-util}/Cargo.toml | 10 +- .../utils => crates/fluvio-test-util}/lib.rs | 2 +- .../fluvio-test-util}/setup/environment/k8.rs | 0 .../setup/environment/local.rs | 0 .../setup/environment/mod.rs | 0 .../fluvio-test-util}/setup/mod.rs | 0 .../test_meta/derive_attr.rs | 0 .../test_meta/environment.rs | 0 .../fluvio-test-util}/test_meta/mod.rs | 0 .../test_meta/test_result.rs | 0 .../fluvio-test-util}/test_meta/test_timer.rs | 0 .../fluvio-test-util}/test_runner/mod.rs | 0 .../test_runner/test_driver/mod.rs | 0 .../test_runner/test_meta.rs | 0 .../utils => crates/fluvio-test-util}/tls.rs | 0 .../runner => crates/fluvio-test}/Cargo.toml | 20 ++-- .../runner => crates/fluvio-test}/src/lib.rs | 0 .../runner => crates/fluvio-test}/src/main.rs | 22 ++-- .../src/tests/concurrent/consumer.rs | 0 .../fluvio-test}/src/tests/concurrent/mod.rs | 4 +- .../src/tests/concurrent/producer.rs | 0 .../fluvio-test}/src/tests/concurrent/util.rs | 0 .../fluvio-test}/src/tests/mod.rs | 0 .../fluvio-test}/src/tests/producer_stress.rs | 2 +- .../fluvio-test}/src/tests/smoke/consume.rs | 0 .../fluvio-test}/src/tests/smoke/listener.rs | 0 .../fluvio-test}/src/tests/smoke/message.rs | 0 .../fluvio-test}/src/tests/smoke/mod.rs | 3 +- .../fluvio-test}/src/tests/smoke/produce.rs | 0 .../fluvio-test}/src/tests/stress.rs | 0 {src/types => crates/fluvio-types}/Cargo.toml | 2 +- .../fluvio-types}/LICENSE-APACHE | 0 .../fluvio-types}/src/defaults.rs | 0 .../fluvio-types}/src/event.rs | 0 {src/types => crates/fluvio-types}/src/lib.rs | 0 .../fluvio-types}/src/macros.rs | 0 .../fluvio-types}/src/partition.rs | 0 {src/client => crates/fluvio}/Cargo.toml | 16 +-- {src/utils => crates/fluvio}/LICENSE-APACHE | 0 {src/client => crates/fluvio}/README.md | 0 {src/client => crates/fluvio}/src/admin.rs | 0 .../fluvio}/src/config/cluster.rs | 0 .../fluvio}/src/config/config.rs | 0 .../fluvio}/src/config/mod.rs | 0 .../fluvio}/src/config/tls.rs | 0 {src/client => crates/fluvio}/src/consumer.rs | 0 {src/client => crates/fluvio}/src/error.rs | 0 {src/client => crates/fluvio}/src/fluvio.rs | 0 {src/client => crates/fluvio}/src/lib.rs | 0 {src/client => crates/fluvio}/src/offset.rs | 0 {src/client => crates/fluvio}/src/producer.rs | 0 {src/client => crates/fluvio}/src/sockets.rs | 0 {src/client => crates/fluvio}/src/spu.rs | 0 .../fluvio}/src/sync/controller.rs | 0 {src/client => crates/fluvio}/src/sync/mod.rs | 0 .../fluvio}/src/sync/store.rs | 0 .../fluvio}/test-data/profiles/config.toml | 0 .../fluvio}/test-data/profiles/default.toml | 0 .../fluvio}/test-data/profiles/invalid.toml | 0 .../fluvio}/test-data/tls/file.toml | 0 .../fluvio}/test-data/tls/inline.toml | 0 .../fluvio}/test-data/tls/no-verf.toml | 0 doc/TEST.md | 72 ------------- examples/00-produce/Cargo.toml | 4 +- examples/01-produce-batch/Cargo.toml | 2 +- examples/01-produce-key-value/Cargo.toml | 2 +- examples/02-consume/Cargo.toml | 2 +- examples/03-echo/Cargo.toml | 2 +- examples/04-admin-watch/Cargo.toml | 2 +- tests/Makefile | 7 +- tests/README.md | 32 +++--- 663 files changed, 387 insertions(+), 353 deletions(-) rename {src/auth => crates/fluvio-auth}/Cargo.toml (67%) rename {src/auth => crates/fluvio-auth}/LICENSE-APACHE (100%) rename {src/auth => crates/fluvio-auth}/README.md (100%) rename {src/auth => crates/fluvio-auth}/src/error.rs (100%) rename {src/auth => crates/fluvio-auth}/src/lib.rs (100%) rename {src/auth => crates/fluvio-auth}/src/policy.rs (100%) rename {src/auth => crates/fluvio-auth}/src/x509/authenticator.rs (100%) rename {src/auth => crates/fluvio-auth}/src/x509/identity.rs (100%) rename {src/auth => crates/fluvio-auth}/src/x509/mod.rs (100%) rename {src/auth => crates/fluvio-auth}/src/x509/request.rs (100%) rename {src/cli => crates/fluvio-cli}/Cargo.toml (74%) rename {src/cli => crates/fluvio-cli}/LICENSE-APACHE (100%) rename {src/cli => crates/fluvio-cli}/README.md (100%) rename {src/cli => crates/fluvio-cli}/build.rs (100%) rename {src/cli => crates/fluvio-cli}/src/.gitignore (100%) rename {src/cli => crates/fluvio-cli}/src/bin/main.rs (100%) rename {src/cli => crates/fluvio-cli}/src/consume/mod.rs (100%) rename {src/cli => crates/fluvio-cli}/src/consume/record_format.rs (100%) rename {src/cli => crates/fluvio-cli}/src/error.rs (100%) rename {src/cli => crates/fluvio-cli}/src/http.rs (100%) rename {src/cli => crates/fluvio-cli}/src/install/mod.rs (100%) rename {src/cli => crates/fluvio-cli}/src/install/plugins.rs (100%) rename {src/cli => crates/fluvio-cli}/src/install/update.rs (100%) rename {src/cli => crates/fluvio-cli}/src/lib.rs (100%) rename {src/cli => crates/fluvio-cli}/src/metadata.rs (100%) rename {src/cli => crates/fluvio-cli}/src/partition/list.rs (100%) rename {src/cli => crates/fluvio-cli}/src/partition/mod.rs (100%) rename {src/cli => crates/fluvio-cli}/src/produce/mod.rs (100%) rename {src/cli => crates/fluvio-cli}/src/profile/current.rs (100%) rename {src/cli => crates/fluvio-cli}/src/profile/delete_cluster.rs (100%) rename {src/cli => crates/fluvio-cli}/src/profile/delete_profile.rs (100%) rename {src/cli => crates/fluvio-cli}/src/profile/list.rs (100%) rename {src/cli => crates/fluvio-cli}/src/profile/mod.rs (100%) rename {src/cli => crates/fluvio-cli}/src/profile/rename.rs (100%) rename {src/cli => crates/fluvio-cli}/src/profile/switch.rs (100%) rename {src/cli => crates/fluvio-cli}/src/profile/sync/k8.rs (100%) rename {src/cli => crates/fluvio-cli}/src/profile/sync/local.rs (100%) rename {src/cli => crates/fluvio-cli}/src/profile/sync/mod.rs (100%) rename {src/cli => crates/fluvio-cli}/src/topic/create.rs (100%) rename {src/cli => crates/fluvio-cli}/src/topic/delete.rs (100%) rename {src/cli => crates/fluvio-cli}/src/topic/describe.rs (100%) rename {src/cli => crates/fluvio-cli}/src/topic/list.rs (100%) rename {src/cli => crates/fluvio-cli}/src/topic/mod.rs (100%) rename {src/cli => crates/fluvio-cli}/src/version.rs (100%) rename {src/cli => crates/fluvio-cli}/test-data/group-cfg/valid_config.json (100%) rename {src/cli => crates/fluvio-cli}/test-data/input-files/icon1.png (100%) rename {src/cli => crates/fluvio-cli}/test-data/input-files/icon2.png (100%) rename {src/cli => crates/fluvio-cli}/test-data/input-files/json-file.json (100%) rename {src/cli => crates/fluvio-cli}/test-data/input-files/text-file.txt (100%) rename {src/cli => crates/fluvio-cli}/test-data/topics/out_of_order.json (100%) rename {src/cli => crates/fluvio-cli}/test-data/topics/valid_assignment.json (100%) rename {src/cli => crates/fluvio-cli}/test-data/topics/valid_assignment1.json (100%) rename {src/cli => crates/fluvio-cli}/test-data/topics/valid_kf_assignment.json (100%) rename {src/cluster => crates/fluvio-cluster}/Cargo.toml (83%) rename {src/client => crates/fluvio-cluster}/LICENSE-APACHE (100%) rename {src/cluster => crates/fluvio-cluster}/Makefile (100%) rename {src/cluster => crates/fluvio-cluster}/build.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/charts/chart.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/charts/location.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/charts/mod.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/check/mod.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/check/render.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/cli/check.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/cli/delete.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/cli/error.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/cli/group/create.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/cli/group/delete.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/cli/group/list.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/cli/group/mod.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/cli/mod.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/cli/spu/display.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/cli/spu/list.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/cli/spu/mod.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/cli/spu/register.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/cli/spu/unregister.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/cli/start/k8.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/cli/start/local.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/cli/start/mod.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/cli/start/sys.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/cli/start/tls.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/cli/util.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/delete.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/error.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/lib.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/start/common.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/start/k8.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/start/local.rs (100%) rename {src/cluster => crates/fluvio-cluster}/src/start/mod.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/Cargo.toml (68%) rename {src/cluster => crates/fluvio-controlplane-metadata}/LICENSE-APACHE (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/README.md (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/lib.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/message/mod.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/message/msg_type.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/message/replica_msg.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/partition/k8.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/partition/mod.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/partition/policy.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/partition/replica.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/partition/spec.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/partition/status.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/partition/store.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/spg/k8/mod.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/spg/k8/spec.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/spg/mod.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/spg/spec.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/spg/status.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/spg/store.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/spu/k8.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/spu/mod.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/spu/spec.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/spu/status.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/spu/store.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/topic/k8.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/topic/mod.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/topic/spec.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/topic/status.rs (100%) rename {src/controlplane-metadata => crates/fluvio-controlplane-metadata}/src/topic/store.rs (100%) rename {src/controlplane => crates/fluvio-controlplane}/Cargo.toml (51%) rename {src/controlplane-metadata => crates/fluvio-controlplane}/LICENSE-APACHE (100%) rename {src/controlplane => crates/fluvio-controlplane}/src/lib.rs (100%) rename {src/controlplane => crates/fluvio-controlplane}/src/requests/mod.rs (100%) rename {src/controlplane => crates/fluvio-controlplane}/src/requests/register_spu.rs (100%) rename {src/controlplane => crates/fluvio-controlplane}/src/requests/remove.rs (100%) rename {src/controlplane => crates/fluvio-controlplane}/src/requests/update_lrs.rs (100%) rename {src/controlplane => crates/fluvio-controlplane}/src/requests/update_replica.rs (100%) rename {src/controlplane => crates/fluvio-controlplane}/src/requests/update_spu.rs (100%) rename {src/controlplane => crates/fluvio-controlplane}/src/sc_api.rs (100%) rename {src/controlplane => crates/fluvio-controlplane}/src/spu_api.rs (100%) rename {src/dataplane-protocol => crates/fluvio-dataplane-protocol}/Cargo.toml (86%) rename {src/controlplane => crates/fluvio-dataplane-protocol}/LICENSE-APACHE (100%) rename {src/dataplane-protocol => crates/fluvio-dataplane-protocol}/README.md (100%) rename {src/dataplane-protocol => crates/fluvio-dataplane-protocol}/src/batch.rs (100%) rename {src/dataplane-protocol => crates/fluvio-dataplane-protocol}/src/common.rs (100%) rename {src/dataplane-protocol => crates/fluvio-dataplane-protocol}/src/error_code.rs (100%) rename {src/dataplane-protocol => crates/fluvio-dataplane-protocol}/src/fetch/mod.rs (100%) rename {src/dataplane-protocol => crates/fluvio-dataplane-protocol}/src/fetch/request.rs (100%) rename {src/dataplane-protocol => crates/fluvio-dataplane-protocol}/src/fetch/response.rs (100%) rename {src/dataplane-protocol => crates/fluvio-dataplane-protocol}/src/fixture.rs (100%) rename {src/dataplane-protocol => crates/fluvio-dataplane-protocol}/src/lib.rs (100%) rename {src/dataplane-protocol => crates/fluvio-dataplane-protocol}/src/produce/mod.rs (100%) rename {src/dataplane-protocol => crates/fluvio-dataplane-protocol}/src/produce/request.rs (100%) rename {src/dataplane-protocol => crates/fluvio-dataplane-protocol}/src/produce/response.rs (100%) rename {src/dataplane-protocol => crates/fluvio-dataplane-protocol}/src/record.rs (100%) rename {src/dataplane-protocol => crates/fluvio-dataplane-protocol}/src/smartstream.rs (100%) rename {src/dataplane-protocol => crates/fluvio-dataplane-protocol}/src/versions.rs (100%) rename {src/dataplane-protocol => crates/fluvio-dataplane-protocol}/tests/file_fetch.rs (100%) rename {src/dataplane-protocol => crates/fluvio-dataplane-protocol}/tests/test_old_record_empty_key.bin (100%) rename {src/extension-common => crates/fluvio-extension-common}/Cargo.toml (83%) rename {src/dataplane-protocol => crates/fluvio-extension-common}/LICENSE-APACHE (100%) rename {src/extension-common => crates/fluvio-extension-common}/README.md (100%) rename {src/extension-common => crates/fluvio-extension-common}/src/common/hex_dump.rs (100%) rename {src/extension-common => crates/fluvio-extension-common}/src/common/mod.rs (100%) rename {src/extension-common => crates/fluvio-extension-common}/src/lib.rs (100%) rename {src/extension-common => crates/fluvio-extension-common}/src/output/describe.rs (100%) rename {src/extension-common => crates/fluvio-extension-common}/src/output/mod.rs (100%) rename {src/extension-common => crates/fluvio-extension-common}/src/output/serde.rs (100%) rename {src/extension-common => crates/fluvio-extension-common}/src/output/table.rs (100%) rename {src/extension-common => crates/fluvio-extension-common}/src/tls.rs (100%) rename {src/package-index => crates/fluvio-package-index}/Cargo.toml (100%) rename {src/extension-common => crates/fluvio-package-index}/LICENSE-APACHE (100%) rename {src/package-index => crates/fluvio-package-index}/build.rs (100%) rename {src/package-index => crates/fluvio-package-index}/src/error.rs (100%) rename {src/package-index => crates/fluvio-package-index}/src/http.rs (100%) rename {src/package-index => crates/fluvio-package-index}/src/lib.rs (100%) rename {src/package-index => crates/fluvio-package-index}/src/package.rs (100%) rename {src/package-index => crates/fluvio-package-index}/src/package_id.rs (100%) rename {src/package-index => crates/fluvio-package-index}/src/tags.rs (100%) rename {src/package-index => crates/fluvio-package-index}/src/target.rs (100%) rename {src/package-index => crates/fluvio-package-index}/src/version.rs (100%) rename {src/protocol => crates}/fluvio-protocol-api/Cargo.toml (100%) rename {src/package-index => crates/fluvio-protocol-api}/LICENSE-APACHE (100%) rename {src/protocol => crates}/fluvio-protocol-api/README.md (100%) rename {src/protocol => crates}/fluvio-protocol-api/src/api.rs (100%) rename {src/protocol => crates}/fluvio-protocol-api/src/lib.rs (100%) rename {src/protocol => crates}/fluvio-protocol-api/src/request.rs (100%) rename {src/protocol => crates}/fluvio-protocol-api/src/response.rs (100%) rename {src/protocol => crates}/fluvio-protocol-codec/Cargo.lock (100%) rename {src/protocol => crates}/fluvio-protocol-codec/Cargo.toml (100%) rename {src/protocol => crates/fluvio-protocol-codec}/LICENSE-APACHE (100%) rename {src/protocol => crates}/fluvio-protocol-codec/README.md (100%) rename {src/protocol => crates}/fluvio-protocol-codec/src/codec.rs (100%) rename {src/protocol => crates}/fluvio-protocol-codec/src/lib.rs (100%) rename {src/protocol => crates}/fluvio-protocol-core/Cargo.lock (100%) rename {src/protocol => crates}/fluvio-protocol-core/Cargo.toml (99%) rename {src/protocol/fluvio-protocol-api => crates/fluvio-protocol-core}/LICENSE-APACHE (100%) rename {src/protocol => crates}/fluvio-protocol-core/README.md (100%) rename {src/protocol => crates}/fluvio-protocol-core/src/buffer.rs (100%) rename {src/protocol => crates}/fluvio-protocol-core/src/decoder.rs (100%) rename {src/protocol => crates}/fluvio-protocol-core/src/encoder.rs (100%) rename {src/protocol => crates}/fluvio-protocol-core/src/lib.rs (100%) rename {src/protocol => crates}/fluvio-protocol-core/src/varint.rs (100%) rename {src/protocol => crates}/fluvio-protocol-core/src/zerocopy.rs (100%) rename {src/protocol => crates}/fluvio-protocol-derive/Cargo.lock (100%) rename {src/protocol => crates}/fluvio-protocol-derive/Cargo.toml (85%) rename {src/protocol/fluvio-protocol-codec => crates/fluvio-protocol-derive}/LICENSE-APACHE (100%) rename {src/protocol => crates}/fluvio-protocol-derive/README.md (100%) rename {src/protocol => crates}/fluvio-protocol-derive/rustfmt.toml (100%) rename {src/protocol => crates}/fluvio-protocol-derive/src/api.rs (100%) rename {src/protocol => crates}/fluvio-protocol-derive/src/ast/container.rs (100%) rename {src/protocol => crates}/fluvio-protocol-derive/src/ast/enum.rs (100%) rename {src/protocol => crates}/fluvio-protocol-derive/src/ast/mod.rs (100%) rename {src/protocol => crates}/fluvio-protocol-derive/src/ast/prop.rs (100%) rename {src/protocol => crates}/fluvio-protocol-derive/src/ast/struct.rs (100%) rename {src/protocol => crates}/fluvio-protocol-derive/src/de.rs (100%) rename {src/protocol => crates}/fluvio-protocol-derive/src/lib.rs (100%) rename {src/protocol => crates}/fluvio-protocol-derive/src/ser.rs (100%) rename {src/protocol => crates}/fluvio-protocol-derive/src/util.rs (100%) rename {src/protocol => crates}/fluvio-protocol-derive/tests/parse.rs (100%) rename {src/protocol => crates}/fluvio-protocol-derive/ui-tests/pass_derive_decode.rs (100%) rename {src/protocol => crates}/fluvio-protocol-derive/ui-tests/pass_derive_encode.rs (100%) rename {src/protocol => crates/fluvio-protocol}/.github/workflows/ci.yml (100%) rename {src/protocol => crates/fluvio-protocol}/.gitignore (100%) rename {src/protocol => crates/fluvio-protocol}/CODE-OF-CONDUCT.md (100%) rename {src/protocol => crates/fluvio-protocol}/CONTRIBUTING.md (100%) rename {src/protocol => crates/fluvio-protocol}/Cargo.lock (100%) rename {src/protocol => crates/fluvio-protocol}/Cargo.toml (53%) rename {src/protocol/fluvio-protocol-core => crates/fluvio-protocol}/LICENSE-APACHE (100%) rename {src/protocol => crates/fluvio-protocol}/Makefile (100%) rename {src/protocol => crates/fluvio-protocol}/README.md (100%) rename {src/protocol => crates/fluvio-protocol}/send-b-client.sh (100%) rename {src/protocol => crates/fluvio-protocol}/src/lib.rs (100%) rename {src/protocol => crates/fluvio-protocol}/src/store.rs (100%) rename {src/protocol => crates/fluvio-protocol}/test-client.sh (100%) rename {src/protocol => crates/fluvio-protocol}/tests/api.rs (100%) rename {src/protocol => crates/fluvio-protocol}/tests/btreemap.rs (100%) rename {src/protocol => crates/fluvio-protocol}/tests/decode.rs (100%) rename {src/protocol => crates/fluvio-protocol}/tests/default.rs (100%) rename {src/protocol => crates/fluvio-protocol}/tests/encode.rs (100%) rename {src/protocol => crates/fluvio-protocol}/tests/enum.rs (100%) rename {src/protocol => crates/fluvio-protocol}/tests/generic.rs (100%) rename {src/protocol => crates/fluvio-protocol}/tests/option.rs (100%) rename {src/protocol => crates/fluvio-protocol}/tests/version.rs (100%) rename {src/runner => crates/fluvio-run}/Cargo.toml (78%) rename {src/runner => crates/fluvio-run}/src/bin/main.rs (100%) rename {src/runner => crates/fluvio-run}/src/error.rs (100%) rename {src/runner => crates/fluvio-run}/src/lib.rs (100%) rename {src/sc-schema => crates/fluvio-sc-schema}/Cargo.toml (67%) rename {src/protocol/fluvio-protocol-derive => crates/fluvio-sc-schema}/LICENSE-APACHE (100%) rename {src/sc-schema => crates/fluvio-sc-schema}/README.md (100%) rename {src/sc-schema => crates/fluvio-sc-schema}/src/apis.rs (100%) rename {src/sc-schema => crates/fluvio-sc-schema}/src/lib.rs (100%) rename {src/sc-schema => crates/fluvio-sc-schema}/src/objects/create.rs (100%) rename {src/sc-schema => crates/fluvio-sc-schema}/src/objects/delete.rs (100%) rename {src/sc-schema => crates/fluvio-sc-schema}/src/objects/list.rs (100%) rename {src/sc-schema => crates/fluvio-sc-schema}/src/objects/mod.rs (100%) rename {src/sc-schema => crates/fluvio-sc-schema}/src/objects/watch.rs (100%) rename {src/sc-schema => crates/fluvio-sc-schema}/src/partition/mod.rs (100%) rename {src/sc-schema => crates/fluvio-sc-schema}/src/request.rs (100%) rename {src/sc-schema => crates/fluvio-sc-schema}/src/response.rs (100%) rename {src/sc-schema => crates/fluvio-sc-schema}/src/spg/mod.rs (100%) rename {src/sc-schema => crates/fluvio-sc-schema}/src/spu/mod.rs (100%) rename {src/sc-schema => crates/fluvio-sc-schema}/src/topic/mod.rs (100%) rename {src/sc-schema => crates/fluvio-sc-schema}/src/versions.rs (100%) rename {src/sc => crates/fluvio-sc}/Cargo.toml (62%) rename {src/sc-schema => crates/fluvio-sc}/LICENSE-APACHE (100%) rename {src/sc => crates/fluvio-sc}/README.md (100%) rename {src/sc => crates/fluvio-sc}/build.rs (100%) rename {src/sc => crates/fluvio-sc}/src/bin/k8.rs (100%) rename {src/sc => crates/fluvio-sc}/src/cli.rs (100%) rename {src/sc => crates/fluvio-sc}/src/config/mod.rs (100%) rename {src/sc => crates/fluvio-sc}/src/config/sc_config.rs (100%) rename {src/sc => crates/fluvio-sc}/src/controllers/mod.rs (100%) rename {src/sc => crates/fluvio-sc}/src/controllers/partitions/Test.MD (100%) rename {src/sc => crates/fluvio-sc}/src/controllers/partitions/controller.rs (100%) rename {src/sc => crates/fluvio-sc}/src/controllers/partitions/mod.rs (100%) rename {src/sc => crates/fluvio-sc}/src/controllers/partitions/reducer.rs (100%) rename {src/sc => crates/fluvio-sc}/src/controllers/spus/actions.rs (100%) rename {src/sc => crates/fluvio-sc}/src/controllers/spus/controller.rs (100%) rename {src/sc => crates/fluvio-sc}/src/controllers/spus/mod.rs (100%) rename {src/sc => crates/fluvio-sc}/src/controllers/spus/reducer.rs (100%) rename {src/sc => crates/fluvio-sc}/src/controllers/topics/actions.rs (100%) rename {src/sc => crates/fluvio-sc}/src/controllers/topics/controller.rs (100%) rename {src/sc => crates/fluvio-sc}/src/controllers/topics/mod.rs (100%) rename {src/sc => crates/fluvio-sc}/src/controllers/topics/policy.rs (100%) rename {src/sc => crates/fluvio-sc}/src/controllers/topics/reducer.rs (100%) rename {src/sc => crates/fluvio-sc}/src/core/common/channels.rs (100%) rename {src/sc => crates/fluvio-sc}/src/core/common/dispatcher.rs (100%) rename {src/sc => crates/fluvio-sc}/src/core/common/mod.rs (100%) rename {src/sc => crates/fluvio-sc}/src/core/common/test_fixtures.rs (100%) rename {src/sc => crates/fluvio-sc}/src/core/context.rs (100%) rename {src/sc => crates/fluvio-sc}/src/core/dispatcher.rs (100%) rename {src/sc => crates/fluvio-sc}/src/core/mod.rs (100%) rename {src/sc => crates/fluvio-sc}/src/core/world_store.rs (100%) rename {src/sc => crates/fluvio-sc}/src/error.rs (100%) rename {src/sc => crates/fluvio-sc}/src/init.rs (100%) rename {src/sc => crates/fluvio-sc}/src/k8/controllers/mod.rs (100%) rename {src/sc => crates/fluvio-sc}/src/k8/controllers/spg_stateful.rs (100%) rename {src/sc => crates/fluvio-sc}/src/k8/controllers/spu_controller.rs (100%) rename {src/sc => crates/fluvio-sc}/src/k8/controllers/spu_service.rs (100%) rename {src/sc => crates/fluvio-sc}/src/k8/mod.rs (100%) rename {src/sc => crates/fluvio-sc}/src/k8/objects/mod.rs (100%) rename {src/sc => crates/fluvio-sc}/src/k8/objects/spg_group.rs (100%) rename {src/sc => crates/fluvio-sc}/src/k8/objects/spg_service.rs (100%) rename {src/sc => crates/fluvio-sc}/src/k8/objects/spu_k8_config.rs (100%) rename {src/sc => crates/fluvio-sc}/src/k8/objects/spu_service.rs (100%) rename {src/sc => crates/fluvio-sc}/src/k8/objects/statefulset.rs (100%) rename {src/sc => crates/fluvio-sc}/src/lib.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/auth/basic.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/auth/mod.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/mod.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/private_api/mod.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/private_api/private_server.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/public_api/api_version.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/public_api/create.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/public_api/delete.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/public_api/list.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/public_api/mod.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/public_api/partition/mod.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/public_api/public_server.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/public_api/spg/create.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/public_api/spg/delete.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/public_api/spg/fetch.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/public_api/spg/mod.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/public_api/spu/fetch.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/public_api/spu/mod.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/public_api/spu/register_custom_spus_req.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/public_api/spu/unregister_custom_spus_req.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/public_api/spu/watch.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/public_api/topic/create.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/public_api/topic/delete.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/public_api/topic/fetch.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/public_api/topic/mod.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/public_api/watch.rs (100%) rename {src/sc => crates/fluvio-sc}/src/services/send_channels.rs (100%) rename {src/sc => crates/fluvio-sc}/src/stores/mod.rs (100%) rename {src/sc => crates/fluvio-sc}/src/stores/partition.rs (100%) rename {src/sc => crates/fluvio-sc}/src/stores/spg.rs (100%) rename {src/sc => crates/fluvio-sc}/src/stores/spu.rs (100%) rename {src/sc => crates/fluvio-sc}/src/stores/topic.rs (100%) rename {src/sc => crates/fluvio-sc}/src/tests/TESTS.md (100%) rename {src/sc => crates/fluvio-sc}/src/tests/fixture/generator.rs (100%) rename {src/sc => crates/fluvio-sc}/src/tests/fixture/mock_cm.rs (100%) rename {src/sc => crates/fluvio-sc}/src/tests/fixture/mock_kv.rs (100%) rename {src/sc => crates/fluvio-sc}/src/tests/fixture/mock_spu.rs (100%) rename {src/sc => crates/fluvio-sc}/src/tests/fixture/mod.rs (100%) rename {src/sc => crates/fluvio-sc}/src/tests/fixture/test_runner.rs (100%) rename {src/sc => crates/fluvio-sc}/src/tests/mod.rs (100%) rename {src/sc => crates/fluvio-sc}/src/tests/suite/conn_test.rs (100%) rename {src/sc => crates/fluvio-sc}/src/tests/suite/mod.rs (100%) rename {src/sc => crates/fluvio-sc}/src/tests/suite/partition_test.rs (100%) rename {src/sc => crates/fluvio-sc}/test-data/auth_config/policy.json (100%) rename {src/sc => crates/fluvio-sc}/test-data/auth_config/scopes.json (100%) rename {src/sc => crates/fluvio-sc}/test-data/config/sc_invalid.toml (100%) rename {src/sc => crates/fluvio-sc}/test-data/config/sc_min.toml (100%) rename {src/sc => crates/fluvio-sc}/test-data/config/sc_server.toml (100%) rename {src/sc => crates/fluvio-sc}/test-data/config/sc_tls.toml (100%) rename {src/service => crates/fluvio-service}/Cargo.toml (80%) rename {src/sc => crates/fluvio-service}/LICENSE-APACHE (100%) rename {src/service => crates/fluvio-service}/src/lib.rs (100%) rename {src/service => crates/fluvio-service}/src/server.rs (100%) rename {src/service => crates/fluvio-service}/src/test_request.rs (100%) rename {src/smartstream/derive => crates/fluvio-smartstream-derive}/Cargo.toml (91%) rename {src/smartstream/derive => crates/fluvio-smartstream-derive}/src/ast.rs (100%) rename {src/smartstream/derive => crates/fluvio-smartstream-derive}/src/generator/aggregate.rs (100%) rename {src/smartstream/derive => crates/fluvio-smartstream-derive}/src/generator/filter.rs (100%) rename {src/smartstream/derive => crates/fluvio-smartstream-derive}/src/generator/map.rs (100%) rename {src/smartstream/derive => crates/fluvio-smartstream-derive}/src/generator/mod.rs (100%) rename {src/smartstream/derive => crates/fluvio-smartstream-derive}/src/lib.rs (100%) rename {src/smartstream/derive => crates/fluvio-smartstream-derive}/tests/parse.rs (100%) rename {src/smartstream/derive => crates/fluvio-smartstream-derive}/ui-tests/pass_filter.rs (100%) rename {src/smartstream => crates/fluvio-smartstream}/Cargo.toml (70%) rename {src/service => crates/fluvio-smartstream}/LICENSE-APACHE (100%) rename {src/smartstream => crates/fluvio-smartstream}/README.md (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/.cargo/config.toml (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/.gitignore (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/Cargo.lock (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/Cargo.toml (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/Makefile (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/aggregate-average/Cargo.toml (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/aggregate-average/src/lib.rs (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/aggregate-json/Cargo.toml (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/aggregate-json/src/lib.rs (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/aggregate-sum/Cargo.toml (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/aggregate-sum/src/lib.rs (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/aggregate/Cargo.toml (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/aggregate/src/lib.rs (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/filter/Cargo.toml (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/filter/src/lib.rs (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/filter_json/Cargo.toml (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/filter_json/src/lib.rs (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/filter_odd/Cargo.toml (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/filter_odd/src/lib.rs (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/filter_regex/Cargo.toml (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/filter_regex/src/lib.rs (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/map/Cargo.toml (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/map/src/lib.rs (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/map_double/Cargo.toml (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/map_double/src/lib.rs (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/map_json/Cargo.toml (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/map_json/src/lib.rs (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/map_regex/Cargo.toml (100%) rename {src/smartstream => crates/fluvio-smartstream}/examples/map_regex/src/lib.rs (100%) rename {src/smartstream => crates/fluvio-smartstream}/src/lib.rs (100%) rename {src/socket => crates/fluvio-socket}/Cargo.toml (93%) rename {src/smartstream => crates/fluvio-socket}/LICENSE-APACHE (100%) rename {src/socket => crates/fluvio-socket}/README.md (100%) rename {src/socket => crates/fluvio-socket}/certs/.gitignore (100%) rename {src/socket => crates/fluvio-socket}/certs/Makefile (100%) rename {src/socket => crates/fluvio-socket}/certs/cert.conf (100%) rename {src/socket => crates/fluvio-socket}/certs/certs/ca.crt (100%) rename {src/socket => crates/fluvio-socket}/certs/certs/ca.key (100%) rename {src/socket => crates/fluvio-socket}/certs/certs/ca.srl (100%) rename {src/socket => crates/fluvio-socket}/certs/certs/client.crt (100%) rename {src/socket => crates/fluvio-socket}/certs/certs/client.csr (100%) rename {src/socket => crates/fluvio-socket}/certs/certs/client.key (100%) rename {src/socket => crates/fluvio-socket}/certs/certs/client.pfx (100%) rename {src/socket => crates/fluvio-socket}/certs/certs/server.crt (100%) rename {src/socket => crates/fluvio-socket}/certs/certs/server.csr (100%) rename {src/socket => crates/fluvio-socket}/certs/certs/server.key (100%) rename {src/socket => crates/fluvio-socket}/certs/certs/server.pfx (100%) rename {src/socket => crates/fluvio-socket}/certs/nginx.conf (100%) rename {src/socket => crates/fluvio-socket}/certs/openssl-ca.cnf (100%) rename {src/socket => crates/fluvio-socket}/certs/openssl.cnf (100%) rename {src/socket => crates/fluvio-socket}/src/error.rs (100%) rename {src/socket => crates/fluvio-socket}/src/lib.rs (100%) rename {src/socket => crates/fluvio-socket}/src/multiplexing.rs (100%) rename {src/socket => crates/fluvio-socket}/src/sink.rs (100%) rename {src/socket => crates/fluvio-socket}/src/socket.rs (100%) rename {src/socket => crates/fluvio-socket}/src/stream.rs (100%) rename {src/socket => crates/fluvio-socket}/src/test_request.rs (100%) rename {src/socket => crates/fluvio-socket}/tests/enum.rs (100%) rename {src/socket => crates/fluvio-socket}/tests/test.txt (100%) rename {src/spu-schema => crates/fluvio-spu-schema}/Cargo.toml (74%) rename {src/socket => crates/fluvio-spu-schema}/LICENSE-APACHE (100%) rename {src/spu-schema => crates/fluvio-spu-schema}/README.md (100%) rename {src/spu-schema => crates/fluvio-spu-schema}/src/client/api.rs (100%) rename {src/spu-schema => crates/fluvio-spu-schema}/src/client/api_key.rs (100%) rename {src/spu-schema => crates/fluvio-spu-schema}/src/client/mod.rs (100%) rename {src/spu-schema => crates/fluvio-spu-schema}/src/client/offset.rs (100%) rename {src/spu-schema => crates/fluvio-spu-schema}/src/lib.rs (100%) rename {src/spu-schema => crates/fluvio-spu-schema}/src/server/api.rs (100%) rename {src/spu-schema => crates/fluvio-spu-schema}/src/server/api_key.rs (100%) rename {src/spu-schema => crates/fluvio-spu-schema}/src/server/fetch_offset.rs (100%) rename {src/spu-schema => crates/fluvio-spu-schema}/src/server/mod.rs (100%) rename {src/spu-schema => crates/fluvio-spu-schema}/src/server/stream_fetch.rs (100%) rename {src/spu-schema => crates/fluvio-spu-schema}/src/server/update_offset.rs (100%) rename {src/spu => crates/fluvio-spu}/Cargo.toml (66%) rename {src/spu-schema => crates/fluvio-spu}/LICENSE-APACHE (100%) rename {src/spu => crates/fluvio-spu}/Makefile (100%) rename {src/spu => crates/fluvio-spu}/README.md (100%) rename {src/spu => crates/fluvio-spu}/src/config/cli.rs (100%) rename {src/spu => crates/fluvio-spu}/src/config/mod.rs (100%) rename {src/spu => crates/fluvio-spu}/src/config/spu_config.rs (100%) rename {src/spu => crates/fluvio-spu}/src/control_plane/action.rs (100%) rename {src/spu => crates/fluvio-spu}/src/control_plane/dispatcher.rs (100%) rename {src/spu => crates/fluvio-spu}/src/control_plane/message_sink.rs (100%) rename {src/spu => crates/fluvio-spu}/src/control_plane/mod.rs (100%) rename {src/spu => crates/fluvio-spu}/src/core/global_context.rs (100%) rename {src/spu => crates/fluvio-spu}/src/core/mod.rs (100%) rename {src/spu => crates/fluvio-spu}/src/core/replica/metadata.rs (100%) rename {src/spu => crates/fluvio-spu}/src/core/replica/mod.rs (100%) rename {src/spu => crates/fluvio-spu}/src/core/spus/metadata.rs (100%) rename {src/spu => crates/fluvio-spu}/src/core/spus/mod.rs (100%) rename {src/spu => crates/fluvio-spu}/src/core/storage/mod.rs (100%) rename {src/spu => crates/fluvio-spu}/src/core/store.rs (100%) rename {src/spu => crates/fluvio-spu}/src/error.rs (100%) rename {src/spu => crates/fluvio-spu}/src/lib.rs (100%) rename {src/spu => crates/fluvio-spu}/src/main.rs (100%) rename {src/spu => crates/fluvio-spu}/src/replication/follower/api_key.rs (100%) rename {src/spu => crates/fluvio-spu}/src/replication/follower/controller.rs (100%) rename {src/spu => crates/fluvio-spu}/src/replication/follower/mod.rs (100%) rename {src/spu => crates/fluvio-spu}/src/replication/follower/peer_api.rs (100%) rename {src/spu => crates/fluvio-spu}/src/replication/follower/reject_request.rs (100%) rename {src/spu => crates/fluvio-spu}/src/replication/follower/state.rs (100%) rename {src/spu => crates/fluvio-spu}/src/replication/follower/sync.rs (100%) rename {src/spu => crates/fluvio-spu}/src/replication/leader/actions.rs (100%) rename {src/spu => crates/fluvio-spu}/src/replication/leader/api_key.rs (100%) rename {src/spu => crates/fluvio-spu}/src/replication/leader/connection.rs (100%) rename {src/spu => crates/fluvio-spu}/src/replication/leader/leaders_state.rs (100%) rename {src/spu => crates/fluvio-spu}/src/replication/leader/mod.rs (100%) rename {src/spu => crates/fluvio-spu}/src/replication/leader/peer_api.rs (100%) rename {src/spu => crates/fluvio-spu}/src/replication/leader/replica_state.rs (100%) rename {src/spu => crates/fluvio-spu}/src/replication/leader/spu.rs (100%) rename {src/spu => crates/fluvio-spu}/src/replication/leader/update_offsets.rs (100%) rename {src/spu => crates/fluvio-spu}/src/replication/mod.rs (100%) rename {src/spu => crates/fluvio-spu}/src/replication/test.rs (100%) rename {src/spu => crates/fluvio-spu}/src/services/internal/api.rs (100%) rename {src/spu => crates/fluvio-spu}/src/services/internal/fetch_stream_request.rs (100%) rename {src/spu => crates/fluvio-spu}/src/services/internal/mod.rs (100%) rename {src/spu => crates/fluvio-spu}/src/services/internal/service_impl.rs (100%) rename {src/spu => crates/fluvio-spu}/src/services/mod.rs (100%) rename {src/spu => crates/fluvio-spu}/src/services/public/api_versions.rs (100%) rename {src/spu => crates/fluvio-spu}/src/services/public/fetch_handler.rs (100%) rename {src/spu => crates/fluvio-spu}/src/services/public/mod.rs (100%) rename {src/spu => crates/fluvio-spu}/src/services/public/offset_request.rs (100%) rename {src/spu => crates/fluvio-spu}/src/services/public/produce_handler.rs (100%) rename {src/spu => crates/fluvio-spu}/src/services/public/service_impl.rs (100%) rename {src/spu => crates/fluvio-spu}/src/services/public/stream_fetch.rs (99%) rename {src/spu => crates/fluvio-spu}/src/smart_stream/aggregate.rs (100%) rename {src/spu => crates/fluvio-spu}/src/smart_stream/file_batch.rs (100%) rename {src/spu => crates/fluvio-spu}/src/smart_stream/filter.rs (100%) rename {src/spu => crates/fluvio-spu}/src/smart_stream/map.rs (100%) rename {src/spu => crates/fluvio-spu}/src/smart_stream/memory.rs (100%) rename {src/spu => crates/fluvio-spu}/src/smart_stream/mod.rs (100%) rename {src/spu => crates/fluvio-spu}/src/start.rs (100%) rename {src/spu => crates/fluvio-spu}/src/storage/mod.rs (100%) rename {src/spu => crates/fluvio-spu}/src/tests/fixture/generator.rs (100%) rename {src/spu => crates/fluvio-spu}/src/tests/fixture/mock_sc.rs (100%) rename {src/spu => crates/fluvio-spu}/src/tests/fixture/mod.rs (100%) rename {src/spu => crates/fluvio-spu}/src/tests/fixture/spu_client.rs (100%) rename {src/spu => crates/fluvio-spu}/src/tests/fixture/test_runner.rs (100%) rename {src/spu => crates/fluvio-spu}/src/tests/mod.rs (100%) rename {src/spu => crates/fluvio-spu}/src/tests/suites/mod.rs (100%) rename {src/spu => crates/fluvio-spu}/src/tests/suites/test_fetch.rs (100%) rename {src/spu => crates/fluvio-spu}/src/tests/suites/test_offsets.rs (100%) rename {src/spu => crates/fluvio-spu}/src/tests/suites/test_replication.rs (100%) rename {src/storage => crates/fluvio-storage}/Cargo.toml (67%) rename {src/spu => crates/fluvio-storage}/LICENSE-APACHE (100%) rename {src/storage => crates/fluvio-storage}/README.md (69%) rename {src/storage => crates/fluvio-storage}/src/batch.rs (100%) rename {src/storage => crates/fluvio-storage}/src/batch_header.rs (100%) rename {src/storage => crates/fluvio-storage}/src/bin/cli.rs (100%) rename {src/storage => crates/fluvio-storage}/src/checkpoint.rs (100%) rename {src/storage => crates/fluvio-storage}/src/config.rs (100%) rename {src/storage => crates/fluvio-storage}/src/error.rs (100%) rename {src/storage => crates/fluvio-storage}/src/fixture.rs (100%) rename {src/storage => crates/fluvio-storage}/src/index.rs (100%) rename {src/storage => crates/fluvio-storage}/src/lib.rs (100%) rename {src/storage => crates/fluvio-storage}/src/mut_index.rs (100%) rename {src/storage => crates/fluvio-storage}/src/mut_records.rs (100%) rename {src/storage => crates/fluvio-storage}/src/range_map.rs (100%) rename {src/storage => crates/fluvio-storage}/src/records.rs (100%) rename {src/storage => crates/fluvio-storage}/src/replica.rs (100%) rename {src/storage => crates/fluvio-storage}/src/segment.rs (100%) rename {src/storage => crates/fluvio-storage}/src/util.rs (100%) rename {src/storage => crates/fluvio-storage}/src/validator.rs (100%) rename {src/storage => crates/fluvio-storage}/tests/replica_test.rs (100%) rename {src/stream-dispatcher => crates/fluvio-stream-dispatcher}/Cargo.toml (91%) rename {src/storage => crates/fluvio-stream-dispatcher}/LICENSE-APACHE (100%) rename {src/stream-dispatcher => crates/fluvio-stream-dispatcher}/src/actions.rs (100%) rename {src/stream-dispatcher => crates/fluvio-stream-dispatcher}/src/dispatcher/k8_dispatcher.rs (100%) rename {src/stream-dispatcher => crates/fluvio-stream-dispatcher}/src/dispatcher/k8_ws_service.rs (100%) rename {src/stream-dispatcher => crates/fluvio-stream-dispatcher}/src/dispatcher/mod.rs (100%) rename {src/stream-dispatcher => crates/fluvio-stream-dispatcher}/src/error.rs (100%) rename {src/stream-dispatcher => crates/fluvio-stream-dispatcher}/src/lib.rs (100%) rename {src/stream-dispatcher => crates/fluvio-stream-dispatcher}/src/store/mod.rs (100%) rename {src/stream-model => crates/fluvio-stream-model}/Cargo.toml (99%) rename {src/stream-dispatcher => crates/fluvio-stream-model}/LICENSE-APACHE (100%) rename {src/stream-model => crates/fluvio-stream-model}/src/core.rs (100%) rename {src/stream-model => crates/fluvio-stream-model}/src/epoch/dual_epoch_map.rs (100%) rename {src/stream-model => crates/fluvio-stream-model}/src/epoch/epoch_map.rs (100%) rename {src/stream-model => crates/fluvio-stream-model}/src/epoch/mod.rs (100%) rename {src/stream-model => crates/fluvio-stream-model}/src/lib.rs (100%) rename {src/stream-model => crates/fluvio-stream-model}/src/store/actions.rs (100%) rename {src/stream-model => crates/fluvio-stream-model}/src/store/concurrent_hashmap.rs (100%) rename {src/stream-model => crates/fluvio-stream-model}/src/store/dual_store.rs (100%) rename {src/stream-model => crates/fluvio-stream-model}/src/store/event.rs (100%) rename {src/stream-model => crates/fluvio-stream-model}/src/store/filter.rs (100%) rename {src/stream-model => crates/fluvio-stream-model}/src/store/k8.rs (100%) rename {src/stream-model => crates/fluvio-stream-model}/src/store/metadata.rs (100%) rename {src/stream-model => crates/fluvio-stream-model}/src/store/mod.rs (100%) rename {src/utils => crates/fluvio-system-util}/Cargo.toml (84%) rename {src/stream-model => crates/fluvio-system-util}/LICENSE-APACHE (100%) rename {src/utils => crates/fluvio-system-util}/src/bin.rs (100%) rename {src/utils => crates/fluvio-system-util}/src/config_helper.rs (100%) rename {src/utils => crates/fluvio-system-util}/src/counters/counter_tbl.rs (100%) rename {src/utils => crates/fluvio-system-util}/src/counters/counters.rs (100%) rename {src/utils => crates/fluvio-system-util}/src/counters/mod.rs (100%) rename {src/utils => crates/fluvio-system-util}/src/generators.rs (100%) rename {src/utils => crates/fluvio-system-util}/src/lib.rs (100%) rename {tests/runner/src/fluvio-integration-derive => crates/fluvio-test-derive}/Cargo.toml (73%) rename {tests/runner/src/fluvio-integration-derive => crates/fluvio-test-derive}/src/lib.rs (100%) rename {tests/runner/src/fluvio-integration-derive => crates/fluvio-test-derive}/tests/parse.rs (100%) rename {tests/runner/src/fluvio-integration-derive => crates/fluvio-test-derive}/ui-tests/fail_cluster_type.rs (100%) rename {tests/runner/src/fluvio-integration-derive => crates/fluvio-test-derive}/ui-tests/fail_invalid_key.rs (100%) rename {tests/runner/src/fluvio-integration-derive => crates/fluvio-test-derive}/ui-tests/fail_min_spu_type.rs (100%) rename {tests/runner/src/fluvio-integration-derive => crates/fluvio-test-derive}/ui-tests/fail_multi.rs (100%) rename {tests/runner/src/fluvio-integration-derive => crates/fluvio-test-derive}/ui-tests/fail_name.rs (100%) rename {tests/runner/src/fluvio-integration-derive => crates/fluvio-test-derive}/ui-tests/fail_timeout.rs (100%) rename {tests/runner/src/fluvio-integration-derive => crates/fluvio-test-derive}/ui-tests/fail_topic_type.rs (100%) rename {tests/runner/src/fluvio-integration-derive => crates/fluvio-test-derive}/ui-tests/pass_cluster_type.rs (100%) rename {tests/runner/src/fluvio-integration-derive => crates/fluvio-test-derive}/ui-tests/pass_min_spu.rs (100%) rename {tests/runner/src/fluvio-integration-derive => crates/fluvio-test-derive}/ui-tests/pass_multi.rs (100%) rename {tests/runner/src/fluvio-integration-derive => crates/fluvio-test-derive}/ui-tests/pass_name.rs (100%) rename {tests/runner/src/fluvio-integration-derive => crates/fluvio-test-derive}/ui-tests/pass_no_macro_args.rs (100%) rename {tests/runner/src/fluvio-integration-derive => crates/fluvio-test-derive}/ui-tests/pass_timeout.rs (100%) rename {tests/runner/src/fluvio-integration-derive => crates/fluvio-test-derive}/ui-tests/pass_topic.rs (100%) create mode 100644 crates/fluvio-test-derive/wip/fail_cluster_type.stderr create mode 100644 crates/fluvio-test-derive/wip/fail_invalid_key.stderr create mode 100644 crates/fluvio-test-derive/wip/fail_min_spu_type.stderr create mode 100644 crates/fluvio-test-derive/wip/fail_multi.stderr create mode 100644 crates/fluvio-test-derive/wip/fail_name.stderr create mode 100644 crates/fluvio-test-derive/wip/fail_no_fn_args.stderr create mode 100644 crates/fluvio-test-derive/wip/fail_timeout.stderr create mode 100644 crates/fluvio-test-derive/wip/fail_topic_type.stderr rename {tests/runner/src/utils => crates/fluvio-test-util}/Cargo.toml (72%) rename {tests/runner/src/utils => crates/fluvio-test-util}/lib.rs (84%) rename {tests/runner/src/utils => crates/fluvio-test-util}/setup/environment/k8.rs (100%) rename {tests/runner/src/utils => crates/fluvio-test-util}/setup/environment/local.rs (100%) rename {tests/runner/src/utils => crates/fluvio-test-util}/setup/environment/mod.rs (100%) rename {tests/runner/src/utils => crates/fluvio-test-util}/setup/mod.rs (100%) rename {tests/runner/src/utils => crates/fluvio-test-util}/test_meta/derive_attr.rs (100%) rename {tests/runner/src/utils => crates/fluvio-test-util}/test_meta/environment.rs (100%) rename {tests/runner/src/utils => crates/fluvio-test-util}/test_meta/mod.rs (100%) rename {tests/runner/src/utils => crates/fluvio-test-util}/test_meta/test_result.rs (100%) rename {tests/runner/src/utils => crates/fluvio-test-util}/test_meta/test_timer.rs (100%) rename {tests/runner/src/utils => crates/fluvio-test-util}/test_runner/mod.rs (100%) rename {tests/runner/src/utils => crates/fluvio-test-util}/test_runner/test_driver/mod.rs (100%) rename {tests/runner/src/utils => crates/fluvio-test-util}/test_runner/test_meta.rs (100%) rename {tests/runner/src/utils => crates/fluvio-test-util}/tls.rs (100%) rename {tests/runner => crates/fluvio-test}/Cargo.toml (56%) rename {tests/runner => crates/fluvio-test}/src/lib.rs (100%) rename {tests/runner => crates/fluvio-test}/src/main.rs (94%) rename {tests/runner => crates/fluvio-test}/src/tests/concurrent/consumer.rs (100%) rename {tests/runner => crates/fluvio-test}/src/tests/concurrent/mod.rs (97%) rename {tests/runner => crates/fluvio-test}/src/tests/concurrent/producer.rs (100%) rename {tests/runner => crates/fluvio-test}/src/tests/concurrent/util.rs (100%) rename {tests/runner => crates/fluvio-test}/src/tests/mod.rs (100%) rename {tests/runner => crates/fluvio-test}/src/tests/producer_stress.rs (98%) rename {tests/runner => crates/fluvio-test}/src/tests/smoke/consume.rs (100%) rename {tests/runner => crates/fluvio-test}/src/tests/smoke/listener.rs (100%) rename {tests/runner => crates/fluvio-test}/src/tests/smoke/message.rs (100%) rename {tests/runner => crates/fluvio-test}/src/tests/smoke/mod.rs (98%) rename {tests/runner => crates/fluvio-test}/src/tests/smoke/produce.rs (100%) rename {tests/runner => crates/fluvio-test}/src/tests/stress.rs (100%) rename {src/types => crates/fluvio-types}/Cargo.toml (90%) rename {src/types => crates/fluvio-types}/LICENSE-APACHE (100%) rename {src/types => crates/fluvio-types}/src/defaults.rs (100%) rename {src/types => crates/fluvio-types}/src/event.rs (100%) rename {src/types => crates/fluvio-types}/src/lib.rs (100%) rename {src/types => crates/fluvio-types}/src/macros.rs (100%) rename {src/types => crates/fluvio-types}/src/partition.rs (100%) rename {src/client => crates/fluvio}/Cargo.toml (72%) rename {src/utils => crates/fluvio}/LICENSE-APACHE (100%) rename {src/client => crates/fluvio}/README.md (100%) rename {src/client => crates/fluvio}/src/admin.rs (100%) rename {src/client => crates/fluvio}/src/config/cluster.rs (100%) rename {src/client => crates/fluvio}/src/config/config.rs (100%) rename {src/client => crates/fluvio}/src/config/mod.rs (100%) rename {src/client => crates/fluvio}/src/config/tls.rs (100%) rename {src/client => crates/fluvio}/src/consumer.rs (100%) rename {src/client => crates/fluvio}/src/error.rs (100%) rename {src/client => crates/fluvio}/src/fluvio.rs (100%) rename {src/client => crates/fluvio}/src/lib.rs (100%) rename {src/client => crates/fluvio}/src/offset.rs (100%) rename {src/client => crates/fluvio}/src/producer.rs (100%) rename {src/client => crates/fluvio}/src/sockets.rs (100%) rename {src/client => crates/fluvio}/src/spu.rs (100%) rename {src/client => crates/fluvio}/src/sync/controller.rs (100%) rename {src/client => crates/fluvio}/src/sync/mod.rs (100%) rename {src/client => crates/fluvio}/src/sync/store.rs (100%) rename {src/client => crates/fluvio}/test-data/profiles/config.toml (100%) rename {src/client => crates/fluvio}/test-data/profiles/default.toml (100%) rename {src/client => crates/fluvio}/test-data/profiles/invalid.toml (100%) rename {src/client => crates/fluvio}/test-data/tls/file.toml (100%) rename {src/client => crates/fluvio}/test-data/tls/inline.toml (100%) rename {src/client => crates/fluvio}/test-data/tls/no-verf.toml (100%) delete mode 100644 doc/TEST.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a53b71e2fb..60b788842f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: - x86_64-unknown-linux-musl - aarch64-unknown-linux-musl rust: [stable] - binary: [fluvio, fluvio-run, flv-test] + binary: [fluvio, fluvio-run, fluvio-test] os: [ubuntu-latest] env: RUST_BACKTRACE: full @@ -83,8 +83,8 @@ jobs: if: ${{ matrix.binary == 'fluvio-run' }} run: make build-cluster - - name: Build flv-test - if: ${{ matrix.binary == 'flv-test' }} + - name: Build fluvio-test + if: ${{ matrix.binary == 'fluvio-test' }} run: make build-test # Upload artifacts @@ -243,13 +243,13 @@ jobs: os: [ubuntu-latest] rust: [stable] wasm-crate: - - client - - socket - - protocol - - spu-schema - - sc-schema - - dataplane-protocol - - types + - fluvio + - fluvio-socket + - fluvio-protocol + - fluvio-spu-schema + - fluvio-sc-schema + - fluvio-dataplane-protocol + - fluvio-types env: RUST_BACKTRACE: full RUSTV: ${{ matrix.rust }} @@ -264,7 +264,7 @@ jobs: target: wasm32-unknown-unknown - name: Build WASM for ${{ matrix.wasm-crate }} - run: cargo check --manifest-path ./src/${{matrix.wasm-crate}}/Cargo.toml --target wasm32-unknown-unknown + run: cargo check --manifest-path ./crates/${{matrix.wasm-crate}}/Cargo.toml --target wasm32-unknown-unknown check_windows: name: Check Windows for crates (${{ matrix.crate }}) @@ -275,8 +275,8 @@ jobs: os: [windows-latest] rust: [stable] crate: - - client - - cli + - fluvio + - fluvio-cli env: RUST_BACKTRACE: full RUSTV: ${{ matrix.rust }} @@ -293,10 +293,10 @@ jobs: key: ${{ matrix.os }}-${{ matrix.crate }} - name: Build ${{ matrix.crate }} for ${{ matrix.os }} - run: cargo build --manifest-path ./src/${{matrix.crate}}/Cargo.toml + run: cargo build --manifest-path ./crates/${{ matrix.crate }}/Cargo.toml - name: Test ${{ matrix.crate }} for ${{ matrix.os }} - run: cargo test --manifest-path ./src/${{matrix.crate}}/Cargo.toml + run: cargo test --manifest-path ./crates/${{ matrix.crate }}/Cargo.toml local_cluster_test: name: Local cluster test run (${{ matrix.run }}) @@ -324,25 +324,25 @@ jobs: name: fluvio-run-x86_64-unknown-linux-musl path: ~/.fluvio/extensions - run: chmod +x ~/.fluvio/extensions/fluvio-run - - name: Download artifact - flv-test + - name: Download artifact - fluvio-test uses: actions/download-artifact@v2 with: - name: flv-test-x86_64-unknown-linux-musl + name: fluvio-test-x86_64-unknown-linux-musl path: . - name: Print artifacts and mark executable - run: chmod +x ./fluvio ./flv-test && ./fluvio version + run: chmod +x ./fluvio ./fluvio-test && ./fluvio version - name: Set up cluster run: ./k8-util/cluster/reset-k3d.sh - name: Run smoke-test timeout-minutes: 2 run: | date - make FLUVIO_BIN=./fluvio TEST_BIN=./flv-test SERVER_LOG=info UNINSTALL=noclean EXTRA_ARG=--keep-cluster smoke-test-tls-root + make FLUVIO_BIN=./fluvio TEST_BIN=./fluvio-test SERVER_LOG=info UNINSTALL=noclean EXTRA_ARG=--keep-cluster smoke-test-tls-root date kubectl get partitions kubectl get partitions -o=jsonpath='{.items[0].status.leader.leo}' | grep 100 echo "done" - # make RUST_LOG=flv_test=debug,fluvio_test=debug,fluvio_socket=trace,fluvio::consumer=debug,fluvio::producer=debug DEFAULT_ITERATION=10 DEFAULT_SPU=1 REPL=1 FLUVIO_BIN=./fluvio TEST_BIN=./flv-test UNINSTALL=noclean smoke-test-local + # make RUST_LOG=fluvio_test=debug,fluvio_test=debug,fluvio_socket=trace,fluvio::consumer=debug,fluvio::producer=debug DEFAULT_ITERATION=10 DEFAULT_SPU=1 REPL=1 FLUVIO_BIN=./fluvio TEST_BIN=./fluvio-test UNINSTALL=noclean smoke-test-local - name: Save logs @@ -421,10 +421,10 @@ jobs: with: name: fluvio-x86_64-unknown-linux-musl path: . - - name: Download artifact - flv-test + - name: Download artifact - fluvio-test uses: actions/download-artifact@v2 with: - name: flv-test-x86_64-unknown-linux-musl + name: fluvio-test-x86_64-unknown-linux-musl path: . - name: Download Docker Image as Artifact uses: actions/download-artifact@v2 @@ -433,7 +433,7 @@ jobs: path: /tmp - name: Print artifacts and mark executable - run: ls -la . && chmod +x ./fluvio ./flv-test && ./fluvio version && ./flv-test -h + run: ls -la . && chmod +x ./fluvio ./fluvio-test && ./fluvio version && ./fluvio-test -h # Retag image to remove arch from tag - name: Load Fluvio Docker Image @@ -454,7 +454,7 @@ jobs: command: | ./k8-util/cluster/reset-k3d.sh k3d image import -k /tmp/infinyon-fluvio.tar -c fluvio - make FLUVIO_BIN=./fluvio TEST_BIN=./flv-test smoke-test-k8-tls-root + make FLUVIO_BIN=./fluvio TEST_BIN=./fluvio-test smoke-test-k8-tls-root - name: Print version run: ./fluvio version diff --git a/.github/workflows/ci_tier2.yaml b/.github/workflows/ci_tier2.yaml index c1b0f607ef..337ea5373f 100644 --- a/.github/workflows/ci_tier2.yaml +++ b/.github/workflows/ci_tier2.yaml @@ -139,11 +139,11 @@ jobs: with: name: fluvio-tier2-run-${{ matrix.rust_target }} path: ${{ env.RUST_BIN_DIR }}/fluvio-run - - name: Upload atrifact - flv-test + - name: Upload atrifact - fluvio-test uses: actions/upload-artifact@v2 with: - name: flv-tier2-test-${{ matrix.rust_target }} - path: ${{ env.RUST_BIN_DIR }}/flv-test + name: fluvio-tier2-test-${{ matrix.rust_target }} + path: ${{ env.RUST_BIN_DIR }}/fluvio-test local_cluster_test: name: Local Tier 2cluster test @@ -178,17 +178,17 @@ jobs: with: name: fluvio-x86_64-unknown-linux-musl path: . - - name: Download artifact - flv-test + - name: Download artifact - fluvio-test uses: actions/download-artifact@v2 with: - name: flv-test-x86_64-unknown-linux-musl + name: fluvio-test-x86_64-unknown-linux-musl path: . - name: Print artifacts and mark executable - run: ls -la . && chmod +x ./fluvio ./flv-test && ./fluvio -h && ./flv-test -h + run: ls -la . && chmod +x ./fluvio ./fluvio-test && ./fluvio -h && ./fluvio-test -h - name: Run smoke-test timeout-minutes: 3 run: | - make FLUVIO_BIN=./fluvio TEST_BIN=./flv-test UNINSTALL=noclean smoke-test-tls-root + make FLUVIO_BIN=./fluvio TEST_BIN=./fluvio-test UNINSTALL=noclean smoke-test-tls-root - name: Upload SC log uses: actions/upload-artifact@v2 timeout-minutes: 5 diff --git a/Cargo.lock b/Cargo.lock index 364a136d12..8bcef51229 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1561,7 +1561,7 @@ dependencies = [ "async-std", "async-trait", "cfg-if 1.0.0", - "fluvio-test-derive", + "fluvio-test-derive 0.1.1", "fluvio-wasm-timer", "fluvio_ws_stream_wasm", "futures-lite", @@ -1592,22 +1592,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "fluvio-integration-derive" -version = "0.1.0" -dependencies = [ - "fluvio", - "fluvio-future", - "fluvio-test-util", - "inflections", - "proc-macro2", - "quote", - "serde_json", - "syn", - "tokio", - "trybuild 1.0.42 (git+https://github.com/sehz/trybuild?branch=check_option)", -] - [[package]] name = "fluvio-package-index" version = "0.5.0" @@ -1939,6 +1923,54 @@ dependencies = [ "tracing", ] +[[package]] +name = "fluvio-test" +version = "0.0.0" +dependencies = [ + "async-lock", + "async-trait", + "bencher", + "bytes", + "fluvio", + "fluvio-cluster", + "fluvio-command", + "fluvio-controlplane-metadata", + "fluvio-dataplane-protocol", + "fluvio-future", + "fluvio-system-util", + "fluvio-test-derive 0.0.0", + "fluvio-test-util", + "fluvio-types", + "futures-lite", + "hdrhistogram", + "inventory", + "md-5", + "prettytable-rs", + "rand 0.8.4", + "serde", + "serde_json", + "structopt", + "syn", + "tokio", + "tracing", +] + +[[package]] +name = "fluvio-test-derive" +version = "0.0.0" +dependencies = [ + "fluvio", + "fluvio-future", + "fluvio-test-util", + "inflections", + "proc-macro2", + "quote", + "serde_json", + "syn", + "tokio", + "trybuild 1.0.42 (git+https://github.com/sehz/trybuild?branch=check_option)", +] + [[package]] name = "fluvio-test-derive" version = "0.1.1" @@ -1952,7 +1984,7 @@ dependencies = [ [[package]] name = "fluvio-test-util" -version = "0.1.0" +version = "0.0.0" dependencies = [ "async-lock", "async-trait", @@ -2024,38 +2056,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "flv-test" -version = "1.0.1" -dependencies = [ - "async-lock", - "async-trait", - "bencher", - "bytes", - "fluvio", - "fluvio-cluster", - "fluvio-command", - "fluvio-controlplane-metadata", - "fluvio-dataplane-protocol", - "fluvio-future", - "fluvio-integration-derive", - "fluvio-system-util", - "fluvio-test-util", - "fluvio-types", - "futures-lite", - "hdrhistogram", - "inventory", - "md-5", - "prettytable-rs", - "rand 0.8.4", - "serde", - "serde_json", - "structopt", - "syn", - "tokio", - "tracing", -] - [[package]] name = "flv-tls-proxy" version = "0.5.0" diff --git a/Cargo.toml b/Cargo.toml index f02e5aa902..7bcf701b85 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,35 +6,40 @@ members = [ "examples/02-consume", "examples/03-echo", "examples/04-admin-watch", - "src/auth", - "src/cli", - "src/client", - "src/cluster", - "src/controlplane", - "src/controlplane-metadata", - "src/dataplane-protocol", - "src/package-index", - "src/protocol", - "src/sc", - "src/sc-schema", - "src/service", - "src/socket", - "src/spu", - "src/spu-schema", - "src/storage", - "src/stream-dispatcher", - "src/stream-model", - "src/types", - "src/utils", - "src/extension-common", - "src/runner", - "src/smartstream", - "src/smartstream/derive", - "tests/runner", + "crates/fluvio", + "crates/fluvio-auth", + "crates/fluvio-cli", + "crates/fluvio-cluster", + "crates/fluvio-controlplane", + "crates/fluvio-controlplane-metadata", + "crates/fluvio-dataplane-protocol", + "crates/fluvio-extension-common", + "crates/fluvio-package-index", + "crates/fluvio-protocol", + "crates/fluvio-protocol-api", + "crates/fluvio-protocol-codec", + "crates/fluvio-protocol-core", + "crates/fluvio-protocol-derive", + "crates/fluvio-run", + "crates/fluvio-sc", + "crates/fluvio-sc-schema", + "crates/fluvio-service", + "crates/fluvio-smartstream", + "crates/fluvio-smartstream-derive", + "crates/fluvio-socket", + "crates/fluvio-spu", + "crates/fluvio-spu-schema", + "crates/fluvio-storage", + "crates/fluvio-stream-dispatcher", + "crates/fluvio-stream-model", + "crates/fluvio-system-util", + "crates/fluvio-test", + "crates/fluvio-test-derive", + "crates/fluvio-test-util", + "crates/fluvio-types", ] resolver = "2" - # Used to make eyre faster on debug builds # See https://github.com/yaahc/color-eyre#improving-perf-on-debug-builds [profile.dev.package.backtrace] @@ -45,11 +50,11 @@ opt-level = 3 opt-level = 3 # Used to preserve some linker hacks used by `inventory` crate -[profile.dev.package.flv-test] +[profile.dev.package.fluvio-test] incremental = false -# Make flv-test release package more like dev profile. Specifically for `inventory` crate -[profile.release.package.flv-test] +# Make fluvio-test release package more like dev profile. Specifically for `inventory` crate +[profile.release.package.fluvio-test] opt-level = 0 debug = true debug-assertions = true diff --git a/DEVELOPER.md b/DEVELOPER.md index 8de9ac3229..66dd1f1de6 100644 --- a/DEVELOPER.md +++ b/DEVELOPER.md @@ -354,7 +354,7 @@ Hang tight while we grab the latest from your chart repositories... ...Successfully got an update from the "fluvio" chart repository Update Complete. ⎈ Happy Helming!⎈ Exited with status code: 1 -thread 'main' panicked at 'assertion failed: false', src/cli/src/cluster/util.rs:115:17 +thread 'main' panicked at 'assertion failed: false', crates/fluvio-cli/src/cluster/util.rs:115:17 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` diff --git a/Makefile b/Makefile index 495ca02683..9445df08dd 100644 --- a/Makefile +++ b/Makefile @@ -11,12 +11,12 @@ TARGET_FLAG=$(if $(TARGET),--target $(TARGET),) VERBOSE_FLAG=$(if $(VERBOSE),--verbose,) CLIENT_LOG=warn SERVER_LOG=fluvio=debug -TEST_BIN=$(if $(TARGET),./target/$(TARGET)/$(BUILD_PROFILE)/flv-test,./target/$(BUILD_PROFILE)/flv-test) +TEST_BIN=$(if $(TARGET),./target/$(TARGET)/$(BUILD_PROFILE)/fluvio-test,./target/$(BUILD_PROFILE)/fluvio-test) DEFAULT_SPU=2 REPL=2 DEFAULT_ITERATION=1000 SPU_DELAY=5 -SC_AUTH_CONFIG=./src/sc/test-data/auth_config +SC_AUTH_CONFIG=./crates/fluvio-sc/test-data/auth_config EXTRA_ARG= # Test env @@ -51,14 +51,14 @@ build-cli: install_rustup_target build-cli-minimal: install_rustup_target # https://github.com/infinyon/fluvio/issues/1255 - cargo build --bin fluvio $(RELEASE_FLAG) $(TARGET_FLAG) $(VERBOSE_FLAG) --no-default-features --features consumer --manifest-path ./src/cli/Cargo.toml + cargo build --bin fluvio $(RELEASE_FLAG) $(TARGET_FLAG) $(VERBOSE_FLAG) --no-default-features --features consumer --manifest-path ./crates/fluvio-cli/Cargo.toml build-cluster: install_rustup_target cargo build --bin fluvio-run $(RELEASE_FLAG) $(TARGET_FLAG) $(VERBOSE_FLAG) build-test: install_rustup_target - cargo build --bin flv-test $(RELEASE_FLAG) $(TARGET_FLAG) $(VERBOSE_FLAG) + cargo build --bin fluvio-test $(RELEASE_FLAG) $(TARGET_FLAG) $(VERBOSE_FLAG) install_rustup_target: ./build-scripts/install_target.sh @@ -212,12 +212,12 @@ check-clippy: install-clippy install_rustup_target cargo +$(RUSTV) clippy --all --all-features --tests $(VERBOSE_FLAG) -- -D warnings -A clippy::upper_case_acronyms $(TARGET_FLAG) build_smartstreams: - make -C src/smartstream/examples build + make -C crates/fluvio-smartstream/examples build run-all-unit-test: build_smartstreams install_rustup_target cargo test --lib --all-features $(RELEASE_FLAG) $(TARGET_FLAG) cargo test -p fluvio-storage $(RELEASE_FLAG) $(TARGET_FLAG) - make test-all -C src/protocol + make test-all -C crates/fluvio-protocol run-integration-test:build_smartstreams install_rustup_target cargo test --lib --all-features $(RELEASE_FLAG) $(TARGET_FLAG) -- --ignored --test-threads=1 diff --git a/src/auth/Cargo.toml b/crates/fluvio-auth/Cargo.toml similarity index 67% rename from src/auth/Cargo.toml rename to crates/fluvio-auth/Cargo.toml index 06200e9cf1..46c698ca9b 100644 --- a/src/auth/Cargo.toml +++ b/crates/fluvio-auth/Cargo.toml @@ -21,11 +21,11 @@ tracing = "0.1" tracing-futures = "0.2.4" x509-parser = "0.9.1" -fluvio-controlplane-metadata = { version = "0.10.0", path = "../controlplane-metadata" } -dataplane = { version = "0.6.0", path = "../dataplane-protocol", package = "fluvio-dataplane-protocol" } +fluvio-controlplane-metadata = { version = "0.10.0", path = "../fluvio-controlplane-metadata" } +dataplane = { version = "0.6.0", path = "../fluvio-dataplane-protocol", package = "fluvio-dataplane-protocol" } fluvio-future = { version = "0.3.0", features = ["net", "openssl_tls"] } -fluvio-protocol = { path = "../protocol", version = "0.6" } -fluvio-socket = { path = "../socket", version = "0.9" } -fluvio-types = { version = "0.2.0", path = "../types" } +fluvio-protocol = { path = "../fluvio-protocol", version = "0.6" } +fluvio-socket = { path = "../fluvio-socket", version = "0.9" } +fluvio-types = { version = "0.2.0", path = "../fluvio-types" } flv-tls-proxy = { version = "0.5.0" } futures-util = { version = "0.3.5" } diff --git a/src/auth/LICENSE-APACHE b/crates/fluvio-auth/LICENSE-APACHE similarity index 100% rename from src/auth/LICENSE-APACHE rename to crates/fluvio-auth/LICENSE-APACHE diff --git a/src/auth/README.md b/crates/fluvio-auth/README.md similarity index 100% rename from src/auth/README.md rename to crates/fluvio-auth/README.md diff --git a/src/auth/src/error.rs b/crates/fluvio-auth/src/error.rs similarity index 100% rename from src/auth/src/error.rs rename to crates/fluvio-auth/src/error.rs diff --git a/src/auth/src/lib.rs b/crates/fluvio-auth/src/lib.rs similarity index 100% rename from src/auth/src/lib.rs rename to crates/fluvio-auth/src/lib.rs diff --git a/src/auth/src/policy.rs b/crates/fluvio-auth/src/policy.rs similarity index 100% rename from src/auth/src/policy.rs rename to crates/fluvio-auth/src/policy.rs diff --git a/src/auth/src/x509/authenticator.rs b/crates/fluvio-auth/src/x509/authenticator.rs similarity index 100% rename from src/auth/src/x509/authenticator.rs rename to crates/fluvio-auth/src/x509/authenticator.rs diff --git a/src/auth/src/x509/identity.rs b/crates/fluvio-auth/src/x509/identity.rs similarity index 100% rename from src/auth/src/x509/identity.rs rename to crates/fluvio-auth/src/x509/identity.rs diff --git a/src/auth/src/x509/mod.rs b/crates/fluvio-auth/src/x509/mod.rs similarity index 100% rename from src/auth/src/x509/mod.rs rename to crates/fluvio-auth/src/x509/mod.rs diff --git a/src/auth/src/x509/request.rs b/crates/fluvio-auth/src/x509/request.rs similarity index 100% rename from src/auth/src/x509/request.rs rename to crates/fluvio-auth/src/x509/request.rs diff --git a/src/cli/Cargo.toml b/crates/fluvio-cli/Cargo.toml similarity index 74% rename from src/cli/Cargo.toml rename to crates/fluvio-cli/Cargo.toml index fb54b9e90c..e791d57597 100644 --- a/src/cli/Cargo.toml +++ b/crates/fluvio-cli/Cargo.toml @@ -66,19 +66,19 @@ content_inspector = { version = "0.2.4", optional = true} # Fluvio dependencies k8-config = { version = "1.3.0", optional = true} k8-client = { version = "5.0.0", optional = true} -fluvio-cluster = { version = "0.0.0", path = "../cluster", default-features = false, features = ["cli"], optional = true } +fluvio-cluster = { version = "0.0.0", path = "../fluvio-cluster", default-features = false, features = ["cli"], optional = true } -fluvio = { version = "0.9.1", path = "../client", default-features = false } +fluvio = { version = "0.9.1", path = "../fluvio", default-features = false } fluvio-command = { version = "0.2.0" } -fluvio-package-index = { version = "0.5.0", path = "../package-index" } -fluvio-extension-common = { version = "0.5.0", path = "../extension-common", features = ["target"]} -fluvio-controlplane-metadata = { version = "0.10.0", path = "../controlplane-metadata", features = ["use_serde", "k8"] } +fluvio-package-index = { version = "0.5.0", path = "../fluvio-package-index" } +fluvio-extension-common = { version = "0.5.0", path = "../fluvio-extension-common", features = ["target"]} +fluvio-controlplane-metadata = { version = "0.10.0", path = "../fluvio-controlplane-metadata", features = ["use_serde", "k8"] } k8-types = { version = "0.2.0", features = ["core"]} # Optional Fluvio dependencies -fluvio-types = { version = "0.2.0" , path = "../types", optional = true} +fluvio-types = { version = "0.2.0" , path = "../fluvio-types", optional = true} fluvio-future = { version = "0.3.0", features = ["fs", "io", "subscriber", "native2_tls"], optional = true } -fluvio-sc-schema = { version = "0.9.1", path = "../sc-schema", features = ["use_serde"], optional = true } +fluvio-sc-schema = { version = "0.9.1", path = "../fluvio-sc-schema", features = ["use_serde"], optional = true } [dev-dependencies] fluvio-future = { version = "0.3.0", features = ["fixture"] } diff --git a/src/cli/LICENSE-APACHE b/crates/fluvio-cli/LICENSE-APACHE similarity index 100% rename from src/cli/LICENSE-APACHE rename to crates/fluvio-cli/LICENSE-APACHE diff --git a/src/cli/README.md b/crates/fluvio-cli/README.md similarity index 100% rename from src/cli/README.md rename to crates/fluvio-cli/README.md diff --git a/src/cli/build.rs b/crates/fluvio-cli/build.rs similarity index 100% rename from src/cli/build.rs rename to crates/fluvio-cli/build.rs diff --git a/src/cli/src/.gitignore b/crates/fluvio-cli/src/.gitignore similarity index 100% rename from src/cli/src/.gitignore rename to crates/fluvio-cli/src/.gitignore diff --git a/src/cli/src/bin/main.rs b/crates/fluvio-cli/src/bin/main.rs similarity index 100% rename from src/cli/src/bin/main.rs rename to crates/fluvio-cli/src/bin/main.rs diff --git a/src/cli/src/consume/mod.rs b/crates/fluvio-cli/src/consume/mod.rs similarity index 100% rename from src/cli/src/consume/mod.rs rename to crates/fluvio-cli/src/consume/mod.rs diff --git a/src/cli/src/consume/record_format.rs b/crates/fluvio-cli/src/consume/record_format.rs similarity index 100% rename from src/cli/src/consume/record_format.rs rename to crates/fluvio-cli/src/consume/record_format.rs diff --git a/src/cli/src/error.rs b/crates/fluvio-cli/src/error.rs similarity index 100% rename from src/cli/src/error.rs rename to crates/fluvio-cli/src/error.rs diff --git a/src/cli/src/http.rs b/crates/fluvio-cli/src/http.rs similarity index 100% rename from src/cli/src/http.rs rename to crates/fluvio-cli/src/http.rs diff --git a/src/cli/src/install/mod.rs b/crates/fluvio-cli/src/install/mod.rs similarity index 100% rename from src/cli/src/install/mod.rs rename to crates/fluvio-cli/src/install/mod.rs diff --git a/src/cli/src/install/plugins.rs b/crates/fluvio-cli/src/install/plugins.rs similarity index 100% rename from src/cli/src/install/plugins.rs rename to crates/fluvio-cli/src/install/plugins.rs diff --git a/src/cli/src/install/update.rs b/crates/fluvio-cli/src/install/update.rs similarity index 100% rename from src/cli/src/install/update.rs rename to crates/fluvio-cli/src/install/update.rs diff --git a/src/cli/src/lib.rs b/crates/fluvio-cli/src/lib.rs similarity index 100% rename from src/cli/src/lib.rs rename to crates/fluvio-cli/src/lib.rs diff --git a/src/cli/src/metadata.rs b/crates/fluvio-cli/src/metadata.rs similarity index 100% rename from src/cli/src/metadata.rs rename to crates/fluvio-cli/src/metadata.rs diff --git a/src/cli/src/partition/list.rs b/crates/fluvio-cli/src/partition/list.rs similarity index 100% rename from src/cli/src/partition/list.rs rename to crates/fluvio-cli/src/partition/list.rs diff --git a/src/cli/src/partition/mod.rs b/crates/fluvio-cli/src/partition/mod.rs similarity index 100% rename from src/cli/src/partition/mod.rs rename to crates/fluvio-cli/src/partition/mod.rs diff --git a/src/cli/src/produce/mod.rs b/crates/fluvio-cli/src/produce/mod.rs similarity index 100% rename from src/cli/src/produce/mod.rs rename to crates/fluvio-cli/src/produce/mod.rs diff --git a/src/cli/src/profile/current.rs b/crates/fluvio-cli/src/profile/current.rs similarity index 100% rename from src/cli/src/profile/current.rs rename to crates/fluvio-cli/src/profile/current.rs diff --git a/src/cli/src/profile/delete_cluster.rs b/crates/fluvio-cli/src/profile/delete_cluster.rs similarity index 100% rename from src/cli/src/profile/delete_cluster.rs rename to crates/fluvio-cli/src/profile/delete_cluster.rs diff --git a/src/cli/src/profile/delete_profile.rs b/crates/fluvio-cli/src/profile/delete_profile.rs similarity index 100% rename from src/cli/src/profile/delete_profile.rs rename to crates/fluvio-cli/src/profile/delete_profile.rs diff --git a/src/cli/src/profile/list.rs b/crates/fluvio-cli/src/profile/list.rs similarity index 100% rename from src/cli/src/profile/list.rs rename to crates/fluvio-cli/src/profile/list.rs diff --git a/src/cli/src/profile/mod.rs b/crates/fluvio-cli/src/profile/mod.rs similarity index 100% rename from src/cli/src/profile/mod.rs rename to crates/fluvio-cli/src/profile/mod.rs diff --git a/src/cli/src/profile/rename.rs b/crates/fluvio-cli/src/profile/rename.rs similarity index 100% rename from src/cli/src/profile/rename.rs rename to crates/fluvio-cli/src/profile/rename.rs diff --git a/src/cli/src/profile/switch.rs b/crates/fluvio-cli/src/profile/switch.rs similarity index 100% rename from src/cli/src/profile/switch.rs rename to crates/fluvio-cli/src/profile/switch.rs diff --git a/src/cli/src/profile/sync/k8.rs b/crates/fluvio-cli/src/profile/sync/k8.rs similarity index 100% rename from src/cli/src/profile/sync/k8.rs rename to crates/fluvio-cli/src/profile/sync/k8.rs diff --git a/src/cli/src/profile/sync/local.rs b/crates/fluvio-cli/src/profile/sync/local.rs similarity index 100% rename from src/cli/src/profile/sync/local.rs rename to crates/fluvio-cli/src/profile/sync/local.rs diff --git a/src/cli/src/profile/sync/mod.rs b/crates/fluvio-cli/src/profile/sync/mod.rs similarity index 100% rename from src/cli/src/profile/sync/mod.rs rename to crates/fluvio-cli/src/profile/sync/mod.rs diff --git a/src/cli/src/topic/create.rs b/crates/fluvio-cli/src/topic/create.rs similarity index 100% rename from src/cli/src/topic/create.rs rename to crates/fluvio-cli/src/topic/create.rs diff --git a/src/cli/src/topic/delete.rs b/crates/fluvio-cli/src/topic/delete.rs similarity index 100% rename from src/cli/src/topic/delete.rs rename to crates/fluvio-cli/src/topic/delete.rs diff --git a/src/cli/src/topic/describe.rs b/crates/fluvio-cli/src/topic/describe.rs similarity index 100% rename from src/cli/src/topic/describe.rs rename to crates/fluvio-cli/src/topic/describe.rs diff --git a/src/cli/src/topic/list.rs b/crates/fluvio-cli/src/topic/list.rs similarity index 100% rename from src/cli/src/topic/list.rs rename to crates/fluvio-cli/src/topic/list.rs diff --git a/src/cli/src/topic/mod.rs b/crates/fluvio-cli/src/topic/mod.rs similarity index 100% rename from src/cli/src/topic/mod.rs rename to crates/fluvio-cli/src/topic/mod.rs diff --git a/src/cli/src/version.rs b/crates/fluvio-cli/src/version.rs similarity index 100% rename from src/cli/src/version.rs rename to crates/fluvio-cli/src/version.rs diff --git a/src/cli/test-data/group-cfg/valid_config.json b/crates/fluvio-cli/test-data/group-cfg/valid_config.json similarity index 100% rename from src/cli/test-data/group-cfg/valid_config.json rename to crates/fluvio-cli/test-data/group-cfg/valid_config.json diff --git a/src/cli/test-data/input-files/icon1.png b/crates/fluvio-cli/test-data/input-files/icon1.png similarity index 100% rename from src/cli/test-data/input-files/icon1.png rename to crates/fluvio-cli/test-data/input-files/icon1.png diff --git a/src/cli/test-data/input-files/icon2.png b/crates/fluvio-cli/test-data/input-files/icon2.png similarity index 100% rename from src/cli/test-data/input-files/icon2.png rename to crates/fluvio-cli/test-data/input-files/icon2.png diff --git a/src/cli/test-data/input-files/json-file.json b/crates/fluvio-cli/test-data/input-files/json-file.json similarity index 100% rename from src/cli/test-data/input-files/json-file.json rename to crates/fluvio-cli/test-data/input-files/json-file.json diff --git a/src/cli/test-data/input-files/text-file.txt b/crates/fluvio-cli/test-data/input-files/text-file.txt similarity index 100% rename from src/cli/test-data/input-files/text-file.txt rename to crates/fluvio-cli/test-data/input-files/text-file.txt diff --git a/src/cli/test-data/topics/out_of_order.json b/crates/fluvio-cli/test-data/topics/out_of_order.json similarity index 100% rename from src/cli/test-data/topics/out_of_order.json rename to crates/fluvio-cli/test-data/topics/out_of_order.json diff --git a/src/cli/test-data/topics/valid_assignment.json b/crates/fluvio-cli/test-data/topics/valid_assignment.json similarity index 100% rename from src/cli/test-data/topics/valid_assignment.json rename to crates/fluvio-cli/test-data/topics/valid_assignment.json diff --git a/src/cli/test-data/topics/valid_assignment1.json b/crates/fluvio-cli/test-data/topics/valid_assignment1.json similarity index 100% rename from src/cli/test-data/topics/valid_assignment1.json rename to crates/fluvio-cli/test-data/topics/valid_assignment1.json diff --git a/src/cli/test-data/topics/valid_kf_assignment.json b/crates/fluvio-cli/test-data/topics/valid_kf_assignment.json similarity index 100% rename from src/cli/test-data/topics/valid_kf_assignment.json rename to crates/fluvio-cli/test-data/topics/valid_kf_assignment.json diff --git a/src/cluster/Cargo.toml b/crates/fluvio-cluster/Cargo.toml similarity index 83% rename from src/cluster/Cargo.toml rename to crates/fluvio-cluster/Cargo.toml index a867c32a30..985f149418 100644 --- a/src/cluster/Cargo.toml +++ b/crates/fluvio-cluster/Cargo.toml @@ -47,13 +47,13 @@ include_dir = "0.6.1" tempdir = "0.3.7" # Fluvio dependencies -fluvio = { version = "0.9.1", path = "../client", default-features = false } +fluvio = { version = "0.9.1", path = "../fluvio", default-features = false } fluvio-helm = "0.4.1" fluvio-future = { version = "0.3.0" } fluvio-command = { version = "0.2.0" } -fluvio-extension-common = { version = "0.5.0", path = "../extension-common", optional = true } -fluvio-controlplane-metadata = { version = "0.10.0", path = "../controlplane-metadata", features = ["k8"] } -fluvio-sc-schema = { version = "0.9.1", path = "../sc-schema", default-features = false, optional = true } +fluvio-extension-common = { version = "0.5.0", path = "../fluvio-extension-common", optional = true } +fluvio-controlplane-metadata = { version = "0.10.0", path = "../fluvio-controlplane-metadata", features = ["k8"] } +fluvio-sc-schema = { version = "0.9.1", path = "../fluvio-sc-schema", default-features = false, optional = true } flv-util = "0.5.2" k8-config = { version = "1.3.0" } k8-client = { version = "5.0.0" } diff --git a/src/client/LICENSE-APACHE b/crates/fluvio-cluster/LICENSE-APACHE similarity index 100% rename from src/client/LICENSE-APACHE rename to crates/fluvio-cluster/LICENSE-APACHE diff --git a/src/cluster/Makefile b/crates/fluvio-cluster/Makefile similarity index 100% rename from src/cluster/Makefile rename to crates/fluvio-cluster/Makefile diff --git a/src/cluster/build.rs b/crates/fluvio-cluster/build.rs similarity index 100% rename from src/cluster/build.rs rename to crates/fluvio-cluster/build.rs diff --git a/src/cluster/src/charts/chart.rs b/crates/fluvio-cluster/src/charts/chart.rs similarity index 100% rename from src/cluster/src/charts/chart.rs rename to crates/fluvio-cluster/src/charts/chart.rs diff --git a/src/cluster/src/charts/location.rs b/crates/fluvio-cluster/src/charts/location.rs similarity index 100% rename from src/cluster/src/charts/location.rs rename to crates/fluvio-cluster/src/charts/location.rs diff --git a/src/cluster/src/charts/mod.rs b/crates/fluvio-cluster/src/charts/mod.rs similarity index 100% rename from src/cluster/src/charts/mod.rs rename to crates/fluvio-cluster/src/charts/mod.rs diff --git a/src/cluster/src/check/mod.rs b/crates/fluvio-cluster/src/check/mod.rs similarity index 100% rename from src/cluster/src/check/mod.rs rename to crates/fluvio-cluster/src/check/mod.rs diff --git a/src/cluster/src/check/render.rs b/crates/fluvio-cluster/src/check/render.rs similarity index 100% rename from src/cluster/src/check/render.rs rename to crates/fluvio-cluster/src/check/render.rs diff --git a/src/cluster/src/cli/check.rs b/crates/fluvio-cluster/src/cli/check.rs similarity index 100% rename from src/cluster/src/cli/check.rs rename to crates/fluvio-cluster/src/cli/check.rs diff --git a/src/cluster/src/cli/delete.rs b/crates/fluvio-cluster/src/cli/delete.rs similarity index 100% rename from src/cluster/src/cli/delete.rs rename to crates/fluvio-cluster/src/cli/delete.rs diff --git a/src/cluster/src/cli/error.rs b/crates/fluvio-cluster/src/cli/error.rs similarity index 100% rename from src/cluster/src/cli/error.rs rename to crates/fluvio-cluster/src/cli/error.rs diff --git a/src/cluster/src/cli/group/create.rs b/crates/fluvio-cluster/src/cli/group/create.rs similarity index 100% rename from src/cluster/src/cli/group/create.rs rename to crates/fluvio-cluster/src/cli/group/create.rs diff --git a/src/cluster/src/cli/group/delete.rs b/crates/fluvio-cluster/src/cli/group/delete.rs similarity index 100% rename from src/cluster/src/cli/group/delete.rs rename to crates/fluvio-cluster/src/cli/group/delete.rs diff --git a/src/cluster/src/cli/group/list.rs b/crates/fluvio-cluster/src/cli/group/list.rs similarity index 100% rename from src/cluster/src/cli/group/list.rs rename to crates/fluvio-cluster/src/cli/group/list.rs diff --git a/src/cluster/src/cli/group/mod.rs b/crates/fluvio-cluster/src/cli/group/mod.rs similarity index 100% rename from src/cluster/src/cli/group/mod.rs rename to crates/fluvio-cluster/src/cli/group/mod.rs diff --git a/src/cluster/src/cli/mod.rs b/crates/fluvio-cluster/src/cli/mod.rs similarity index 100% rename from src/cluster/src/cli/mod.rs rename to crates/fluvio-cluster/src/cli/mod.rs diff --git a/src/cluster/src/cli/spu/display.rs b/crates/fluvio-cluster/src/cli/spu/display.rs similarity index 100% rename from src/cluster/src/cli/spu/display.rs rename to crates/fluvio-cluster/src/cli/spu/display.rs diff --git a/src/cluster/src/cli/spu/list.rs b/crates/fluvio-cluster/src/cli/spu/list.rs similarity index 100% rename from src/cluster/src/cli/spu/list.rs rename to crates/fluvio-cluster/src/cli/spu/list.rs diff --git a/src/cluster/src/cli/spu/mod.rs b/crates/fluvio-cluster/src/cli/spu/mod.rs similarity index 100% rename from src/cluster/src/cli/spu/mod.rs rename to crates/fluvio-cluster/src/cli/spu/mod.rs diff --git a/src/cluster/src/cli/spu/register.rs b/crates/fluvio-cluster/src/cli/spu/register.rs similarity index 100% rename from src/cluster/src/cli/spu/register.rs rename to crates/fluvio-cluster/src/cli/spu/register.rs diff --git a/src/cluster/src/cli/spu/unregister.rs b/crates/fluvio-cluster/src/cli/spu/unregister.rs similarity index 100% rename from src/cluster/src/cli/spu/unregister.rs rename to crates/fluvio-cluster/src/cli/spu/unregister.rs diff --git a/src/cluster/src/cli/start/k8.rs b/crates/fluvio-cluster/src/cli/start/k8.rs similarity index 100% rename from src/cluster/src/cli/start/k8.rs rename to crates/fluvio-cluster/src/cli/start/k8.rs diff --git a/src/cluster/src/cli/start/local.rs b/crates/fluvio-cluster/src/cli/start/local.rs similarity index 100% rename from src/cluster/src/cli/start/local.rs rename to crates/fluvio-cluster/src/cli/start/local.rs diff --git a/src/cluster/src/cli/start/mod.rs b/crates/fluvio-cluster/src/cli/start/mod.rs similarity index 100% rename from src/cluster/src/cli/start/mod.rs rename to crates/fluvio-cluster/src/cli/start/mod.rs diff --git a/src/cluster/src/cli/start/sys.rs b/crates/fluvio-cluster/src/cli/start/sys.rs similarity index 100% rename from src/cluster/src/cli/start/sys.rs rename to crates/fluvio-cluster/src/cli/start/sys.rs diff --git a/src/cluster/src/cli/start/tls.rs b/crates/fluvio-cluster/src/cli/start/tls.rs similarity index 100% rename from src/cluster/src/cli/start/tls.rs rename to crates/fluvio-cluster/src/cli/start/tls.rs diff --git a/src/cluster/src/cli/util.rs b/crates/fluvio-cluster/src/cli/util.rs similarity index 100% rename from src/cluster/src/cli/util.rs rename to crates/fluvio-cluster/src/cli/util.rs diff --git a/src/cluster/src/delete.rs b/crates/fluvio-cluster/src/delete.rs similarity index 100% rename from src/cluster/src/delete.rs rename to crates/fluvio-cluster/src/delete.rs diff --git a/src/cluster/src/error.rs b/crates/fluvio-cluster/src/error.rs similarity index 100% rename from src/cluster/src/error.rs rename to crates/fluvio-cluster/src/error.rs diff --git a/src/cluster/src/lib.rs b/crates/fluvio-cluster/src/lib.rs similarity index 100% rename from src/cluster/src/lib.rs rename to crates/fluvio-cluster/src/lib.rs diff --git a/src/cluster/src/start/common.rs b/crates/fluvio-cluster/src/start/common.rs similarity index 100% rename from src/cluster/src/start/common.rs rename to crates/fluvio-cluster/src/start/common.rs diff --git a/src/cluster/src/start/k8.rs b/crates/fluvio-cluster/src/start/k8.rs similarity index 100% rename from src/cluster/src/start/k8.rs rename to crates/fluvio-cluster/src/start/k8.rs diff --git a/src/cluster/src/start/local.rs b/crates/fluvio-cluster/src/start/local.rs similarity index 100% rename from src/cluster/src/start/local.rs rename to crates/fluvio-cluster/src/start/local.rs diff --git a/src/cluster/src/start/mod.rs b/crates/fluvio-cluster/src/start/mod.rs similarity index 100% rename from src/cluster/src/start/mod.rs rename to crates/fluvio-cluster/src/start/mod.rs diff --git a/src/controlplane-metadata/Cargo.toml b/crates/fluvio-controlplane-metadata/Cargo.toml similarity index 68% rename from src/controlplane-metadata/Cargo.toml rename to crates/fluvio-controlplane-metadata/Cargo.toml index a62e54164b..3f02c3fe85 100644 --- a/src/controlplane-metadata/Cargo.toml +++ b/crates/fluvio-controlplane-metadata/Cargo.toml @@ -24,10 +24,10 @@ async-trait = "0.1.21" # Fluvio dependencies fluvio-future = { version = "0.3.0" } flv-util = { version = "0.5.0" } -fluvio-types = { version = "0.2.0", path = "../types" } -fluvio-stream-model = { path = "../stream-model", version = "0.5.0" } -fluvio-protocol = { path = "../protocol", version = "0.6" } -dataplane = { version = "0.6.0", path = "../dataplane-protocol", package = "fluvio-dataplane-protocol" } +fluvio-types = { version = "0.2.0", path = "../fluvio-types" } +fluvio-stream-model = { path = "../fluvio-stream-model", version = "0.5.0" } +fluvio-protocol = { path = "../fluvio-protocol", version = "0.6" } +dataplane = { version = "0.6.0", path = "../fluvio-dataplane-protocol", package = "fluvio-dataplane-protocol" } [dev-dependencies] fluvio-future = { version = "0.3.0", features = ["fixture"] } diff --git a/src/cluster/LICENSE-APACHE b/crates/fluvio-controlplane-metadata/LICENSE-APACHE similarity index 100% rename from src/cluster/LICENSE-APACHE rename to crates/fluvio-controlplane-metadata/LICENSE-APACHE diff --git a/src/controlplane-metadata/README.md b/crates/fluvio-controlplane-metadata/README.md similarity index 100% rename from src/controlplane-metadata/README.md rename to crates/fluvio-controlplane-metadata/README.md diff --git a/src/controlplane-metadata/src/lib.rs b/crates/fluvio-controlplane-metadata/src/lib.rs similarity index 100% rename from src/controlplane-metadata/src/lib.rs rename to crates/fluvio-controlplane-metadata/src/lib.rs diff --git a/src/controlplane-metadata/src/message/mod.rs b/crates/fluvio-controlplane-metadata/src/message/mod.rs similarity index 100% rename from src/controlplane-metadata/src/message/mod.rs rename to crates/fluvio-controlplane-metadata/src/message/mod.rs diff --git a/src/controlplane-metadata/src/message/msg_type.rs b/crates/fluvio-controlplane-metadata/src/message/msg_type.rs similarity index 100% rename from src/controlplane-metadata/src/message/msg_type.rs rename to crates/fluvio-controlplane-metadata/src/message/msg_type.rs diff --git a/src/controlplane-metadata/src/message/replica_msg.rs b/crates/fluvio-controlplane-metadata/src/message/replica_msg.rs similarity index 100% rename from src/controlplane-metadata/src/message/replica_msg.rs rename to crates/fluvio-controlplane-metadata/src/message/replica_msg.rs diff --git a/src/controlplane-metadata/src/partition/k8.rs b/crates/fluvio-controlplane-metadata/src/partition/k8.rs similarity index 100% rename from src/controlplane-metadata/src/partition/k8.rs rename to crates/fluvio-controlplane-metadata/src/partition/k8.rs diff --git a/src/controlplane-metadata/src/partition/mod.rs b/crates/fluvio-controlplane-metadata/src/partition/mod.rs similarity index 100% rename from src/controlplane-metadata/src/partition/mod.rs rename to crates/fluvio-controlplane-metadata/src/partition/mod.rs diff --git a/src/controlplane-metadata/src/partition/policy.rs b/crates/fluvio-controlplane-metadata/src/partition/policy.rs similarity index 100% rename from src/controlplane-metadata/src/partition/policy.rs rename to crates/fluvio-controlplane-metadata/src/partition/policy.rs diff --git a/src/controlplane-metadata/src/partition/replica.rs b/crates/fluvio-controlplane-metadata/src/partition/replica.rs similarity index 100% rename from src/controlplane-metadata/src/partition/replica.rs rename to crates/fluvio-controlplane-metadata/src/partition/replica.rs diff --git a/src/controlplane-metadata/src/partition/spec.rs b/crates/fluvio-controlplane-metadata/src/partition/spec.rs similarity index 100% rename from src/controlplane-metadata/src/partition/spec.rs rename to crates/fluvio-controlplane-metadata/src/partition/spec.rs diff --git a/src/controlplane-metadata/src/partition/status.rs b/crates/fluvio-controlplane-metadata/src/partition/status.rs similarity index 100% rename from src/controlplane-metadata/src/partition/status.rs rename to crates/fluvio-controlplane-metadata/src/partition/status.rs diff --git a/src/controlplane-metadata/src/partition/store.rs b/crates/fluvio-controlplane-metadata/src/partition/store.rs similarity index 100% rename from src/controlplane-metadata/src/partition/store.rs rename to crates/fluvio-controlplane-metadata/src/partition/store.rs diff --git a/src/controlplane-metadata/src/spg/k8/mod.rs b/crates/fluvio-controlplane-metadata/src/spg/k8/mod.rs similarity index 100% rename from src/controlplane-metadata/src/spg/k8/mod.rs rename to crates/fluvio-controlplane-metadata/src/spg/k8/mod.rs diff --git a/src/controlplane-metadata/src/spg/k8/spec.rs b/crates/fluvio-controlplane-metadata/src/spg/k8/spec.rs similarity index 100% rename from src/controlplane-metadata/src/spg/k8/spec.rs rename to crates/fluvio-controlplane-metadata/src/spg/k8/spec.rs diff --git a/src/controlplane-metadata/src/spg/mod.rs b/crates/fluvio-controlplane-metadata/src/spg/mod.rs similarity index 100% rename from src/controlplane-metadata/src/spg/mod.rs rename to crates/fluvio-controlplane-metadata/src/spg/mod.rs diff --git a/src/controlplane-metadata/src/spg/spec.rs b/crates/fluvio-controlplane-metadata/src/spg/spec.rs similarity index 100% rename from src/controlplane-metadata/src/spg/spec.rs rename to crates/fluvio-controlplane-metadata/src/spg/spec.rs diff --git a/src/controlplane-metadata/src/spg/status.rs b/crates/fluvio-controlplane-metadata/src/spg/status.rs similarity index 100% rename from src/controlplane-metadata/src/spg/status.rs rename to crates/fluvio-controlplane-metadata/src/spg/status.rs diff --git a/src/controlplane-metadata/src/spg/store.rs b/crates/fluvio-controlplane-metadata/src/spg/store.rs similarity index 100% rename from src/controlplane-metadata/src/spg/store.rs rename to crates/fluvio-controlplane-metadata/src/spg/store.rs diff --git a/src/controlplane-metadata/src/spu/k8.rs b/crates/fluvio-controlplane-metadata/src/spu/k8.rs similarity index 100% rename from src/controlplane-metadata/src/spu/k8.rs rename to crates/fluvio-controlplane-metadata/src/spu/k8.rs diff --git a/src/controlplane-metadata/src/spu/mod.rs b/crates/fluvio-controlplane-metadata/src/spu/mod.rs similarity index 100% rename from src/controlplane-metadata/src/spu/mod.rs rename to crates/fluvio-controlplane-metadata/src/spu/mod.rs diff --git a/src/controlplane-metadata/src/spu/spec.rs b/crates/fluvio-controlplane-metadata/src/spu/spec.rs similarity index 100% rename from src/controlplane-metadata/src/spu/spec.rs rename to crates/fluvio-controlplane-metadata/src/spu/spec.rs diff --git a/src/controlplane-metadata/src/spu/status.rs b/crates/fluvio-controlplane-metadata/src/spu/status.rs similarity index 100% rename from src/controlplane-metadata/src/spu/status.rs rename to crates/fluvio-controlplane-metadata/src/spu/status.rs diff --git a/src/controlplane-metadata/src/spu/store.rs b/crates/fluvio-controlplane-metadata/src/spu/store.rs similarity index 100% rename from src/controlplane-metadata/src/spu/store.rs rename to crates/fluvio-controlplane-metadata/src/spu/store.rs diff --git a/src/controlplane-metadata/src/topic/k8.rs b/crates/fluvio-controlplane-metadata/src/topic/k8.rs similarity index 100% rename from src/controlplane-metadata/src/topic/k8.rs rename to crates/fluvio-controlplane-metadata/src/topic/k8.rs diff --git a/src/controlplane-metadata/src/topic/mod.rs b/crates/fluvio-controlplane-metadata/src/topic/mod.rs similarity index 100% rename from src/controlplane-metadata/src/topic/mod.rs rename to crates/fluvio-controlplane-metadata/src/topic/mod.rs diff --git a/src/controlplane-metadata/src/topic/spec.rs b/crates/fluvio-controlplane-metadata/src/topic/spec.rs similarity index 100% rename from src/controlplane-metadata/src/topic/spec.rs rename to crates/fluvio-controlplane-metadata/src/topic/spec.rs diff --git a/src/controlplane-metadata/src/topic/status.rs b/crates/fluvio-controlplane-metadata/src/topic/status.rs similarity index 100% rename from src/controlplane-metadata/src/topic/status.rs rename to crates/fluvio-controlplane-metadata/src/topic/status.rs diff --git a/src/controlplane-metadata/src/topic/store.rs b/crates/fluvio-controlplane-metadata/src/topic/store.rs similarity index 100% rename from src/controlplane-metadata/src/topic/store.rs rename to crates/fluvio-controlplane-metadata/src/topic/store.rs diff --git a/src/controlplane/Cargo.toml b/crates/fluvio-controlplane/Cargo.toml similarity index 51% rename from src/controlplane/Cargo.toml rename to crates/fluvio-controlplane/Cargo.toml index ddc682be3c..8fd7ecd884 100644 --- a/src/controlplane/Cargo.toml +++ b/crates/fluvio-controlplane/Cargo.toml @@ -17,7 +17,7 @@ log = "0.4.8" tracing = "0.1.19" # Fluvio dependencies -fluvio-types = { path = "../types", version = "0.2.0" } -fluvio-controlplane-metadata = { path = "../controlplane-metadata", version = "0.10.0" } -fluvio-protocol = { path = "../protocol", version = "0.6" } -dataplane = { version = "0.6.0", path = "../dataplane-protocol", package = "fluvio-dataplane-protocol" } +fluvio-types = { path = "../fluvio-types", version = "0.2.0" } +fluvio-controlplane-metadata = { path = "../fluvio-controlplane-metadata", version = "0.10.0" } +fluvio-protocol = { path = "../fluvio-protocol", version = "0.6" } +dataplane = { version = "0.6.0", path = "../fluvio-dataplane-protocol", package = "fluvio-dataplane-protocol" } diff --git a/src/controlplane-metadata/LICENSE-APACHE b/crates/fluvio-controlplane/LICENSE-APACHE similarity index 100% rename from src/controlplane-metadata/LICENSE-APACHE rename to crates/fluvio-controlplane/LICENSE-APACHE diff --git a/src/controlplane/src/lib.rs b/crates/fluvio-controlplane/src/lib.rs similarity index 100% rename from src/controlplane/src/lib.rs rename to crates/fluvio-controlplane/src/lib.rs diff --git a/src/controlplane/src/requests/mod.rs b/crates/fluvio-controlplane/src/requests/mod.rs similarity index 100% rename from src/controlplane/src/requests/mod.rs rename to crates/fluvio-controlplane/src/requests/mod.rs diff --git a/src/controlplane/src/requests/register_spu.rs b/crates/fluvio-controlplane/src/requests/register_spu.rs similarity index 100% rename from src/controlplane/src/requests/register_spu.rs rename to crates/fluvio-controlplane/src/requests/register_spu.rs diff --git a/src/controlplane/src/requests/remove.rs b/crates/fluvio-controlplane/src/requests/remove.rs similarity index 100% rename from src/controlplane/src/requests/remove.rs rename to crates/fluvio-controlplane/src/requests/remove.rs diff --git a/src/controlplane/src/requests/update_lrs.rs b/crates/fluvio-controlplane/src/requests/update_lrs.rs similarity index 100% rename from src/controlplane/src/requests/update_lrs.rs rename to crates/fluvio-controlplane/src/requests/update_lrs.rs diff --git a/src/controlplane/src/requests/update_replica.rs b/crates/fluvio-controlplane/src/requests/update_replica.rs similarity index 100% rename from src/controlplane/src/requests/update_replica.rs rename to crates/fluvio-controlplane/src/requests/update_replica.rs diff --git a/src/controlplane/src/requests/update_spu.rs b/crates/fluvio-controlplane/src/requests/update_spu.rs similarity index 100% rename from src/controlplane/src/requests/update_spu.rs rename to crates/fluvio-controlplane/src/requests/update_spu.rs diff --git a/src/controlplane/src/sc_api.rs b/crates/fluvio-controlplane/src/sc_api.rs similarity index 100% rename from src/controlplane/src/sc_api.rs rename to crates/fluvio-controlplane/src/sc_api.rs diff --git a/src/controlplane/src/spu_api.rs b/crates/fluvio-controlplane/src/spu_api.rs similarity index 100% rename from src/controlplane/src/spu_api.rs rename to crates/fluvio-controlplane/src/spu_api.rs diff --git a/src/dataplane-protocol/Cargo.toml b/crates/fluvio-dataplane-protocol/Cargo.toml similarity index 86% rename from src/dataplane-protocol/Cargo.toml rename to crates/fluvio-dataplane-protocol/Cargo.toml index 11a87c53a5..60b89c36c6 100644 --- a/src/dataplane-protocol/Cargo.toml +++ b/crates/fluvio-dataplane-protocol/Cargo.toml @@ -27,13 +27,13 @@ thiserror = "1" # Fluvio dependencies fluvio-future = { version = "0.3.1" } -fluvio-protocol = { path = "../protocol", version = "0.6", features = [ +fluvio-protocol = { path = "../fluvio-protocol", version = "0.6", features = [ "derive", "api", ] } flv-util = { version = "0.5.0" } [dev-dependencies] -fluvio-socket = { path = "../socket", version = "0.9" } +fluvio-socket = { path = "../fluvio-socket", version = "0.9" } fluvio-future = { version = "0.3.1", features = ["fixture", "fs"] } flv-util = { version = "0.5.2", features = ["fixture"] } diff --git a/src/controlplane/LICENSE-APACHE b/crates/fluvio-dataplane-protocol/LICENSE-APACHE similarity index 100% rename from src/controlplane/LICENSE-APACHE rename to crates/fluvio-dataplane-protocol/LICENSE-APACHE diff --git a/src/dataplane-protocol/README.md b/crates/fluvio-dataplane-protocol/README.md similarity index 100% rename from src/dataplane-protocol/README.md rename to crates/fluvio-dataplane-protocol/README.md diff --git a/src/dataplane-protocol/src/batch.rs b/crates/fluvio-dataplane-protocol/src/batch.rs similarity index 100% rename from src/dataplane-protocol/src/batch.rs rename to crates/fluvio-dataplane-protocol/src/batch.rs diff --git a/src/dataplane-protocol/src/common.rs b/crates/fluvio-dataplane-protocol/src/common.rs similarity index 100% rename from src/dataplane-protocol/src/common.rs rename to crates/fluvio-dataplane-protocol/src/common.rs diff --git a/src/dataplane-protocol/src/error_code.rs b/crates/fluvio-dataplane-protocol/src/error_code.rs similarity index 100% rename from src/dataplane-protocol/src/error_code.rs rename to crates/fluvio-dataplane-protocol/src/error_code.rs diff --git a/src/dataplane-protocol/src/fetch/mod.rs b/crates/fluvio-dataplane-protocol/src/fetch/mod.rs similarity index 100% rename from src/dataplane-protocol/src/fetch/mod.rs rename to crates/fluvio-dataplane-protocol/src/fetch/mod.rs diff --git a/src/dataplane-protocol/src/fetch/request.rs b/crates/fluvio-dataplane-protocol/src/fetch/request.rs similarity index 100% rename from src/dataplane-protocol/src/fetch/request.rs rename to crates/fluvio-dataplane-protocol/src/fetch/request.rs diff --git a/src/dataplane-protocol/src/fetch/response.rs b/crates/fluvio-dataplane-protocol/src/fetch/response.rs similarity index 100% rename from src/dataplane-protocol/src/fetch/response.rs rename to crates/fluvio-dataplane-protocol/src/fetch/response.rs diff --git a/src/dataplane-protocol/src/fixture.rs b/crates/fluvio-dataplane-protocol/src/fixture.rs similarity index 100% rename from src/dataplane-protocol/src/fixture.rs rename to crates/fluvio-dataplane-protocol/src/fixture.rs diff --git a/src/dataplane-protocol/src/lib.rs b/crates/fluvio-dataplane-protocol/src/lib.rs similarity index 100% rename from src/dataplane-protocol/src/lib.rs rename to crates/fluvio-dataplane-protocol/src/lib.rs diff --git a/src/dataplane-protocol/src/produce/mod.rs b/crates/fluvio-dataplane-protocol/src/produce/mod.rs similarity index 100% rename from src/dataplane-protocol/src/produce/mod.rs rename to crates/fluvio-dataplane-protocol/src/produce/mod.rs diff --git a/src/dataplane-protocol/src/produce/request.rs b/crates/fluvio-dataplane-protocol/src/produce/request.rs similarity index 100% rename from src/dataplane-protocol/src/produce/request.rs rename to crates/fluvio-dataplane-protocol/src/produce/request.rs diff --git a/src/dataplane-protocol/src/produce/response.rs b/crates/fluvio-dataplane-protocol/src/produce/response.rs similarity index 100% rename from src/dataplane-protocol/src/produce/response.rs rename to crates/fluvio-dataplane-protocol/src/produce/response.rs diff --git a/src/dataplane-protocol/src/record.rs b/crates/fluvio-dataplane-protocol/src/record.rs similarity index 100% rename from src/dataplane-protocol/src/record.rs rename to crates/fluvio-dataplane-protocol/src/record.rs diff --git a/src/dataplane-protocol/src/smartstream.rs b/crates/fluvio-dataplane-protocol/src/smartstream.rs similarity index 100% rename from src/dataplane-protocol/src/smartstream.rs rename to crates/fluvio-dataplane-protocol/src/smartstream.rs diff --git a/src/dataplane-protocol/src/versions.rs b/crates/fluvio-dataplane-protocol/src/versions.rs similarity index 100% rename from src/dataplane-protocol/src/versions.rs rename to crates/fluvio-dataplane-protocol/src/versions.rs diff --git a/src/dataplane-protocol/tests/file_fetch.rs b/crates/fluvio-dataplane-protocol/tests/file_fetch.rs similarity index 100% rename from src/dataplane-protocol/tests/file_fetch.rs rename to crates/fluvio-dataplane-protocol/tests/file_fetch.rs diff --git a/src/dataplane-protocol/tests/test_old_record_empty_key.bin b/crates/fluvio-dataplane-protocol/tests/test_old_record_empty_key.bin similarity index 100% rename from src/dataplane-protocol/tests/test_old_record_empty_key.bin rename to crates/fluvio-dataplane-protocol/tests/test_old_record_empty_key.bin diff --git a/src/extension-common/Cargo.toml b/crates/fluvio-extension-common/Cargo.toml similarity index 83% rename from src/extension-common/Cargo.toml rename to crates/fluvio-extension-common/Cargo.toml index 7352f3fc89..4402701372 100644 --- a/src/extension-common/Cargo.toml +++ b/crates/fluvio-extension-common/Cargo.toml @@ -27,5 +27,5 @@ futures-lite = { version = "1.7.0" } thiserror = "1.0.20" semver = { version = "1.0.0", features = ["serde"] } -fluvio = { version = "0.9.1", path = "../client", optional = true } -fluvio-package-index = { version = "0.5", path = "../package-index" } +fluvio = { version = "0.9.1", path = "../fluvio", optional = true } +fluvio-package-index = { version = "0.5", path = "../fluvio-package-index" } diff --git a/src/dataplane-protocol/LICENSE-APACHE b/crates/fluvio-extension-common/LICENSE-APACHE similarity index 100% rename from src/dataplane-protocol/LICENSE-APACHE rename to crates/fluvio-extension-common/LICENSE-APACHE diff --git a/src/extension-common/README.md b/crates/fluvio-extension-common/README.md similarity index 100% rename from src/extension-common/README.md rename to crates/fluvio-extension-common/README.md diff --git a/src/extension-common/src/common/hex_dump.rs b/crates/fluvio-extension-common/src/common/hex_dump.rs similarity index 100% rename from src/extension-common/src/common/hex_dump.rs rename to crates/fluvio-extension-common/src/common/hex_dump.rs diff --git a/src/extension-common/src/common/mod.rs b/crates/fluvio-extension-common/src/common/mod.rs similarity index 100% rename from src/extension-common/src/common/mod.rs rename to crates/fluvio-extension-common/src/common/mod.rs diff --git a/src/extension-common/src/lib.rs b/crates/fluvio-extension-common/src/lib.rs similarity index 100% rename from src/extension-common/src/lib.rs rename to crates/fluvio-extension-common/src/lib.rs diff --git a/src/extension-common/src/output/describe.rs b/crates/fluvio-extension-common/src/output/describe.rs similarity index 100% rename from src/extension-common/src/output/describe.rs rename to crates/fluvio-extension-common/src/output/describe.rs diff --git a/src/extension-common/src/output/mod.rs b/crates/fluvio-extension-common/src/output/mod.rs similarity index 100% rename from src/extension-common/src/output/mod.rs rename to crates/fluvio-extension-common/src/output/mod.rs diff --git a/src/extension-common/src/output/serde.rs b/crates/fluvio-extension-common/src/output/serde.rs similarity index 100% rename from src/extension-common/src/output/serde.rs rename to crates/fluvio-extension-common/src/output/serde.rs diff --git a/src/extension-common/src/output/table.rs b/crates/fluvio-extension-common/src/output/table.rs similarity index 100% rename from src/extension-common/src/output/table.rs rename to crates/fluvio-extension-common/src/output/table.rs diff --git a/src/extension-common/src/tls.rs b/crates/fluvio-extension-common/src/tls.rs similarity index 100% rename from src/extension-common/src/tls.rs rename to crates/fluvio-extension-common/src/tls.rs diff --git a/src/package-index/Cargo.toml b/crates/fluvio-package-index/Cargo.toml similarity index 100% rename from src/package-index/Cargo.toml rename to crates/fluvio-package-index/Cargo.toml diff --git a/src/extension-common/LICENSE-APACHE b/crates/fluvio-package-index/LICENSE-APACHE similarity index 100% rename from src/extension-common/LICENSE-APACHE rename to crates/fluvio-package-index/LICENSE-APACHE diff --git a/src/package-index/build.rs b/crates/fluvio-package-index/build.rs similarity index 100% rename from src/package-index/build.rs rename to crates/fluvio-package-index/build.rs diff --git a/src/package-index/src/error.rs b/crates/fluvio-package-index/src/error.rs similarity index 100% rename from src/package-index/src/error.rs rename to crates/fluvio-package-index/src/error.rs diff --git a/src/package-index/src/http.rs b/crates/fluvio-package-index/src/http.rs similarity index 100% rename from src/package-index/src/http.rs rename to crates/fluvio-package-index/src/http.rs diff --git a/src/package-index/src/lib.rs b/crates/fluvio-package-index/src/lib.rs similarity index 100% rename from src/package-index/src/lib.rs rename to crates/fluvio-package-index/src/lib.rs diff --git a/src/package-index/src/package.rs b/crates/fluvio-package-index/src/package.rs similarity index 100% rename from src/package-index/src/package.rs rename to crates/fluvio-package-index/src/package.rs diff --git a/src/package-index/src/package_id.rs b/crates/fluvio-package-index/src/package_id.rs similarity index 100% rename from src/package-index/src/package_id.rs rename to crates/fluvio-package-index/src/package_id.rs diff --git a/src/package-index/src/tags.rs b/crates/fluvio-package-index/src/tags.rs similarity index 100% rename from src/package-index/src/tags.rs rename to crates/fluvio-package-index/src/tags.rs diff --git a/src/package-index/src/target.rs b/crates/fluvio-package-index/src/target.rs similarity index 100% rename from src/package-index/src/target.rs rename to crates/fluvio-package-index/src/target.rs diff --git a/src/package-index/src/version.rs b/crates/fluvio-package-index/src/version.rs similarity index 100% rename from src/package-index/src/version.rs rename to crates/fluvio-package-index/src/version.rs diff --git a/src/protocol/fluvio-protocol-api/Cargo.toml b/crates/fluvio-protocol-api/Cargo.toml similarity index 100% rename from src/protocol/fluvio-protocol-api/Cargo.toml rename to crates/fluvio-protocol-api/Cargo.toml diff --git a/src/package-index/LICENSE-APACHE b/crates/fluvio-protocol-api/LICENSE-APACHE similarity index 100% rename from src/package-index/LICENSE-APACHE rename to crates/fluvio-protocol-api/LICENSE-APACHE diff --git a/src/protocol/fluvio-protocol-api/README.md b/crates/fluvio-protocol-api/README.md similarity index 100% rename from src/protocol/fluvio-protocol-api/README.md rename to crates/fluvio-protocol-api/README.md diff --git a/src/protocol/fluvio-protocol-api/src/api.rs b/crates/fluvio-protocol-api/src/api.rs similarity index 100% rename from src/protocol/fluvio-protocol-api/src/api.rs rename to crates/fluvio-protocol-api/src/api.rs diff --git a/src/protocol/fluvio-protocol-api/src/lib.rs b/crates/fluvio-protocol-api/src/lib.rs similarity index 100% rename from src/protocol/fluvio-protocol-api/src/lib.rs rename to crates/fluvio-protocol-api/src/lib.rs diff --git a/src/protocol/fluvio-protocol-api/src/request.rs b/crates/fluvio-protocol-api/src/request.rs similarity index 100% rename from src/protocol/fluvio-protocol-api/src/request.rs rename to crates/fluvio-protocol-api/src/request.rs diff --git a/src/protocol/fluvio-protocol-api/src/response.rs b/crates/fluvio-protocol-api/src/response.rs similarity index 100% rename from src/protocol/fluvio-protocol-api/src/response.rs rename to crates/fluvio-protocol-api/src/response.rs diff --git a/src/protocol/fluvio-protocol-codec/Cargo.lock b/crates/fluvio-protocol-codec/Cargo.lock similarity index 100% rename from src/protocol/fluvio-protocol-codec/Cargo.lock rename to crates/fluvio-protocol-codec/Cargo.lock diff --git a/src/protocol/fluvio-protocol-codec/Cargo.toml b/crates/fluvio-protocol-codec/Cargo.toml similarity index 100% rename from src/protocol/fluvio-protocol-codec/Cargo.toml rename to crates/fluvio-protocol-codec/Cargo.toml diff --git a/src/protocol/LICENSE-APACHE b/crates/fluvio-protocol-codec/LICENSE-APACHE similarity index 100% rename from src/protocol/LICENSE-APACHE rename to crates/fluvio-protocol-codec/LICENSE-APACHE diff --git a/src/protocol/fluvio-protocol-codec/README.md b/crates/fluvio-protocol-codec/README.md similarity index 100% rename from src/protocol/fluvio-protocol-codec/README.md rename to crates/fluvio-protocol-codec/README.md diff --git a/src/protocol/fluvio-protocol-codec/src/codec.rs b/crates/fluvio-protocol-codec/src/codec.rs similarity index 100% rename from src/protocol/fluvio-protocol-codec/src/codec.rs rename to crates/fluvio-protocol-codec/src/codec.rs diff --git a/src/protocol/fluvio-protocol-codec/src/lib.rs b/crates/fluvio-protocol-codec/src/lib.rs similarity index 100% rename from src/protocol/fluvio-protocol-codec/src/lib.rs rename to crates/fluvio-protocol-codec/src/lib.rs diff --git a/src/protocol/fluvio-protocol-core/Cargo.lock b/crates/fluvio-protocol-core/Cargo.lock similarity index 100% rename from src/protocol/fluvio-protocol-core/Cargo.lock rename to crates/fluvio-protocol-core/Cargo.lock diff --git a/src/protocol/fluvio-protocol-core/Cargo.toml b/crates/fluvio-protocol-core/Cargo.toml similarity index 99% rename from src/protocol/fluvio-protocol-core/Cargo.toml rename to crates/fluvio-protocol-core/Cargo.toml index 6ba237e931..cdb6e49fdb 100644 --- a/src/protocol/fluvio-protocol-core/Cargo.toml +++ b/crates/fluvio-protocol-core/Cargo.toml @@ -8,7 +8,6 @@ repository = "https://github.com/infinyon/fluvio-protocol" license = "Apache-2.0" categories = ["encoding"] - [dependencies] bytes = "1.0.0" log = "0.4.8" diff --git a/src/protocol/fluvio-protocol-api/LICENSE-APACHE b/crates/fluvio-protocol-core/LICENSE-APACHE similarity index 100% rename from src/protocol/fluvio-protocol-api/LICENSE-APACHE rename to crates/fluvio-protocol-core/LICENSE-APACHE diff --git a/src/protocol/fluvio-protocol-core/README.md b/crates/fluvio-protocol-core/README.md similarity index 100% rename from src/protocol/fluvio-protocol-core/README.md rename to crates/fluvio-protocol-core/README.md diff --git a/src/protocol/fluvio-protocol-core/src/buffer.rs b/crates/fluvio-protocol-core/src/buffer.rs similarity index 100% rename from src/protocol/fluvio-protocol-core/src/buffer.rs rename to crates/fluvio-protocol-core/src/buffer.rs diff --git a/src/protocol/fluvio-protocol-core/src/decoder.rs b/crates/fluvio-protocol-core/src/decoder.rs similarity index 100% rename from src/protocol/fluvio-protocol-core/src/decoder.rs rename to crates/fluvio-protocol-core/src/decoder.rs diff --git a/src/protocol/fluvio-protocol-core/src/encoder.rs b/crates/fluvio-protocol-core/src/encoder.rs similarity index 100% rename from src/protocol/fluvio-protocol-core/src/encoder.rs rename to crates/fluvio-protocol-core/src/encoder.rs diff --git a/src/protocol/fluvio-protocol-core/src/lib.rs b/crates/fluvio-protocol-core/src/lib.rs similarity index 100% rename from src/protocol/fluvio-protocol-core/src/lib.rs rename to crates/fluvio-protocol-core/src/lib.rs diff --git a/src/protocol/fluvio-protocol-core/src/varint.rs b/crates/fluvio-protocol-core/src/varint.rs similarity index 100% rename from src/protocol/fluvio-protocol-core/src/varint.rs rename to crates/fluvio-protocol-core/src/varint.rs diff --git a/src/protocol/fluvio-protocol-core/src/zerocopy.rs b/crates/fluvio-protocol-core/src/zerocopy.rs similarity index 100% rename from src/protocol/fluvio-protocol-core/src/zerocopy.rs rename to crates/fluvio-protocol-core/src/zerocopy.rs diff --git a/src/protocol/fluvio-protocol-derive/Cargo.lock b/crates/fluvio-protocol-derive/Cargo.lock similarity index 100% rename from src/protocol/fluvio-protocol-derive/Cargo.lock rename to crates/fluvio-protocol-derive/Cargo.lock diff --git a/src/protocol/fluvio-protocol-derive/Cargo.toml b/crates/fluvio-protocol-derive/Cargo.toml similarity index 85% rename from src/protocol/fluvio-protocol-derive/Cargo.toml rename to crates/fluvio-protocol-derive/Cargo.toml index e895a0165e..4a0c55cd16 100644 --- a/src/protocol/fluvio-protocol-derive/Cargo.toml +++ b/crates/fluvio-protocol-derive/Cargo.toml @@ -23,4 +23,4 @@ features = ["full"] [dev-dependencies] trybuild = { git = "https://github.com/infinyon/trybuild", branch = "check_option" } -fluvio-protocol = { version = "0.6", path = "../", features = ["derive", "api"] } +fluvio-protocol = { version = "0.6", path = "../fluvio-protocol", features = ["derive", "api"] } diff --git a/src/protocol/fluvio-protocol-codec/LICENSE-APACHE b/crates/fluvio-protocol-derive/LICENSE-APACHE similarity index 100% rename from src/protocol/fluvio-protocol-codec/LICENSE-APACHE rename to crates/fluvio-protocol-derive/LICENSE-APACHE diff --git a/src/protocol/fluvio-protocol-derive/README.md b/crates/fluvio-protocol-derive/README.md similarity index 100% rename from src/protocol/fluvio-protocol-derive/README.md rename to crates/fluvio-protocol-derive/README.md diff --git a/src/protocol/fluvio-protocol-derive/rustfmt.toml b/crates/fluvio-protocol-derive/rustfmt.toml similarity index 100% rename from src/protocol/fluvio-protocol-derive/rustfmt.toml rename to crates/fluvio-protocol-derive/rustfmt.toml diff --git a/src/protocol/fluvio-protocol-derive/src/api.rs b/crates/fluvio-protocol-derive/src/api.rs similarity index 100% rename from src/protocol/fluvio-protocol-derive/src/api.rs rename to crates/fluvio-protocol-derive/src/api.rs diff --git a/src/protocol/fluvio-protocol-derive/src/ast/container.rs b/crates/fluvio-protocol-derive/src/ast/container.rs similarity index 100% rename from src/protocol/fluvio-protocol-derive/src/ast/container.rs rename to crates/fluvio-protocol-derive/src/ast/container.rs diff --git a/src/protocol/fluvio-protocol-derive/src/ast/enum.rs b/crates/fluvio-protocol-derive/src/ast/enum.rs similarity index 100% rename from src/protocol/fluvio-protocol-derive/src/ast/enum.rs rename to crates/fluvio-protocol-derive/src/ast/enum.rs diff --git a/src/protocol/fluvio-protocol-derive/src/ast/mod.rs b/crates/fluvio-protocol-derive/src/ast/mod.rs similarity index 100% rename from src/protocol/fluvio-protocol-derive/src/ast/mod.rs rename to crates/fluvio-protocol-derive/src/ast/mod.rs diff --git a/src/protocol/fluvio-protocol-derive/src/ast/prop.rs b/crates/fluvio-protocol-derive/src/ast/prop.rs similarity index 100% rename from src/protocol/fluvio-protocol-derive/src/ast/prop.rs rename to crates/fluvio-protocol-derive/src/ast/prop.rs diff --git a/src/protocol/fluvio-protocol-derive/src/ast/struct.rs b/crates/fluvio-protocol-derive/src/ast/struct.rs similarity index 100% rename from src/protocol/fluvio-protocol-derive/src/ast/struct.rs rename to crates/fluvio-protocol-derive/src/ast/struct.rs diff --git a/src/protocol/fluvio-protocol-derive/src/de.rs b/crates/fluvio-protocol-derive/src/de.rs similarity index 100% rename from src/protocol/fluvio-protocol-derive/src/de.rs rename to crates/fluvio-protocol-derive/src/de.rs diff --git a/src/protocol/fluvio-protocol-derive/src/lib.rs b/crates/fluvio-protocol-derive/src/lib.rs similarity index 100% rename from src/protocol/fluvio-protocol-derive/src/lib.rs rename to crates/fluvio-protocol-derive/src/lib.rs diff --git a/src/protocol/fluvio-protocol-derive/src/ser.rs b/crates/fluvio-protocol-derive/src/ser.rs similarity index 100% rename from src/protocol/fluvio-protocol-derive/src/ser.rs rename to crates/fluvio-protocol-derive/src/ser.rs diff --git a/src/protocol/fluvio-protocol-derive/src/util.rs b/crates/fluvio-protocol-derive/src/util.rs similarity index 100% rename from src/protocol/fluvio-protocol-derive/src/util.rs rename to crates/fluvio-protocol-derive/src/util.rs diff --git a/src/protocol/fluvio-protocol-derive/tests/parse.rs b/crates/fluvio-protocol-derive/tests/parse.rs similarity index 100% rename from src/protocol/fluvio-protocol-derive/tests/parse.rs rename to crates/fluvio-protocol-derive/tests/parse.rs diff --git a/src/protocol/fluvio-protocol-derive/ui-tests/pass_derive_decode.rs b/crates/fluvio-protocol-derive/ui-tests/pass_derive_decode.rs similarity index 100% rename from src/protocol/fluvio-protocol-derive/ui-tests/pass_derive_decode.rs rename to crates/fluvio-protocol-derive/ui-tests/pass_derive_decode.rs diff --git a/src/protocol/fluvio-protocol-derive/ui-tests/pass_derive_encode.rs b/crates/fluvio-protocol-derive/ui-tests/pass_derive_encode.rs similarity index 100% rename from src/protocol/fluvio-protocol-derive/ui-tests/pass_derive_encode.rs rename to crates/fluvio-protocol-derive/ui-tests/pass_derive_encode.rs diff --git a/src/protocol/.github/workflows/ci.yml b/crates/fluvio-protocol/.github/workflows/ci.yml similarity index 100% rename from src/protocol/.github/workflows/ci.yml rename to crates/fluvio-protocol/.github/workflows/ci.yml diff --git a/src/protocol/.gitignore b/crates/fluvio-protocol/.gitignore similarity index 100% rename from src/protocol/.gitignore rename to crates/fluvio-protocol/.gitignore diff --git a/src/protocol/CODE-OF-CONDUCT.md b/crates/fluvio-protocol/CODE-OF-CONDUCT.md similarity index 100% rename from src/protocol/CODE-OF-CONDUCT.md rename to crates/fluvio-protocol/CODE-OF-CONDUCT.md diff --git a/src/protocol/CONTRIBUTING.md b/crates/fluvio-protocol/CONTRIBUTING.md similarity index 100% rename from src/protocol/CONTRIBUTING.md rename to crates/fluvio-protocol/CONTRIBUTING.md diff --git a/src/protocol/Cargo.lock b/crates/fluvio-protocol/Cargo.lock similarity index 100% rename from src/protocol/Cargo.lock rename to crates/fluvio-protocol/Cargo.lock diff --git a/src/protocol/Cargo.toml b/crates/fluvio-protocol/Cargo.toml similarity index 53% rename from src/protocol/Cargo.toml rename to crates/fluvio-protocol/Cargo.toml index 5be0cb2a63..ee20139744 100644 --- a/src/protocol/Cargo.toml +++ b/crates/fluvio-protocol/Cargo.toml @@ -16,16 +16,16 @@ store = ["fluvio-future", "fluvio-protocol-api", "bytes"] [dependencies] tracing = "0.1" -fluvio-protocol-api = { version = "0.4.0", path = "fluvio-protocol-api", optional = true } -fluvio-protocol-core = { version = "0.3.1", path = "fluvio-protocol-core" } -fluvio-protocol-codec = { version = "0.3.1", path = "fluvio-protocol-codec", optional = true } -fluvio-protocol-derive = { version = "0.3.0", path = "fluvio-protocol-derive", optional = true } +fluvio-protocol-api = { version = "0.4.0", path = "../fluvio-protocol-api", optional = true } +fluvio-protocol-core = { version = "0.3.1", path = "../fluvio-protocol-core" } +fluvio-protocol-codec = { version = "0.3.1", path = "../fluvio-protocol-codec", optional = true } +fluvio-protocol-derive = { version = "0.3.0", path = "../fluvio-protocol-derive", optional = true } fluvio-future = { version = "0.3.0", optional = true } bytes = { version = "1.0.0", optional = true } [dev-dependencies] flv-util = { version = "0.5.2" } -fluvio-protocol-api = { version = "0.4.0", path = "fluvio-protocol-api" } -fluvio-protocol-core = { version = "0.3.1", path = "fluvio-protocol-core" } -fluvio-protocol-derive = { version = "0.3.0", path = "fluvio-protocol-derive" } +fluvio-protocol-api = { version = "0.4.0", path = "../fluvio-protocol-api" } +fluvio-protocol-core = { version = "0.3.1", path = "../fluvio-protocol-core" } +fluvio-protocol-derive = { version = "0.3.0", path = "../fluvio-protocol-derive" } fluvio-future = { version = "0.3.0", features = ["subscriber"] } diff --git a/src/protocol/fluvio-protocol-core/LICENSE-APACHE b/crates/fluvio-protocol/LICENSE-APACHE similarity index 100% rename from src/protocol/fluvio-protocol-core/LICENSE-APACHE rename to crates/fluvio-protocol/LICENSE-APACHE diff --git a/src/protocol/Makefile b/crates/fluvio-protocol/Makefile similarity index 100% rename from src/protocol/Makefile rename to crates/fluvio-protocol/Makefile diff --git a/src/protocol/README.md b/crates/fluvio-protocol/README.md similarity index 100% rename from src/protocol/README.md rename to crates/fluvio-protocol/README.md diff --git a/src/protocol/send-b-client.sh b/crates/fluvio-protocol/send-b-client.sh similarity index 100% rename from src/protocol/send-b-client.sh rename to crates/fluvio-protocol/send-b-client.sh diff --git a/src/protocol/src/lib.rs b/crates/fluvio-protocol/src/lib.rs similarity index 100% rename from src/protocol/src/lib.rs rename to crates/fluvio-protocol/src/lib.rs diff --git a/src/protocol/src/store.rs b/crates/fluvio-protocol/src/store.rs similarity index 100% rename from src/protocol/src/store.rs rename to crates/fluvio-protocol/src/store.rs diff --git a/src/protocol/test-client.sh b/crates/fluvio-protocol/test-client.sh similarity index 100% rename from src/protocol/test-client.sh rename to crates/fluvio-protocol/test-client.sh diff --git a/src/protocol/tests/api.rs b/crates/fluvio-protocol/tests/api.rs similarity index 100% rename from src/protocol/tests/api.rs rename to crates/fluvio-protocol/tests/api.rs diff --git a/src/protocol/tests/btreemap.rs b/crates/fluvio-protocol/tests/btreemap.rs similarity index 100% rename from src/protocol/tests/btreemap.rs rename to crates/fluvio-protocol/tests/btreemap.rs diff --git a/src/protocol/tests/decode.rs b/crates/fluvio-protocol/tests/decode.rs similarity index 100% rename from src/protocol/tests/decode.rs rename to crates/fluvio-protocol/tests/decode.rs diff --git a/src/protocol/tests/default.rs b/crates/fluvio-protocol/tests/default.rs similarity index 100% rename from src/protocol/tests/default.rs rename to crates/fluvio-protocol/tests/default.rs diff --git a/src/protocol/tests/encode.rs b/crates/fluvio-protocol/tests/encode.rs similarity index 100% rename from src/protocol/tests/encode.rs rename to crates/fluvio-protocol/tests/encode.rs diff --git a/src/protocol/tests/enum.rs b/crates/fluvio-protocol/tests/enum.rs similarity index 100% rename from src/protocol/tests/enum.rs rename to crates/fluvio-protocol/tests/enum.rs diff --git a/src/protocol/tests/generic.rs b/crates/fluvio-protocol/tests/generic.rs similarity index 100% rename from src/protocol/tests/generic.rs rename to crates/fluvio-protocol/tests/generic.rs diff --git a/src/protocol/tests/option.rs b/crates/fluvio-protocol/tests/option.rs similarity index 100% rename from src/protocol/tests/option.rs rename to crates/fluvio-protocol/tests/option.rs diff --git a/src/protocol/tests/version.rs b/crates/fluvio-protocol/tests/version.rs similarity index 100% rename from src/protocol/tests/version.rs rename to crates/fluvio-protocol/tests/version.rs diff --git a/src/runner/Cargo.toml b/crates/fluvio-run/Cargo.toml similarity index 78% rename from src/runner/Cargo.toml rename to crates/fluvio-run/Cargo.toml index f5f88c8911..be08677349 100644 --- a/src/runner/Cargo.toml +++ b/crates/fluvio-run/Cargo.toml @@ -20,12 +20,9 @@ doc = false [features] default = [] - [dependencies] tracing = "0.1" tracing-subscriber = "0.2" - - structopt = { version = "0.3.16", default-features = false } thiserror = "1.0.20" semver = "1.0.0" @@ -33,6 +30,6 @@ serde_json = "1.0.64" # regardless of TLS, sc and spu always use openssl_tls for now because we need cert API fluvio-future = { version = "0.3.0", features = ["subscriber"] } -fluvio-sc = { version = "0.0.0", path = "../sc" } -fluvio-spu = { version = "0.0.0", path = "../spu" } -fluvio-extension-common = { version = "0.5.0", path = "../extension-common" } +fluvio-sc = { version = "0.0.0", path = "../fluvio-sc" } +fluvio-spu = { version = "0.0.0", path = "../fluvio-spu" } +fluvio-extension-common = { version = "0.5.0", path = "../fluvio-extension-common" } diff --git a/src/runner/src/bin/main.rs b/crates/fluvio-run/src/bin/main.rs similarity index 100% rename from src/runner/src/bin/main.rs rename to crates/fluvio-run/src/bin/main.rs diff --git a/src/runner/src/error.rs b/crates/fluvio-run/src/error.rs similarity index 100% rename from src/runner/src/error.rs rename to crates/fluvio-run/src/error.rs diff --git a/src/runner/src/lib.rs b/crates/fluvio-run/src/lib.rs similarity index 100% rename from src/runner/src/lib.rs rename to crates/fluvio-run/src/lib.rs diff --git a/src/sc-schema/Cargo.toml b/crates/fluvio-sc-schema/Cargo.toml similarity index 67% rename from src/sc-schema/Cargo.toml rename to crates/fluvio-sc-schema/Cargo.toml index 441ad0eed8..ef37ece5c8 100644 --- a/src/sc-schema/Cargo.toml +++ b/crates/fluvio-sc-schema/Cargo.toml @@ -22,7 +22,7 @@ thiserror = "1.0.20" static_assertions = "1.1.0" # Fluvio dependencies -fluvio-types = { version = "0.2.0", path = "../types" } -fluvio-controlplane-metadata = { version = "0.10.0", default-features = false, path = "../controlplane-metadata" } -fluvio-protocol = { path = "../protocol", version = "0.6" } -dataplane = { version = "0.6.0", path = "../dataplane-protocol", package = "fluvio-dataplane-protocol" } +fluvio-types = { version = "0.2.0", path = "../fluvio-types" } +fluvio-controlplane-metadata = { version = "0.10.0", default-features = false, path = "../fluvio-controlplane-metadata" } +fluvio-protocol = { path = "../fluvio-protocol", version = "0.6" } +dataplane = { version = "0.6.0", path = "../fluvio-dataplane-protocol", package = "fluvio-dataplane-protocol" } diff --git a/src/protocol/fluvio-protocol-derive/LICENSE-APACHE b/crates/fluvio-sc-schema/LICENSE-APACHE similarity index 100% rename from src/protocol/fluvio-protocol-derive/LICENSE-APACHE rename to crates/fluvio-sc-schema/LICENSE-APACHE diff --git a/src/sc-schema/README.md b/crates/fluvio-sc-schema/README.md similarity index 100% rename from src/sc-schema/README.md rename to crates/fluvio-sc-schema/README.md diff --git a/src/sc-schema/src/apis.rs b/crates/fluvio-sc-schema/src/apis.rs similarity index 100% rename from src/sc-schema/src/apis.rs rename to crates/fluvio-sc-schema/src/apis.rs diff --git a/src/sc-schema/src/lib.rs b/crates/fluvio-sc-schema/src/lib.rs similarity index 100% rename from src/sc-schema/src/lib.rs rename to crates/fluvio-sc-schema/src/lib.rs diff --git a/src/sc-schema/src/objects/create.rs b/crates/fluvio-sc-schema/src/objects/create.rs similarity index 100% rename from src/sc-schema/src/objects/create.rs rename to crates/fluvio-sc-schema/src/objects/create.rs diff --git a/src/sc-schema/src/objects/delete.rs b/crates/fluvio-sc-schema/src/objects/delete.rs similarity index 100% rename from src/sc-schema/src/objects/delete.rs rename to crates/fluvio-sc-schema/src/objects/delete.rs diff --git a/src/sc-schema/src/objects/list.rs b/crates/fluvio-sc-schema/src/objects/list.rs similarity index 100% rename from src/sc-schema/src/objects/list.rs rename to crates/fluvio-sc-schema/src/objects/list.rs diff --git a/src/sc-schema/src/objects/mod.rs b/crates/fluvio-sc-schema/src/objects/mod.rs similarity index 100% rename from src/sc-schema/src/objects/mod.rs rename to crates/fluvio-sc-schema/src/objects/mod.rs diff --git a/src/sc-schema/src/objects/watch.rs b/crates/fluvio-sc-schema/src/objects/watch.rs similarity index 100% rename from src/sc-schema/src/objects/watch.rs rename to crates/fluvio-sc-schema/src/objects/watch.rs diff --git a/src/sc-schema/src/partition/mod.rs b/crates/fluvio-sc-schema/src/partition/mod.rs similarity index 100% rename from src/sc-schema/src/partition/mod.rs rename to crates/fluvio-sc-schema/src/partition/mod.rs diff --git a/src/sc-schema/src/request.rs b/crates/fluvio-sc-schema/src/request.rs similarity index 100% rename from src/sc-schema/src/request.rs rename to crates/fluvio-sc-schema/src/request.rs diff --git a/src/sc-schema/src/response.rs b/crates/fluvio-sc-schema/src/response.rs similarity index 100% rename from src/sc-schema/src/response.rs rename to crates/fluvio-sc-schema/src/response.rs diff --git a/src/sc-schema/src/spg/mod.rs b/crates/fluvio-sc-schema/src/spg/mod.rs similarity index 100% rename from src/sc-schema/src/spg/mod.rs rename to crates/fluvio-sc-schema/src/spg/mod.rs diff --git a/src/sc-schema/src/spu/mod.rs b/crates/fluvio-sc-schema/src/spu/mod.rs similarity index 100% rename from src/sc-schema/src/spu/mod.rs rename to crates/fluvio-sc-schema/src/spu/mod.rs diff --git a/src/sc-schema/src/topic/mod.rs b/crates/fluvio-sc-schema/src/topic/mod.rs similarity index 100% rename from src/sc-schema/src/topic/mod.rs rename to crates/fluvio-sc-schema/src/topic/mod.rs diff --git a/src/sc-schema/src/versions.rs b/crates/fluvio-sc-schema/src/versions.rs similarity index 100% rename from src/sc-schema/src/versions.rs rename to crates/fluvio-sc-schema/src/versions.rs diff --git a/src/sc/Cargo.toml b/crates/fluvio-sc/Cargo.toml similarity index 62% rename from src/sc/Cargo.toml rename to crates/fluvio-sc/Cargo.toml index af435454a3..1ead4edfcd 100644 --- a/src/sc/Cargo.toml +++ b/crates/fluvio-sc/Cargo.toml @@ -43,21 +43,21 @@ once_cell = "1.5" cfg-if = { version = "1.0.0" } # Fluvio dependencies -fluvio-auth = { version = "0.6.1", path = "../auth" } +fluvio-auth = { version = "0.6.1", path = "../fluvio-auth" } fluvio-future = { version = "0.3.0", features = ["subscriber", "openssl_tls", "zero_copy"] } -fluvio-types = { version = "0.2.0", path = "../types", features = ["events"] } -fluvio-sc-schema = { version = "0.9.1", path = "../sc-schema" } -fluvio-stream-model = { version = "0.5.0", path = "../stream-model" } -fluvio-controlplane = { version = "0.8.0", path = "../controlplane" } -fluvio-controlplane-metadata = { version = "0.10.1", features = ["k8", "serde"], path = "../controlplane-metadata" } -fluvio-stream-dispatcher = { version = "0.6.0", path = "../stream-dispatcher" } +fluvio-types = { version = "0.2.0", path = "../fluvio-types", features = ["events"] } +fluvio-sc-schema = { version = "0.9.1", path = "../fluvio-sc-schema" } +fluvio-stream-model = { version = "0.5.0", path = "../fluvio-stream-model" } +fluvio-controlplane = { version = "0.8.0", path = "../fluvio-controlplane" } +fluvio-controlplane-metadata = { version = "0.10.1", features = ["k8", "serde"], path = "../fluvio-controlplane-metadata" } +fluvio-stream-dispatcher = { version = "0.6.0", path = "../fluvio-stream-dispatcher" } k8-client = { version = "5.1.5", optional = true } k8-metadata-client = { version = "3.0.0" } -fluvio-protocol = { path = "../protocol", version = "0.6" } +fluvio-protocol = { path = "../fluvio-protocol", version = "0.6" } k8-types = { version = "0.2.7", features = ["app"] } -fluvio-socket = { path = "../socket", version = "0.9" } -dataplane = { version = "0.6.0", path = "../dataplane-protocol", package = "fluvio-dataplane-protocol" } -fluvio-service = { path = "../service", version = "0.0.0" } +fluvio-socket = { path = "../fluvio-socket", version = "0.9" } +dataplane = { version = "0.6.0", path = "../fluvio-dataplane-protocol", package = "fluvio-dataplane-protocol" } +fluvio-service = { path = "../fluvio-service", version = "0.0.0" } flv-tls-proxy = { version = "0.5.0" } [dev-dependencies] diff --git a/src/sc-schema/LICENSE-APACHE b/crates/fluvio-sc/LICENSE-APACHE similarity index 100% rename from src/sc-schema/LICENSE-APACHE rename to crates/fluvio-sc/LICENSE-APACHE diff --git a/src/sc/README.md b/crates/fluvio-sc/README.md similarity index 100% rename from src/sc/README.md rename to crates/fluvio-sc/README.md diff --git a/src/sc/build.rs b/crates/fluvio-sc/build.rs similarity index 100% rename from src/sc/build.rs rename to crates/fluvio-sc/build.rs diff --git a/src/sc/src/bin/k8.rs b/crates/fluvio-sc/src/bin/k8.rs similarity index 100% rename from src/sc/src/bin/k8.rs rename to crates/fluvio-sc/src/bin/k8.rs diff --git a/src/sc/src/cli.rs b/crates/fluvio-sc/src/cli.rs similarity index 100% rename from src/sc/src/cli.rs rename to crates/fluvio-sc/src/cli.rs diff --git a/src/sc/src/config/mod.rs b/crates/fluvio-sc/src/config/mod.rs similarity index 100% rename from src/sc/src/config/mod.rs rename to crates/fluvio-sc/src/config/mod.rs diff --git a/src/sc/src/config/sc_config.rs b/crates/fluvio-sc/src/config/sc_config.rs similarity index 100% rename from src/sc/src/config/sc_config.rs rename to crates/fluvio-sc/src/config/sc_config.rs diff --git a/src/sc/src/controllers/mod.rs b/crates/fluvio-sc/src/controllers/mod.rs similarity index 100% rename from src/sc/src/controllers/mod.rs rename to crates/fluvio-sc/src/controllers/mod.rs diff --git a/src/sc/src/controllers/partitions/Test.MD b/crates/fluvio-sc/src/controllers/partitions/Test.MD similarity index 100% rename from src/sc/src/controllers/partitions/Test.MD rename to crates/fluvio-sc/src/controllers/partitions/Test.MD diff --git a/src/sc/src/controllers/partitions/controller.rs b/crates/fluvio-sc/src/controllers/partitions/controller.rs similarity index 100% rename from src/sc/src/controllers/partitions/controller.rs rename to crates/fluvio-sc/src/controllers/partitions/controller.rs diff --git a/src/sc/src/controllers/partitions/mod.rs b/crates/fluvio-sc/src/controllers/partitions/mod.rs similarity index 100% rename from src/sc/src/controllers/partitions/mod.rs rename to crates/fluvio-sc/src/controllers/partitions/mod.rs diff --git a/src/sc/src/controllers/partitions/reducer.rs b/crates/fluvio-sc/src/controllers/partitions/reducer.rs similarity index 100% rename from src/sc/src/controllers/partitions/reducer.rs rename to crates/fluvio-sc/src/controllers/partitions/reducer.rs diff --git a/src/sc/src/controllers/spus/actions.rs b/crates/fluvio-sc/src/controllers/spus/actions.rs similarity index 100% rename from src/sc/src/controllers/spus/actions.rs rename to crates/fluvio-sc/src/controllers/spus/actions.rs diff --git a/src/sc/src/controllers/spus/controller.rs b/crates/fluvio-sc/src/controllers/spus/controller.rs similarity index 100% rename from src/sc/src/controllers/spus/controller.rs rename to crates/fluvio-sc/src/controllers/spus/controller.rs diff --git a/src/sc/src/controllers/spus/mod.rs b/crates/fluvio-sc/src/controllers/spus/mod.rs similarity index 100% rename from src/sc/src/controllers/spus/mod.rs rename to crates/fluvio-sc/src/controllers/spus/mod.rs diff --git a/src/sc/src/controllers/spus/reducer.rs b/crates/fluvio-sc/src/controllers/spus/reducer.rs similarity index 100% rename from src/sc/src/controllers/spus/reducer.rs rename to crates/fluvio-sc/src/controllers/spus/reducer.rs diff --git a/src/sc/src/controllers/topics/actions.rs b/crates/fluvio-sc/src/controllers/topics/actions.rs similarity index 100% rename from src/sc/src/controllers/topics/actions.rs rename to crates/fluvio-sc/src/controllers/topics/actions.rs diff --git a/src/sc/src/controllers/topics/controller.rs b/crates/fluvio-sc/src/controllers/topics/controller.rs similarity index 100% rename from src/sc/src/controllers/topics/controller.rs rename to crates/fluvio-sc/src/controllers/topics/controller.rs diff --git a/src/sc/src/controllers/topics/mod.rs b/crates/fluvio-sc/src/controllers/topics/mod.rs similarity index 100% rename from src/sc/src/controllers/topics/mod.rs rename to crates/fluvio-sc/src/controllers/topics/mod.rs diff --git a/src/sc/src/controllers/topics/policy.rs b/crates/fluvio-sc/src/controllers/topics/policy.rs similarity index 100% rename from src/sc/src/controllers/topics/policy.rs rename to crates/fluvio-sc/src/controllers/topics/policy.rs diff --git a/src/sc/src/controllers/topics/reducer.rs b/crates/fluvio-sc/src/controllers/topics/reducer.rs similarity index 100% rename from src/sc/src/controllers/topics/reducer.rs rename to crates/fluvio-sc/src/controllers/topics/reducer.rs diff --git a/src/sc/src/core/common/channels.rs b/crates/fluvio-sc/src/core/common/channels.rs similarity index 100% rename from src/sc/src/core/common/channels.rs rename to crates/fluvio-sc/src/core/common/channels.rs diff --git a/src/sc/src/core/common/dispatcher.rs b/crates/fluvio-sc/src/core/common/dispatcher.rs similarity index 100% rename from src/sc/src/core/common/dispatcher.rs rename to crates/fluvio-sc/src/core/common/dispatcher.rs diff --git a/src/sc/src/core/common/mod.rs b/crates/fluvio-sc/src/core/common/mod.rs similarity index 100% rename from src/sc/src/core/common/mod.rs rename to crates/fluvio-sc/src/core/common/mod.rs diff --git a/src/sc/src/core/common/test_fixtures.rs b/crates/fluvio-sc/src/core/common/test_fixtures.rs similarity index 100% rename from src/sc/src/core/common/test_fixtures.rs rename to crates/fluvio-sc/src/core/common/test_fixtures.rs diff --git a/src/sc/src/core/context.rs b/crates/fluvio-sc/src/core/context.rs similarity index 100% rename from src/sc/src/core/context.rs rename to crates/fluvio-sc/src/core/context.rs diff --git a/src/sc/src/core/dispatcher.rs b/crates/fluvio-sc/src/core/dispatcher.rs similarity index 100% rename from src/sc/src/core/dispatcher.rs rename to crates/fluvio-sc/src/core/dispatcher.rs diff --git a/src/sc/src/core/mod.rs b/crates/fluvio-sc/src/core/mod.rs similarity index 100% rename from src/sc/src/core/mod.rs rename to crates/fluvio-sc/src/core/mod.rs diff --git a/src/sc/src/core/world_store.rs b/crates/fluvio-sc/src/core/world_store.rs similarity index 100% rename from src/sc/src/core/world_store.rs rename to crates/fluvio-sc/src/core/world_store.rs diff --git a/src/sc/src/error.rs b/crates/fluvio-sc/src/error.rs similarity index 100% rename from src/sc/src/error.rs rename to crates/fluvio-sc/src/error.rs diff --git a/src/sc/src/init.rs b/crates/fluvio-sc/src/init.rs similarity index 100% rename from src/sc/src/init.rs rename to crates/fluvio-sc/src/init.rs diff --git a/src/sc/src/k8/controllers/mod.rs b/crates/fluvio-sc/src/k8/controllers/mod.rs similarity index 100% rename from src/sc/src/k8/controllers/mod.rs rename to crates/fluvio-sc/src/k8/controllers/mod.rs diff --git a/src/sc/src/k8/controllers/spg_stateful.rs b/crates/fluvio-sc/src/k8/controllers/spg_stateful.rs similarity index 100% rename from src/sc/src/k8/controllers/spg_stateful.rs rename to crates/fluvio-sc/src/k8/controllers/spg_stateful.rs diff --git a/src/sc/src/k8/controllers/spu_controller.rs b/crates/fluvio-sc/src/k8/controllers/spu_controller.rs similarity index 100% rename from src/sc/src/k8/controllers/spu_controller.rs rename to crates/fluvio-sc/src/k8/controllers/spu_controller.rs diff --git a/src/sc/src/k8/controllers/spu_service.rs b/crates/fluvio-sc/src/k8/controllers/spu_service.rs similarity index 100% rename from src/sc/src/k8/controllers/spu_service.rs rename to crates/fluvio-sc/src/k8/controllers/spu_service.rs diff --git a/src/sc/src/k8/mod.rs b/crates/fluvio-sc/src/k8/mod.rs similarity index 100% rename from src/sc/src/k8/mod.rs rename to crates/fluvio-sc/src/k8/mod.rs diff --git a/src/sc/src/k8/objects/mod.rs b/crates/fluvio-sc/src/k8/objects/mod.rs similarity index 100% rename from src/sc/src/k8/objects/mod.rs rename to crates/fluvio-sc/src/k8/objects/mod.rs diff --git a/src/sc/src/k8/objects/spg_group.rs b/crates/fluvio-sc/src/k8/objects/spg_group.rs similarity index 100% rename from src/sc/src/k8/objects/spg_group.rs rename to crates/fluvio-sc/src/k8/objects/spg_group.rs diff --git a/src/sc/src/k8/objects/spg_service.rs b/crates/fluvio-sc/src/k8/objects/spg_service.rs similarity index 100% rename from src/sc/src/k8/objects/spg_service.rs rename to crates/fluvio-sc/src/k8/objects/spg_service.rs diff --git a/src/sc/src/k8/objects/spu_k8_config.rs b/crates/fluvio-sc/src/k8/objects/spu_k8_config.rs similarity index 100% rename from src/sc/src/k8/objects/spu_k8_config.rs rename to crates/fluvio-sc/src/k8/objects/spu_k8_config.rs diff --git a/src/sc/src/k8/objects/spu_service.rs b/crates/fluvio-sc/src/k8/objects/spu_service.rs similarity index 100% rename from src/sc/src/k8/objects/spu_service.rs rename to crates/fluvio-sc/src/k8/objects/spu_service.rs diff --git a/src/sc/src/k8/objects/statefulset.rs b/crates/fluvio-sc/src/k8/objects/statefulset.rs similarity index 100% rename from src/sc/src/k8/objects/statefulset.rs rename to crates/fluvio-sc/src/k8/objects/statefulset.rs diff --git a/src/sc/src/lib.rs b/crates/fluvio-sc/src/lib.rs similarity index 100% rename from src/sc/src/lib.rs rename to crates/fluvio-sc/src/lib.rs diff --git a/src/sc/src/services/auth/basic.rs b/crates/fluvio-sc/src/services/auth/basic.rs similarity index 100% rename from src/sc/src/services/auth/basic.rs rename to crates/fluvio-sc/src/services/auth/basic.rs diff --git a/src/sc/src/services/auth/mod.rs b/crates/fluvio-sc/src/services/auth/mod.rs similarity index 100% rename from src/sc/src/services/auth/mod.rs rename to crates/fluvio-sc/src/services/auth/mod.rs diff --git a/src/sc/src/services/mod.rs b/crates/fluvio-sc/src/services/mod.rs similarity index 100% rename from src/sc/src/services/mod.rs rename to crates/fluvio-sc/src/services/mod.rs diff --git a/src/sc/src/services/private_api/mod.rs b/crates/fluvio-sc/src/services/private_api/mod.rs similarity index 100% rename from src/sc/src/services/private_api/mod.rs rename to crates/fluvio-sc/src/services/private_api/mod.rs diff --git a/src/sc/src/services/private_api/private_server.rs b/crates/fluvio-sc/src/services/private_api/private_server.rs similarity index 100% rename from src/sc/src/services/private_api/private_server.rs rename to crates/fluvio-sc/src/services/private_api/private_server.rs diff --git a/src/sc/src/services/public_api/api_version.rs b/crates/fluvio-sc/src/services/public_api/api_version.rs similarity index 100% rename from src/sc/src/services/public_api/api_version.rs rename to crates/fluvio-sc/src/services/public_api/api_version.rs diff --git a/src/sc/src/services/public_api/create.rs b/crates/fluvio-sc/src/services/public_api/create.rs similarity index 100% rename from src/sc/src/services/public_api/create.rs rename to crates/fluvio-sc/src/services/public_api/create.rs diff --git a/src/sc/src/services/public_api/delete.rs b/crates/fluvio-sc/src/services/public_api/delete.rs similarity index 100% rename from src/sc/src/services/public_api/delete.rs rename to crates/fluvio-sc/src/services/public_api/delete.rs diff --git a/src/sc/src/services/public_api/list.rs b/crates/fluvio-sc/src/services/public_api/list.rs similarity index 100% rename from src/sc/src/services/public_api/list.rs rename to crates/fluvio-sc/src/services/public_api/list.rs diff --git a/src/sc/src/services/public_api/mod.rs b/crates/fluvio-sc/src/services/public_api/mod.rs similarity index 100% rename from src/sc/src/services/public_api/mod.rs rename to crates/fluvio-sc/src/services/public_api/mod.rs diff --git a/src/sc/src/services/public_api/partition/mod.rs b/crates/fluvio-sc/src/services/public_api/partition/mod.rs similarity index 100% rename from src/sc/src/services/public_api/partition/mod.rs rename to crates/fluvio-sc/src/services/public_api/partition/mod.rs diff --git a/src/sc/src/services/public_api/public_server.rs b/crates/fluvio-sc/src/services/public_api/public_server.rs similarity index 100% rename from src/sc/src/services/public_api/public_server.rs rename to crates/fluvio-sc/src/services/public_api/public_server.rs diff --git a/src/sc/src/services/public_api/spg/create.rs b/crates/fluvio-sc/src/services/public_api/spg/create.rs similarity index 100% rename from src/sc/src/services/public_api/spg/create.rs rename to crates/fluvio-sc/src/services/public_api/spg/create.rs diff --git a/src/sc/src/services/public_api/spg/delete.rs b/crates/fluvio-sc/src/services/public_api/spg/delete.rs similarity index 100% rename from src/sc/src/services/public_api/spg/delete.rs rename to crates/fluvio-sc/src/services/public_api/spg/delete.rs diff --git a/src/sc/src/services/public_api/spg/fetch.rs b/crates/fluvio-sc/src/services/public_api/spg/fetch.rs similarity index 100% rename from src/sc/src/services/public_api/spg/fetch.rs rename to crates/fluvio-sc/src/services/public_api/spg/fetch.rs diff --git a/src/sc/src/services/public_api/spg/mod.rs b/crates/fluvio-sc/src/services/public_api/spg/mod.rs similarity index 100% rename from src/sc/src/services/public_api/spg/mod.rs rename to crates/fluvio-sc/src/services/public_api/spg/mod.rs diff --git a/src/sc/src/services/public_api/spu/fetch.rs b/crates/fluvio-sc/src/services/public_api/spu/fetch.rs similarity index 100% rename from src/sc/src/services/public_api/spu/fetch.rs rename to crates/fluvio-sc/src/services/public_api/spu/fetch.rs diff --git a/src/sc/src/services/public_api/spu/mod.rs b/crates/fluvio-sc/src/services/public_api/spu/mod.rs similarity index 100% rename from src/sc/src/services/public_api/spu/mod.rs rename to crates/fluvio-sc/src/services/public_api/spu/mod.rs diff --git a/src/sc/src/services/public_api/spu/register_custom_spus_req.rs b/crates/fluvio-sc/src/services/public_api/spu/register_custom_spus_req.rs similarity index 100% rename from src/sc/src/services/public_api/spu/register_custom_spus_req.rs rename to crates/fluvio-sc/src/services/public_api/spu/register_custom_spus_req.rs diff --git a/src/sc/src/services/public_api/spu/unregister_custom_spus_req.rs b/crates/fluvio-sc/src/services/public_api/spu/unregister_custom_spus_req.rs similarity index 100% rename from src/sc/src/services/public_api/spu/unregister_custom_spus_req.rs rename to crates/fluvio-sc/src/services/public_api/spu/unregister_custom_spus_req.rs diff --git a/src/sc/src/services/public_api/spu/watch.rs b/crates/fluvio-sc/src/services/public_api/spu/watch.rs similarity index 100% rename from src/sc/src/services/public_api/spu/watch.rs rename to crates/fluvio-sc/src/services/public_api/spu/watch.rs diff --git a/src/sc/src/services/public_api/topic/create.rs b/crates/fluvio-sc/src/services/public_api/topic/create.rs similarity index 100% rename from src/sc/src/services/public_api/topic/create.rs rename to crates/fluvio-sc/src/services/public_api/topic/create.rs diff --git a/src/sc/src/services/public_api/topic/delete.rs b/crates/fluvio-sc/src/services/public_api/topic/delete.rs similarity index 100% rename from src/sc/src/services/public_api/topic/delete.rs rename to crates/fluvio-sc/src/services/public_api/topic/delete.rs diff --git a/src/sc/src/services/public_api/topic/fetch.rs b/crates/fluvio-sc/src/services/public_api/topic/fetch.rs similarity index 100% rename from src/sc/src/services/public_api/topic/fetch.rs rename to crates/fluvio-sc/src/services/public_api/topic/fetch.rs diff --git a/src/sc/src/services/public_api/topic/mod.rs b/crates/fluvio-sc/src/services/public_api/topic/mod.rs similarity index 100% rename from src/sc/src/services/public_api/topic/mod.rs rename to crates/fluvio-sc/src/services/public_api/topic/mod.rs diff --git a/src/sc/src/services/public_api/watch.rs b/crates/fluvio-sc/src/services/public_api/watch.rs similarity index 100% rename from src/sc/src/services/public_api/watch.rs rename to crates/fluvio-sc/src/services/public_api/watch.rs diff --git a/src/sc/src/services/send_channels.rs b/crates/fluvio-sc/src/services/send_channels.rs similarity index 100% rename from src/sc/src/services/send_channels.rs rename to crates/fluvio-sc/src/services/send_channels.rs diff --git a/src/sc/src/stores/mod.rs b/crates/fluvio-sc/src/stores/mod.rs similarity index 100% rename from src/sc/src/stores/mod.rs rename to crates/fluvio-sc/src/stores/mod.rs diff --git a/src/sc/src/stores/partition.rs b/crates/fluvio-sc/src/stores/partition.rs similarity index 100% rename from src/sc/src/stores/partition.rs rename to crates/fluvio-sc/src/stores/partition.rs diff --git a/src/sc/src/stores/spg.rs b/crates/fluvio-sc/src/stores/spg.rs similarity index 100% rename from src/sc/src/stores/spg.rs rename to crates/fluvio-sc/src/stores/spg.rs diff --git a/src/sc/src/stores/spu.rs b/crates/fluvio-sc/src/stores/spu.rs similarity index 100% rename from src/sc/src/stores/spu.rs rename to crates/fluvio-sc/src/stores/spu.rs diff --git a/src/sc/src/stores/topic.rs b/crates/fluvio-sc/src/stores/topic.rs similarity index 100% rename from src/sc/src/stores/topic.rs rename to crates/fluvio-sc/src/stores/topic.rs diff --git a/src/sc/src/tests/TESTS.md b/crates/fluvio-sc/src/tests/TESTS.md similarity index 100% rename from src/sc/src/tests/TESTS.md rename to crates/fluvio-sc/src/tests/TESTS.md diff --git a/src/sc/src/tests/fixture/generator.rs b/crates/fluvio-sc/src/tests/fixture/generator.rs similarity index 100% rename from src/sc/src/tests/fixture/generator.rs rename to crates/fluvio-sc/src/tests/fixture/generator.rs diff --git a/src/sc/src/tests/fixture/mock_cm.rs b/crates/fluvio-sc/src/tests/fixture/mock_cm.rs similarity index 100% rename from src/sc/src/tests/fixture/mock_cm.rs rename to crates/fluvio-sc/src/tests/fixture/mock_cm.rs diff --git a/src/sc/src/tests/fixture/mock_kv.rs b/crates/fluvio-sc/src/tests/fixture/mock_kv.rs similarity index 100% rename from src/sc/src/tests/fixture/mock_kv.rs rename to crates/fluvio-sc/src/tests/fixture/mock_kv.rs diff --git a/src/sc/src/tests/fixture/mock_spu.rs b/crates/fluvio-sc/src/tests/fixture/mock_spu.rs similarity index 100% rename from src/sc/src/tests/fixture/mock_spu.rs rename to crates/fluvio-sc/src/tests/fixture/mock_spu.rs diff --git a/src/sc/src/tests/fixture/mod.rs b/crates/fluvio-sc/src/tests/fixture/mod.rs similarity index 100% rename from src/sc/src/tests/fixture/mod.rs rename to crates/fluvio-sc/src/tests/fixture/mod.rs diff --git a/src/sc/src/tests/fixture/test_runner.rs b/crates/fluvio-sc/src/tests/fixture/test_runner.rs similarity index 100% rename from src/sc/src/tests/fixture/test_runner.rs rename to crates/fluvio-sc/src/tests/fixture/test_runner.rs diff --git a/src/sc/src/tests/mod.rs b/crates/fluvio-sc/src/tests/mod.rs similarity index 100% rename from src/sc/src/tests/mod.rs rename to crates/fluvio-sc/src/tests/mod.rs diff --git a/src/sc/src/tests/suite/conn_test.rs b/crates/fluvio-sc/src/tests/suite/conn_test.rs similarity index 100% rename from src/sc/src/tests/suite/conn_test.rs rename to crates/fluvio-sc/src/tests/suite/conn_test.rs diff --git a/src/sc/src/tests/suite/mod.rs b/crates/fluvio-sc/src/tests/suite/mod.rs similarity index 100% rename from src/sc/src/tests/suite/mod.rs rename to crates/fluvio-sc/src/tests/suite/mod.rs diff --git a/src/sc/src/tests/suite/partition_test.rs b/crates/fluvio-sc/src/tests/suite/partition_test.rs similarity index 100% rename from src/sc/src/tests/suite/partition_test.rs rename to crates/fluvio-sc/src/tests/suite/partition_test.rs diff --git a/src/sc/test-data/auth_config/policy.json b/crates/fluvio-sc/test-data/auth_config/policy.json similarity index 100% rename from src/sc/test-data/auth_config/policy.json rename to crates/fluvio-sc/test-data/auth_config/policy.json diff --git a/src/sc/test-data/auth_config/scopes.json b/crates/fluvio-sc/test-data/auth_config/scopes.json similarity index 100% rename from src/sc/test-data/auth_config/scopes.json rename to crates/fluvio-sc/test-data/auth_config/scopes.json diff --git a/src/sc/test-data/config/sc_invalid.toml b/crates/fluvio-sc/test-data/config/sc_invalid.toml similarity index 100% rename from src/sc/test-data/config/sc_invalid.toml rename to crates/fluvio-sc/test-data/config/sc_invalid.toml diff --git a/src/sc/test-data/config/sc_min.toml b/crates/fluvio-sc/test-data/config/sc_min.toml similarity index 100% rename from src/sc/test-data/config/sc_min.toml rename to crates/fluvio-sc/test-data/config/sc_min.toml diff --git a/src/sc/test-data/config/sc_server.toml b/crates/fluvio-sc/test-data/config/sc_server.toml similarity index 100% rename from src/sc/test-data/config/sc_server.toml rename to crates/fluvio-sc/test-data/config/sc_server.toml diff --git a/src/sc/test-data/config/sc_tls.toml b/crates/fluvio-sc/test-data/config/sc_tls.toml similarity index 100% rename from src/sc/test-data/config/sc_tls.toml rename to crates/fluvio-sc/test-data/config/sc_tls.toml diff --git a/src/service/Cargo.toml b/crates/fluvio-service/Cargo.toml similarity index 80% rename from src/service/Cargo.toml rename to crates/fluvio-service/Cargo.toml index dbd9a5b206..228471bdf4 100644 --- a/src/service/Cargo.toml +++ b/crates/fluvio-service/Cargo.toml @@ -23,9 +23,9 @@ tokio = { version = "1.3.0", features = ["macros"] } # Fluvio dependencies futures-util = { version = "0.3.5" } fluvio-future = { version = "0.3.0" } -fluvio-socket = { version = "0.9", path = "../socket" } -fluvio-protocol = { path = "../protocol", version = "0.6", features = ["derive", "api", "codec"] } -fluvio-types = { version = "0.2.3", features = ["events"], path = "../types" } +fluvio-socket = { version = "0.9", path = "../fluvio-socket" } +fluvio-protocol = { path = "../fluvio-protocol", version = "0.6", features = ["derive", "api", "codec"] } +fluvio-types = { version = "0.2.3", features = ["events"], path = "../fluvio-types" } [dev-dependencies] fluvio-future = { version = "0.3.0", features = ["fixture"] } diff --git a/src/sc/LICENSE-APACHE b/crates/fluvio-service/LICENSE-APACHE similarity index 100% rename from src/sc/LICENSE-APACHE rename to crates/fluvio-service/LICENSE-APACHE diff --git a/src/service/src/lib.rs b/crates/fluvio-service/src/lib.rs similarity index 100% rename from src/service/src/lib.rs rename to crates/fluvio-service/src/lib.rs diff --git a/src/service/src/server.rs b/crates/fluvio-service/src/server.rs similarity index 100% rename from src/service/src/server.rs rename to crates/fluvio-service/src/server.rs diff --git a/src/service/src/test_request.rs b/crates/fluvio-service/src/test_request.rs similarity index 100% rename from src/service/src/test_request.rs rename to crates/fluvio-service/src/test_request.rs diff --git a/src/smartstream/derive/Cargo.toml b/crates/fluvio-smartstream-derive/Cargo.toml similarity index 91% rename from src/smartstream/derive/Cargo.toml rename to crates/fluvio-smartstream-derive/Cargo.toml index 1e5dc63a9c..fd7e087b69 100644 --- a/src/smartstream/derive/Cargo.toml +++ b/crates/fluvio-smartstream-derive/Cargo.toml @@ -19,4 +19,4 @@ proc-macro2 = "1.0" [dev-dependencies] trybuild = { git = "https://github.com/sehz/trybuild", branch = "check_option" } -fluvio-smartstream = { path = "../" } +fluvio-smartstream = { path = "../fluvio-smartstream" } diff --git a/src/smartstream/derive/src/ast.rs b/crates/fluvio-smartstream-derive/src/ast.rs similarity index 100% rename from src/smartstream/derive/src/ast.rs rename to crates/fluvio-smartstream-derive/src/ast.rs diff --git a/src/smartstream/derive/src/generator/aggregate.rs b/crates/fluvio-smartstream-derive/src/generator/aggregate.rs similarity index 100% rename from src/smartstream/derive/src/generator/aggregate.rs rename to crates/fluvio-smartstream-derive/src/generator/aggregate.rs diff --git a/src/smartstream/derive/src/generator/filter.rs b/crates/fluvio-smartstream-derive/src/generator/filter.rs similarity index 100% rename from src/smartstream/derive/src/generator/filter.rs rename to crates/fluvio-smartstream-derive/src/generator/filter.rs diff --git a/src/smartstream/derive/src/generator/map.rs b/crates/fluvio-smartstream-derive/src/generator/map.rs similarity index 100% rename from src/smartstream/derive/src/generator/map.rs rename to crates/fluvio-smartstream-derive/src/generator/map.rs diff --git a/src/smartstream/derive/src/generator/mod.rs b/crates/fluvio-smartstream-derive/src/generator/mod.rs similarity index 100% rename from src/smartstream/derive/src/generator/mod.rs rename to crates/fluvio-smartstream-derive/src/generator/mod.rs diff --git a/src/smartstream/derive/src/lib.rs b/crates/fluvio-smartstream-derive/src/lib.rs similarity index 100% rename from src/smartstream/derive/src/lib.rs rename to crates/fluvio-smartstream-derive/src/lib.rs diff --git a/src/smartstream/derive/tests/parse.rs b/crates/fluvio-smartstream-derive/tests/parse.rs similarity index 100% rename from src/smartstream/derive/tests/parse.rs rename to crates/fluvio-smartstream-derive/tests/parse.rs diff --git a/src/smartstream/derive/ui-tests/pass_filter.rs b/crates/fluvio-smartstream-derive/ui-tests/pass_filter.rs similarity index 100% rename from src/smartstream/derive/ui-tests/pass_filter.rs rename to crates/fluvio-smartstream-derive/ui-tests/pass_filter.rs diff --git a/src/smartstream/Cargo.toml b/crates/fluvio-smartstream/Cargo.toml similarity index 70% rename from src/smartstream/Cargo.toml rename to crates/fluvio-smartstream/Cargo.toml index 9ddf62d216..0c7b04dd43 100644 --- a/src/smartstream/Cargo.toml +++ b/crates/fluvio-smartstream/Cargo.toml @@ -18,5 +18,5 @@ crate-type = ['lib'] [dependencies] eyre = { version = "0.6", default-features = false } -fluvio-dataplane-protocol = { version = "0.6", path = "../dataplane-protocol", default-features = false } -fluvio-smartstream-derive = { version = "0.1.1", path = "./derive", optional = true } +fluvio-dataplane-protocol = { version = "0.6", path = "../fluvio-dataplane-protocol", default-features = false } +fluvio-smartstream-derive = { version = "0.1.1", path = "../fluvio-smartstream-derive", optional = true } diff --git a/src/service/LICENSE-APACHE b/crates/fluvio-smartstream/LICENSE-APACHE similarity index 100% rename from src/service/LICENSE-APACHE rename to crates/fluvio-smartstream/LICENSE-APACHE diff --git a/src/smartstream/README.md b/crates/fluvio-smartstream/README.md similarity index 100% rename from src/smartstream/README.md rename to crates/fluvio-smartstream/README.md diff --git a/src/smartstream/examples/.cargo/config.toml b/crates/fluvio-smartstream/examples/.cargo/config.toml similarity index 100% rename from src/smartstream/examples/.cargo/config.toml rename to crates/fluvio-smartstream/examples/.cargo/config.toml diff --git a/src/smartstream/examples/.gitignore b/crates/fluvio-smartstream/examples/.gitignore similarity index 100% rename from src/smartstream/examples/.gitignore rename to crates/fluvio-smartstream/examples/.gitignore diff --git a/src/smartstream/examples/Cargo.lock b/crates/fluvio-smartstream/examples/Cargo.lock similarity index 100% rename from src/smartstream/examples/Cargo.lock rename to crates/fluvio-smartstream/examples/Cargo.lock diff --git a/src/smartstream/examples/Cargo.toml b/crates/fluvio-smartstream/examples/Cargo.toml similarity index 100% rename from src/smartstream/examples/Cargo.toml rename to crates/fluvio-smartstream/examples/Cargo.toml diff --git a/src/smartstream/examples/Makefile b/crates/fluvio-smartstream/examples/Makefile similarity index 100% rename from src/smartstream/examples/Makefile rename to crates/fluvio-smartstream/examples/Makefile diff --git a/src/smartstream/examples/aggregate-average/Cargo.toml b/crates/fluvio-smartstream/examples/aggregate-average/Cargo.toml similarity index 100% rename from src/smartstream/examples/aggregate-average/Cargo.toml rename to crates/fluvio-smartstream/examples/aggregate-average/Cargo.toml diff --git a/src/smartstream/examples/aggregate-average/src/lib.rs b/crates/fluvio-smartstream/examples/aggregate-average/src/lib.rs similarity index 100% rename from src/smartstream/examples/aggregate-average/src/lib.rs rename to crates/fluvio-smartstream/examples/aggregate-average/src/lib.rs diff --git a/src/smartstream/examples/aggregate-json/Cargo.toml b/crates/fluvio-smartstream/examples/aggregate-json/Cargo.toml similarity index 100% rename from src/smartstream/examples/aggregate-json/Cargo.toml rename to crates/fluvio-smartstream/examples/aggregate-json/Cargo.toml diff --git a/src/smartstream/examples/aggregate-json/src/lib.rs b/crates/fluvio-smartstream/examples/aggregate-json/src/lib.rs similarity index 100% rename from src/smartstream/examples/aggregate-json/src/lib.rs rename to crates/fluvio-smartstream/examples/aggregate-json/src/lib.rs diff --git a/src/smartstream/examples/aggregate-sum/Cargo.toml b/crates/fluvio-smartstream/examples/aggregate-sum/Cargo.toml similarity index 100% rename from src/smartstream/examples/aggregate-sum/Cargo.toml rename to crates/fluvio-smartstream/examples/aggregate-sum/Cargo.toml diff --git a/src/smartstream/examples/aggregate-sum/src/lib.rs b/crates/fluvio-smartstream/examples/aggregate-sum/src/lib.rs similarity index 100% rename from src/smartstream/examples/aggregate-sum/src/lib.rs rename to crates/fluvio-smartstream/examples/aggregate-sum/src/lib.rs diff --git a/src/smartstream/examples/aggregate/Cargo.toml b/crates/fluvio-smartstream/examples/aggregate/Cargo.toml similarity index 100% rename from src/smartstream/examples/aggregate/Cargo.toml rename to crates/fluvio-smartstream/examples/aggregate/Cargo.toml diff --git a/src/smartstream/examples/aggregate/src/lib.rs b/crates/fluvio-smartstream/examples/aggregate/src/lib.rs similarity index 100% rename from src/smartstream/examples/aggregate/src/lib.rs rename to crates/fluvio-smartstream/examples/aggregate/src/lib.rs diff --git a/src/smartstream/examples/filter/Cargo.toml b/crates/fluvio-smartstream/examples/filter/Cargo.toml similarity index 100% rename from src/smartstream/examples/filter/Cargo.toml rename to crates/fluvio-smartstream/examples/filter/Cargo.toml diff --git a/src/smartstream/examples/filter/src/lib.rs b/crates/fluvio-smartstream/examples/filter/src/lib.rs similarity index 100% rename from src/smartstream/examples/filter/src/lib.rs rename to crates/fluvio-smartstream/examples/filter/src/lib.rs diff --git a/src/smartstream/examples/filter_json/Cargo.toml b/crates/fluvio-smartstream/examples/filter_json/Cargo.toml similarity index 100% rename from src/smartstream/examples/filter_json/Cargo.toml rename to crates/fluvio-smartstream/examples/filter_json/Cargo.toml diff --git a/src/smartstream/examples/filter_json/src/lib.rs b/crates/fluvio-smartstream/examples/filter_json/src/lib.rs similarity index 100% rename from src/smartstream/examples/filter_json/src/lib.rs rename to crates/fluvio-smartstream/examples/filter_json/src/lib.rs diff --git a/src/smartstream/examples/filter_odd/Cargo.toml b/crates/fluvio-smartstream/examples/filter_odd/Cargo.toml similarity index 100% rename from src/smartstream/examples/filter_odd/Cargo.toml rename to crates/fluvio-smartstream/examples/filter_odd/Cargo.toml diff --git a/src/smartstream/examples/filter_odd/src/lib.rs b/crates/fluvio-smartstream/examples/filter_odd/src/lib.rs similarity index 100% rename from src/smartstream/examples/filter_odd/src/lib.rs rename to crates/fluvio-smartstream/examples/filter_odd/src/lib.rs diff --git a/src/smartstream/examples/filter_regex/Cargo.toml b/crates/fluvio-smartstream/examples/filter_regex/Cargo.toml similarity index 100% rename from src/smartstream/examples/filter_regex/Cargo.toml rename to crates/fluvio-smartstream/examples/filter_regex/Cargo.toml diff --git a/src/smartstream/examples/filter_regex/src/lib.rs b/crates/fluvio-smartstream/examples/filter_regex/src/lib.rs similarity index 100% rename from src/smartstream/examples/filter_regex/src/lib.rs rename to crates/fluvio-smartstream/examples/filter_regex/src/lib.rs diff --git a/src/smartstream/examples/map/Cargo.toml b/crates/fluvio-smartstream/examples/map/Cargo.toml similarity index 100% rename from src/smartstream/examples/map/Cargo.toml rename to crates/fluvio-smartstream/examples/map/Cargo.toml diff --git a/src/smartstream/examples/map/src/lib.rs b/crates/fluvio-smartstream/examples/map/src/lib.rs similarity index 100% rename from src/smartstream/examples/map/src/lib.rs rename to crates/fluvio-smartstream/examples/map/src/lib.rs diff --git a/src/smartstream/examples/map_double/Cargo.toml b/crates/fluvio-smartstream/examples/map_double/Cargo.toml similarity index 100% rename from src/smartstream/examples/map_double/Cargo.toml rename to crates/fluvio-smartstream/examples/map_double/Cargo.toml diff --git a/src/smartstream/examples/map_double/src/lib.rs b/crates/fluvio-smartstream/examples/map_double/src/lib.rs similarity index 100% rename from src/smartstream/examples/map_double/src/lib.rs rename to crates/fluvio-smartstream/examples/map_double/src/lib.rs diff --git a/src/smartstream/examples/map_json/Cargo.toml b/crates/fluvio-smartstream/examples/map_json/Cargo.toml similarity index 100% rename from src/smartstream/examples/map_json/Cargo.toml rename to crates/fluvio-smartstream/examples/map_json/Cargo.toml diff --git a/src/smartstream/examples/map_json/src/lib.rs b/crates/fluvio-smartstream/examples/map_json/src/lib.rs similarity index 100% rename from src/smartstream/examples/map_json/src/lib.rs rename to crates/fluvio-smartstream/examples/map_json/src/lib.rs diff --git a/src/smartstream/examples/map_regex/Cargo.toml b/crates/fluvio-smartstream/examples/map_regex/Cargo.toml similarity index 100% rename from src/smartstream/examples/map_regex/Cargo.toml rename to crates/fluvio-smartstream/examples/map_regex/Cargo.toml diff --git a/src/smartstream/examples/map_regex/src/lib.rs b/crates/fluvio-smartstream/examples/map_regex/src/lib.rs similarity index 100% rename from src/smartstream/examples/map_regex/src/lib.rs rename to crates/fluvio-smartstream/examples/map_regex/src/lib.rs diff --git a/src/smartstream/src/lib.rs b/crates/fluvio-smartstream/src/lib.rs similarity index 100% rename from src/smartstream/src/lib.rs rename to crates/fluvio-smartstream/src/lib.rs diff --git a/src/socket/Cargo.toml b/crates/fluvio-socket/Cargo.toml similarity index 93% rename from src/socket/Cargo.toml rename to crates/fluvio-socket/Cargo.toml index 15f462c471..5e9ed96103 100644 --- a/src/socket/Cargo.toml +++ b/crates/fluvio-socket/Cargo.toml @@ -32,7 +32,7 @@ thiserror = "1.0.20" # Fluvio dependencies fluvio-future = { version = "0.3.2", features = ["net", "task"] } -fluvio-protocol = { path = "../protocol", version = "0.6", features = [ +fluvio-protocol = { path = "../fluvio-protocol", version = "0.6", features = [ "derive", "api", "codec", diff --git a/src/smartstream/LICENSE-APACHE b/crates/fluvio-socket/LICENSE-APACHE similarity index 100% rename from src/smartstream/LICENSE-APACHE rename to crates/fluvio-socket/LICENSE-APACHE diff --git a/src/socket/README.md b/crates/fluvio-socket/README.md similarity index 100% rename from src/socket/README.md rename to crates/fluvio-socket/README.md diff --git a/src/socket/certs/.gitignore b/crates/fluvio-socket/certs/.gitignore similarity index 100% rename from src/socket/certs/.gitignore rename to crates/fluvio-socket/certs/.gitignore diff --git a/src/socket/certs/Makefile b/crates/fluvio-socket/certs/Makefile similarity index 100% rename from src/socket/certs/Makefile rename to crates/fluvio-socket/certs/Makefile diff --git a/src/socket/certs/cert.conf b/crates/fluvio-socket/certs/cert.conf similarity index 100% rename from src/socket/certs/cert.conf rename to crates/fluvio-socket/certs/cert.conf diff --git a/src/socket/certs/certs/ca.crt b/crates/fluvio-socket/certs/certs/ca.crt similarity index 100% rename from src/socket/certs/certs/ca.crt rename to crates/fluvio-socket/certs/certs/ca.crt diff --git a/src/socket/certs/certs/ca.key b/crates/fluvio-socket/certs/certs/ca.key similarity index 100% rename from src/socket/certs/certs/ca.key rename to crates/fluvio-socket/certs/certs/ca.key diff --git a/src/socket/certs/certs/ca.srl b/crates/fluvio-socket/certs/certs/ca.srl similarity index 100% rename from src/socket/certs/certs/ca.srl rename to crates/fluvio-socket/certs/certs/ca.srl diff --git a/src/socket/certs/certs/client.crt b/crates/fluvio-socket/certs/certs/client.crt similarity index 100% rename from src/socket/certs/certs/client.crt rename to crates/fluvio-socket/certs/certs/client.crt diff --git a/src/socket/certs/certs/client.csr b/crates/fluvio-socket/certs/certs/client.csr similarity index 100% rename from src/socket/certs/certs/client.csr rename to crates/fluvio-socket/certs/certs/client.csr diff --git a/src/socket/certs/certs/client.key b/crates/fluvio-socket/certs/certs/client.key similarity index 100% rename from src/socket/certs/certs/client.key rename to crates/fluvio-socket/certs/certs/client.key diff --git a/src/socket/certs/certs/client.pfx b/crates/fluvio-socket/certs/certs/client.pfx similarity index 100% rename from src/socket/certs/certs/client.pfx rename to crates/fluvio-socket/certs/certs/client.pfx diff --git a/src/socket/certs/certs/server.crt b/crates/fluvio-socket/certs/certs/server.crt similarity index 100% rename from src/socket/certs/certs/server.crt rename to crates/fluvio-socket/certs/certs/server.crt diff --git a/src/socket/certs/certs/server.csr b/crates/fluvio-socket/certs/certs/server.csr similarity index 100% rename from src/socket/certs/certs/server.csr rename to crates/fluvio-socket/certs/certs/server.csr diff --git a/src/socket/certs/certs/server.key b/crates/fluvio-socket/certs/certs/server.key similarity index 100% rename from src/socket/certs/certs/server.key rename to crates/fluvio-socket/certs/certs/server.key diff --git a/src/socket/certs/certs/server.pfx b/crates/fluvio-socket/certs/certs/server.pfx similarity index 100% rename from src/socket/certs/certs/server.pfx rename to crates/fluvio-socket/certs/certs/server.pfx diff --git a/src/socket/certs/nginx.conf b/crates/fluvio-socket/certs/nginx.conf similarity index 100% rename from src/socket/certs/nginx.conf rename to crates/fluvio-socket/certs/nginx.conf diff --git a/src/socket/certs/openssl-ca.cnf b/crates/fluvio-socket/certs/openssl-ca.cnf similarity index 100% rename from src/socket/certs/openssl-ca.cnf rename to crates/fluvio-socket/certs/openssl-ca.cnf diff --git a/src/socket/certs/openssl.cnf b/crates/fluvio-socket/certs/openssl.cnf similarity index 100% rename from src/socket/certs/openssl.cnf rename to crates/fluvio-socket/certs/openssl.cnf diff --git a/src/socket/src/error.rs b/crates/fluvio-socket/src/error.rs similarity index 100% rename from src/socket/src/error.rs rename to crates/fluvio-socket/src/error.rs diff --git a/src/socket/src/lib.rs b/crates/fluvio-socket/src/lib.rs similarity index 100% rename from src/socket/src/lib.rs rename to crates/fluvio-socket/src/lib.rs diff --git a/src/socket/src/multiplexing.rs b/crates/fluvio-socket/src/multiplexing.rs similarity index 100% rename from src/socket/src/multiplexing.rs rename to crates/fluvio-socket/src/multiplexing.rs diff --git a/src/socket/src/sink.rs b/crates/fluvio-socket/src/sink.rs similarity index 100% rename from src/socket/src/sink.rs rename to crates/fluvio-socket/src/sink.rs diff --git a/src/socket/src/socket.rs b/crates/fluvio-socket/src/socket.rs similarity index 100% rename from src/socket/src/socket.rs rename to crates/fluvio-socket/src/socket.rs diff --git a/src/socket/src/stream.rs b/crates/fluvio-socket/src/stream.rs similarity index 100% rename from src/socket/src/stream.rs rename to crates/fluvio-socket/src/stream.rs diff --git a/src/socket/src/test_request.rs b/crates/fluvio-socket/src/test_request.rs similarity index 100% rename from src/socket/src/test_request.rs rename to crates/fluvio-socket/src/test_request.rs diff --git a/src/socket/tests/enum.rs b/crates/fluvio-socket/tests/enum.rs similarity index 100% rename from src/socket/tests/enum.rs rename to crates/fluvio-socket/tests/enum.rs diff --git a/src/socket/tests/test.txt b/crates/fluvio-socket/tests/test.txt similarity index 100% rename from src/socket/tests/test.txt rename to crates/fluvio-socket/tests/test.txt diff --git a/src/spu-schema/Cargo.toml b/crates/fluvio-spu-schema/Cargo.toml similarity index 74% rename from src/spu-schema/Cargo.toml rename to crates/fluvio-spu-schema/Cargo.toml index cd5ad3ad3e..f43fbee6e5 100644 --- a/src/spu-schema/Cargo.toml +++ b/crates/fluvio-spu-schema/Cargo.toml @@ -23,5 +23,5 @@ serde = { version = "1.0.103", features = ['derive'] } static_assertions = "1.1.0" # Fluvio dependencies -fluvio-protocol = { path = "../protocol", version = "0.6" } -dataplane = { version = "0.6", path = "../dataplane-protocol", package = "fluvio-dataplane-protocol" } +fluvio-protocol = { path = "../fluvio-protocol", version = "0.6" } +dataplane = { version = "0.6", path = "../fluvio-dataplane-protocol", package = "fluvio-dataplane-protocol" } diff --git a/src/socket/LICENSE-APACHE b/crates/fluvio-spu-schema/LICENSE-APACHE similarity index 100% rename from src/socket/LICENSE-APACHE rename to crates/fluvio-spu-schema/LICENSE-APACHE diff --git a/src/spu-schema/README.md b/crates/fluvio-spu-schema/README.md similarity index 100% rename from src/spu-schema/README.md rename to crates/fluvio-spu-schema/README.md diff --git a/src/spu-schema/src/client/api.rs b/crates/fluvio-spu-schema/src/client/api.rs similarity index 100% rename from src/spu-schema/src/client/api.rs rename to crates/fluvio-spu-schema/src/client/api.rs diff --git a/src/spu-schema/src/client/api_key.rs b/crates/fluvio-spu-schema/src/client/api_key.rs similarity index 100% rename from src/spu-schema/src/client/api_key.rs rename to crates/fluvio-spu-schema/src/client/api_key.rs diff --git a/src/spu-schema/src/client/mod.rs b/crates/fluvio-spu-schema/src/client/mod.rs similarity index 100% rename from src/spu-schema/src/client/mod.rs rename to crates/fluvio-spu-schema/src/client/mod.rs diff --git a/src/spu-schema/src/client/offset.rs b/crates/fluvio-spu-schema/src/client/offset.rs similarity index 100% rename from src/spu-schema/src/client/offset.rs rename to crates/fluvio-spu-schema/src/client/offset.rs diff --git a/src/spu-schema/src/lib.rs b/crates/fluvio-spu-schema/src/lib.rs similarity index 100% rename from src/spu-schema/src/lib.rs rename to crates/fluvio-spu-schema/src/lib.rs diff --git a/src/spu-schema/src/server/api.rs b/crates/fluvio-spu-schema/src/server/api.rs similarity index 100% rename from src/spu-schema/src/server/api.rs rename to crates/fluvio-spu-schema/src/server/api.rs diff --git a/src/spu-schema/src/server/api_key.rs b/crates/fluvio-spu-schema/src/server/api_key.rs similarity index 100% rename from src/spu-schema/src/server/api_key.rs rename to crates/fluvio-spu-schema/src/server/api_key.rs diff --git a/src/spu-schema/src/server/fetch_offset.rs b/crates/fluvio-spu-schema/src/server/fetch_offset.rs similarity index 100% rename from src/spu-schema/src/server/fetch_offset.rs rename to crates/fluvio-spu-schema/src/server/fetch_offset.rs diff --git a/src/spu-schema/src/server/mod.rs b/crates/fluvio-spu-schema/src/server/mod.rs similarity index 100% rename from src/spu-schema/src/server/mod.rs rename to crates/fluvio-spu-schema/src/server/mod.rs diff --git a/src/spu-schema/src/server/stream_fetch.rs b/crates/fluvio-spu-schema/src/server/stream_fetch.rs similarity index 100% rename from src/spu-schema/src/server/stream_fetch.rs rename to crates/fluvio-spu-schema/src/server/stream_fetch.rs diff --git a/src/spu-schema/src/server/update_offset.rs b/crates/fluvio-spu-schema/src/server/update_offset.rs similarity index 100% rename from src/spu-schema/src/server/update_offset.rs rename to crates/fluvio-spu-schema/src/server/update_offset.rs diff --git a/src/spu/Cargo.toml b/crates/fluvio-spu/Cargo.toml similarity index 66% rename from src/spu/Cargo.toml rename to crates/fluvio-spu/Cargo.toml index 6fdf327707..d582a4fe6c 100644 --- a/src/spu/Cargo.toml +++ b/crates/fluvio-spu/Cargo.toml @@ -45,15 +45,15 @@ thiserror = "1" once_cell = "1.5" # Fluvio dependencies -fluvio-types = { version = "0.2.3", features = ["events"], path = "../types" } -fluvio-storage = { version = "0.4", path = "../storage" } -fluvio-controlplane = { version = "0.8.0", path = "../controlplane" } -fluvio-controlplane-metadata = { version = "0.10.0", path = "../controlplane-metadata" } -fluvio-spu-schema = { version = "0.8.0", path = "../spu-schema", features = ["file"]} -fluvio-protocol = { path = "../protocol", version = "0.6" } -fluvio-socket = { path = "../socket", version = "0.9", features = ["file"] } -dataplane = { version = "0.6.0", path = "../dataplane-protocol", package = "fluvio-dataplane-protocol" , features=["file"]} -fluvio-service = { path = "../service", version = "0.0.0" } +fluvio-types = { version = "0.2.3", features = ["events"], path = "../fluvio-types" } +fluvio-storage = { version = "0.4", path = "../fluvio-storage" } +fluvio-controlplane = { version = "0.8.0", path = "../fluvio-controlplane" } +fluvio-controlplane-metadata = { version = "0.10.0", path = "../fluvio-controlplane-metadata" } +fluvio-spu-schema = { version = "0.8.0", path = "../fluvio-spu-schema", features = ["file"]} +fluvio-protocol = { path = "../fluvio-protocol", version = "0.6" } +fluvio-socket = { path = "../fluvio-socket", version = "0.9", features = ["file"] } +dataplane = { version = "0.6.0", path = "../fluvio-dataplane-protocol", package = "fluvio-dataplane-protocol" , features=["file"]} +fluvio-service = { path = "../fluvio-service", version = "0.0.0" } flv-tls-proxy = { version = "0.5.0" } flv-util = { version = "0.5.0" } fluvio-future = { version = "0.3.8", features = ["subscriber", "openssl_tls", "zero_copy"] } @@ -63,4 +63,4 @@ once_cell = "1.5.2" flv-util = { version = "0.5.2", features = ["fixture"] } fluvio-future = { version = "0.3.1", features = ["fixture", "subscriber"] } derive_builder = { version = "0.10.0" } -dataplane = { version = "0.6", path = "../dataplane-protocol", package = "fluvio-dataplane-protocol", features = ["fixture"] } +dataplane = { version = "0.6", path = "../fluvio-dataplane-protocol", package = "fluvio-dataplane-protocol", features = ["fixture"] } diff --git a/src/spu-schema/LICENSE-APACHE b/crates/fluvio-spu/LICENSE-APACHE similarity index 100% rename from src/spu-schema/LICENSE-APACHE rename to crates/fluvio-spu/LICENSE-APACHE diff --git a/src/spu/Makefile b/crates/fluvio-spu/Makefile similarity index 100% rename from src/spu/Makefile rename to crates/fluvio-spu/Makefile diff --git a/src/spu/README.md b/crates/fluvio-spu/README.md similarity index 100% rename from src/spu/README.md rename to crates/fluvio-spu/README.md diff --git a/src/spu/src/config/cli.rs b/crates/fluvio-spu/src/config/cli.rs similarity index 100% rename from src/spu/src/config/cli.rs rename to crates/fluvio-spu/src/config/cli.rs diff --git a/src/spu/src/config/mod.rs b/crates/fluvio-spu/src/config/mod.rs similarity index 100% rename from src/spu/src/config/mod.rs rename to crates/fluvio-spu/src/config/mod.rs diff --git a/src/spu/src/config/spu_config.rs b/crates/fluvio-spu/src/config/spu_config.rs similarity index 100% rename from src/spu/src/config/spu_config.rs rename to crates/fluvio-spu/src/config/spu_config.rs diff --git a/src/spu/src/control_plane/action.rs b/crates/fluvio-spu/src/control_plane/action.rs similarity index 100% rename from src/spu/src/control_plane/action.rs rename to crates/fluvio-spu/src/control_plane/action.rs diff --git a/src/spu/src/control_plane/dispatcher.rs b/crates/fluvio-spu/src/control_plane/dispatcher.rs similarity index 100% rename from src/spu/src/control_plane/dispatcher.rs rename to crates/fluvio-spu/src/control_plane/dispatcher.rs diff --git a/src/spu/src/control_plane/message_sink.rs b/crates/fluvio-spu/src/control_plane/message_sink.rs similarity index 100% rename from src/spu/src/control_plane/message_sink.rs rename to crates/fluvio-spu/src/control_plane/message_sink.rs diff --git a/src/spu/src/control_plane/mod.rs b/crates/fluvio-spu/src/control_plane/mod.rs similarity index 100% rename from src/spu/src/control_plane/mod.rs rename to crates/fluvio-spu/src/control_plane/mod.rs diff --git a/src/spu/src/core/global_context.rs b/crates/fluvio-spu/src/core/global_context.rs similarity index 100% rename from src/spu/src/core/global_context.rs rename to crates/fluvio-spu/src/core/global_context.rs diff --git a/src/spu/src/core/mod.rs b/crates/fluvio-spu/src/core/mod.rs similarity index 100% rename from src/spu/src/core/mod.rs rename to crates/fluvio-spu/src/core/mod.rs diff --git a/src/spu/src/core/replica/metadata.rs b/crates/fluvio-spu/src/core/replica/metadata.rs similarity index 100% rename from src/spu/src/core/replica/metadata.rs rename to crates/fluvio-spu/src/core/replica/metadata.rs diff --git a/src/spu/src/core/replica/mod.rs b/crates/fluvio-spu/src/core/replica/mod.rs similarity index 100% rename from src/spu/src/core/replica/mod.rs rename to crates/fluvio-spu/src/core/replica/mod.rs diff --git a/src/spu/src/core/spus/metadata.rs b/crates/fluvio-spu/src/core/spus/metadata.rs similarity index 100% rename from src/spu/src/core/spus/metadata.rs rename to crates/fluvio-spu/src/core/spus/metadata.rs diff --git a/src/spu/src/core/spus/mod.rs b/crates/fluvio-spu/src/core/spus/mod.rs similarity index 100% rename from src/spu/src/core/spus/mod.rs rename to crates/fluvio-spu/src/core/spus/mod.rs diff --git a/src/spu/src/core/storage/mod.rs b/crates/fluvio-spu/src/core/storage/mod.rs similarity index 100% rename from src/spu/src/core/storage/mod.rs rename to crates/fluvio-spu/src/core/storage/mod.rs diff --git a/src/spu/src/core/store.rs b/crates/fluvio-spu/src/core/store.rs similarity index 100% rename from src/spu/src/core/store.rs rename to crates/fluvio-spu/src/core/store.rs diff --git a/src/spu/src/error.rs b/crates/fluvio-spu/src/error.rs similarity index 100% rename from src/spu/src/error.rs rename to crates/fluvio-spu/src/error.rs diff --git a/src/spu/src/lib.rs b/crates/fluvio-spu/src/lib.rs similarity index 100% rename from src/spu/src/lib.rs rename to crates/fluvio-spu/src/lib.rs diff --git a/src/spu/src/main.rs b/crates/fluvio-spu/src/main.rs similarity index 100% rename from src/spu/src/main.rs rename to crates/fluvio-spu/src/main.rs diff --git a/src/spu/src/replication/follower/api_key.rs b/crates/fluvio-spu/src/replication/follower/api_key.rs similarity index 100% rename from src/spu/src/replication/follower/api_key.rs rename to crates/fluvio-spu/src/replication/follower/api_key.rs diff --git a/src/spu/src/replication/follower/controller.rs b/crates/fluvio-spu/src/replication/follower/controller.rs similarity index 100% rename from src/spu/src/replication/follower/controller.rs rename to crates/fluvio-spu/src/replication/follower/controller.rs diff --git a/src/spu/src/replication/follower/mod.rs b/crates/fluvio-spu/src/replication/follower/mod.rs similarity index 100% rename from src/spu/src/replication/follower/mod.rs rename to crates/fluvio-spu/src/replication/follower/mod.rs diff --git a/src/spu/src/replication/follower/peer_api.rs b/crates/fluvio-spu/src/replication/follower/peer_api.rs similarity index 100% rename from src/spu/src/replication/follower/peer_api.rs rename to crates/fluvio-spu/src/replication/follower/peer_api.rs diff --git a/src/spu/src/replication/follower/reject_request.rs b/crates/fluvio-spu/src/replication/follower/reject_request.rs similarity index 100% rename from src/spu/src/replication/follower/reject_request.rs rename to crates/fluvio-spu/src/replication/follower/reject_request.rs diff --git a/src/spu/src/replication/follower/state.rs b/crates/fluvio-spu/src/replication/follower/state.rs similarity index 100% rename from src/spu/src/replication/follower/state.rs rename to crates/fluvio-spu/src/replication/follower/state.rs diff --git a/src/spu/src/replication/follower/sync.rs b/crates/fluvio-spu/src/replication/follower/sync.rs similarity index 100% rename from src/spu/src/replication/follower/sync.rs rename to crates/fluvio-spu/src/replication/follower/sync.rs diff --git a/src/spu/src/replication/leader/actions.rs b/crates/fluvio-spu/src/replication/leader/actions.rs similarity index 100% rename from src/spu/src/replication/leader/actions.rs rename to crates/fluvio-spu/src/replication/leader/actions.rs diff --git a/src/spu/src/replication/leader/api_key.rs b/crates/fluvio-spu/src/replication/leader/api_key.rs similarity index 100% rename from src/spu/src/replication/leader/api_key.rs rename to crates/fluvio-spu/src/replication/leader/api_key.rs diff --git a/src/spu/src/replication/leader/connection.rs b/crates/fluvio-spu/src/replication/leader/connection.rs similarity index 100% rename from src/spu/src/replication/leader/connection.rs rename to crates/fluvio-spu/src/replication/leader/connection.rs diff --git a/src/spu/src/replication/leader/leaders_state.rs b/crates/fluvio-spu/src/replication/leader/leaders_state.rs similarity index 100% rename from src/spu/src/replication/leader/leaders_state.rs rename to crates/fluvio-spu/src/replication/leader/leaders_state.rs diff --git a/src/spu/src/replication/leader/mod.rs b/crates/fluvio-spu/src/replication/leader/mod.rs similarity index 100% rename from src/spu/src/replication/leader/mod.rs rename to crates/fluvio-spu/src/replication/leader/mod.rs diff --git a/src/spu/src/replication/leader/peer_api.rs b/crates/fluvio-spu/src/replication/leader/peer_api.rs similarity index 100% rename from src/spu/src/replication/leader/peer_api.rs rename to crates/fluvio-spu/src/replication/leader/peer_api.rs diff --git a/src/spu/src/replication/leader/replica_state.rs b/crates/fluvio-spu/src/replication/leader/replica_state.rs similarity index 100% rename from src/spu/src/replication/leader/replica_state.rs rename to crates/fluvio-spu/src/replication/leader/replica_state.rs diff --git a/src/spu/src/replication/leader/spu.rs b/crates/fluvio-spu/src/replication/leader/spu.rs similarity index 100% rename from src/spu/src/replication/leader/spu.rs rename to crates/fluvio-spu/src/replication/leader/spu.rs diff --git a/src/spu/src/replication/leader/update_offsets.rs b/crates/fluvio-spu/src/replication/leader/update_offsets.rs similarity index 100% rename from src/spu/src/replication/leader/update_offsets.rs rename to crates/fluvio-spu/src/replication/leader/update_offsets.rs diff --git a/src/spu/src/replication/mod.rs b/crates/fluvio-spu/src/replication/mod.rs similarity index 100% rename from src/spu/src/replication/mod.rs rename to crates/fluvio-spu/src/replication/mod.rs diff --git a/src/spu/src/replication/test.rs b/crates/fluvio-spu/src/replication/test.rs similarity index 100% rename from src/spu/src/replication/test.rs rename to crates/fluvio-spu/src/replication/test.rs diff --git a/src/spu/src/services/internal/api.rs b/crates/fluvio-spu/src/services/internal/api.rs similarity index 100% rename from src/spu/src/services/internal/api.rs rename to crates/fluvio-spu/src/services/internal/api.rs diff --git a/src/spu/src/services/internal/fetch_stream_request.rs b/crates/fluvio-spu/src/services/internal/fetch_stream_request.rs similarity index 100% rename from src/spu/src/services/internal/fetch_stream_request.rs rename to crates/fluvio-spu/src/services/internal/fetch_stream_request.rs diff --git a/src/spu/src/services/internal/mod.rs b/crates/fluvio-spu/src/services/internal/mod.rs similarity index 100% rename from src/spu/src/services/internal/mod.rs rename to crates/fluvio-spu/src/services/internal/mod.rs diff --git a/src/spu/src/services/internal/service_impl.rs b/crates/fluvio-spu/src/services/internal/service_impl.rs similarity index 100% rename from src/spu/src/services/internal/service_impl.rs rename to crates/fluvio-spu/src/services/internal/service_impl.rs diff --git a/src/spu/src/services/mod.rs b/crates/fluvio-spu/src/services/mod.rs similarity index 100% rename from src/spu/src/services/mod.rs rename to crates/fluvio-spu/src/services/mod.rs diff --git a/src/spu/src/services/public/api_versions.rs b/crates/fluvio-spu/src/services/public/api_versions.rs similarity index 100% rename from src/spu/src/services/public/api_versions.rs rename to crates/fluvio-spu/src/services/public/api_versions.rs diff --git a/src/spu/src/services/public/fetch_handler.rs b/crates/fluvio-spu/src/services/public/fetch_handler.rs similarity index 100% rename from src/spu/src/services/public/fetch_handler.rs rename to crates/fluvio-spu/src/services/public/fetch_handler.rs diff --git a/src/spu/src/services/public/mod.rs b/crates/fluvio-spu/src/services/public/mod.rs similarity index 100% rename from src/spu/src/services/public/mod.rs rename to crates/fluvio-spu/src/services/public/mod.rs diff --git a/src/spu/src/services/public/offset_request.rs b/crates/fluvio-spu/src/services/public/offset_request.rs similarity index 100% rename from src/spu/src/services/public/offset_request.rs rename to crates/fluvio-spu/src/services/public/offset_request.rs diff --git a/src/spu/src/services/public/produce_handler.rs b/crates/fluvio-spu/src/services/public/produce_handler.rs similarity index 100% rename from src/spu/src/services/public/produce_handler.rs rename to crates/fluvio-spu/src/services/public/produce_handler.rs diff --git a/src/spu/src/services/public/service_impl.rs b/crates/fluvio-spu/src/services/public/service_impl.rs similarity index 100% rename from src/spu/src/services/public/service_impl.rs rename to crates/fluvio-spu/src/services/public/service_impl.rs diff --git a/src/spu/src/services/public/stream_fetch.rs b/crates/fluvio-spu/src/services/public/stream_fetch.rs similarity index 99% rename from src/spu/src/services/public/stream_fetch.rs rename to crates/fluvio-spu/src/services/public/stream_fetch.rs index 42df1a8512..cddf3c7238 100644 --- a/src/spu/src/services/public/stream_fetch.rs +++ b/crates/fluvio-spu/src/services/public/stream_fetch.rs @@ -787,7 +787,7 @@ mod test { .parent() .expect("parent") .join(format!( - "smartstream/examples/target/wasm32-unknown-unknown/debug/{}.wasm", + "fluvio-smartstream/examples/target/wasm32-unknown-unknown/debug/{}.wasm", module_name )); read_filter_from_path(wasm_path) diff --git a/src/spu/src/smart_stream/aggregate.rs b/crates/fluvio-spu/src/smart_stream/aggregate.rs similarity index 100% rename from src/spu/src/smart_stream/aggregate.rs rename to crates/fluvio-spu/src/smart_stream/aggregate.rs diff --git a/src/spu/src/smart_stream/file_batch.rs b/crates/fluvio-spu/src/smart_stream/file_batch.rs similarity index 100% rename from src/spu/src/smart_stream/file_batch.rs rename to crates/fluvio-spu/src/smart_stream/file_batch.rs diff --git a/src/spu/src/smart_stream/filter.rs b/crates/fluvio-spu/src/smart_stream/filter.rs similarity index 100% rename from src/spu/src/smart_stream/filter.rs rename to crates/fluvio-spu/src/smart_stream/filter.rs diff --git a/src/spu/src/smart_stream/map.rs b/crates/fluvio-spu/src/smart_stream/map.rs similarity index 100% rename from src/spu/src/smart_stream/map.rs rename to crates/fluvio-spu/src/smart_stream/map.rs diff --git a/src/spu/src/smart_stream/memory.rs b/crates/fluvio-spu/src/smart_stream/memory.rs similarity index 100% rename from src/spu/src/smart_stream/memory.rs rename to crates/fluvio-spu/src/smart_stream/memory.rs diff --git a/src/spu/src/smart_stream/mod.rs b/crates/fluvio-spu/src/smart_stream/mod.rs similarity index 100% rename from src/spu/src/smart_stream/mod.rs rename to crates/fluvio-spu/src/smart_stream/mod.rs diff --git a/src/spu/src/start.rs b/crates/fluvio-spu/src/start.rs similarity index 100% rename from src/spu/src/start.rs rename to crates/fluvio-spu/src/start.rs diff --git a/src/spu/src/storage/mod.rs b/crates/fluvio-spu/src/storage/mod.rs similarity index 100% rename from src/spu/src/storage/mod.rs rename to crates/fluvio-spu/src/storage/mod.rs diff --git a/src/spu/src/tests/fixture/generator.rs b/crates/fluvio-spu/src/tests/fixture/generator.rs similarity index 100% rename from src/spu/src/tests/fixture/generator.rs rename to crates/fluvio-spu/src/tests/fixture/generator.rs diff --git a/src/spu/src/tests/fixture/mock_sc.rs b/crates/fluvio-spu/src/tests/fixture/mock_sc.rs similarity index 100% rename from src/spu/src/tests/fixture/mock_sc.rs rename to crates/fluvio-spu/src/tests/fixture/mock_sc.rs diff --git a/src/spu/src/tests/fixture/mod.rs b/crates/fluvio-spu/src/tests/fixture/mod.rs similarity index 100% rename from src/spu/src/tests/fixture/mod.rs rename to crates/fluvio-spu/src/tests/fixture/mod.rs diff --git a/src/spu/src/tests/fixture/spu_client.rs b/crates/fluvio-spu/src/tests/fixture/spu_client.rs similarity index 100% rename from src/spu/src/tests/fixture/spu_client.rs rename to crates/fluvio-spu/src/tests/fixture/spu_client.rs diff --git a/src/spu/src/tests/fixture/test_runner.rs b/crates/fluvio-spu/src/tests/fixture/test_runner.rs similarity index 100% rename from src/spu/src/tests/fixture/test_runner.rs rename to crates/fluvio-spu/src/tests/fixture/test_runner.rs diff --git a/src/spu/src/tests/mod.rs b/crates/fluvio-spu/src/tests/mod.rs similarity index 100% rename from src/spu/src/tests/mod.rs rename to crates/fluvio-spu/src/tests/mod.rs diff --git a/src/spu/src/tests/suites/mod.rs b/crates/fluvio-spu/src/tests/suites/mod.rs similarity index 100% rename from src/spu/src/tests/suites/mod.rs rename to crates/fluvio-spu/src/tests/suites/mod.rs diff --git a/src/spu/src/tests/suites/test_fetch.rs b/crates/fluvio-spu/src/tests/suites/test_fetch.rs similarity index 100% rename from src/spu/src/tests/suites/test_fetch.rs rename to crates/fluvio-spu/src/tests/suites/test_fetch.rs diff --git a/src/spu/src/tests/suites/test_offsets.rs b/crates/fluvio-spu/src/tests/suites/test_offsets.rs similarity index 100% rename from src/spu/src/tests/suites/test_offsets.rs rename to crates/fluvio-spu/src/tests/suites/test_offsets.rs diff --git a/src/spu/src/tests/suites/test_replication.rs b/crates/fluvio-spu/src/tests/suites/test_replication.rs similarity index 100% rename from src/spu/src/tests/suites/test_replication.rs rename to crates/fluvio-spu/src/tests/suites/test_replication.rs diff --git a/src/storage/Cargo.toml b/crates/fluvio-storage/Cargo.toml similarity index 67% rename from src/storage/Cargo.toml rename to crates/fluvio-storage/Cargo.toml index 1b3df1ea18..6316187e23 100644 --- a/src/storage/Cargo.toml +++ b/crates/fluvio-storage/Cargo.toml @@ -33,14 +33,14 @@ derive_builder = "0.10.2" thiserror = "1" # Fluvio dependencies -fluvio-types = { version = "0.2.0", path = "../types" } +fluvio-types = { version = "0.2.0", path = "../fluvio-types" } fluvio-future = { version = "0.3.2", features = ["fs", "mmap","zero_copy"] } -fluvio-protocol = { path = "../protocol", version = "0.6" } -dataplane = { version = "0.6.0", path = "../dataplane-protocol", package = "fluvio-dataplane-protocol", features = ["file"] } +fluvio-protocol = { path = "../fluvio-protocol", version = "0.6" } +dataplane = { version = "0.6.0", path = "../fluvio-dataplane-protocol", package = "fluvio-dataplane-protocol", features = ["file"] } [dev-dependencies] fluvio-future = { version = "0.3.0", features = ["fixture"] } flv-util = { version = "0.5.2", features = ["fixture"] } -fluvio-socket = { path = "../socket", version = "0.9",features = ["file"] } +fluvio-socket = { path = "../fluvio-socket", version = "0.9",features = ["file"] } fluvio-storage = { path = ".", features = ["fixture"]} -dataplane = { version = "0.6.0", path = "../dataplane-protocol", package = "fluvio-dataplane-protocol", features = ["fixture"] } +dataplane = { version = "0.6.0", path = "../fluvio-dataplane-protocol", package = "fluvio-dataplane-protocol", features = ["fixture"] } diff --git a/src/spu/LICENSE-APACHE b/crates/fluvio-storage/LICENSE-APACHE similarity index 100% rename from src/spu/LICENSE-APACHE rename to crates/fluvio-storage/LICENSE-APACHE diff --git a/src/storage/README.md b/crates/fluvio-storage/README.md similarity index 69% rename from src/storage/README.md rename to crates/fluvio-storage/README.md index d798bb5874..8ad645adf4 100644 --- a/src/storage/README.md +++ b/crates/fluvio-storage/README.md @@ -2,7 +2,7 @@ From root of the project ``` -cargo build --features=cli --manifest-path src/storage/Cargo.toml +cargo build --features=cli --manifest-path crates/fluvio-storage/Cargo.toml ``` # Running storage cli diff --git a/src/storage/src/batch.rs b/crates/fluvio-storage/src/batch.rs similarity index 100% rename from src/storage/src/batch.rs rename to crates/fluvio-storage/src/batch.rs diff --git a/src/storage/src/batch_header.rs b/crates/fluvio-storage/src/batch_header.rs similarity index 100% rename from src/storage/src/batch_header.rs rename to crates/fluvio-storage/src/batch_header.rs diff --git a/src/storage/src/bin/cli.rs b/crates/fluvio-storage/src/bin/cli.rs similarity index 100% rename from src/storage/src/bin/cli.rs rename to crates/fluvio-storage/src/bin/cli.rs diff --git a/src/storage/src/checkpoint.rs b/crates/fluvio-storage/src/checkpoint.rs similarity index 100% rename from src/storage/src/checkpoint.rs rename to crates/fluvio-storage/src/checkpoint.rs diff --git a/src/storage/src/config.rs b/crates/fluvio-storage/src/config.rs similarity index 100% rename from src/storage/src/config.rs rename to crates/fluvio-storage/src/config.rs diff --git a/src/storage/src/error.rs b/crates/fluvio-storage/src/error.rs similarity index 100% rename from src/storage/src/error.rs rename to crates/fluvio-storage/src/error.rs diff --git a/src/storage/src/fixture.rs b/crates/fluvio-storage/src/fixture.rs similarity index 100% rename from src/storage/src/fixture.rs rename to crates/fluvio-storage/src/fixture.rs diff --git a/src/storage/src/index.rs b/crates/fluvio-storage/src/index.rs similarity index 100% rename from src/storage/src/index.rs rename to crates/fluvio-storage/src/index.rs diff --git a/src/storage/src/lib.rs b/crates/fluvio-storage/src/lib.rs similarity index 100% rename from src/storage/src/lib.rs rename to crates/fluvio-storage/src/lib.rs diff --git a/src/storage/src/mut_index.rs b/crates/fluvio-storage/src/mut_index.rs similarity index 100% rename from src/storage/src/mut_index.rs rename to crates/fluvio-storage/src/mut_index.rs diff --git a/src/storage/src/mut_records.rs b/crates/fluvio-storage/src/mut_records.rs similarity index 100% rename from src/storage/src/mut_records.rs rename to crates/fluvio-storage/src/mut_records.rs diff --git a/src/storage/src/range_map.rs b/crates/fluvio-storage/src/range_map.rs similarity index 100% rename from src/storage/src/range_map.rs rename to crates/fluvio-storage/src/range_map.rs diff --git a/src/storage/src/records.rs b/crates/fluvio-storage/src/records.rs similarity index 100% rename from src/storage/src/records.rs rename to crates/fluvio-storage/src/records.rs diff --git a/src/storage/src/replica.rs b/crates/fluvio-storage/src/replica.rs similarity index 100% rename from src/storage/src/replica.rs rename to crates/fluvio-storage/src/replica.rs diff --git a/src/storage/src/segment.rs b/crates/fluvio-storage/src/segment.rs similarity index 100% rename from src/storage/src/segment.rs rename to crates/fluvio-storage/src/segment.rs diff --git a/src/storage/src/util.rs b/crates/fluvio-storage/src/util.rs similarity index 100% rename from src/storage/src/util.rs rename to crates/fluvio-storage/src/util.rs diff --git a/src/storage/src/validator.rs b/crates/fluvio-storage/src/validator.rs similarity index 100% rename from src/storage/src/validator.rs rename to crates/fluvio-storage/src/validator.rs diff --git a/src/storage/tests/replica_test.rs b/crates/fluvio-storage/tests/replica_test.rs similarity index 100% rename from src/storage/tests/replica_test.rs rename to crates/fluvio-storage/tests/replica_test.rs diff --git a/src/stream-dispatcher/Cargo.toml b/crates/fluvio-stream-dispatcher/Cargo.toml similarity index 91% rename from src/stream-dispatcher/Cargo.toml rename to crates/fluvio-stream-dispatcher/Cargo.toml index 5746a964a3..db054fcd87 100644 --- a/src/stream-dispatcher/Cargo.toml +++ b/crates/fluvio-stream-dispatcher/Cargo.toml @@ -26,8 +26,8 @@ tokio = { version = "1.3.0", features = ["macros"] } once_cell = "1.5" # Fluvio dependencies -fluvio-types = { path = "../types", version = "0.2.0" } -fluvio-stream-model = { features = ["k8"], version = "0.5.1", path = "../stream-model" } +fluvio-types = { path = "../fluvio-types", version = "0.2.0" } +fluvio-stream-model = { features = ["k8"], version = "0.5.1", path = "../fluvio-stream-model" } k8-metadata-client = { version = "3.0.0" } fluvio-future = { version = "0.3.0", features = ["task", "timer"] } diff --git a/src/storage/LICENSE-APACHE b/crates/fluvio-stream-dispatcher/LICENSE-APACHE similarity index 100% rename from src/storage/LICENSE-APACHE rename to crates/fluvio-stream-dispatcher/LICENSE-APACHE diff --git a/src/stream-dispatcher/src/actions.rs b/crates/fluvio-stream-dispatcher/src/actions.rs similarity index 100% rename from src/stream-dispatcher/src/actions.rs rename to crates/fluvio-stream-dispatcher/src/actions.rs diff --git a/src/stream-dispatcher/src/dispatcher/k8_dispatcher.rs b/crates/fluvio-stream-dispatcher/src/dispatcher/k8_dispatcher.rs similarity index 100% rename from src/stream-dispatcher/src/dispatcher/k8_dispatcher.rs rename to crates/fluvio-stream-dispatcher/src/dispatcher/k8_dispatcher.rs diff --git a/src/stream-dispatcher/src/dispatcher/k8_ws_service.rs b/crates/fluvio-stream-dispatcher/src/dispatcher/k8_ws_service.rs similarity index 100% rename from src/stream-dispatcher/src/dispatcher/k8_ws_service.rs rename to crates/fluvio-stream-dispatcher/src/dispatcher/k8_ws_service.rs diff --git a/src/stream-dispatcher/src/dispatcher/mod.rs b/crates/fluvio-stream-dispatcher/src/dispatcher/mod.rs similarity index 100% rename from src/stream-dispatcher/src/dispatcher/mod.rs rename to crates/fluvio-stream-dispatcher/src/dispatcher/mod.rs diff --git a/src/stream-dispatcher/src/error.rs b/crates/fluvio-stream-dispatcher/src/error.rs similarity index 100% rename from src/stream-dispatcher/src/error.rs rename to crates/fluvio-stream-dispatcher/src/error.rs diff --git a/src/stream-dispatcher/src/lib.rs b/crates/fluvio-stream-dispatcher/src/lib.rs similarity index 100% rename from src/stream-dispatcher/src/lib.rs rename to crates/fluvio-stream-dispatcher/src/lib.rs diff --git a/src/stream-dispatcher/src/store/mod.rs b/crates/fluvio-stream-dispatcher/src/store/mod.rs similarity index 100% rename from src/stream-dispatcher/src/store/mod.rs rename to crates/fluvio-stream-dispatcher/src/store/mod.rs diff --git a/src/stream-model/Cargo.toml b/crates/fluvio-stream-model/Cargo.toml similarity index 99% rename from src/stream-model/Cargo.toml rename to crates/fluvio-stream-model/Cargo.toml index 20960ec678..fdd273e974 100644 --- a/src/stream-model/Cargo.toml +++ b/crates/fluvio-stream-model/Cargo.toml @@ -25,7 +25,6 @@ once_cell = "1.5" # Fluvio dependencies k8-types = { version = "0.2.0", optional = true } - [dev-dependencies] tokio = { version = "1.3.0", features = ["macros"] } fluvio-future = { version = "0.3.0", features = ["fixture"] } diff --git a/src/stream-dispatcher/LICENSE-APACHE b/crates/fluvio-stream-model/LICENSE-APACHE similarity index 100% rename from src/stream-dispatcher/LICENSE-APACHE rename to crates/fluvio-stream-model/LICENSE-APACHE diff --git a/src/stream-model/src/core.rs b/crates/fluvio-stream-model/src/core.rs similarity index 100% rename from src/stream-model/src/core.rs rename to crates/fluvio-stream-model/src/core.rs diff --git a/src/stream-model/src/epoch/dual_epoch_map.rs b/crates/fluvio-stream-model/src/epoch/dual_epoch_map.rs similarity index 100% rename from src/stream-model/src/epoch/dual_epoch_map.rs rename to crates/fluvio-stream-model/src/epoch/dual_epoch_map.rs diff --git a/src/stream-model/src/epoch/epoch_map.rs b/crates/fluvio-stream-model/src/epoch/epoch_map.rs similarity index 100% rename from src/stream-model/src/epoch/epoch_map.rs rename to crates/fluvio-stream-model/src/epoch/epoch_map.rs diff --git a/src/stream-model/src/epoch/mod.rs b/crates/fluvio-stream-model/src/epoch/mod.rs similarity index 100% rename from src/stream-model/src/epoch/mod.rs rename to crates/fluvio-stream-model/src/epoch/mod.rs diff --git a/src/stream-model/src/lib.rs b/crates/fluvio-stream-model/src/lib.rs similarity index 100% rename from src/stream-model/src/lib.rs rename to crates/fluvio-stream-model/src/lib.rs diff --git a/src/stream-model/src/store/actions.rs b/crates/fluvio-stream-model/src/store/actions.rs similarity index 100% rename from src/stream-model/src/store/actions.rs rename to crates/fluvio-stream-model/src/store/actions.rs diff --git a/src/stream-model/src/store/concurrent_hashmap.rs b/crates/fluvio-stream-model/src/store/concurrent_hashmap.rs similarity index 100% rename from src/stream-model/src/store/concurrent_hashmap.rs rename to crates/fluvio-stream-model/src/store/concurrent_hashmap.rs diff --git a/src/stream-model/src/store/dual_store.rs b/crates/fluvio-stream-model/src/store/dual_store.rs similarity index 100% rename from src/stream-model/src/store/dual_store.rs rename to crates/fluvio-stream-model/src/store/dual_store.rs diff --git a/src/stream-model/src/store/event.rs b/crates/fluvio-stream-model/src/store/event.rs similarity index 100% rename from src/stream-model/src/store/event.rs rename to crates/fluvio-stream-model/src/store/event.rs diff --git a/src/stream-model/src/store/filter.rs b/crates/fluvio-stream-model/src/store/filter.rs similarity index 100% rename from src/stream-model/src/store/filter.rs rename to crates/fluvio-stream-model/src/store/filter.rs diff --git a/src/stream-model/src/store/k8.rs b/crates/fluvio-stream-model/src/store/k8.rs similarity index 100% rename from src/stream-model/src/store/k8.rs rename to crates/fluvio-stream-model/src/store/k8.rs diff --git a/src/stream-model/src/store/metadata.rs b/crates/fluvio-stream-model/src/store/metadata.rs similarity index 100% rename from src/stream-model/src/store/metadata.rs rename to crates/fluvio-stream-model/src/store/metadata.rs diff --git a/src/stream-model/src/store/mod.rs b/crates/fluvio-stream-model/src/store/mod.rs similarity index 100% rename from src/stream-model/src/store/mod.rs rename to crates/fluvio-stream-model/src/store/mod.rs diff --git a/src/utils/Cargo.toml b/crates/fluvio-system-util/Cargo.toml similarity index 84% rename from src/utils/Cargo.toml rename to crates/fluvio-system-util/Cargo.toml index 4fed0fec8a..5c3b0d312c 100644 --- a/src/utils/Cargo.toml +++ b/crates/fluvio-system-util/Cargo.toml @@ -16,4 +16,4 @@ tracing = "0.1.19" rand = "0.7.2" # Fluvio dependencies -fluvio-types = { version = "0.2.0", path = "../types" } +fluvio-types = { version = "0.2.0", path = "../fluvio-types" } diff --git a/src/stream-model/LICENSE-APACHE b/crates/fluvio-system-util/LICENSE-APACHE similarity index 100% rename from src/stream-model/LICENSE-APACHE rename to crates/fluvio-system-util/LICENSE-APACHE diff --git a/src/utils/src/bin.rs b/crates/fluvio-system-util/src/bin.rs similarity index 100% rename from src/utils/src/bin.rs rename to crates/fluvio-system-util/src/bin.rs diff --git a/src/utils/src/config_helper.rs b/crates/fluvio-system-util/src/config_helper.rs similarity index 100% rename from src/utils/src/config_helper.rs rename to crates/fluvio-system-util/src/config_helper.rs diff --git a/src/utils/src/counters/counter_tbl.rs b/crates/fluvio-system-util/src/counters/counter_tbl.rs similarity index 100% rename from src/utils/src/counters/counter_tbl.rs rename to crates/fluvio-system-util/src/counters/counter_tbl.rs diff --git a/src/utils/src/counters/counters.rs b/crates/fluvio-system-util/src/counters/counters.rs similarity index 100% rename from src/utils/src/counters/counters.rs rename to crates/fluvio-system-util/src/counters/counters.rs diff --git a/src/utils/src/counters/mod.rs b/crates/fluvio-system-util/src/counters/mod.rs similarity index 100% rename from src/utils/src/counters/mod.rs rename to crates/fluvio-system-util/src/counters/mod.rs diff --git a/src/utils/src/generators.rs b/crates/fluvio-system-util/src/generators.rs similarity index 100% rename from src/utils/src/generators.rs rename to crates/fluvio-system-util/src/generators.rs diff --git a/src/utils/src/lib.rs b/crates/fluvio-system-util/src/lib.rs similarity index 100% rename from src/utils/src/lib.rs rename to crates/fluvio-system-util/src/lib.rs diff --git a/tests/runner/src/fluvio-integration-derive/Cargo.toml b/crates/fluvio-test-derive/Cargo.toml similarity index 73% rename from tests/runner/src/fluvio-integration-derive/Cargo.toml rename to crates/fluvio-test-derive/Cargo.toml index 4ac7682c38..d705099be2 100644 --- a/tests/runner/src/fluvio-integration-derive/Cargo.toml +++ b/crates/fluvio-test-derive/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "fluvio-integration-derive" -version = "0.1.0" +name = "fluvio-test-derive" +version = "0.0.0" authors = ["Fluvio Contributors "] edition = "2018" @@ -11,12 +11,12 @@ proc-macro = true syn = { version = "1.0", features = ["full"]} quote = "1.0" proc-macro2 = "1.0" -fluvio-test-util = { path = "../utils"} serde_json = "1.0" inflections = "1.1" +fluvio-test-util = { path = "../fluvio-test-util" } [dev-dependencies] trybuild = { git = "https://github.com/sehz/trybuild", branch = "check_option" } -fluvio = { path = "../../../../src/client" } +fluvio = { path = "../fluvio" } tokio = { version = "1.4", features = ["macros"] } -fluvio-future = { version = "0.3.0", features = ["task", "timer", "subscriber", "fixture"] } \ No newline at end of file +fluvio-future = { version = "0.3.0", features = ["task", "timer", "subscriber", "fixture"] } diff --git a/tests/runner/src/fluvio-integration-derive/src/lib.rs b/crates/fluvio-test-derive/src/lib.rs similarity index 100% rename from tests/runner/src/fluvio-integration-derive/src/lib.rs rename to crates/fluvio-test-derive/src/lib.rs diff --git a/tests/runner/src/fluvio-integration-derive/tests/parse.rs b/crates/fluvio-test-derive/tests/parse.rs similarity index 100% rename from tests/runner/src/fluvio-integration-derive/tests/parse.rs rename to crates/fluvio-test-derive/tests/parse.rs diff --git a/tests/runner/src/fluvio-integration-derive/ui-tests/fail_cluster_type.rs b/crates/fluvio-test-derive/ui-tests/fail_cluster_type.rs similarity index 100% rename from tests/runner/src/fluvio-integration-derive/ui-tests/fail_cluster_type.rs rename to crates/fluvio-test-derive/ui-tests/fail_cluster_type.rs diff --git a/tests/runner/src/fluvio-integration-derive/ui-tests/fail_invalid_key.rs b/crates/fluvio-test-derive/ui-tests/fail_invalid_key.rs similarity index 100% rename from tests/runner/src/fluvio-integration-derive/ui-tests/fail_invalid_key.rs rename to crates/fluvio-test-derive/ui-tests/fail_invalid_key.rs diff --git a/tests/runner/src/fluvio-integration-derive/ui-tests/fail_min_spu_type.rs b/crates/fluvio-test-derive/ui-tests/fail_min_spu_type.rs similarity index 100% rename from tests/runner/src/fluvio-integration-derive/ui-tests/fail_min_spu_type.rs rename to crates/fluvio-test-derive/ui-tests/fail_min_spu_type.rs diff --git a/tests/runner/src/fluvio-integration-derive/ui-tests/fail_multi.rs b/crates/fluvio-test-derive/ui-tests/fail_multi.rs similarity index 100% rename from tests/runner/src/fluvio-integration-derive/ui-tests/fail_multi.rs rename to crates/fluvio-test-derive/ui-tests/fail_multi.rs diff --git a/tests/runner/src/fluvio-integration-derive/ui-tests/fail_name.rs b/crates/fluvio-test-derive/ui-tests/fail_name.rs similarity index 100% rename from tests/runner/src/fluvio-integration-derive/ui-tests/fail_name.rs rename to crates/fluvio-test-derive/ui-tests/fail_name.rs diff --git a/tests/runner/src/fluvio-integration-derive/ui-tests/fail_timeout.rs b/crates/fluvio-test-derive/ui-tests/fail_timeout.rs similarity index 100% rename from tests/runner/src/fluvio-integration-derive/ui-tests/fail_timeout.rs rename to crates/fluvio-test-derive/ui-tests/fail_timeout.rs diff --git a/tests/runner/src/fluvio-integration-derive/ui-tests/fail_topic_type.rs b/crates/fluvio-test-derive/ui-tests/fail_topic_type.rs similarity index 100% rename from tests/runner/src/fluvio-integration-derive/ui-tests/fail_topic_type.rs rename to crates/fluvio-test-derive/ui-tests/fail_topic_type.rs diff --git a/tests/runner/src/fluvio-integration-derive/ui-tests/pass_cluster_type.rs b/crates/fluvio-test-derive/ui-tests/pass_cluster_type.rs similarity index 100% rename from tests/runner/src/fluvio-integration-derive/ui-tests/pass_cluster_type.rs rename to crates/fluvio-test-derive/ui-tests/pass_cluster_type.rs diff --git a/tests/runner/src/fluvio-integration-derive/ui-tests/pass_min_spu.rs b/crates/fluvio-test-derive/ui-tests/pass_min_spu.rs similarity index 100% rename from tests/runner/src/fluvio-integration-derive/ui-tests/pass_min_spu.rs rename to crates/fluvio-test-derive/ui-tests/pass_min_spu.rs diff --git a/tests/runner/src/fluvio-integration-derive/ui-tests/pass_multi.rs b/crates/fluvio-test-derive/ui-tests/pass_multi.rs similarity index 100% rename from tests/runner/src/fluvio-integration-derive/ui-tests/pass_multi.rs rename to crates/fluvio-test-derive/ui-tests/pass_multi.rs diff --git a/tests/runner/src/fluvio-integration-derive/ui-tests/pass_name.rs b/crates/fluvio-test-derive/ui-tests/pass_name.rs similarity index 100% rename from tests/runner/src/fluvio-integration-derive/ui-tests/pass_name.rs rename to crates/fluvio-test-derive/ui-tests/pass_name.rs diff --git a/tests/runner/src/fluvio-integration-derive/ui-tests/pass_no_macro_args.rs b/crates/fluvio-test-derive/ui-tests/pass_no_macro_args.rs similarity index 100% rename from tests/runner/src/fluvio-integration-derive/ui-tests/pass_no_macro_args.rs rename to crates/fluvio-test-derive/ui-tests/pass_no_macro_args.rs diff --git a/tests/runner/src/fluvio-integration-derive/ui-tests/pass_timeout.rs b/crates/fluvio-test-derive/ui-tests/pass_timeout.rs similarity index 100% rename from tests/runner/src/fluvio-integration-derive/ui-tests/pass_timeout.rs rename to crates/fluvio-test-derive/ui-tests/pass_timeout.rs diff --git a/tests/runner/src/fluvio-integration-derive/ui-tests/pass_topic.rs b/crates/fluvio-test-derive/ui-tests/pass_topic.rs similarity index 100% rename from tests/runner/src/fluvio-integration-derive/ui-tests/pass_topic.rs rename to crates/fluvio-test-derive/ui-tests/pass_topic.rs diff --git a/crates/fluvio-test-derive/wip/fail_cluster_type.stderr b/crates/fluvio-test-derive/wip/fail_cluster_type.stderr new file mode 100644 index 0000000000..da10b4b229 --- /dev/null +++ b/crates/fluvio-test-derive/wip/fail_cluster_type.stderr @@ -0,0 +1,13 @@ +error: custom attribute panicked + --> $DIR/fail_cluster_type.rs:9:1 + | +9 | #[fluvio_test(cluster_type="not-a-type")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: message: Parse failed + +error: expected literal + --> $DIR/fail_cluster_type.rs:14:28 + | +14 | #[fluvio_test(cluster_type=["k8", "local"])] + | ^^^^^^^^^^^^^^^ diff --git a/crates/fluvio-test-derive/wip/fail_invalid_key.stderr b/crates/fluvio-test-derive/wip/fail_invalid_key.stderr new file mode 100644 index 0000000000..2f94284e07 --- /dev/null +++ b/crates/fluvio-test-derive/wip/fail_invalid_key.stderr @@ -0,0 +1,7 @@ +error: custom attribute panicked + --> $DIR/fail_invalid_key.rs:9:1 + | +9 | #[fluvio_test(fail)] + | ^^^^^^^^^^^^^^^^^^^^ + | + = help: message: Parse failed diff --git a/crates/fluvio-test-derive/wip/fail_min_spu_type.stderr b/crates/fluvio-test-derive/wip/fail_min_spu_type.stderr new file mode 100644 index 0000000000..3fa6692750 --- /dev/null +++ b/crates/fluvio-test-derive/wip/fail_min_spu_type.stderr @@ -0,0 +1,13 @@ +error: expected literal + --> $DIR/fail_min_spu_type.rs:9:25 + | +9 | #[fluvio_test(min_spu = a)] + | ^ + +error: custom attribute panicked + --> $DIR/fail_min_spu_type.rs:13:1 + | +13 | #[fluvio_test(min_spu = "1")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: message: Parse failed diff --git a/crates/fluvio-test-derive/wip/fail_multi.stderr b/crates/fluvio-test-derive/wip/fail_multi.stderr new file mode 100644 index 0000000000..5f944d6ecc --- /dev/null +++ b/crates/fluvio-test-derive/wip/fail_multi.stderr @@ -0,0 +1,5 @@ +error: expected literal + --> $DIR/fail_multi.rs:9:25 + | +9 | #[fluvio_test(min_spu = a, topic = 2)] + | ^ diff --git a/crates/fluvio-test-derive/wip/fail_name.stderr b/crates/fluvio-test-derive/wip/fail_name.stderr new file mode 100644 index 0000000000..9eee44206a --- /dev/null +++ b/crates/fluvio-test-derive/wip/fail_name.stderr @@ -0,0 +1,13 @@ +error: custom attribute panicked + --> $DIR/fail_name.rs:9:1 + | +9 | #[fluvio_test(name = 1)] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: message: Parse failed + +error: expected literal + --> $DIR/fail_name.rs:13:22 + | +13 | #[fluvio_test(name = unquoted)] + | ^^^^^^^^ diff --git a/crates/fluvio-test-derive/wip/fail_no_fn_args.stderr b/crates/fluvio-test-derive/wip/fail_no_fn_args.stderr new file mode 100644 index 0000000000..67298fa03e --- /dev/null +++ b/crates/fluvio-test-derive/wip/fail_no_fn_args.stderr @@ -0,0 +1,35 @@ +error[E0412]: cannot find type `Arc` in this scope + --> $DIR/fail_no_fn_args.rs:3:1 + | +3 | #[fluvio_test] + | ^^^^^^^^^^^^^^ not found in this scope + | + = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) +help: consider importing this struct + | +1 | use std::sync::Arc; + | + +error[E0412]: cannot find type `Fluvio` in this scope + --> $DIR/fail_no_fn_args.rs:3:1 + | +3 | #[fluvio_test] + | ^^^^^^^^^^^^^^ not found in this scope + | + = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) +help: consider importing this struct + | +1 | use fluvio::Fluvio; + | + +error[E0412]: cannot find type `TestCase` in this scope + --> $DIR/fail_no_fn_args.rs:3:1 + | +3 | #[fluvio_test] + | ^^^^^^^^^^^^^^ not found in this scope + | + = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) +help: consider importing this struct + | +1 | use fluvio_test_util::test_meta::TestCase; + | diff --git a/crates/fluvio-test-derive/wip/fail_timeout.stderr b/crates/fluvio-test-derive/wip/fail_timeout.stderr new file mode 100644 index 0000000000..b9d9c527b9 --- /dev/null +++ b/crates/fluvio-test-derive/wip/fail_timeout.stderr @@ -0,0 +1,21 @@ +error: custom attribute panicked + --> $DIR/fail_timeout.rs:9:1 + | +9 | #[fluvio_test(timeout = "a")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: message: Parse failed + +error: custom attribute panicked + --> $DIR/fail_timeout.rs:13:1 + | +13 | #[fluvio_test(timeout = "1")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: message: Parse failed + +error: expected literal + --> $DIR/fail_timeout.rs:17:25 + | +17 | #[fluvio_test(timeout = a)] + | ^ diff --git a/crates/fluvio-test-derive/wip/fail_topic_type.stderr b/crates/fluvio-test-derive/wip/fail_topic_type.stderr new file mode 100644 index 0000000000..fbb882cd35 --- /dev/null +++ b/crates/fluvio-test-derive/wip/fail_topic_type.stderr @@ -0,0 +1,7 @@ +error: custom attribute panicked + --> $DIR/fail_topic_type.rs:9:1 + | +9 | #[fluvio_test(topic = 1)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: message: Parse failed diff --git a/tests/runner/src/utils/Cargo.toml b/crates/fluvio-test-util/Cargo.toml similarity index 72% rename from tests/runner/src/utils/Cargo.toml rename to crates/fluvio-test-util/Cargo.toml index f8c983686d..01c8e7ecae 100644 --- a/tests/runner/src/utils/Cargo.toml +++ b/crates/fluvio-test-util/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fluvio-test-util" -version = "0.1.0" +version = "0.0.0" authors = ["Fluvio Contributors "] edition = "2018" @@ -24,11 +24,11 @@ semver = "1.0.0" hdrhistogram = "7.3.0" async-lock = "2.4.0" -fluvio = { path = "../../../../src/client" } +fluvio = { path = "../fluvio" } fluvio-future = { version = "0.3.0", features = ["task", "timer", "subscriber", "fixture"] } -fluvio-cluster = { path = "../../../../src/cluster" } +fluvio-cluster = { path = "../fluvio-cluster" } fluvio-command = { version = "0.2.0" } -fluvio-controlplane-metadata = { features = ["k8"], path = "../../../../src/controlplane-metadata" } +fluvio-controlplane-metadata = { features = ["k8"], path = "../fluvio-controlplane-metadata" } [lib] -path = "lib.rs" \ No newline at end of file +path = "lib.rs" diff --git a/tests/runner/src/utils/lib.rs b/crates/fluvio-test-util/lib.rs similarity index 84% rename from tests/runner/src/utils/lib.rs rename to crates/fluvio-test-util/lib.rs index fd539227cb..81287e4ee0 100644 --- a/tests/runner/src/utils/lib.rs +++ b/crates/fluvio-test-util/lib.rs @@ -6,7 +6,7 @@ pub mod test_meta; use once_cell::sync::Lazy; static VERSION: Lazy = Lazy::new(|| { - let version = include_str!("../../../../VERSION"); + let version = include_str!("../../VERSION"); match option_env!("FLUVIO_VERSION_SUFFIX") { Some(suffix) => format!("{}-{}", version, suffix), None => version.to_string(), diff --git a/tests/runner/src/utils/setup/environment/k8.rs b/crates/fluvio-test-util/setup/environment/k8.rs similarity index 100% rename from tests/runner/src/utils/setup/environment/k8.rs rename to crates/fluvio-test-util/setup/environment/k8.rs diff --git a/tests/runner/src/utils/setup/environment/local.rs b/crates/fluvio-test-util/setup/environment/local.rs similarity index 100% rename from tests/runner/src/utils/setup/environment/local.rs rename to crates/fluvio-test-util/setup/environment/local.rs diff --git a/tests/runner/src/utils/setup/environment/mod.rs b/crates/fluvio-test-util/setup/environment/mod.rs similarity index 100% rename from tests/runner/src/utils/setup/environment/mod.rs rename to crates/fluvio-test-util/setup/environment/mod.rs diff --git a/tests/runner/src/utils/setup/mod.rs b/crates/fluvio-test-util/setup/mod.rs similarity index 100% rename from tests/runner/src/utils/setup/mod.rs rename to crates/fluvio-test-util/setup/mod.rs diff --git a/tests/runner/src/utils/test_meta/derive_attr.rs b/crates/fluvio-test-util/test_meta/derive_attr.rs similarity index 100% rename from tests/runner/src/utils/test_meta/derive_attr.rs rename to crates/fluvio-test-util/test_meta/derive_attr.rs diff --git a/tests/runner/src/utils/test_meta/environment.rs b/crates/fluvio-test-util/test_meta/environment.rs similarity index 100% rename from tests/runner/src/utils/test_meta/environment.rs rename to crates/fluvio-test-util/test_meta/environment.rs diff --git a/tests/runner/src/utils/test_meta/mod.rs b/crates/fluvio-test-util/test_meta/mod.rs similarity index 100% rename from tests/runner/src/utils/test_meta/mod.rs rename to crates/fluvio-test-util/test_meta/mod.rs diff --git a/tests/runner/src/utils/test_meta/test_result.rs b/crates/fluvio-test-util/test_meta/test_result.rs similarity index 100% rename from tests/runner/src/utils/test_meta/test_result.rs rename to crates/fluvio-test-util/test_meta/test_result.rs diff --git a/tests/runner/src/utils/test_meta/test_timer.rs b/crates/fluvio-test-util/test_meta/test_timer.rs similarity index 100% rename from tests/runner/src/utils/test_meta/test_timer.rs rename to crates/fluvio-test-util/test_meta/test_timer.rs diff --git a/tests/runner/src/utils/test_runner/mod.rs b/crates/fluvio-test-util/test_runner/mod.rs similarity index 100% rename from tests/runner/src/utils/test_runner/mod.rs rename to crates/fluvio-test-util/test_runner/mod.rs diff --git a/tests/runner/src/utils/test_runner/test_driver/mod.rs b/crates/fluvio-test-util/test_runner/test_driver/mod.rs similarity index 100% rename from tests/runner/src/utils/test_runner/test_driver/mod.rs rename to crates/fluvio-test-util/test_runner/test_driver/mod.rs diff --git a/tests/runner/src/utils/test_runner/test_meta.rs b/crates/fluvio-test-util/test_runner/test_meta.rs similarity index 100% rename from tests/runner/src/utils/test_runner/test_meta.rs rename to crates/fluvio-test-util/test_runner/test_meta.rs diff --git a/tests/runner/src/utils/tls.rs b/crates/fluvio-test-util/tls.rs similarity index 100% rename from tests/runner/src/utils/tls.rs rename to crates/fluvio-test-util/tls.rs diff --git a/tests/runner/Cargo.toml b/crates/fluvio-test/Cargo.toml similarity index 56% rename from tests/runner/Cargo.toml rename to crates/fluvio-test/Cargo.toml index 7f770a41fd..60753b2f75 100644 --- a/tests/runner/Cargo.toml +++ b/crates/fluvio-test/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "flv-test" -version = "1.0.1" +name = "fluvio-test" +version = "0.0.0" authors = ["Fluvio Contributors "] edition = "2018" autotests = false @@ -24,15 +24,15 @@ hdrhistogram = "7.3.0" async-lock = "2.4.0" # Fluvio dependencies -fluvio = { path = "../../src/client" } -fluvio-types = { version = "0.2.0", path = "../../src/types" } +fluvio = { path = "../fluvio" } +fluvio-types = { version = "0.2.0", path = "../fluvio-types" } fluvio-future = { version = "0.3.0", features = ["task", "timer", "subscriber", "fixture"] } fluvio-command = { version = "0.2.0" } -fluvio-cluster = { path = "../../src/cluster" } -fluvio-controlplane-metadata = { features = ["k8"], path = "../../src/controlplane-metadata" } -dataplane = { path = "../../src/dataplane-protocol", package = "fluvio-dataplane-protocol" } -fluvio-system-util = { version = "0.1.0", path = "../../src/utils" } +fluvio-cluster = { path = "../fluvio-cluster" } +fluvio-controlplane-metadata = { features = ["k8"], path = "../fluvio-controlplane-metadata" } +dataplane = { path = "../fluvio-dataplane-protocol", package = "fluvio-dataplane-protocol" } +fluvio-system-util = { version = "0.1.0", path = "../fluvio-system-util" } # Fluvio test framework Attribute macro -fluvio-integration-derive = { path = "./src/fluvio-integration-derive" } -fluvio-test-util = { path = "./src/utils" } \ No newline at end of file +fluvio-test-derive = { path = "../fluvio-test-derive" } +fluvio-test-util = { path = "../fluvio-test-util" } \ No newline at end of file diff --git a/tests/runner/src/lib.rs b/crates/fluvio-test/src/lib.rs similarity index 100% rename from tests/runner/src/lib.rs rename to crates/fluvio-test/src/lib.rs diff --git a/tests/runner/src/main.rs b/crates/fluvio-test/src/main.rs similarity index 94% rename from tests/runner/src/main.rs rename to crates/fluvio-test/src/main.rs index a938851b4d..6894d01ff8 100644 --- a/tests/runner/src/main.rs +++ b/crates/fluvio-test/src/main.rs @@ -15,7 +15,7 @@ use hdrhistogram::Histogram; // This is important for `inventory` crate #[allow(unused_imports)] -use flv_test::tests as _; +use fluvio_test::tests as _; use async_lock::RwLock; fn main() { @@ -149,22 +149,22 @@ async fn cluster_setup(option: &EnvironmentSetup) -> Arc> { mod tests { // CLI Tests + use std::time::Duration; use structopt::StructOpt; use fluvio_test_util::test_meta::{BaseCli, TestCli}; use fluvio_test_util::test_meta::environment::EnvDetail; - use flv_test::tests::smoke::SmokeTestOption; - use std::time::Duration; + use fluvio_test::tests::smoke::SmokeTestOption; #[test] fn valid_test_name() { - let args = BaseCli::from_iter_safe(vec!["flv-test", "smoke"]); + let args = BaseCli::from_iter_safe(vec!["fluvio-test", "smoke"]); assert!(args.is_ok()); } #[test] fn invalid_test_name() { - let args = BaseCli::from_iter_safe(vec!["flv-test", "testdoesnotexist"]); + let args = BaseCli::from_iter_safe(vec!["fluvio-test", "testdoesnotexist"]); assert!(args.is_err()); } @@ -172,7 +172,7 @@ mod tests { #[test] fn extra_vars() { let args = BaseCli::from_iter(vec![ - "flv-test", + "fluvio-test", "smoke", "--", "--producer-iteration=9000", @@ -201,7 +201,7 @@ mod tests { #[test] fn topic() { let args = BaseCli::from_iter(vec![ - "flv-test", + "fluvio-test", "smoke", "--topic-name", "not_the_default_topic_name", @@ -212,14 +212,14 @@ mod tests { #[test] fn spu() { - let args = BaseCli::from_iter(vec!["flv-test", "smoke", "--spu", "5"]); + let args = BaseCli::from_iter(vec!["fluvio-test", "smoke", "--spu", "5"]); assert_eq!(args.environment.spu, 5); } #[test] fn timeout() { - let args = BaseCli::from_iter(vec!["flv-test", "smoke", "--timeout", "9000"]); + let args = BaseCli::from_iter(vec!["fluvio-test", "smoke", "--timeout", "9000"]); assert_eq!(args.environment.timeout(), Duration::from_secs(9000)); } @@ -242,7 +242,7 @@ mod tests { // run_block_on(async { // let skip_cluster_delete_cmd = CliArgs::from_iter(vec![ - // "flv-test", + // "fluvio-test", // "smoke", // "--keep-cluster", // "--local", @@ -259,7 +259,7 @@ mod tests { // cluster_cleanup(test_case).await; // let skip_cluster_start_cmd = CliArgs::from_iter(vec![ - // "flv-test", + // "fluvio-test", // "smoke", // "--disable-install", // "--local", diff --git a/tests/runner/src/tests/concurrent/consumer.rs b/crates/fluvio-test/src/tests/concurrent/consumer.rs similarity index 100% rename from tests/runner/src/tests/concurrent/consumer.rs rename to crates/fluvio-test/src/tests/concurrent/consumer.rs diff --git a/tests/runner/src/tests/concurrent/mod.rs b/crates/fluvio-test/src/tests/concurrent/mod.rs similarity index 97% rename from tests/runner/src/tests/concurrent/mod.rs rename to crates/fluvio-test/src/tests/concurrent/mod.rs index d54b057d50..1499391f94 100644 --- a/tests/runner/src/tests/concurrent/mod.rs +++ b/crates/fluvio-test/src/tests/concurrent/mod.rs @@ -8,14 +8,14 @@ use async_lock::RwLock; use structopt::StructOpt; use fluvio_future::task::spawn; -use fluvio_integration_derive::fluvio_test; +use fluvio_test_derive::fluvio_test; use fluvio_test_util::test_meta::derive_attr::TestRequirements; use fluvio_test_util::test_meta::environment::EnvironmentSetup; use fluvio_test_util::test_meta::{TestOption, TestCase}; use fluvio_test_util::test_meta::test_result::TestResult; - use fluvio_test_util::test_runner::test_driver::TestDriver; use fluvio_test_util::test_runner::test_meta::FluvioTestMeta; + #[derive(Debug, Clone)] pub struct ConcurrentTestCase { pub environment: EnvironmentSetup, diff --git a/tests/runner/src/tests/concurrent/producer.rs b/crates/fluvio-test/src/tests/concurrent/producer.rs similarity index 100% rename from tests/runner/src/tests/concurrent/producer.rs rename to crates/fluvio-test/src/tests/concurrent/producer.rs diff --git a/tests/runner/src/tests/concurrent/util.rs b/crates/fluvio-test/src/tests/concurrent/util.rs similarity index 100% rename from tests/runner/src/tests/concurrent/util.rs rename to crates/fluvio-test/src/tests/concurrent/util.rs diff --git a/tests/runner/src/tests/mod.rs b/crates/fluvio-test/src/tests/mod.rs similarity index 100% rename from tests/runner/src/tests/mod.rs rename to crates/fluvio-test/src/tests/mod.rs diff --git a/tests/runner/src/tests/producer_stress.rs b/crates/fluvio-test/src/tests/producer_stress.rs similarity index 98% rename from tests/runner/src/tests/producer_stress.rs rename to crates/fluvio-test/src/tests/producer_stress.rs index e9d7c87a7e..03b97814da 100644 --- a/tests/runner/src/tests/producer_stress.rs +++ b/crates/fluvio-test/src/tests/producer_stress.rs @@ -4,7 +4,7 @@ use structopt::StructOpt; use std::sync::Arc; use fluvio::RecordKey; -use fluvio_integration_derive::fluvio_test; +use fluvio_test_derive::fluvio_test; use fluvio_test_util::test_meta::derive_attr::TestRequirements; use fluvio_test_util::test_meta::environment::EnvironmentSetup; use fluvio_test_util::test_meta::{TestOption, TestCase}; diff --git a/tests/runner/src/tests/smoke/consume.rs b/crates/fluvio-test/src/tests/smoke/consume.rs similarity index 100% rename from tests/runner/src/tests/smoke/consume.rs rename to crates/fluvio-test/src/tests/smoke/consume.rs diff --git a/tests/runner/src/tests/smoke/listener.rs b/crates/fluvio-test/src/tests/smoke/listener.rs similarity index 100% rename from tests/runner/src/tests/smoke/listener.rs rename to crates/fluvio-test/src/tests/smoke/listener.rs diff --git a/tests/runner/src/tests/smoke/message.rs b/crates/fluvio-test/src/tests/smoke/message.rs similarity index 100% rename from tests/runner/src/tests/smoke/message.rs rename to crates/fluvio-test/src/tests/smoke/message.rs diff --git a/tests/runner/src/tests/smoke/mod.rs b/crates/fluvio-test/src/tests/smoke/mod.rs similarity index 98% rename from tests/runner/src/tests/smoke/mod.rs rename to crates/fluvio-test/src/tests/smoke/mod.rs index 7e66f4efd9..a24f30fbf6 100644 --- a/tests/runner/src/tests/smoke/mod.rs +++ b/crates/fluvio-test/src/tests/smoke/mod.rs @@ -7,12 +7,11 @@ use std::sync::Arc; use structopt::StructOpt; -use fluvio_integration_derive::fluvio_test; +use fluvio_test_derive::fluvio_test; use fluvio_test_util::test_meta::derive_attr::TestRequirements; use fluvio_test_util::test_meta::environment::EnvironmentSetup; use fluvio_test_util::test_meta::{TestOption, TestCase}; use fluvio_test_util::test_meta::test_result::TestResult; - use fluvio_test_util::test_runner::test_driver::TestDriver; use fluvio_test_util::test_runner::test_meta::FluvioTestMeta; use async_lock::RwLock; diff --git a/tests/runner/src/tests/smoke/produce.rs b/crates/fluvio-test/src/tests/smoke/produce.rs similarity index 100% rename from tests/runner/src/tests/smoke/produce.rs rename to crates/fluvio-test/src/tests/smoke/produce.rs diff --git a/tests/runner/src/tests/stress.rs b/crates/fluvio-test/src/tests/stress.rs similarity index 100% rename from tests/runner/src/tests/stress.rs rename to crates/fluvio-test/src/tests/stress.rs diff --git a/src/types/Cargo.toml b/crates/fluvio-types/Cargo.toml similarity index 90% rename from src/types/Cargo.toml rename to crates/fluvio-types/Cargo.toml index e7b9bca511..33a49d3dd2 100644 --- a/src/types/Cargo.toml +++ b/crates/fluvio-types/Cargo.toml @@ -18,4 +18,4 @@ thiserror = "1" [dev-dependencies] fluvio-future = { version = "0.3.0", features = ["fixture", "subscriber"] } -tokio = { version = "1.3.0", features = ["macros"] } \ No newline at end of file +tokio = { version = "1.3.0", features = ["macros"] } diff --git a/src/types/LICENSE-APACHE b/crates/fluvio-types/LICENSE-APACHE similarity index 100% rename from src/types/LICENSE-APACHE rename to crates/fluvio-types/LICENSE-APACHE diff --git a/src/types/src/defaults.rs b/crates/fluvio-types/src/defaults.rs similarity index 100% rename from src/types/src/defaults.rs rename to crates/fluvio-types/src/defaults.rs diff --git a/src/types/src/event.rs b/crates/fluvio-types/src/event.rs similarity index 100% rename from src/types/src/event.rs rename to crates/fluvio-types/src/event.rs diff --git a/src/types/src/lib.rs b/crates/fluvio-types/src/lib.rs similarity index 100% rename from src/types/src/lib.rs rename to crates/fluvio-types/src/lib.rs diff --git a/src/types/src/macros.rs b/crates/fluvio-types/src/macros.rs similarity index 100% rename from src/types/src/macros.rs rename to crates/fluvio-types/src/macros.rs diff --git a/src/types/src/partition.rs b/crates/fluvio-types/src/partition.rs similarity index 100% rename from src/types/src/partition.rs rename to crates/fluvio-types/src/partition.rs diff --git a/src/client/Cargo.toml b/crates/fluvio/Cargo.toml similarity index 72% rename from src/client/Cargo.toml rename to crates/fluvio/Cargo.toml index 9c722e355b..ff19f2e3c8 100644 --- a/src/client/Cargo.toml +++ b/crates/fluvio/Cargo.toml @@ -41,22 +41,22 @@ derive_builder = "0.10" # Fluvio dependencies fluvio-future = { version = "0.3.5", features = ["task", "openssl_tls", "task_unstable"] } -fluvio-types = { version = "0.2.1", features = ["events"], path = "../types" } -fluvio-sc-schema = { version = "0.9.0", path = "../sc-schema", default-features = false } -fluvio-socket = { path = "../socket", version = "0.9.1" } -fluvio-protocol = { path = "../protocol", version = "0.6" } -dataplane = { version = "0.6.0", path = "../dataplane-protocol", package = "fluvio-dataplane-protocol" } +fluvio-types = { version = "0.2.1", features = ["events"], path = "../fluvio-types" } +fluvio-sc-schema = { version = "0.9.0", path = "../fluvio-sc-schema", default-features = false } +fluvio-socket = { path = "../fluvio-socket", version = "0.9.1" } +fluvio-protocol = { path = "../fluvio-protocol", version = "0.6" } +dataplane = { version = "0.6.0", path = "../fluvio-dataplane-protocol", package = "fluvio-dataplane-protocol" } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] dirs = "3.0.0" [target.'cfg(unix)'.dependencies] -fluvio-spu-schema = { version = "0.8.0", path = "../spu-schema", features = ["file"] } +fluvio-spu-schema = { version = "0.8.0", path = "../fluvio-spu-schema", features = ["file"] } [target.'cfg(windows)'.dependencies] -fluvio-spu-schema = { version = "0.8.0", path = "../spu-schema" } +fluvio-spu-schema = { version = "0.8.0", path = "../fluvio-spu-schema" } [target.'cfg(target_arch = "wasm32")'.dependencies] -fluvio-spu-schema = { version = "0.8.0", path = "../spu-schema" } +fluvio-spu-schema = { version = "0.8.0", path = "../fluvio-spu-schema" } [dev-dependencies] async-std = { version = "1.6.4", default-features = false } diff --git a/src/utils/LICENSE-APACHE b/crates/fluvio/LICENSE-APACHE similarity index 100% rename from src/utils/LICENSE-APACHE rename to crates/fluvio/LICENSE-APACHE diff --git a/src/client/README.md b/crates/fluvio/README.md similarity index 100% rename from src/client/README.md rename to crates/fluvio/README.md diff --git a/src/client/src/admin.rs b/crates/fluvio/src/admin.rs similarity index 100% rename from src/client/src/admin.rs rename to crates/fluvio/src/admin.rs diff --git a/src/client/src/config/cluster.rs b/crates/fluvio/src/config/cluster.rs similarity index 100% rename from src/client/src/config/cluster.rs rename to crates/fluvio/src/config/cluster.rs diff --git a/src/client/src/config/config.rs b/crates/fluvio/src/config/config.rs similarity index 100% rename from src/client/src/config/config.rs rename to crates/fluvio/src/config/config.rs diff --git a/src/client/src/config/mod.rs b/crates/fluvio/src/config/mod.rs similarity index 100% rename from src/client/src/config/mod.rs rename to crates/fluvio/src/config/mod.rs diff --git a/src/client/src/config/tls.rs b/crates/fluvio/src/config/tls.rs similarity index 100% rename from src/client/src/config/tls.rs rename to crates/fluvio/src/config/tls.rs diff --git a/src/client/src/consumer.rs b/crates/fluvio/src/consumer.rs similarity index 100% rename from src/client/src/consumer.rs rename to crates/fluvio/src/consumer.rs diff --git a/src/client/src/error.rs b/crates/fluvio/src/error.rs similarity index 100% rename from src/client/src/error.rs rename to crates/fluvio/src/error.rs diff --git a/src/client/src/fluvio.rs b/crates/fluvio/src/fluvio.rs similarity index 100% rename from src/client/src/fluvio.rs rename to crates/fluvio/src/fluvio.rs diff --git a/src/client/src/lib.rs b/crates/fluvio/src/lib.rs similarity index 100% rename from src/client/src/lib.rs rename to crates/fluvio/src/lib.rs diff --git a/src/client/src/offset.rs b/crates/fluvio/src/offset.rs similarity index 100% rename from src/client/src/offset.rs rename to crates/fluvio/src/offset.rs diff --git a/src/client/src/producer.rs b/crates/fluvio/src/producer.rs similarity index 100% rename from src/client/src/producer.rs rename to crates/fluvio/src/producer.rs diff --git a/src/client/src/sockets.rs b/crates/fluvio/src/sockets.rs similarity index 100% rename from src/client/src/sockets.rs rename to crates/fluvio/src/sockets.rs diff --git a/src/client/src/spu.rs b/crates/fluvio/src/spu.rs similarity index 100% rename from src/client/src/spu.rs rename to crates/fluvio/src/spu.rs diff --git a/src/client/src/sync/controller.rs b/crates/fluvio/src/sync/controller.rs similarity index 100% rename from src/client/src/sync/controller.rs rename to crates/fluvio/src/sync/controller.rs diff --git a/src/client/src/sync/mod.rs b/crates/fluvio/src/sync/mod.rs similarity index 100% rename from src/client/src/sync/mod.rs rename to crates/fluvio/src/sync/mod.rs diff --git a/src/client/src/sync/store.rs b/crates/fluvio/src/sync/store.rs similarity index 100% rename from src/client/src/sync/store.rs rename to crates/fluvio/src/sync/store.rs diff --git a/src/client/test-data/profiles/config.toml b/crates/fluvio/test-data/profiles/config.toml similarity index 100% rename from src/client/test-data/profiles/config.toml rename to crates/fluvio/test-data/profiles/config.toml diff --git a/src/client/test-data/profiles/default.toml b/crates/fluvio/test-data/profiles/default.toml similarity index 100% rename from src/client/test-data/profiles/default.toml rename to crates/fluvio/test-data/profiles/default.toml diff --git a/src/client/test-data/profiles/invalid.toml b/crates/fluvio/test-data/profiles/invalid.toml similarity index 100% rename from src/client/test-data/profiles/invalid.toml rename to crates/fluvio/test-data/profiles/invalid.toml diff --git a/src/client/test-data/tls/file.toml b/crates/fluvio/test-data/tls/file.toml similarity index 100% rename from src/client/test-data/tls/file.toml rename to crates/fluvio/test-data/tls/file.toml diff --git a/src/client/test-data/tls/inline.toml b/crates/fluvio/test-data/tls/inline.toml similarity index 100% rename from src/client/test-data/tls/inline.toml rename to crates/fluvio/test-data/tls/inline.toml diff --git a/src/client/test-data/tls/no-verf.toml b/crates/fluvio/test-data/tls/no-verf.toml similarity index 100% rename from src/client/test-data/tls/no-verf.toml rename to crates/fluvio/test-data/tls/no-verf.toml diff --git a/doc/TEST.md b/doc/TEST.md deleted file mode 100644 index bb53ec2450..0000000000 --- a/doc/TEST.md +++ /dev/null @@ -1,72 +0,0 @@ -# Test Runner - -Fluvio test runner is used to run test Fluvio platform. - -## Assumption - -* Fluvio system chart has been installed -* Kubernetes cluster has been setup - -## Installation - -Build Fluvio binaries -``` -cargo build -``` - -Test runner can be located in: ```target/debug/flv-test``` - -## Cleaning up existing cluster - -By default, ```flv-test``` will create new cluster. Ensure you delete existing using fluvio: - -```fluvio cluster delete``` for k8 or -```fluvio cluster delete --local``` for local cluster - -## Alias - -Set following alias to reduce cmd: - -``` -alias flvt='target/debug/flv-test' -``` - -## Running tests - -Test runner performs following: -* Create new cluster -* Set up test topic -* Produce sets of message -* Consume message and validate them - -Following test configuration can be changed -* Number of SPU ```--spu``` (default: 1) -* Number of parallel producer ```---produce-count``` (default: 1) -* Number of records to send by each produce ```---produce-iteration``` (default: 1) -* Record size ```---record-size``` (default: 100) -* Topic Name ```---topic-name``` (defaults to ```topic1```) -* Replication ```--replication``` ( default to 1) -* TLS (defaults to none) - -### Test using Local cluster - -``` -flvt --local-driver -``` - -This creates local cluster with SC and 1 SPU. - -### Test using Kubernetes cluster - -``` -flvt -``` - -This use release version of fluvio image. To run local image compiled from current code: -```make minikube_image``` - -and - -``` -flvt --local-driver -``` diff --git a/examples/00-produce/Cargo.toml b/examples/00-produce/Cargo.toml index 1c5cd1d819..1d1c814c5f 100644 --- a/examples/00-produce/Cargo.toml +++ b/examples/00-produce/Cargo.toml @@ -5,8 +5,6 @@ authors = ["Fluvio Contributors "] edition = "2018" publish = false -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] -fluvio = { path = "../../src/client" } +fluvio = { path = "../../crates/fluvio" } async-std = { version = "1.8.0", default-features = false, features = ["attributes"] } diff --git a/examples/01-produce-batch/Cargo.toml b/examples/01-produce-batch/Cargo.toml index f389427ab2..d19c5c668c 100644 --- a/examples/01-produce-batch/Cargo.toml +++ b/examples/01-produce-batch/Cargo.toml @@ -8,5 +8,5 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -fluvio = { path = "../../src/client" } +fluvio = { path = "../../crates/fluvio" } async-std = { version = "1.8.0", default-features = false, features = ["attributes"] } diff --git a/examples/01-produce-key-value/Cargo.toml b/examples/01-produce-key-value/Cargo.toml index 417a72fb1e..0ebc04c42e 100644 --- a/examples/01-produce-key-value/Cargo.toml +++ b/examples/01-produce-key-value/Cargo.toml @@ -8,6 +8,6 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -fluvio = { path = "../../src/client" } +fluvio = { path = "../../crates/fluvio" } async-std = { version = "1.8.0", default-features = false, features = ["attributes"] } tracing-subscriber = "0.2.17" diff --git a/examples/02-consume/Cargo.toml b/examples/02-consume/Cargo.toml index 447915609a..9786870de6 100644 --- a/examples/02-consume/Cargo.toml +++ b/examples/02-consume/Cargo.toml @@ -8,6 +8,6 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -fluvio = { path = "../../src/client" } +fluvio = { path = "../../crates/fluvio" } async-std = { version = "1.8.0", default-features = false , features = ["attributes"] } futures-lite = "1.11.3" diff --git a/examples/03-echo/Cargo.toml b/examples/03-echo/Cargo.toml index 020fea2ef1..53e3d2fa2c 100644 --- a/examples/03-echo/Cargo.toml +++ b/examples/03-echo/Cargo.toml @@ -8,6 +8,6 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -fluvio = { path = "../../src/client" } +fluvio = { path = "../../crates/fluvio" } futures = "0.3.0" async-std = { version = "1.8.0", default-features = false,features = ["attributes"] } diff --git a/examples/04-admin-watch/Cargo.toml b/examples/04-admin-watch/Cargo.toml index 796c3bc7b6..1c9179e551 100644 --- a/examples/04-admin-watch/Cargo.toml +++ b/examples/04-admin-watch/Cargo.toml @@ -8,6 +8,6 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -fluvio = { path = "../../src/client", features = ["unstable"] } +fluvio = { path = "../../crates/fluvio", features = ["unstable"] } futures = "0.3.0" async-std = { version = "1.8.0", default-features = false,features = ["attributes"] } diff --git a/tests/Makefile b/tests/Makefile index c4229ef057..22989f7874 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,4 +1,4 @@ -flvt=../target/debug/flv-test +flvt=../target/debug/fluvio-test DRIVER=--local-driver COUNT=3000 @@ -10,10 +10,5 @@ test: run-local run-k8 smoke-test: build $(flvt) $(DRIVER) - run-stress: build $(flvt) $(DRIVER) --produce-count $(COUNT) - - - - diff --git a/tests/README.md b/tests/README.md index 5dfa0633d6..d9b0629fed 100644 --- a/tests/README.md +++ b/tests/README.md @@ -27,7 +27,7 @@ Optional: Set up alias to run development version of Fluvio and Test runner CLI. ``` cargo build -alias flv-test=./target/debug/flv-test +alias fluvio-test=./target/debug/fluvio-test ``` ### Release profile @@ -40,16 +40,16 @@ Optional: Set up alias to run release version of Fluvio and Test runner CLI. ``` cargo build --release -alias flv-test=./target/release/flv-test +alias fluvio-test=./target/release/fluvio-test ``` # Running Test runner ``` -flv-test [FLAGS] [OPTIONS] -- [SUBCOMMAND OPTIONS] +fluvio-test [FLAGS] [OPTIONS] -- [SUBCOMMAND OPTIONS] ``` -> Test runner testing doesn't work when VERSION set to an unpublished version. Workaround: Run `make minikube_image` and use `--develop` flag with `flv-test` (issue #[859](https://github.com/infinyon/fluvio/issues/859)) +> Test runner testing doesn't work when VERSION set to an unpublished version. Workaround: Run `make minikube_image` and use `--develop` flag with `fluvio-test` (issue #[859](https://github.com/infinyon/fluvio/issues/859)) Test runner can be a running in two ways: @@ -57,7 +57,7 @@ Test runner can be a running in two ways: - Run tests againts existing cluster -> Expected behavior of local clusters that flv-test start: +> Expected behavior of local clusters that fluvio-test start: > > If you `ctrl+c`, the local cluster will also be terminated. > @@ -70,10 +70,10 @@ Test runner can be a running in two ways: * To run a test in benchmark mode, run test with the `--benchmark` flag. ``` -cargo run --release --bin flv-test -- producer_stress --develop --disable-install --benchmark -- --iteration 5 --producers 5 +cargo run --release --bin fluvio-test -- producer_stress --develop --disable-install --benchmark -- --iteration 5 --producers 5 ``` -> The `--benchmark` flag is specified as an option of `flv-test` (Before the `--`.) +> The `--benchmark` flag is specified as an option of `fluvio-test` (Before the `--`.) An error message will appear when attempting to benchmark tests without `benchmark = true`. @@ -88,7 +88,7 @@ Total iterations run depend on the runtime of a single test. The longer the test The smoke test can be configured with it's own CLI options: -`flv-test smoke [environment vars] -- [smoke test vars]` +`fluvio-test smoke [environment vars] -- [smoke test vars]` --- @@ -98,7 +98,7 @@ This run a simple smoke test by creating new local cluster. It creates a simple topic: `topic` and perform produce/consume ``` -$ flv-test smoke --local +$ fluvio-test smoke --local Start running fluvio test runner deleting cluster @@ -124,7 +124,7 @@ Smoke test can be specified with more than 1 iterations: Run a test with sending 10 records: ``` -$ flv-test smoke --local -- --producer-iteration 10 +$ fluvio-test smoke --local -- --producer-iteration 10 ``` ### Run test without re-installing @@ -132,8 +132,8 @@ $ flv-test smoke --local -- --producer-iteration 10 After initial test using `--keep-cluster`, more iteration can be tested without re-installing cluster using `--disable-install` ``` -$ flv-test smoke --local --keep-cluster -- --producer-iteration 10 -$ flv-test smoke --disable-install -- --producer-iteration 200 +$ fluvio-test smoke --local --keep-cluster -- --producer-iteration 10 +$ fluvio-test smoke --disable-install -- --producer-iteration 200 ``` ### No streaming @@ -141,7 +141,7 @@ $ flv-test smoke --disable-install -- --producer-iteration 200 By default, produce and consumer run in parallel, but you can force consumer to wait for all producer iteration ``` -$ flv-test smoke -- --producer-iteration=400 --consumer-wait +$ fluvio-test smoke -- --producer-iteration=400 --consumer-wait ``` ## Anatomy of a new test @@ -160,7 +160,7 @@ There are 4 parts to adding new tests. ### Test stub of a new test -Write new tests in the `tests` module of the `flv-test` crate. +Write new tests in the `tests` module of the `fluvio-test` crate. Here's a complete stub to modify: ```rust @@ -238,12 +238,12 @@ pub async fn run(client: Arc, mut option: TestCase) { If this test's name was `example`, we can start this test by running: -`cargo run --bin flv-test -- example` +`cargo run --bin fluvio-test -- example` Which would be skipped, because the test requires 2 spu, and by default we only have one. But if we run it like: -`cargo run --bin flv-test -- example --spu 2` +`cargo run --bin fluvio-test -- example --spu 2` The test would start and a test topic named `test_topic` would be created because the minimum requirements were met. \ No newline at end of file From 0214af26c1f5b83fb4aa76a53cee532c36af6367 Mon Sep 17 00:00:00 2001 From: Nick Mosher Date: Fri, 27 Aug 2021 18:49:48 +0000 Subject: [PATCH 11/18] Remove fluvio-system-util crate (#1521) This entire crate was unused except for the `get_fluvio` function, so I copied that into `fluvio-test` where it was needed and now we can delete the whole utils crate --- Cargo.lock | 10 - Cargo.toml | 1 - crates/fluvio-system-util/Cargo.toml | 19 -- crates/fluvio-system-util/LICENSE-APACHE | 201 ------------- crates/fluvio-system-util/src/bin.rs | 74 ----- .../fluvio-system-util/src/config_helper.rs | 50 ---- .../src/counters/counter_tbl.rs | 263 ------------------ .../src/counters/counters.rs | 189 ------------- crates/fluvio-system-util/src/counters/mod.rs | 6 - crates/fluvio-system-util/src/generators.rs | 87 ------ crates/fluvio-system-util/src/lib.rs | 4 - crates/fluvio-test/Cargo.toml | 1 - crates/fluvio-test/src/lib.rs | 24 ++ crates/fluvio-test/src/tests/smoke/consume.rs | 4 +- crates/fluvio-test/src/tests/smoke/produce.rs | 4 +- 15 files changed, 28 insertions(+), 909 deletions(-) delete mode 100644 crates/fluvio-system-util/Cargo.toml delete mode 100644 crates/fluvio-system-util/LICENSE-APACHE delete mode 100644 crates/fluvio-system-util/src/bin.rs delete mode 100644 crates/fluvio-system-util/src/config_helper.rs delete mode 100644 crates/fluvio-system-util/src/counters/counter_tbl.rs delete mode 100644 crates/fluvio-system-util/src/counters/counters.rs delete mode 100644 crates/fluvio-system-util/src/counters/mod.rs delete mode 100644 crates/fluvio-system-util/src/generators.rs delete mode 100644 crates/fluvio-system-util/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 8bcef51229..e6d27e2c44 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1914,15 +1914,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "fluvio-system-util" -version = "0.1.1" -dependencies = [ - "fluvio-types", - "rand 0.7.3", - "tracing", -] - [[package]] name = "fluvio-test" version = "0.0.0" @@ -1937,7 +1928,6 @@ dependencies = [ "fluvio-controlplane-metadata", "fluvio-dataplane-protocol", "fluvio-future", - "fluvio-system-util", "fluvio-test-derive 0.0.0", "fluvio-test-util", "fluvio-types", diff --git a/Cargo.toml b/Cargo.toml index 7bcf701b85..4f0d7b05f2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,6 @@ members = [ "crates/fluvio-storage", "crates/fluvio-stream-dispatcher", "crates/fluvio-stream-model", - "crates/fluvio-system-util", "crates/fluvio-test", "crates/fluvio-test-derive", "crates/fluvio-test-util", diff --git a/crates/fluvio-system-util/Cargo.toml b/crates/fluvio-system-util/Cargo.toml deleted file mode 100644 index 5c3b0d312c..0000000000 --- a/crates/fluvio-system-util/Cargo.toml +++ /dev/null @@ -1,19 +0,0 @@ -[package] -name = "fluvio-system-util" -version = "0.1.1" -authors = ["fluvio.io"] -edition = "2018" -description = "Utilities for Fluvio System components" -repository = "https://github.com/infinyon/fluvio" -license = "Apache-2.0" - -[features] -default = [] -fixture = [] - -[dependencies] -tracing = "0.1.19" -rand = "0.7.2" - -# Fluvio dependencies -fluvio-types = { version = "0.2.0", path = "../fluvio-types" } diff --git a/crates/fluvio-system-util/LICENSE-APACHE b/crates/fluvio-system-util/LICENSE-APACHE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/crates/fluvio-system-util/LICENSE-APACHE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/crates/fluvio-system-util/src/bin.rs b/crates/fluvio-system-util/src/bin.rs deleted file mode 100644 index 04e71fb055..0000000000 --- a/crates/fluvio-system-util/src/bin.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::io::Error as IoError; -use std::io::ErrorKind; -use std::process::Command; - -use tracing::debug; - -pub fn get_fluvio() -> Result { - get_binary("fluvio") -} - -/// get path to the binary -pub fn get_binary(bin_name: &str) -> Result { - let current_exe = - std::env::current_exe().expect("Failed to get the path of the integration test binary"); - let mut bin_dir = current_exe - .parent() - .expect("failed to get parent") - .to_owned(); - bin_dir.push(bin_name); - bin_dir.set_extension(std::env::consts::EXE_EXTENSION); - - debug!("try to get binary: {:#?}", bin_dir); - if !bin_dir.exists() { - Err(IoError::new( - ErrorKind::NotFound, - format!("{} not founded in: {:#?}", bin_name, bin_dir), - )) - } else { - Ok(Command::new(bin_dir.into_os_string())) - } -} - -use std::fs::File; -use std::process::Stdio; - -#[allow(unused)] -pub fn open_log(prefix: &str) -> (File, File) { - let output = File::create(format!("/tmp/flv_{}.out", prefix)).expect("log file"); - let error = File::create(format!("/tmp/flv_{}.log", prefix)).expect("err file"); - - (output, error) -} - -#[allow(unused)] -pub fn command_exec(binary: &str, prefix: &str, process: impl Fn(&mut Command)) { - let mut cmd = get_binary(binary).unwrap_or_else(|_| panic!("unable to get binary: {}", binary)); - - let (output, error) = open_log(prefix); - - cmd.stdout(Stdio::from(output)).stderr(Stdio::from(error)); - - process(&mut cmd); - - let status = cmd.status().expect("topic creation failed"); - - if !status.success() { - println!("topic creation failed: {}", status); - } -} - -use std::process::Child; - -#[allow(unused)] -pub fn command_spawn(binary: &str, prefix: &str, process: impl Fn(&mut Command)) -> Child { - let mut cmd = get_binary(binary).unwrap_or_else(|_| panic!("unable to get binary: {}", binary)); - - let (output, error) = open_log(prefix); - - cmd.stdout(Stdio::from(output)).stderr(Stdio::from(error)); - - process(&mut cmd); - - cmd.spawn().expect("child") -} diff --git a/crates/fluvio-system-util/src/config_helper.rs b/crates/fluvio-system-util/src/config_helper.rs deleted file mode 100644 index e178b32871..0000000000 --- a/crates/fluvio-system-util/src/config_helper.rs +++ /dev/null @@ -1,50 +0,0 @@ -//! -//! # Config helper -//! -use std::path::PathBuf; - -use fluvio_types::defaults::CONFIG_FILE_EXTENTION; -use fluvio_types::defaults::{SERVER_CONFIG_BASE_PATH, SERVER_CONFIG_DIR}; - -/// generate server configuration file -pub fn build_server_config_file_path(file_name: &'static str) -> PathBuf { - let mut config_file_path = PathBuf::new(); - - // stitch-up default configuration file path - config_file_path.push(SERVER_CONFIG_BASE_PATH); - config_file_path.push(SERVER_CONFIG_DIR); - config_file_path.push(file_name); - config_file_path.set_extension(CONFIG_FILE_EXTENTION); - - config_file_path -} - -// -// Unit Tests -// - -#[cfg(test)] -pub mod test { - use super::*; - use fluvio_types::defaults::{SC_CONFIG_FILE, SPU_CONFIG_FILE}; - - #[test] - fn test_build_sc_server_config_file_path() { - let sc_server_file_path = build_server_config_file_path(SC_CONFIG_FILE); - - let mut expected_file_path = PathBuf::new(); - expected_file_path.push("/etc/fluvio/sc_server.toml"); - - assert_eq!(sc_server_file_path, expected_file_path); - } - - #[test] - fn test_build_spu_server_config_file_path() { - let spu_server_file_path = build_server_config_file_path(SPU_CONFIG_FILE); - - let mut expected_file_path = PathBuf::new(); - expected_file_path.push("/etc/fluvio/spu_server.toml"); - - assert_eq!(spu_server_file_path, expected_file_path); - } -} diff --git a/crates/fluvio-system-util/src/counters/counter_tbl.rs b/crates/fluvio-system-util/src/counters/counter_tbl.rs deleted file mode 100644 index bd6c0c23a6..0000000000 --- a/crates/fluvio-system-util/src/counters/counter_tbl.rs +++ /dev/null @@ -1,263 +0,0 @@ -//! -//! # Counter Table -//! -//! Stores counters in table costruct. Each table has a header and rows with counters for each column. -//! -use std::cmp; -use std::collections::BTreeMap; -use std::sync::RwLock; - -#[derive(Debug)] -pub struct CounterTable { - pub columns: BTreeMap, - pub rows: RwLock>>, -} - -#[derive(Debug, PartialEq)] -pub struct Column { - label: &'static str, - internal: bool, -} - -impl ::std::default::Default for CounterTable -where - C: Ord, - T: Ord, -{ - fn default() -> Self { - Self { - columns: BTreeMap::new(), - rows: RwLock::new(BTreeMap::new()), - } - } -} - -impl ::std::cmp::PartialEq for CounterTable -where - C: PartialEq, - T: PartialEq, -{ - fn eq(&self, other: &CounterTable) -> bool { - // compare columns - if self.columns != other.columns { - return false; - } - - // compare counters - let local_rows = self.rows.read().unwrap(); - let other_rows = other.rows.read().unwrap(); - if *local_rows != *other_rows { - return false; - } - true - } -} - -impl CounterTable -where - C: Ord + Clone, - T: Ord, -{ - /// builder pattern to add columns - pub fn with_columns(mut self, columns: Vec<(C, &'static str, bool)>) -> Self { - for (column_id, label, internal) in columns { - self.columns.insert(column_id, Column { label, internal }); - } - self - } - - /// create a row and add counter columns - pub fn add_row(&self, row_id: T) { - // add one counter per column - let mut column_counters = BTreeMap::new(); - for column_id in self.columns.keys() { - column_counters.insert(column_id.clone(), 0); - } - - // add counters to row - self.rows.write().unwrap().insert(row_id, column_counters); - } - - /// remove counter row - pub fn remove_row(&self, row_id: &T) { - self.rows.write().unwrap().remove(row_id); - } - - /// number of rows - pub fn row_count(&self) -> usize { - self.rows.read().unwrap().len() - } - - /// increment counter - pub fn inc_counter(&self, row_id: &T, column_id: C) { - if let Some(row) = self.rows.write().unwrap().get_mut(row_id) { - if let Some(counter) = row.get_mut(&column_id) { - *counter += 1; - } - } - } - - /// set counter - pub fn set_counter(&self, row_id: &T, column_id: C, val: u32) { - if let Some(row) = self.rows.write().unwrap().get_mut(row_id) { - if let Some(counter) = row.get_mut(&column_id) { - *counter = val; - } - } - } - - /// reset all counters - pub fn reset_counters(&self) { - for row in self.rows.write().unwrap().values_mut() { - for counter in row.values_mut() { - *counter = 0; - } - } - } - - /// column headers in string format (center justified, min 10 spaces) - pub fn header_fmt(&self) -> String { - let mut res = String::new(); - - // accumulate labels - for column in self.columns.values() { - res.push_str(&format!("{:^10}", column.label)); - res.push_str(" "); - } - - // remove last 2 spaces - if res.len() > 2 { - res.truncate(res.len() - 2); - } - - res - } - - /// format values in string format (center justified to column header - min 10 spaces) - pub fn values_fmt(&self, row_id: T) -> String { - let mut res = String::new(); - if let Some(row) = self.rows.write().unwrap().get_mut(&row_id) { - // accumulate labels - for (column_id, counter) in row { - let value_str = counter.to_string(); - let column_label = if let Some(column) = self.columns.get(column_id) { - &(*column.label) - } else { - "" - }; - let space_width = cmp::max(column_label.len(), 10); - let value_width = value_str.len(); - - // center justify... need to compute our own adding (as Rust formatter requires literal) - let (pad_left, pad_right) = if value_width > space_width { - (0, 0) - } else { - let pad_left = (space_width - value_width) / 2; - let pad_right = space_width - pad_left - value_width; - (pad_left, pad_right) - }; - - res.push_str(&(0..pad_left).map(|_| " ").collect::()); - res.push_str(&value_str); - res.push_str(&(0..pad_right).map(|_| " ").collect::()); - res.push_str(" "); - } - - // remove last 2 spaces - if res.len() > 2 { - res.truncate(res.len() - 2); - } - } - - res - } -} - -// ----------------------------------- -// Unit Tests -// ----------------------------------- - -#[cfg(test)] -pub mod test { - use super::*; - - #[derive(Debug, PartialEq, PartialOrd, Eq, Ord, Clone)] - enum TestCntr { - Ok = 0, - Failed = 1, - Retry = 2, - Shutdown = 3, - InternalErr = 4, - } - - fn generate_counters() -> Vec<(TestCntr, &'static str, bool)> { - vec![ - (TestCntr::Ok, "CONN-OK", false), - (TestCntr::Failed, "CONN-FAILED", false), - (TestCntr::Retry, "CONN-RETRY", false), - (TestCntr::Shutdown, "CONN-SHUTDOWN", false), - (TestCntr::InternalErr, "INTERNAL-ERR", true), - ] - } - - #[test] - fn test_counter_table_all() { - let counter_tbl = CounterTable::default().with_columns(generate_counters()); - - // test generation - assert_eq!(counter_tbl.columns.len(), 5); - - // test add rows - let (row0, row1): (i32, i32) = (0, 1); - counter_tbl.add_row(row0); - counter_tbl.add_row(row1); - assert_eq!(counter_tbl.row_count(), 2); - - // test header formatter - let header = counter_tbl.header_fmt(); - let expected_header = - " CONN-OK CONN-FAILED CONN-RETRY CONN-SHUTDOWN INTERNAL-ERR".to_owned(); - assert_eq!(header, expected_header); - - // test increment & value formatter - counter_tbl.set_counter(&row0, TestCntr::Ok, 4294967290); - counter_tbl.inc_counter(&row0, TestCntr::Failed); - counter_tbl.set_counter(&row0, TestCntr::Retry, 4199999999); - let values_r1 = counter_tbl.values_fmt(row0); - let expected_values_r1 = - "4294967290 1 4199999999 0 0 ".to_owned(); - assert_eq!(values_r1, expected_values_r1); - - counter_tbl.inc_counter(&row1, TestCntr::Shutdown); - counter_tbl.inc_counter(&row1, TestCntr::Shutdown); - let values_r2 = counter_tbl.values_fmt(row1); - let expected_values_r2 = - " 0 0 0 2 0 ".to_owned(); - assert_eq!(values_r2, expected_values_r2); - - // test equality - let expected_counter_tbl = CounterTable::default().with_columns(generate_counters()); - expected_counter_tbl.add_row(row0); - expected_counter_tbl.add_row(row1); - expected_counter_tbl.set_counter(&row0, TestCntr::Ok, 4294967290); - expected_counter_tbl.set_counter(&row0, TestCntr::Failed, 1); - expected_counter_tbl.set_counter(&row0, TestCntr::Retry, 4199999999); - expected_counter_tbl.set_counter(&row1, TestCntr::Shutdown, 2); - assert_eq!(counter_tbl, expected_counter_tbl); - - // test reset - counter_tbl.reset_counters(); - let expected_reset_tbl = CounterTable::default().with_columns(generate_counters()); - expected_reset_tbl.add_row(row0); - expected_reset_tbl.add_row(row1); - assert_eq!(counter_tbl, expected_reset_tbl); - assert_eq!(counter_tbl.row_count(), 2); - - // teest remoev row - counter_tbl.remove_row(&row0); - let expected_one_row_tbl = CounterTable::default().with_columns(generate_counters()); - expected_one_row_tbl.add_row(row1); - assert_eq!(counter_tbl, expected_one_row_tbl); - assert_eq!(counter_tbl.row_count(), 1); - } -} diff --git a/crates/fluvio-system-util/src/counters/counters.rs b/crates/fluvio-system-util/src/counters/counters.rs deleted file mode 100644 index 5afc194b0f..0000000000 --- a/crates/fluvio-system-util/src/counters/counters.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! -//! # Counters -//! -//! Counters object definition and functionality -//! -use std::cmp; -use std::collections::BTreeMap; - -#[derive(Debug, PartialEq)] -pub struct Counters { - pub list: BTreeMap, -} - -#[derive(Debug, PartialEq)] -pub struct Counter { - label: &'static str, - internal: bool, - value: u32, -} - -impl ::std::default::Default for Counters -where - T: Ord, -{ - fn default() -> Self { - Self { - list: BTreeMap::new(), - } - } -} - -impl Counters -where - T: Ord, -{ - /// build counter from array of tuples - pub fn new(items: Vec<(T, &'static str, bool)>) -> Self { - let mut counters = Counters::default(); - for (id, label, internal) in items { - counters.list.insert( - id, - Counter { - label, - internal, - value: 0, - }, - ); - } - counters - } - - /// increment counter - pub fn inc_counter(&mut self, id: T) { - if let Some(counter) = self.list.get_mut(&id) { - counter.value += 1; - } - } - - /// increment counter - pub fn set_counter(&mut self, id: T, val: u32) { - if let Some(counter) = self.list.get_mut(&id) { - counter.value = val; - } - } - - /// reset counters - pub fn reset(&mut self) { - for counter in self.list.values_mut() { - counter.value = 0; - } - } - - /// counter heders in string format (center justified, min 10 spaces) - pub fn header_fmt(&self) -> String { - let mut res = String::new(); - - // accumulate labels - for counter in self.list.values() { - res.push_str(&format!("{:^10}", counter.label)); - res.push_str(" "); - } - - // remove last 2 spaces - if res.len() > 2 { - res.truncate(res.len() - 2); - } - - res - } - - /// format values in string format (center justified to column header - min 10 spaces) - pub fn values_fmt(&self) -> String { - let mut res = String::new(); - - // accumulate labels - for counter in self.list.values() { - let value_str = counter.value.to_string(); - let space_width = cmp::max(counter.label.len(), 10); - let value_width = value_str.len(); - - // center justify... need to compute our own adding (as Rust formatter requires literal) - let (pad_left, pad_right) = if value_width > space_width { - (0, 0) - } else { - let pad_left = (space_width - value_width) / 2; - let pad_right = space_width - pad_left - value_width; - (pad_left, pad_right) - }; - - res.push_str(&(0..pad_left).map(|_| " ").collect::()); - res.push_str(&value_str); - res.push_str(&(0..pad_right).map(|_| " ").collect::()); - res.push_str(" "); - } - - // remove last 2 spaces - if res.len() > 2 { - res.truncate(res.len() - 2); - } - - res - } -} - -// ----------------------------------- -// Unit Tests -// ----------------------------------- - -#[cfg(test)] -pub mod test { - use super::*; - - #[derive(Debug, PartialEq, PartialOrd, Eq, Ord)] - enum TestCntr { - Ok = 0, - Failed = 1, - Retry = 2, - Shutdown = 3, - InternalErr = 4, - } - - fn generate_counters() -> Vec<(TestCntr, &'static str, bool)> { - vec![ - (TestCntr::Ok, "CONN-OK", false), - (TestCntr::Failed, "CONN-FAILED", false), - (TestCntr::Retry, "CONN-RETRY", false), - (TestCntr::Shutdown, "CONN-SHUTDOWN", false), - (TestCntr::InternalErr, "INTERNAL-ERR", true), - ] - } - - #[test] - fn test_counters_all() { - let mut counters = Counters::new(generate_counters()); - - // test generation - assert_eq!(counters.list.len(), 5); - - // test header formatter - let header = counters.header_fmt(); - let expected_header = - " CONN-OK CONN-FAILED CONN-RETRY CONN-SHUTDOWN INTERNAL-ERR".to_owned(); - assert_eq!(header, expected_header); - - // test increment & value formatter - counters.set_counter(TestCntr::Ok, 4294967290); - counters.inc_counter(TestCntr::Failed); - counters.set_counter(TestCntr::Retry, 4199999999); - counters.inc_counter(TestCntr::Shutdown); - counters.inc_counter(TestCntr::Shutdown); - let values = counters.values_fmt(); - let expected_values = - "4294967290 1 4199999999 2 0 ".to_owned(); - assert_eq!(values, expected_values); - - // test equal - let mut expected_counters = Counters::new(generate_counters()); - expected_counters.set_counter(TestCntr::Ok, 4294967290); - expected_counters.set_counter(TestCntr::Failed, 1); - expected_counters.set_counter(TestCntr::Retry, 4199999999); - expected_counters.set_counter(TestCntr::Shutdown, 2); - assert_eq!(counters, expected_counters); - - // test reset - counters.reset(); - assert_eq!(counters, Counters::new(generate_counters())); - assert_eq!(counters.list.len(), 5); - } -} diff --git a/crates/fluvio-system-util/src/counters/mod.rs b/crates/fluvio-system-util/src/counters/mod.rs deleted file mode 100644 index cc5d8bb2d5..0000000000 --- a/crates/fluvio-system-util/src/counters/mod.rs +++ /dev/null @@ -1,6 +0,0 @@ -mod counter_tbl; -#[allow(clippy::module_inception)] -mod counters; - -pub use self::counter_tbl::CounterTable; -pub use self::counters::Counters; diff --git a/crates/fluvio-system-util/src/generators.rs b/crates/fluvio-system-util/src/generators.rs deleted file mode 100644 index 9c8134adc0..0000000000 --- a/crates/fluvio-system-util/src/generators.rs +++ /dev/null @@ -1,87 +0,0 @@ -//! -//! # Utils -//! -//! Utility file to generate random entities -//! - -use rand::prelude::*; -use std::i32; - -/// Generate a random correlation_id (0 to 65535) -pub fn rand_correlation_id() -> i32 { - thread_rng().gen_range(0, 65535) -} - -/// Generate a random client group key (50001 to 65535) -pub fn generate_group_id() -> String { - format!("fluvio-consumer-{}", thread_rng().gen_range(50001, 65535)) -} - -#[allow(dead_code)] -/// Generates a random authorization secret -pub fn generate_secret() -> String { - const CHARSET: &[u8] = b"abcdefghijklmnopqrstuvwxyz\ - 0123456789"; - - const SECRET_SIZE: usize = 16; - let secret: String = (0..SECRET_SIZE) - .map(|_| { - let idx = thread_rng().gen_range(0, CHARSET.len()); - // This is safe because `idx` is in range of `CHARSET` - char::from(unsafe { *CHARSET.get_unchecked(idx) }) - }) - .collect(); - - secret -} - -#[allow(dead_code)] -/// Generates a random authorization token -pub fn generate_auth_token() -> (String, String) { - const CHARSET: &[u8] = b"abcdefghijklmnopqrstuvwxyz\ - 0123456789"; - - const ID_SIZE: usize = 6; - let token_name: String = (0..ID_SIZE) - .map(|_| { - let idx = thread_rng().gen_range(0, CHARSET.len()); - // This is safe because `idx` is in range of `CHARSET` - char::from(unsafe { *CHARSET.get_unchecked(idx) }) - }) - .collect(); - - const SECRET_SIZE: usize = 16; - let token_secret: String = (0..SECRET_SIZE) - .map(|_| { - let idx = thread_rng().gen_range(0, CHARSET.len()); - // This is safe because `idx` is in range of `CHARSET` - char::from(unsafe { *CHARSET.get_unchecked(idx) }) - }) - .collect(); - - (token_name, token_secret) -} - -#[allow(dead_code)] -/// Generate a random session id -pub fn rand_session_id() -> i32 { - thread_rng().gen_range(1024, i32::MAX) -} - -#[allow(dead_code)] -/// Generates a random key -pub fn generate_random_key() -> String { - const CHARSET: &[u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZ\ - abcdefghijklmnopqrstuvwxyz\ - 0123456789)(*&^%$#@!~"; - const SIZE: usize = 32; - let key: String = (0..SIZE) - .map(|_| { - let idx = thread_rng().gen_range(0, CHARSET.len()); - // This is safe because `idx` is in range of `CHARSET` - char::from(unsafe { *CHARSET.get_unchecked(idx) }) - }) - .collect(); - - key -} diff --git a/crates/fluvio-system-util/src/lib.rs b/crates/fluvio-system-util/src/lib.rs deleted file mode 100644 index a7e3467528..0000000000 --- a/crates/fluvio-system-util/src/lib.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub mod config_helper; -pub mod counters; -pub mod generators; -pub mod bin; diff --git a/crates/fluvio-test/Cargo.toml b/crates/fluvio-test/Cargo.toml index 60753b2f75..ba0f973999 100644 --- a/crates/fluvio-test/Cargo.toml +++ b/crates/fluvio-test/Cargo.toml @@ -31,7 +31,6 @@ fluvio-command = { version = "0.2.0" } fluvio-cluster = { path = "../fluvio-cluster" } fluvio-controlplane-metadata = { features = ["k8"], path = "../fluvio-controlplane-metadata" } dataplane = { path = "../fluvio-dataplane-protocol", package = "fluvio-dataplane-protocol" } -fluvio-system-util = { version = "0.1.0", path = "../fluvio-system-util" } # Fluvio test framework Attribute macro fluvio-test-derive = { path = "../fluvio-test-derive" } diff --git a/crates/fluvio-test/src/lib.rs b/crates/fluvio-test/src/lib.rs index 15ab560571..30be507951 100644 --- a/crates/fluvio-test/src/lib.rs +++ b/crates/fluvio-test/src/lib.rs @@ -1 +1,25 @@ +use std::io::{Error as IoError, ErrorKind}; +use std::process::Command; + pub mod tests; + +pub fn get_binary(bin_name: &str) -> Result { + let current_exe = + std::env::current_exe().expect("Failed to get the path of the integration test binary"); + let mut bin_dir = current_exe + .parent() + .expect("failed to get parent") + .to_owned(); + bin_dir.push(bin_name); + bin_dir.set_extension(std::env::consts::EXE_EXTENSION); + + tracing::debug!("try to get binary: {:#?}", bin_dir); + if !bin_dir.exists() { + Err(IoError::new( + ErrorKind::NotFound, + format!("{} not founded in: {:#?}", bin_name, bin_dir), + )) + } else { + Ok(Command::new(bin_dir.into_os_string())) + } +} diff --git a/crates/fluvio-test/src/tests/smoke/consume.rs b/crates/fluvio-test/src/tests/smoke/consume.rs index 0219c621ab..97e5d2aaff 100644 --- a/crates/fluvio-test/src/tests/smoke/consume.rs +++ b/crates/fluvio-test/src/tests/smoke/consume.rs @@ -9,10 +9,10 @@ use async_lock::RwLock; use tracing::{info, debug}; use futures_lite::stream::StreamExt; -use fluvio_system_util::bin::get_fluvio; use fluvio_test_util::test_runner::test_driver::{TestDriver, TestDriverType}; use fluvio::Offset; use fluvio_command::CommandExt; +use crate::get_binary; use super::SmokeTestCase; use super::message::*; @@ -40,7 +40,7 @@ fn validate_consume_message_cli(test_case: &SmokeTestCase, offsets: Offsets) { for i in 0..replication { let topic_name = test_case.environment.topic_name.clone(); let offset = offsets.get(&topic_name).expect("topic offset"); - let mut command = get_fluvio().expect("fluvio not found"); + let mut command = get_binary("fluvio").expect("fluvio not found"); command .arg("consume") .arg(&topic_name) diff --git a/crates/fluvio-test/src/tests/smoke/produce.rs b/crates/fluvio-test/src/tests/smoke/produce.rs index e5bd5455be..cd61151a80 100644 --- a/crates/fluvio-test/src/tests/smoke/produce.rs +++ b/crates/fluvio-test/src/tests/smoke/produce.rs @@ -166,9 +166,9 @@ mod cli { use std::io::Write; use std::process::Stdio; - use fluvio_system_util::bin::get_fluvio; use fluvio_future::timer::sleep; use std::time::Duration; + use crate::get_binary; pub async fn produce_message_with_cli(test_case: &SmokeTestCase, offsets: Offsets) { println!("starting produce"); @@ -200,7 +200,7 @@ mod cli { topic_name, base_offset ); - let mut child = get_fluvio().expect("no fluvio"); + let mut child = get_binary("fluvio").expect("no fluvio"); if let Some(log) = &test_case.environment.client_log { child.env("RUST_LOG", log); } From e84b35cd8c52f2cb2abd7f6e01345545d6c339f1 Mon Sep 17 00:00:00 2001 From: Nick Mosher Date: Fri, 27 Aug 2021 19:52:03 +0000 Subject: [PATCH 12/18] Reduce noise for SmartStreamWasm Debug printout (#1524) The default Debug implementation for `SmartStreamWasm` would print out the entire byte vector and fill up any printout, making it very noisy and hard to read. This adds a custom Debug implementation that just prints variant and the number of bytes. --- CHANGELOG.md | 2 ++ Cargo.lock | 2 +- crates/fluvio-spu-schema/Cargo.toml | 2 +- .../src/server/stream_fetch.rs | 18 +++++++++++++++++- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 532f5820e4..3c49dc6879 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Release Notes ## Platform Version 0.9.5 - UNRELEASED +* Update `Debug` printout for `SmartStreamWasm` to reduce noise ([#1524](https://github.com/infinyon/fluvio/pull/1524)) + ## Platform Version 0.9.4 - 2021-08-26 * Publish docker image for aarch64 #1389 ([#1389](https://github.com/infinyon/fluvio/pull/1389)) * Do not panic when trying to create topic with space in the name. ([#1448](https://github.com/infinyon/fluvio/pull/1448)) diff --git a/Cargo.lock b/Cargo.lock index e6d27e2c44..687f1766a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1840,7 +1840,7 @@ dependencies = [ [[package]] name = "fluvio-spu-schema" -version = "0.8.1" +version = "0.8.2" dependencies = [ "bytes", "flate2", diff --git a/crates/fluvio-spu-schema/Cargo.toml b/crates/fluvio-spu-schema/Cargo.toml index f43fbee6e5..7641aa2f72 100644 --- a/crates/fluvio-spu-schema/Cargo.toml +++ b/crates/fluvio-spu-schema/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fluvio-spu-schema" -version = "0.8.1" +version = "0.8.2" edition = "2018" authors = ["Fluvio Contributors "] description = "Fluvio API for SPU" diff --git a/crates/fluvio-spu-schema/src/server/stream_fetch.rs b/crates/fluvio-spu-schema/src/server/stream_fetch.rs index b1c725978e..2476a0d756 100644 --- a/crates/fluvio-spu-schema/src/server/stream_fetch.rs +++ b/crates/fluvio-spu-schema/src/server/stream_fetch.rs @@ -3,6 +3,7 @@ //! //! Stream records to client //! +use std::fmt; use std::fmt::Debug; use std::marker::PhantomData; use std::io::{self, Read}; @@ -93,7 +94,7 @@ impl Default for SmartStreamKind { /// as raw bytes. /// // TODO ... or, it may be named and selected from the WASM store. -#[derive(Debug, Clone, Encoder, Decoder)] +#[derive(Clone, Encoder, Decoder)] pub enum SmartStreamWasm { Raw(Vec), /// compressed WASM module payload using Gzip @@ -149,6 +150,21 @@ impl Default for SmartStreamWasm { } } +impl Debug for SmartStreamWasm { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Raw(bytes) => f + .debug_tuple("Raw") + .field(&format!("{} bytes", bytes.len())) + .finish(), + Self::Gzip(bytes) => f + .debug_tuple("Gzip") + .field(&format!("{} bytes", bytes.len())) + .finish(), + } + } +} + #[derive(Encoder, Decoder, Default, Debug)] pub struct StreamFetchResponse where From b28a8354434f2ae62be8c31def1394e539ea056c Mon Sep 17 00:00:00 2001 From: "T.J. Telan" Date: Sat, 28 Aug 2021 01:24:11 +0000 Subject: [PATCH 13/18] Less expensive random for upgrade test (#1525) `/dev/urandom` on the github runners is sometimes slow. Random alphanumeric is all we need. --- tests/upgrade-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/upgrade-test.sh b/tests/upgrade-test.sh index 5c68e19d75..7714906999 100755 --- a/tests/upgrade-test.sh +++ b/tests/upgrade-test.sh @@ -253,7 +253,7 @@ function create_test_data() { for BASE in {1..2} do echo "Create the baseline file #${BASE}" - local RANDOM_DATA=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w${TEST_DATA_BYTES} | head -n1) + local RANDOM_DATA=$(shuf -zer -n${TEST_DATA_BYTES} {A..Z} {a..z} {0..9}) echo ${RANDOM_DATA} | tee -a data${BASE}.txt.tmp done From 733ec8b124ad259dfffdb708c15b6d3bb790d854 Mon Sep 17 00:00:00 2001 From: Sehyo Chang Date: Sun, 29 Aug 2021 04:38:09 +0000 Subject: [PATCH 14/18] improve platform stability (#1497) fixes #1490 and probably #1480 due to failure in health during installation. * Add minikube/k3 for K8 Test * Remove unneeded delay for tests * Improve K8 and Local installation * Simplify SPU health check to improve reliability * Improve SC's SPU controller reliability * Increase SPG's creation time to allow longer period for PVC provisioning * Error recovery for K8 Dispatcher in case of controller API issues * More instrumentation for tracing --- .github/workflows/ci.yml | 147 ++++++--- .github/workflows/ci_tier2.yaml | 4 +- CHANGELOG.md | 1 + Cargo.lock | 120 ++++---- Cargo.toml | 1 + Makefile | 1 - crates/fluvio-cluster/build.rs | 1 + crates/fluvio-cluster/src/cli/start/k8.rs | 12 +- crates/fluvio-cluster/src/start/common.rs | 65 +++- crates/fluvio-cluster/src/start/k8.rs | 280 +++++------------- crates/fluvio-cluster/src/start/local.rs | 35 +-- crates/fluvio-cluster/src/start/mod.rs | 2 +- .../fluvio-controlplane-metadata/Cargo.toml | 2 +- .../src/spu/status.rs | 4 + crates/fluvio-sc/Cargo.toml | 4 +- .../fluvio-sc/src/controllers/spus/actions.rs | 10 - .../src/controllers/spus/controller.rs | 230 +++----------- crates/fluvio-sc/src/controllers/spus/mod.rs | 35 --- crates/fluvio-sc/src/core/context.rs | 7 +- .../src/k8/controllers/spu_controller.rs | 66 +---- .../services/private_api/private_server.rs | 47 +-- .../src/services/public_api/public_server.rs | 4 +- .../src/services/public_api/spg/create.rs | 12 +- crates/fluvio-sc/src/stores/spu.rs | 47 ++- crates/fluvio-service/src/server.rs | 47 ++- crates/fluvio-service/src/test_request.rs | 3 +- crates/fluvio-socket/src/multiplexing.rs | 2 +- crates/fluvio-spu/Cargo.toml | 2 +- .../src/control_plane/dispatcher.rs | 2 +- .../src/services/internal/service_impl.rs | 4 + .../src/services/public/service_impl.rs | 2 + crates/fluvio-stream-dispatcher/Cargo.toml | 2 +- .../src/dispatcher/k8_dispatcher.rs | 21 +- .../fluvio-stream-dispatcher/src/store/mod.rs | 18 +- .../src/store/dual_store.rs | 19 +- crates/fluvio-test/src/tests/smoke/consume.rs | 5 +- dev-tools/sc-pod-log.sh | 3 +- k8-util/cluster/reset-k3d.sh | 2 +- k8-util/helm/Makefile | 4 +- tests/upgrade-test.sh | 19 +- 40 files changed, 562 insertions(+), 730 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60b788842f..eb279e6808 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,25 @@ env: jobs: + # this job set up dynamic configuration shared among jobs + config: + name: Set up Config + runs-on: ubuntu-latest + env: + ENABLE_CHECK: true + TEST_RUNS: "[r1]" # default runs + outputs: + check: ${{ steps.check.outputs.check }} + runs: ${{ steps.runs.outputs.runs }} + steps: + - id: check + run: echo "::set-output name=check::${{ env.ENABLE_CHECK }}" + #- name: Set Staging runs + ## if: github.event_name == 'push' && github.ref == 'refs/heads/staging' + # run: echo "TEST_RUNS='[r1,r2,r3,r4,r5]'" | tee -a $GITHUB_ENV + + + # build binaries for linux x86_64/aarch64 musl which is primary OS for testing clusters build_primary_binaries: name: Primary build ${{ matrix.binary }} for ${{ matrix.rust-target }} on (${{ matrix.os }}) @@ -193,7 +212,8 @@ jobs: # Run all checks and unit test. This always run on debug mode check: name: Rust check ${{ matrix.check }} (${{ matrix.rust-target }}) - # if: ${{ false }} + needs: config + if: ${{ needs.config.outputs.check == 'true' }} runs-on: ${{ matrix.os }} strategy: matrix: @@ -236,7 +256,8 @@ jobs: check_wasm: name: Build WASM crates (${{ matrix.wasm-crate }}) - # if: ${{ false }} + needs: config + if: ${{ needs.config.outputs.check == 'true' }} runs-on: ${{ matrix.os }} strategy: matrix: @@ -268,7 +289,8 @@ jobs: check_windows: name: Check Windows for crates (${{ matrix.crate }}) - # if: ${{ false }} + needs: config + if: ${{ needs.config.outputs.check == 'true' }} runs-on: ${{ matrix.os }} strategy: matrix: @@ -301,15 +323,16 @@ jobs: local_cluster_test: name: Local cluster test run (${{ matrix.run }}) runs-on: ${{ matrix.os }} - # if: ${{ false }} - needs: build_primary_binaries + needs: + - build_primary_binaries + - config strategy: - # fail-fast: false + fail-fast: false matrix: os: [ubuntu-latest] - # run: [r1, r2, r3, r4, r5, r6, r7, r8, r9, r10,r11,r12,r13,r14,r15,r16,r17] run: [r1] - rust: [stable] + # run: ${{ fromJson(needs.config.outputs.runs )}} + steps: - uses: actions/checkout@v2 - uses: nolar/setup-k3d-k3s@v1 @@ -337,7 +360,7 @@ jobs: timeout-minutes: 2 run: | date - make FLUVIO_BIN=./fluvio TEST_BIN=./fluvio-test SERVER_LOG=info UNINSTALL=noclean EXTRA_ARG=--keep-cluster smoke-test-tls-root + make FLUVIO_BIN=./fluvio TEST_BIN=./fluvio-test UNINSTALL=noclean EXTRA_ARG=--keep-cluster smoke-test-tls-root date kubectl get partitions kubectl get partitions -o=jsonpath='{.items[0].status.leader.leo}' | grep 100 @@ -361,12 +384,11 @@ jobs: timeout-minutes: 5 if: failure() with: - name: fluvio-${{ matrix.run }}-logs + name: local-${{ matrix.run }}-logs path: /tmp/*.log build_image: name: Build Fluvio Docker image - # if: ${{ false }} needs: build_primary_binaries runs-on: ${{ matrix.os }} strategy: @@ -402,19 +424,17 @@ jobs: path: /tmp/infinyon-fluvio-${{ matrix.rust-target }}.tar k8_cluster_test: - name: Kubernetes cluster test run (${{ matrix.run }}) - # if: ${{ false }} + name: Kubernetes cluster test run (${{ matrix.run }}) k8 (${{ matrix.k8 }}) needs: build_image runs-on: ${{ matrix.os }} strategy: - # fail-fast: false + fail-fast: false matrix: os: [ubuntu-latest] run: [r1] - rust: [stable] + k8: [k3d,minikube] steps: - uses: actions/checkout@v2 - - uses: nolar/setup-k3d-k3s@v1 # Download artifacts - name: Download artifact - fluvio uses: actions/download-artifact@v2 @@ -433,64 +453,104 @@ jobs: path: /tmp - name: Print artifacts and mark executable - run: ls -la . && chmod +x ./fluvio ./fluvio-test && ./fluvio version && ./fluvio-test -h + run: chmod +x ./fluvio ./fluvio-test && ./fluvio version && ./fluvio-test -h # Retag image to remove arch from tag - - name: Load Fluvio Docker Image + - name: Load Fluvio Docker Image for K3d run: | ls -la /tmp docker image load --input /tmp/infinyon-fluvio-x86_64-unknown-linux-musl.tar docker image tag infinyon/fluvio:${{ github.sha }}-x86_64-unknown-linux-musl infinyon/fluvio:${{ github.sha }} docker image ls -a + #- name: Load Docker image for Minikube + # eval $(minikube -p minikube docker-env) + # docker image load --input /tmp/infinyon-fluvio.tar + # docker image ls -a - name: Export Docker Image to tarball run: docker image save infinyon/fluvio:${{ github.sha }} --output /tmp/infinyon-fluvio.tar - - - name: Run smoke-test-k8-tls-root - uses: nick-invision/retry@v2 + - name: Install K3d and import image + if: ${{ matrix.k8 == 'k3d' }} + run: | + curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash + ./k8-util/cluster/reset-k3d.sh + - name: Load image to K3d + if: ${{ matrix.k8 == 'k3d' }} + run: | + k3d image import -k /tmp/infinyon-fluvio.tar -c fluvio + - name: Install Minikube and import image + if: ${{ matrix.k8 == 'minikube' }} + uses: manusa/actions-setup-minikube@v2.4.2 with: - timeout_minutes: 7 - max_attempts: 3 - command: | - ./k8-util/cluster/reset-k3d.sh - k3d image import -k /tmp/infinyon-fluvio.tar -c fluvio - make FLUVIO_BIN=./fluvio TEST_BIN=./fluvio-test smoke-test-k8-tls-root + minikube version: "v1.22.0" + kubernetes version: "v1.21.2" + github token: ${{ secrets.GITHUB_TOKEN }} + driver: docker + - name: Load image to minikube + if: ${{ matrix.k8 == 'minikube' }} + run: | + eval $(minikube -p minikube docker-env) + docker image load --input /tmp/infinyon-fluvio.tar + - name: Run smoke-test-k8-tls-root + timeout-minutes: 10 + env: + FLV_DISPATCHER_WAIT: 300 # k3d in Github make take while to provision PVC + run: | + date + make FLUVIO_BIN=./fluvio TEST_BIN=./fluvio-test EXTRA_ARG=--keep-cluster UNINSTALL=noclean smoke-test-k8-tls-root + # make FLUVIO_BIN=./fluvio TEST_BIN=./flv-test smoke-test-k8-tls-root - name: Print version - run: ./fluvio version + run: | + ./fluvio version + date + uname -a + helm list + kubectl get crd + kubectl get spu + kubectl get statefulset + kubectl get pvc + kubectl get pods + kubectl get svc + kubectl get spg - name: Save logs if: failure() run: | + date + uname -a helm list + kubectl get crd kubectl get spu + kubectl get partitions kubectl get statefulset kubectl get pvc kubectl get pods kubectl get svc - kubectl get spg - kubectl logs -l app=fluvio-sc > /tmp/flv_sc.log + kubectl logs fluvio-spg-main-0 > /tmp/k8_${{ matrix.run }}_spu0.log || true + kubectl logs fluvio-spg-main-1 > /tmp/k8_${{ matrix.run }}_spu1.log || true + ./dev-tools/sc-pod-log.sh > /tmp/k8_${{ matrix.run }}_sc.log || true - name: Upload logs timeout-minutes: 5 if: failure() uses: actions/upload-artifact@v2 with: - name: fluvio-k8-logs - path: /tmp/flv_sc.log + name: k8_${{ matrix.run }}_log + path: /tmp/k8_*.log k8_upgrade_test: name: Upgrade cluster test on (${{ matrix.run }}) - # if: ${{ false }} needs: build_image runs-on: ${{ matrix.os }} strategy: - # fail-fast: false + fail-fast: false matrix: os: [ubuntu-latest] run: [r1] steps: - uses: actions/checkout@v2 - - uses: nolar/setup-k3d-k3s@v1 + - name: Setup K3d + run: curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash # Download artifacts - name: Download artifact - fluvio uses: actions/download-artifact@v2 @@ -516,19 +576,24 @@ jobs: - name: Export Docker Image to tarball run: docker image save infinyon/fluvio:${{ github.sha }} --output /tmp/infinyon-fluvio.tar - - name: Set up k3d - run: ./k8-util/cluster/reset-k3d.sh + - name: Set up K3d + if: ${{ false }} # enable on 0.9.5 + run: | + ./k8-util/cluster/reset-k3d.sh + k3d image import -k /tmp/infinyon-fluvio.tar -c fluvio + date - name: Run upgrade test with CI artifacts - timeout-minutes: 5 env: TEST_DATA_BYTES: 10000 + FLV_DISPATCHER_WAIT: 300 uses: nick-invision/retry@v2 + # temporary for 0.9.5 max_attempts with: - timeout_minutes: 15 + timeout_minutes: 3 max_attempts: 3 - command: | + command: | ./k8-util/cluster/reset-k3d.sh - k3d image import -k /tmp/infinyon-fluvio.tar -c fluvio + k3d image import -k /tmp/infinyon-fluvio.tar -c fluvio export PATH=~/.fluvio/bin:$PATH make FLUVIO_BIN=./fluvio upgrade-test diff --git a/.github/workflows/ci_tier2.yaml b/.github/workflows/ci_tier2.yaml index 337ea5373f..86a62f326b 100644 --- a/.github/workflows/ci_tier2.yaml +++ b/.github/workflows/ci_tier2.yaml @@ -11,8 +11,8 @@ concurrency: cancel-in-progress: true on: - pull_request: - branches: [master] +# pull_request: +# branches: [master] # push: # branches: [master] workflow_dispatch: diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c49dc6879..5ed8180685 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Platform Version 0.9.5 - UNRELEASED * Update `Debug` printout for `SmartStreamWasm` to reduce noise ([#1524](https://github.com/infinyon/fluvio/pull/1524)) +* Increase platform stability ([#1497](https://github.com/infinyon/fluvio/pull/1497)) ## Platform Version 0.9.4 - 2021-08-26 * Publish docker image for aarch64 #1389 ([#1389](https://github.com/infinyon/fluvio/pull/1389)) diff --git a/Cargo.lock b/Cargo.lock index 687f1766a1..4d4eea0533 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -30,7 +30,7 @@ dependencies = [ "cpp_demangle", "fallible-iterator", "gimli 0.25.0", - "object 0.26.1", + "object 0.26.2", "rustc-demangle", "smallvec 1.6.1", ] @@ -328,9 +328,9 @@ dependencies = [ [[package]] name = "async-std" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9f06685bad74e0570f5213741bea82158279a4103d988e57bfada11ad230341" +checksum = "f8056f1455169ab86dd47b47391e4ab0cbd25410a70e9fe675544f49bafaf952" dependencies = [ "async-attributes", "async-channel", @@ -417,7 +417,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.26.1", + "object 0.26.2", "rustc-demangle", ] @@ -573,9 +573,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "cache-padded" @@ -789,9 +789,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.1.5" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" +checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" dependencies = [ "libc", ] @@ -1494,7 +1494,7 @@ dependencies = [ [[package]] name = "fluvio-controlplane-metadata" -version = "0.10.1" +version = "0.10.2" dependencies = [ "async-trait", "fluvio-dataplane-protocol", @@ -1550,9 +1550,9 @@ dependencies = [ [[package]] name = "fluvio-future" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffaf3160b66ced37e2f1dcb073b07b3a3a3544a77bf172c94d47f44843d540f" +checksum = "2d22a6d56e769823b8a936cbdbd6409c1ce0f05c82ec528373550a0ab9342cfd" dependencies = [ "async-fs", "async-io", @@ -1879,7 +1879,7 @@ dependencies = [ [[package]] name = "fluvio-stream-dispatcher" -version = "0.6.2" +version = "0.6.3" dependencies = [ "async-channel", "async-rwlock", @@ -2021,7 +2021,7 @@ checksum = "b768c170dc045fa587a8f948c91f9bcfb87f774930477c6215addf54317f137f" dependencies = [ "futures", "js-sys", - "parking_lot 0.11.1", + "parking_lot 0.11.2", "pin-utils", "wasm-bindgen", "wasm-bindgen-futures", @@ -2340,9 +2340,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "825343c4eef0b63f541f8903f395dc5beb362a979b5799a84062527ef1e37726" +checksum = "d7f3675cfef6a30c8031cf9e6493ebdc3bb3272a3fea3923c4210d1830e6a472" dependencies = [ "bytes", "fnv", @@ -2509,9 +2509,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.11" +version = "0.14.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b61cf2d1aebcf6e6352c97b81dc2244ca29194be1b276f5d8ad5c6330fffb11" +checksum = "13f67199e765030fa08fe0bd581af683f0d5bc04ea09c2b1102012c5fb90e7fd" dependencies = [ "bytes", "futures-channel", @@ -2645,9 +2645,9 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "jobserver" @@ -2800,9 +2800,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.99" +version = "0.2.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7f823d141fe0a24df1e23b4af4e3c7ba9e5966ec514ea068c93024aa7deb765" +checksum = "3cb00336871be5ed2c8ed44b60ae9959dc5b9f08539422ed43f09e34ecaeba21" [[package]] name = "libloading" @@ -2832,9 +2832,9 @@ checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "lock_api" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb" +checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" dependencies = [ "scopeguard", ] @@ -3002,9 +3002,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d047c1062aa51e256408c560894e5251f08925980e53cf1aa5bd00eec6512" +checksum = "76e97c412795abf6c24ba30055a8f20642ea57ca12875220b854cfa501bf1e48" dependencies = [ "autocfg", "num-integer", @@ -3053,9 +3053,9 @@ dependencies = [ [[package]] name = "object" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2766204889d09937d00bfbb7fec56bb2a199e2ade963cab19185d8a6104c7c" +checksum = "39f37e50073ccad23b6d09bcb5b263f4e76d3bb6038e4a3c08e52162ffa8abc2" dependencies = [ "flate2", "memchr", @@ -3104,9 +3104,9 @@ checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" [[package]] name = "openssl-src" -version = "111.15.0+1.1.1k" +version = "111.16.0+1.1.1l" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a5f6ae2ac04393b217ea9f700cd04fa9bf3d93fae2872069f3d15d908af70a" +checksum = "7ab2173f69416cf3ec12debb5823d244127d23a9b127d5a5189aa97c5fa2859f" dependencies = [ "cc", ] @@ -3158,13 +3158,13 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", - "parking_lot_core 0.8.3", + "parking_lot_core 0.8.5", ] [[package]] @@ -3181,9 +3181,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" dependencies = [ "cfg-if 1.0.0", "instant", @@ -3404,9 +3404,9 @@ dependencies = [ [[package]] name = "psm" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0617ee61163b5d941d804065ce49040967610a4d4278fae73e096a057b01d358" +checksum = "cd136ff4382c4753fc061cb9e4712ab2af263376b95bbd5bd8cd50c020b78e69" dependencies = [ "cc", ] @@ -3678,7 +3678,7 @@ dependencies = [ "mach_o_sys", "memmap", "nix", - "object 0.26.1", + "object 0.26.2", "proc-maps", "regex", "winapi 0.3.9", @@ -3707,9 +3707,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" [[package]] name = "rustc-hash" @@ -3822,9 +3822,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4effb91b4b8b6fb7732e670b6cee160278ff8e6bf485c7805d9e319d76e284" +checksum = "19133a286e494cc3311c165c4676ccb1fd47bed45b55f9d71fbd784ad4cea6f8" dependencies = [ "core-foundation-sys", "libc", @@ -3880,18 +3880,18 @@ checksum = "930c0acf610d3fdb5e2ab6213019aaa04e227ebe9547b0649ba599b16d788bd7" [[package]] name = "serde" -version = "1.0.127" +version = "1.0.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f03b9878abf6d14e6779d3f24f07b2cfa90352cfec4acc5aab8f1ac7f146fae8" +checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.127" +version = "1.0.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a024926d3432516606328597e0f224a51355a493b49fdd67e9209187cbe55ecc" +checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" dependencies = [ "proc-macro2", "quote", @@ -3900,9 +3900,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.66" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "336b10da19a12ad094b59d870ebde26a45402e5b470add4b5fd03c5048a32127" +checksum = "a7f9e390c27c3c0ce8bc5d725f6e4d30a29d26659494aa4b17535f7522c5c950" dependencies = [ "itoa", "ryu", @@ -3934,12 +3934,12 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.8.18" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "039ba818c784248423789eec090aab9fb566c7b94d6ebbfa1814a9fd52c8afb2" +checksum = "ad104641f3c958dab30eb3010e834c2622d1f3f4c530fef1dee20ad9485f3c09" dependencies = [ "dtoa", - "linked-hash-map", + "indexmap", "serde", "yaml-rust", ] @@ -3952,9 +3952,9 @@ checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" [[package]] name = "sha2" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" +checksum = "9204c41a1597a8c5af23c82d1c921cb01ec0a4c59e07a9c7306062829a3903f3" dependencies = [ "block-buffer", "cfg-if 1.0.0", @@ -4157,9 +4157,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.74" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1873d832550d4588c3dbc20f01361ab00bfe741048f71e3fecf145a7cc18b29c" +checksum = "b7f58f7e8eaa0009c5fec437aabf511bd9933e4b2d7407bd05273c01a8906ea7" dependencies = [ "proc-macro2", "quote", @@ -4341,9 +4341,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cf844b23c6131f624accf65ce0e4e9956a8bb329400ea5bcc26ae3a5c20b0b" +checksum = "92036be488bb6594459f2e03b60e42df6f937fe6ca5c5ffdcb539c6b84dc40f5" dependencies = [ "autocfg", "bytes", @@ -4938,18 +4938,18 @@ dependencies = [ [[package]] name = "wast" -version = "37.0.0" +version = "38.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bc7b9a76845047ded00e031754ff410afee0d50fbdf62b55bdeecd245063d68" +checksum = "0ebc29df4629f497e0893aacd40f13a4a56b85ef6eb4ab6d603f07244f1a7bf2" dependencies = [ "leb128", ] [[package]] name = "wat" -version = "1.0.39" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab2cc8d9a69d1ab28a41d9149bb06bb927aba8fc9d56625f8b597a564c83f50" +checksum = "adcfaeb27e2578d2c6271a45609f4a055e6d7ba3a12eff35b1fd5ba147bdf046" dependencies = [ "wast", ] diff --git a/Cargo.toml b/Cargo.toml index 4f0d7b05f2..4d6b7cc216 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,6 +39,7 @@ members = [ ] resolver = "2" + # Used to make eyre faster on debug builds # See https://github.com/yaahc/color-eyre#improving-perf-on-debug-builds [profile.dev.package.backtrace] diff --git a/Makefile b/Makefile index 9445df08dd..d83d13094f 100644 --- a/Makefile +++ b/Makefile @@ -105,7 +105,6 @@ SC_HOST=localhost SC_PORT=9003 test-permission-user1: rm -f /tmp/topic.err - sleep 10 - $(FLUVIO_BIN) --cluster ${SC_HOST}:${SC_PORT} \ --tls --enable-client-cert --domain fluvio.local \ --ca-cert tls/certs/ca.crt \ diff --git a/crates/fluvio-cluster/build.rs b/crates/fluvio-cluster/build.rs index 146fc7d903..ec0a36c0aa 100644 --- a/crates/fluvio-cluster/build.rs +++ b/crates/fluvio-cluster/build.rs @@ -3,6 +3,7 @@ use std::process::Command; fn main() { // package helm before build println!("cargo:rerun-if-changed=../../k8-util/helm"); + println!("cargo:rerun-if-changed=../../VERSION"); let _uname_output = Command::new("make") .arg("install") .output() diff --git a/crates/fluvio-cluster/src/cli/start/k8.rs b/crates/fluvio-cluster/src/cli/start/k8.rs index da1c0f1b1a..8b4e022e71 100644 --- a/crates/fluvio-cluster/src/cli/start/k8.rs +++ b/crates/fluvio-cluster/src/cli/start/k8.rs @@ -2,7 +2,7 @@ use std::convert::TryInto; use fluvio::config::TlsPolicy; use semver::Version; -use crate::{ClusterInstaller, ClusterError, K8InstallError, StartStatus, ClusterConfig}; +use crate::{ClusterInstaller, K8InstallError, StartStatus, ClusterConfig, ClusterError}; use crate::cli::ClusterCliError; use crate::cli::start::StartOpt; use crate::check::render::{ @@ -66,13 +66,15 @@ pub async fn process_k8( if opt.setup { setup_k8(&installer).await?; } else { - start_k8(&installer).await?; + let k8_install: Result<_, ClusterError> = + start_k8(&installer).await.map_err(|err| err.into()); + k8_install? } Ok(()) } -pub async fn start_k8(installer: &ClusterInstaller) -> Result<(), ClusterCliError> { +pub async fn start_k8(installer: &ClusterInstaller) -> Result<(), K8InstallError> { match installer.install_fluvio().await { // Successfully performed startup without pre-checks Ok(StartStatus { checks: None, .. }) => { @@ -87,11 +89,11 @@ pub async fn start_k8(installer: &ClusterInstaller) -> Result<(), ClusterCliErro println!("Successfully installed Fluvio!"); } // Aborted startup because pre-checks failed - Err(ClusterError::InstallK8(K8InstallError::FailedPrecheck(check_statuses))) => { + Err(K8InstallError::FailedPrecheck(check_statuses)) => { render_statuses_next_steps(&check_statuses); } // Another type of error occurred during checking or startup - Err(other) => return Err(other.into()), + Err(other) => return Err(other), } Ok(()) diff --git a/crates/fluvio-cluster/src/start/common.rs b/crates/fluvio-cluster/src/start/common.rs index 62ef4d4775..eb5ffc9cfd 100644 --- a/crates/fluvio-cluster/src/start/common.rs +++ b/crates/fluvio-cluster/src/start/common.rs @@ -1,6 +1,9 @@ use std::{env, time::Duration}; +use fluvio_controlplane_metadata::spu::SpuSpec; +use k8_client::{SharedK8Client, ClientError}; use once_cell::sync::Lazy; +use semver::Version; use tracing::{debug, instrument}; use fluvio::{Fluvio, FluvioConfig}; @@ -14,13 +17,41 @@ static MAX_SC_LOOP: Lazy = Lazy::new(|| { /// try connection to SC #[instrument] -pub async fn try_connect_to_sc(config: &FluvioConfig) -> Option { - async fn try_connect_sc(fluvio_config: &FluvioConfig) -> Option { - match Fluvio::connect_with_config(fluvio_config).await { - Ok(fluvio) => Some(fluvio), - Err(err) => { - debug!("couldn't connect: {:#?}", err); +pub async fn try_connect_to_sc( + config: &FluvioConfig, + platform_version: &Version, +) -> Option { + async fn try_connect_sc( + fluvio_config: &FluvioConfig, + expected_version: &Version, + ) -> Option { + use tokio::select; + + select! { + _ = &mut sleep(Duration::from_secs(10)) => { + debug!("timer expired"); None + }, + + connection = Fluvio::connect_with_config(fluvio_config) => { + + match connection { + Ok(fluvio) => { + let current_version = fluvio.platform_version(); + if current_version == expected_version { + println!("Got updated SC Version{}", &expected_version); + Some(fluvio) + } else { + println!("Current Version {} is not same as expected: {}",current_version,expected_version); + None + } + } + Err(err) => { + debug!("couldn't connect: {:#?}", err); + None + } + } + } } } @@ -30,7 +61,7 @@ pub async fn try_connect_to_sc(config: &FluvioConfig) -> Option { "Trying to connect to sc at: {}, attempt: {}", config.endpoint, attempt ); - if let Some(fluvio) = try_connect_sc(config).await { + if let Some(fluvio) = try_connect_sc(config, platform_version).await { println!("Connection to sc suceed!"); return Some(fluvio); } else if attempt < *MAX_SC_LOOP - 1 { @@ -42,3 +73,23 @@ pub async fn try_connect_to_sc(config: &FluvioConfig) -> Option { println!("fail to connect to sc at: {}", config.endpoint); None } + +// hack +pub async fn check_crd(client: SharedK8Client) -> Result<(), ClientError> { + use k8_metadata_client::MetadataClient; + + for i in 0..100 { + println!("checking fluvio crd attempt: {}", i); + // check if spu is installed + if let Err(err) = client.retrieve_items::("default").await { + println!("problem retrieving fluvio crd {}", err); + println!("sleeping 1 seconds"); + sleep(Duration::from_secs(10)).await; + } else { + println!("fluvio crd installed"); + return Ok(()); + } + } + + Err(ClientError::Other("Fluvio CRD not ready".to_string())) +} diff --git a/crates/fluvio-cluster/src/start/k8.rs b/crates/fluvio-cluster/src/start/k8.rs index 7d72e45ba2..3ec0ed8f9e 100644 --- a/crates/fluvio-cluster/src/start/k8.rs +++ b/crates/fluvio-cluster/src/start/k8.rs @@ -5,11 +5,12 @@ use std::path::PathBuf; use std::borrow::Cow; use std::process::Command; use std::time::Duration; -use std::net::SocketAddr; use std::env; use derive_builder::Builder; -use tracing::{info, warn, debug, error, instrument}; +use k8_client::SharedK8Client; +use k8_client::load_and_share; +use tracing::{info, warn, debug, instrument}; use once_cell::sync::Lazy; use tempfile::NamedTempFile; use semver::Version; @@ -19,8 +20,6 @@ use fluvio::metadata::spg::SpuGroupSpec; use fluvio::metadata::spu::SpuSpec; use fluvio::config::{TlsPolicy, TlsConfig, TlsPaths, ConfigFile, Profile}; use fluvio_future::timer::sleep; -use fluvio_future::net::{TcpStream, resolve}; -use k8_client::K8Client; use k8_config::K8Config; use k8_client::meta_client::MetadataClient; use k8_types::core::service::{LoadBalancerType, ServiceSpec, TargetPort}; @@ -30,12 +29,14 @@ use fluvio_command::CommandExt; use crate::helm::{HelmClient}; use crate::check::{CheckFailed, CheckResults, AlreadyInstalled, SysChartCheck}; use crate::error::K8InstallError; +use crate::start::common::check_crd; use crate::{ClusterError, StartStatus, DEFAULT_NAMESPACE, CheckStatus, ClusterChecker, CheckStatuses}; use crate::charts::{ChartConfig, ChartInstaller}; use crate::check::render::render_check_progress; use crate::UserChartLocation; use super::constants::*; +use super::common::try_connect_to_sc; const DEFAULT_REGISTRY: &str = "infinyon"; const DEFAULT_GROUP_NAME: &str = "main"; @@ -49,13 +50,6 @@ static MAX_SC_SERVICE_WAIT: Lazy = Lazy::new(|| { var_value.parse().unwrap_or(60) }); -const NETWORK_SLEEP_MS: u64 = 2000; -/// maximum tiime for VERSION CHECK -static MAX_SC_VERSION_LOOP: Lazy = Lazy::new(|| { - let var_value = env::var("FLV_CLUSTER_MAX_SC_VERSION_LOOP").unwrap_or_default(); - var_value.parse().unwrap_or(60) -}); - /// Describes how to install Fluvio onto Kubernetes #[derive(Builder, Debug)] #[builder(build_fn(private, name = "build_impl"))] @@ -571,7 +565,7 @@ pub struct ClusterInstaller { /// Configuration options for this installation config: ClusterConfig, /// Shared Kubernetes client for install - kube_client: K8Client, + kube_client: SharedK8Client, /// Helm client for performing installs helm_client: HelmClient, } @@ -591,7 +585,7 @@ impl ClusterInstaller { pub fn from_config(config: ClusterConfig) -> Result { Ok(Self { config, - kube_client: K8Client::default().map_err(K8InstallError::K8ClientError)?, + kube_client: load_and_share().map_err(K8InstallError::K8ClientError)?, helm_client: HelmClient::new().map_err(K8InstallError::HelmError)?, }) } @@ -642,14 +636,17 @@ impl ClusterInstaller { skip(self), fields(namespace = &*self.config.namespace), )] - pub async fn install_fluvio(&self) -> Result { + pub async fn install_fluvio(&self) -> Result { + println!("starting installing"); + + let mut installed = false; let checks = match self.config.skip_checks { true => None, // Check if env is ready for install and tries to fix anything it can false => { let check_results = self.setup().await; if check_results.iter().any(|it| it.is_err()) { - return Err(K8InstallError::PrecheckErrored(check_results).into()); + return Err(K8InstallError::PrecheckErrored(check_results)); } let statuses: CheckStatuses = @@ -660,14 +657,8 @@ impl ClusterInstaller { match status { // If Fluvio is already installed, return the SC's address CheckStatus::Fail(CheckFailed::AlreadyInstalled) => { - debug!("Fluvio is already installed. Getting SC address"); - let (address, port) = - self.wait_for_sc_service(&self.config.namespace).await?; - return Ok(StartStatus { - address, - port, - checks: Some(statuses), - }); + debug!("Fluvio is already installed"); + installed = true; } CheckStatus::Fail(_) => any_failed = true, _ => (), @@ -676,50 +667,42 @@ impl ClusterInstaller { // If any of the pre-checks was a straight-up failure, install should fail if any_failed { - return Err(K8InstallError::FailedPrecheck(statuses).into()); + return Err(K8InstallError::FailedPrecheck(statuses)); } Some(statuses) } }; - if let Some(proxy) = &self.config.proxy_addr { - println!("Using proxy addr: {}", proxy); + if !installed { + self.install_app().await?; } - self.install_app().await?; + let namespace = &self.config.namespace; - let (address, port) = self - .wait_for_sc_service(namespace) + + // before we do let's try make sure SPU are installed. + check_crd(self.kube_client.clone()) .await - .map_err(|_| K8InstallError::UnableToDetectService)?; - println!("Fluvio SC is up at: {}", address); + .map_err(K8InstallError::from)?; - if self.config.save_profile { - self.update_profile(address.clone())?; - } + let (host_name, port) = self.discover_sc_address(namespace).await?; + + let address = format!("{}:{}", host_name, port); - let cluster = + println!("found SC service addr: {}", address); + let cluster_config = FluvioConfig::new(address.clone()).with_tls(self.config.client_tls_policy.clone()); - if self.config.spu_replicas > 0 && !self.config.upgrade { - debug!("waiting for SC to spin up before attemp to spin up spu"); - // Wait a little bit for the SC to spin up - sleep(Duration::from_millis(2000)).await; + let fluvio = match try_connect_to_sc(&cluster_config, &self.config.platform_version).await { + Some(fluvio) => fluvio, + None => return Err(K8InstallError::SCServiceTimeout), + }; - // Create a managed SPU cluster - self.create_managed_spu_group(&cluster).await?; + if self.config.save_profile { + self.update_profile(address.clone())?; } - // When upgrading, wait for platform version to match new version - println!( - "Waiting up to {} seconds for Fluvio cluster version check...", - *MAX_SC_VERSION_LOOP * 2 - ); - self.wait_for_fluvio_version(&cluster).await?; - - // Wait for the SPU cluster to spin up - if !self.config.skip_spu_liveness_check { - self.wait_for_spu(namespace).await?; - } + // Create a managed SPU cluster + self.create_managed_spu_group(&fluvio).await?; Ok(StartStatus { address, @@ -760,12 +743,11 @@ impl ClusterInstaller { let (np_addr_fd, np_conf_path) = NamedTempFile::new()?.into_parts(); chart_values.push(np_conf_path.to_path_buf()); - debug!("Using NodePort service type"); - let external_addr = if let Some(addr) = &self.config.proxy_addr { debug!(?addr, "use proxying"); addr.to_owned() } else { + debug!("Using NodePort service type"); debug!("Getting external IP from K8s node"); let kube_client = &self.kube_client; @@ -832,7 +814,11 @@ impl ClusterInstaller { debug!("Using helm install settings: {:#?}", &install_settings); - println!("installing fluvio chart"); + if self.config.upgrade { + println!("Upgrading fluvio chart"); + } else { + println!("installing fluvio chart"); + } let mut config = ChartConfig::app_builder() .namespace(&self.config.namespace) @@ -863,9 +849,9 @@ impl ClusterInstaller { Ok(()) } - /// Looks up the external address of a Fluvio SC instance in the given namespace + /// Looks up the external address of a Fluvio SC instance in the given namespac #[instrument(skip(self, ns))] - async fn discover_sc_address(&self, ns: &str) -> Result, K8InstallError> { + async fn discover_sc_address(&self, ns: &str) -> Result<(String, u16), K8InstallError> { use tokio::select; use futures_lite::stream::StreamExt; @@ -881,7 +867,7 @@ impl ClusterInstaller { select! { _ = &mut timer => { debug!(timer = *MAX_SC_SERVICE_WAIT,"timer expired"); - return Ok(None) + return Err(K8InstallError::SCServiceTimeout) }, service_next = service_stream.next() => { if let Some(service_watches) = service_next { @@ -919,19 +905,19 @@ impl ClusterInstaller { if self.config.use_cluster_ip { - return Ok(Some((format!("{}:{}",service.spec.cluster_ip,target_port),target_port))) + return Ok((service.spec.cluster_ip,target_port)) }; let k8_load_balancer_type = service.spec.r#type.ok_or_else(|| K8InstallError::Other("Load Balancer Type".into()))?; match k8_load_balancer_type { LoadBalancerType::ClusterIP => { - return Ok(Some((format!("{}:{}",service.spec.cluster_ip,target_port),target_port))) + return Ok((service.spec.cluster_ip,target_port)) }, LoadBalancerType::NodePort => { let node_port = node_port.ok_or_else(|| K8InstallError::Other("Expecting a NodePort port".into()))?; - let extern_addr = if let Some(addr) = &self.config.proxy_addr { + let host_addr = if let Some(addr) = &self.config.proxy_addr { debug!(?addr,"using proxy"); addr.to_owned() } else { @@ -946,12 +932,12 @@ impl ClusterInstaller { } // Return the first node with type "InternalIP" - node_addr.into_iter().find(|a| a.r#type == "InternalIP") - .ok_or_else(|| K8InstallError::Other("No nodes with InternalIP set".into()))?.address + let external_addr = node_addr.into_iter().find(|a| a.r#type == "InternalIP") + .ok_or_else(|| K8InstallError::Other("No nodes with InternalIP set".into()))?; + external_addr.address }; - return Ok(Some((format!("{}:{}",extern_addr,node_port),node_port))) - + return Ok((host_addr,node_port)) }, LoadBalancerType::LoadBalancer => { let ingress_addr = service @@ -964,7 +950,7 @@ impl ClusterInstaller { if let Some(sock_addr) = ingress_addr.map(|addr| {format!("{}:{}", addr, target_port)}) { debug!(%sock_addr,"found lb address"); - return Ok(Some((sock_addr,target_port))) + return Ok((sock_addr,target_port)) } }, LoadBalancerType::ExternalName => { @@ -978,119 +964,13 @@ impl ClusterInstaller { } } else { debug!("service stream ended"); - return Ok(None) + return Err(K8InstallError::SCServiceTimeout) } } } } } - /// Wait until the platform version of the cluster matches the chart version here - #[instrument(skip(self))] - async fn wait_for_fluvio_version(&self, config: &FluvioConfig) -> Result<(), K8InstallError> { - for attempt in 0..*MAX_SC_VERSION_LOOP { - let fluvio = match Fluvio::connect_with_config(config).await { - Ok(fluvio) => fluvio, - Err(_) => { - sleep(Duration::from_millis(2_000)).await; - continue; - } - }; - - // The major.minor.patch versions should match after upgrade - let platform_version = fluvio.platform_version(); - let compatible = versions_compatible( - platform_version.clone(), - self.config.platform_version.clone(), - ); - - if compatible { - // Success - break; - } - debug!( - platform = %platform_version, - platform_version = %self.config.platform_version, - "Existing platform version is different than platform version", - ); - if attempt >= *MAX_SC_VERSION_LOOP - 1 { - return Err(K8InstallError::FailedPlatformVersion( - self.config.platform_version.to_string(), - )); - } - sleep(Duration::from_millis(2_000)).await; - } - - Ok(()) - } - - /// Wait until the Fluvio SC public service appears in Kubernetes - /// return address and port - #[instrument(skip(self, ns))] - async fn wait_for_sc_service(&self, ns: &str) -> Result<(String, u16), K8InstallError> { - debug!("waiting for SC service"); - if let Some((sock_addr, port)) = self.discover_sc_address(ns).await? { - debug!(%sock_addr, "found SC service addr"); - self.wait_for_sc_port_check(&sock_addr).await?; - Ok((sock_addr, port)) - } else { - Err(K8InstallError::SCServiceTimeout) - } - } - - /// Wait until the Fluvio SC public service appears in Kubernetes - async fn wait_for_sc_port_check(&self, sock_addr_str: &str) -> Result<(), K8InstallError> { - for i in 0..*MAX_SC_NETWORK_LOOP { - if self.config.proxy_addr.is_none() { - debug!("resolving socket addr: {}", sock_addr_str); - let sock_addr = self.wait_for_sc_dns(sock_addr_str).await?; - if TcpStream::connect(&*sock_addr).await.is_ok() { - info!(sock_addr = %sock_addr_str, "finished SC port check"); - return Ok(()); - } - } else { - debug!("trying to connect to proxy: {}", sock_addr_str); - if TcpStream::connect(&*sock_addr_str).await.is_ok() { - info!(sock_addr = %sock_addr_str, "finished SC port check"); - return Ok(()); - } - } - info!( - attempt = i, - "sc port closed, sleeping for {} ms", NETWORK_SLEEP_MS - ); - sleep(Duration::from_millis(NETWORK_SLEEP_MS)).await; - } - error!(sock_addr = %sock_addr_str, "timeout for SC port check"); - Err(K8InstallError::SCPortCheckTimeout) - } - - /// Wait until the Fluvio SC public service appears in Kubernetes - async fn wait_for_sc_dns( - &self, - sock_addr_string: &str, - ) -> Result, K8InstallError> { - debug!("waiting for SC dns resolution: {}", sock_addr_string); - for i in 0..*MAX_SC_NETWORK_LOOP { - match resolve(sock_addr_string).await { - Ok(sock_addr) => { - debug!("finished SC dns resolution: {}", sock_addr_string); - return Ok(sock_addr); - } - Err(err) => { - info!( - attempt = i, - "SC dns resoultion failed {}, sleeping for {} ms", err, NETWORK_SLEEP_MS - ); - sleep(Duration::from_millis(NETWORK_SLEEP_MS)).await; - } - } - } - - error!("timedout sc dns: {}", sock_addr_string); - Err(K8InstallError::SCDNSTimeout) - } - /// Wait until all SPUs are ready and have ingress #[instrument(skip(self, ns))] async fn wait_for_spu(&self, ns: &str) -> Result { @@ -1203,7 +1083,7 @@ impl ClusterInstaller { /// Updates the Fluvio configuration with the newly installed cluster info. fn update_profile(&self, external_addr: String) -> Result<(), K8InstallError> { - debug!("updating profile for: {}", external_addr); + println!("updating profile for: {}", external_addr); let mut config_file = ConfigFile::load_default_or_new()?; let config = config_file.mut_config(); @@ -1257,16 +1137,21 @@ impl ClusterInstaller { } /// Provisions a SPU group for the given cluster according to internal config - #[instrument( - skip(self, cluster), - fields(cluster_endpoint = & * cluster.endpoint) - )] - async fn create_managed_spu_group(&self, cluster: &FluvioConfig) -> Result<(), K8InstallError> { - debug!("trying to create managed spu: {:#?}", cluster); + #[instrument(skip(self, fluvio))] + async fn create_managed_spu_group(&self, fluvio: &Fluvio) -> Result<(), K8InstallError> { let name = self.config.group_name.clone(); - let fluvio = Fluvio::connect_with_config(cluster).await?; let admin = fluvio.admin().await; + println!("checking if spu groups exists"); + let lists = admin.list::(vec![]).await?; + + if !lists.is_empty() { + println!("spu group: {} exists, skipping", lists[0].name); + return Ok(()); + } + + println!("Trying to create managed {} spus", self.config.spu_replicas); + let spu_spec = SpuGroupSpec { replicas: self.config.spu_replicas, min_id: 0, @@ -1274,14 +1159,18 @@ impl ClusterInstaller { }; admin.create(name, false, spu_spec).await?; + + println!("Created {} spus", self.config.spu_replicas); + + // Wait for the SPU cluster to spin up + if !self.config.skip_spu_liveness_check { + self.wait_for_spu(&self.config.namespace).await?; + } + Ok(()) } } -fn versions_compatible(a: Version, b: Version) -> bool { - Version::new(a.major, a.minor, a.patch) == Version::new(b.major, b.minor, b.patch) -} - #[cfg(test)] mod tests { use super::*; @@ -1297,25 +1186,4 @@ mod tests { semver::Version::parse("0.7.0-alpha.1").unwrap() ) } - - #[test] - fn test_compatible_prerelease() { - let a = Version::parse("0.8.0").unwrap(); - let b = Version::parse("0.8.0-alpha.4").unwrap(); - assert!(versions_compatible(a, b)); - } - - #[test] - fn test_compatible_commits() { - let a = Version::parse("0.8.0-abcdef").unwrap(); - let b = Version::parse("0.8.0-fedcba").unwrap(); - assert!(versions_compatible(a, b)); - } - - #[test] - fn test_compatible_pre_and_build() { - let a = Version::parse("0.8.0-alpha.2").unwrap(); - let b = Version::parse("0.8.0-abcdef+abcdef").unwrap(); - assert!(versions_compatible(a, b)); - } } diff --git a/crates/fluvio-cluster/src/start/local.rs b/crates/fluvio-cluster/src/start/local.rs index f0b8b90b09..e607fad2ed 100644 --- a/crates/fluvio-cluster/src/start/local.rs +++ b/crates/fluvio-cluster/src/start/local.rs @@ -4,7 +4,6 @@ use std::fs::{File, create_dir_all}; use std::process::{Command, Stdio}; use std::time::Duration; use fluvio::{Fluvio, FluvioConfig}; -use k8_metadata_client::MetadataClient; use semver::Version; use derive_builder::Builder; @@ -28,6 +27,7 @@ use crate::check::{CheckResults, SysChartCheck}; use crate::check::render::render_check_progress; use super::constants::*; +use super::common::check_crd; pub static DEFAULT_DATA_DIR: Lazy> = Lazy::new(|| directories::BaseDirs::new().map(|it| it.home_dir().join(".fluvio/data"))); @@ -45,6 +45,10 @@ static DEFAULT_RUNNER_PATH: Lazy> = Lazy::new(|| std::env::curre #[derive(Builder, Debug)] #[builder(build_fn(private, name = "build_impl"))] pub struct LocalConfig { + /// Platform version + #[builder(setter(into))] + platform_version: Version, + /// Sets the application log directory. /// /// # Example @@ -209,8 +213,9 @@ impl LocalConfig { /// use semver::Version; /// let mut builder = LocalConfig::builder(Version::parse("0.7.0-alpha.1").unwrap()); /// ``` - pub fn builder(_platform_version: Version) -> LocalConfigBuilder { + pub fn builder(platform_version: Version) -> LocalConfigBuilder { let mut builder = LocalConfigBuilder::default(); + builder.platform_version(platform_version); if let Some(data_dir) = &*DEFAULT_DATA_DIR { builder.data_dir(data_dir); @@ -425,7 +430,9 @@ impl LocalInstaller { let client = load_and_share().map_err(K8InstallError::from)?; // before we do let's try make sure SPU are installed. - self.check_crd(client.clone()).await?; + check_crd(client.clone()) + .await + .map_err(K8InstallError::from)?; debug!("using log dir: {}", self.config.log_dir.display()); if !self.config.log_dir.exists() { @@ -458,24 +465,6 @@ impl LocalInstaller { }) } - // hack - async fn check_crd(&self, client: SharedK8Client) -> Result<(), LocalInstallError> { - for i in 0..100 { - println!("checking fluvio crd attempt: {}", i); - // check if spu is installed - if let Err(err) = client.retrieve_items::("default").await { - println!("problem retrieving fluvio crd {}", err); - println!("sleeping 1 seconds"); - sleep(Duration::from_secs(10)).await; - } else { - println!("fluvio crd installed"); - return Ok(()); - } - } - - Err(LocalInstallError::Other("Fluvio CRD not ready".to_string())) - } - /// Launches an SC on the local machine /// /// Returns the address of the SC if successful @@ -512,7 +501,9 @@ impl LocalInstaller { let cluster_config = FluvioConfig::new(&(*LOCAL_SC_ADDRESS)).with_tls(self.config.client_tls_policy.clone()); - if let Some(fluvio) = try_connect_to_sc(&cluster_config).await { + if let Some(fluvio) = + try_connect_to_sc(&cluster_config, &self.config.platform_version).await + { Ok(fluvio) } else { Err(LocalInstallError::SCServiceTimeout) diff --git a/crates/fluvio-cluster/src/start/mod.rs b/crates/fluvio-cluster/src/start/mod.rs index 7f389d54db..f70d46e759 100644 --- a/crates/fluvio-cluster/src/start/mod.rs +++ b/crates/fluvio-cluster/src/start/mod.rs @@ -10,6 +10,6 @@ mod constants { /// maximum time waiting for network check, DNS or network pub static MAX_SC_NETWORK_LOOP: Lazy = Lazy::new(|| { let var_value = env::var("FLV_CLUSTER_MAX_SC_NETWORK_LOOP").unwrap_or_default(); - var_value.parse().unwrap_or(10) + var_value.parse().unwrap_or(30) }); } diff --git a/crates/fluvio-controlplane-metadata/Cargo.toml b/crates/fluvio-controlplane-metadata/Cargo.toml index 3f02c3fe85..22fa7cf16b 100644 --- a/crates/fluvio-controlplane-metadata/Cargo.toml +++ b/crates/fluvio-controlplane-metadata/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "fluvio-controlplane-metadata" edition = "2018" -version = "0.10.1" +version = "0.10.2" authors = ["Fluvio Contributors "] description = "Fluvio metadata" repository = "https://github.com/infinyon/fluvio" diff --git a/crates/fluvio-controlplane-metadata/src/spu/status.rs b/crates/fluvio-controlplane-metadata/src/spu/status.rs index 48007740ba..10af448c0c 100644 --- a/crates/fluvio-controlplane-metadata/src/spu/status.rs +++ b/crates/fluvio-controlplane-metadata/src/spu/status.rs @@ -54,6 +54,10 @@ impl SpuStatus { self.resolution == SpuStatusResolution::Offline } + pub fn is_init(&self) -> bool { + self.resolution == SpuStatusResolution::Init + } + /// Set resolution to status to online pub fn set_online(&mut self) { self.resolution = SpuStatusResolution::Online; diff --git a/crates/fluvio-sc/Cargo.toml b/crates/fluvio-sc/Cargo.toml index 1ead4edfcd..cd760dcbc0 100644 --- a/crates/fluvio-sc/Cargo.toml +++ b/crates/fluvio-sc/Cargo.toml @@ -49,8 +49,8 @@ fluvio-types = { version = "0.2.0", path = "../fluvio-types", features = ["event fluvio-sc-schema = { version = "0.9.1", path = "../fluvio-sc-schema" } fluvio-stream-model = { version = "0.5.0", path = "../fluvio-stream-model" } fluvio-controlplane = { version = "0.8.0", path = "../fluvio-controlplane" } -fluvio-controlplane-metadata = { version = "0.10.1", features = ["k8", "serde"], path = "../fluvio-controlplane-metadata" } -fluvio-stream-dispatcher = { version = "0.6.0", path = "../fluvio-stream-dispatcher" } +fluvio-controlplane-metadata = { version = "0.10.2", features = ["k8", "serde"], path = "../fluvio-controlplane-metadata" } +fluvio-stream-dispatcher = { version = "0.6.3", path = "../fluvio-stream-dispatcher" } k8-client = { version = "5.1.5", optional = true } k8-metadata-client = { version = "3.0.0" } fluvio-protocol = { path = "../fluvio-protocol", version = "0.6" } diff --git a/crates/fluvio-sc/src/controllers/spus/actions.rs b/crates/fluvio-sc/src/controllers/spus/actions.rs index 3b96d976b6..cbacc256e2 100644 --- a/crates/fluvio-sc/src/controllers/spus/actions.rs +++ b/crates/fluvio-sc/src/controllers/spus/actions.rs @@ -11,13 +11,3 @@ pub struct SpuAction { pub id: SpuId, pub status: bool, } - -impl SpuAction { - pub fn up(id: SpuId) -> Self { - Self { id, status: true } - } - - pub fn down(id: SpuId) -> Self { - Self { id, status: false } - } -} diff --git a/crates/fluvio-sc/src/controllers/spus/controller.rs b/crates/fluvio-sc/src/controllers/spus/controller.rs index e1e584bdae..31a7e75966 100644 --- a/crates/fluvio-sc/src/controllers/spus/controller.rs +++ b/crates/fluvio-sc/src/controllers/spus/controller.rs @@ -1,74 +1,52 @@ //! //! # Spu Controller -use std::collections::HashMap; use std::time::Instant; use std::time::Duration; -use tracing::{debug, error, warn, info, instrument}; - -use async_channel::Receiver; +use tracing::{debug, error, instrument}; use fluvio_future::task::spawn; -use fluvio_types::SpuId; -use crate::stores::actions::WSAction; use crate::core::SharedContext; use crate::stores::StoreContext; use crate::stores::spu::*; -use super::SpuAction; - -struct SpuOnlineStatus { - online: bool, - // last time status was known - time: Instant, -} - -impl SpuOnlineStatus { - fn new() -> Self { - Self { - online: false, - time: Instant::now(), - } - } -} - /// Reconcile SPU health status with Meta data /// if SPU has not send heart beat within a period, it is considered down pub struct SpuController { spus: StoreContext, - health_receiver: Receiver, - status: HashMap, + health_check: SharedHealthCheck, } impl SpuController { pub fn start(ctx: SharedContext) { let controller = Self { spus: ctx.spus().clone(), - health_receiver: ctx.health().receiver(), - status: HashMap::new(), + health_check: ctx.health().clone(), }; debug!("starting spu controller"); spawn(async move { - controller.dispatch_loop().await; + controller.inner_loop().await; }); } #[instrument(skip(self))] - async fn dispatch_loop(mut self) { + async fn inner_loop(mut self) { use tokio::select; use fluvio_future::timer::sleep; - let mut listener = self.spus.change_listener(); + let mut spu_listener = self.spus.change_listener(); + let _ = spu_listener.wait_for_initial_sync().await; + + let mut health_listener = self.health_check.listener(); const HEALTH_DURATION: u64 = 90; let mut time_left = Duration::from_secs(HEALTH_DURATION); loop { self.sync_store().await; - let health_time = Instant::now(); debug!( "waiting on events, health check left: {} secs", @@ -76,27 +54,20 @@ impl SpuController { ); select! { - _ = listener.listen() => { - debug!("detected events in spu"); - listener.load_last(); + _ = spu_listener.listen() => { + debug!("detected events in spu store"); + spu_listener.load_last(); time_left -= health_time.elapsed(); + }, - health_msg = self.health_receiver.recv() => { - - match health_msg { - Ok(health) => { - debug!("received health message: {:?}",health); - self.send_spu_status(health).await; - }, - Err(err) => { - error!("error receiving health msg: {}",err); - } - } + _ = health_listener.listen() => { + debug!("heal check events"); + //health_listener.load_last(); time_left -= health_time.elapsed(); }, _ = sleep(time_left) => { - self.health_check().await; + // self.health_check().await; time_left = Duration::from_secs(HEALTH_DURATION); }, @@ -107,165 +78,40 @@ impl SpuController { /// sync spu status with store #[instrument(skip(self))] async fn sync_store(&mut self) { - use std::collections::HashSet; + // first get status values + let spus = self.spus.store().clone_values().await; - debug!("performing sync with spu store"); - // check if we need to sync spu and our health check cache - if self.spus.store().count().await as usize != self.status.len() { - let keys = self.spus.store().spu_ids().await; - let mut status_keys: HashSet = self.status.keys().copied().collect(); - debug!( - "syncing store before store: {} items, health status: {} items", - keys.len(), - status_keys.len() - ); - for spu_id in &keys { - if self.status.contains_key(spu_id) { - status_keys.remove(spu_id); - } else { - self.status.insert(*spu_id, SpuOnlineStatus::new()); - } - } + let mut changes = vec![]; + let health_read = self.health_check.read().await; - for spu_id in status_keys { - self.status.remove(&spu_id); - } + for mut spu in spus.into_iter() { + // check if we need to sync spu and our health check cache - assert_eq!(self.status.len(), keys.len()); - debug!("syncing store after status: {} items", self.status.len()); - } + let spu_id = spu.spec.id; - // check if any of spu are init, change to offline - let read_guard = self.spus.store().read().await; - - // Ignore needless_collect because we are reading from a guard that we want to drop ASAP - #[allow(clippy::needless_collect)] - let spu_names: Vec = read_guard - .values() - .filter_map(|spu| { - if spu.status.resolution == SpuStatusResolution::Init { - Some(spu.key.clone()) - } else { - None - } - }) - .collect(); - - drop(read_guard); - - for spu_name in spu_names.into_iter() { - if let Err(err) = self - .spus - .send(vec![WSAction::UpdateStatus(( - spu_name.clone(), - SpuStatus::offline(), - ))]) - .await - { - error!("error sending spu status: {}", err); - } else { - debug!("set spu: {} to offline", spu_name); - } - } - } - - async fn send_spu_status(&mut self, action: SpuAction) { - // first check if spu cache exists - if let Some(cache_status) = self.status.get_mut(&action.id) { - cache_status.time = Instant::now(); - cache_status.online = action.status; - - self.send_health_to_store(vec![action]).await; - } else { - warn!("not finding cache status: {}", action.id); - } - } - - /// check if any spu has done health check - #[instrument(skip(self))] - async fn health_check(&mut self) { - debug!("performing health check"); - let mut actions: Vec = vec![]; - for (id, status) in self.status.iter_mut() { - let elapsed_time = status.time.elapsed(); - if elapsed_time >= Duration::from_secs(70) { - info!( - id, - elapsed_sec = elapsed_time.as_secs(), - "setting spu to offline due to no health check", - ); - status.online = false; - status.time = Instant::now(); - actions.push(SpuAction::down(*id)); - } - } - - if !actions.is_empty() { - debug!("health check: {} spus needed to be offline", actions.len()); - self.send_health_to_store(actions).await; - } else { - debug!("health check: everything is up to date, no actions needed"); - } - } - - // send health status to store - async fn send_health_to_store(&mut self, actions: Vec) { - for action in actions.into_iter() { - if let Some(mut spu) = self.spus.store().get_by_id(action.id).await { - let mut update = false; - if action.status && spu.status.is_offline() { - spu.status.set_online(); - update = true; - } else if !action.status && spu.status.is_online() { - spu.status.set_offline(); - update = true; - } - - if update { - if let Err(err) = self - .spus - .send(vec![WSAction::UpdateStatus(( - spu.key_owned(), - spu.status.clone(), - ))]) - .await - { - error!("error sending spu status: {}", err); + if let Some(health_status) = health_read.get(&spu_id) { + if spu.status.is_init() || spu.status.is_online() != *health_status { + if *health_status { + spu.status.set_online(); } else { - debug!("send spu: {}, status: {} to store", action.id, spu.status); + spu.status.set_offline(); } - } else { - debug!("spu: {} health, no change", action.id); + debug!(id = spu.spec.id, status = %spu.status,"spu status changed"); + changes.push(spu); } - } else { - warn!("unknown spu id: {:?}", action); } } - } - /* - /// process requests related to SPU management - async fn process_request(&mut self, request: SpuChangeRequest) { - // process SPU action; update context with new actions - match self.spu_reducer.process_requests(request).await { - Ok(actions) => { - debug!("SPU Controller apply actions: {}", actions); - // send actions to kv - if actions.spus.len() > 0 { - for ws_action in actions.spus.into_iter() { - // log_on_err!(self.ws_service.update_spu(ws_action).await); - } - } - /* - if actions.conns.len() > 0 { - self.conn_manager.process_requests(actions.conns).await; - } - */ + drop(health_read); + + for updated_spu in changes.into_iter() { + let key = updated_spu.key; + let status = updated_spu.status; + if let Err(err) = self.spus.update_status(key, status).await { + error!("error updating status: {:#?}", err); } - Err(err) => error!("error generating spu actions from reducer: {}", err), } } - */ } /* diff --git a/crates/fluvio-sc/src/controllers/spus/mod.rs b/crates/fluvio-sc/src/controllers/spus/mod.rs index ad1fc441b0..33aeb24234 100644 --- a/crates/fluvio-sc/src/controllers/spus/mod.rs +++ b/crates/fluvio-sc/src/controllers/spus/mod.rs @@ -3,38 +3,3 @@ mod controller; pub use self::actions::*; pub use self::controller::*; -pub use channel::*; - -mod channel { - - use async_channel::{Sender, Receiver, bounded}; - use super::*; - - #[derive(Debug)] - pub struct SpuStatusChannel { - sender: Sender, - receiver: Receiver, - } - - impl SpuStatusChannel { - pub fn new() -> Self { - let (sender, receiver) = bounded(10); - - Self { sender, receiver } - } - - pub fn receiver(&self) -> Receiver { - self.receiver.clone() - } - - pub fn sender(&self) -> Sender { - self.sender.clone() - } - } - - impl Default for SpuStatusChannel { - fn default() -> Self { - Self::new() - } - } -} diff --git a/crates/fluvio-sc/src/core/context.rs b/crates/fluvio-sc/src/core/context.rs index 45a32663cc..e3f6af8fbd 100644 --- a/crates/fluvio-sc/src/core/context.rs +++ b/crates/fluvio-sc/src/core/context.rs @@ -11,7 +11,6 @@ use crate::stores::partition::*; use crate::stores::topic::*; use crate::stores::spg::*; use crate::stores::*; -use crate::controllers::spus::SpuStatusChannel; pub type SharedContext = Arc; @@ -23,7 +22,7 @@ pub struct Context { partitions: StoreContext, topics: StoreContext, spgs: StoreContext, - health: SpuStatusChannel, + health: SharedHealthCheck, config: ScConfig, } @@ -43,7 +42,7 @@ impl Context { partitions: StoreContext::new(), topics: StoreContext::new(), spgs: StoreContext::new(), - health: SpuStatusChannel::new(), + health: HealthCheck::shared(), config, } } @@ -68,7 +67,7 @@ impl Context { } /// spu health channel - pub fn health(&self) -> &SpuStatusChannel { + pub fn health(&self) -> &SharedHealthCheck { &self.health } diff --git a/crates/fluvio-sc/src/k8/controllers/spu_controller.rs b/crates/fluvio-sc/src/k8/controllers/spu_controller.rs index db857fc3cd..7a5a48058c 100644 --- a/crates/fluvio-sc/src/k8/controllers/spu_controller.rs +++ b/crates/fluvio-sc/src/k8/controllers/spu_controller.rs @@ -62,8 +62,8 @@ impl K8SpuController { loop { if let Err(err) = self.inner_loop().await { error!("error with inner loop: {:#?}", err); - debug!("sleeping 1 miniute to try again"); - sleep(Duration::from_secs(60)).await; + debug!("sleeping 10 seconds try again"); + sleep(Duration::from_secs(10)).await; } } } @@ -72,14 +72,17 @@ impl K8SpuController { use tokio::select; let mut service_listener = self.services.change_listener(); + let _ = service_listener.wait_for_initial_sync().await; + let mut spg_listener = self.groups.change_listener(); - let mut spu_listener = self.spus.change_listener(); + let _ = spg_listener.wait_for_initial_sync().await; - let mut service_init = false; - let mut spg_init = false; - let mut spu_init = false; + let mut spu_listener = self.spus.change_listener(); + let _ = spu_listener.wait_for_initial_sync().await; loop { + self.sync_spu().await?; + debug!("waiting events"); select! { @@ -99,19 +102,6 @@ impl K8SpuController { epoch, ); - - service_init = true; - if service_init && spg_init && spu_init { - self.sync_spu().await?; - } else { - - debug!( - service_init, - spg_init, - spu_init, - "not ready"); - - } }, _ = spg_listener.listen() => { @@ -127,20 +117,6 @@ impl K8SpuController { deletes.len(), epoch, ); - - - spg_init = true; - if service_init && spg_init && spu_init { - self.sync_spu().await?; - } else { - - debug!( - service_init, - spg_init, - spu_init, - "not ready"); - - } }, @@ -159,25 +135,8 @@ impl K8SpuController { epoch, ); - if !spu_init { - debug!("spu initialized"); - spu_init = true; - // first time sync - if service_init && spg_init && spu_init { - self.sync_spu().await?; - } else { - - debug!( - service_init, - spg_init, - spu_init, - "not ready"); - - } - } else { - debug!("spu was already initialized, ignoring"); - } + debug!("spu was already initialized, ignoring"); } @@ -187,12 +146,15 @@ impl K8SpuController { } } + #[instrument(skip(self))] /// synchronize change from spg to spu async fn sync_spu(&mut self) -> Result<(), ClientError> { // get all models let spg = self.groups.store().clone_values().await; let services = self.get_spu_services().await; + debug!(spg = spg.len(), services = services.len(), "starting sync"); + for group_item in spg.into_iter() { let spg_obj = SpuGroupObj::new(group_item); @@ -201,7 +163,7 @@ impl K8SpuController { for i in 0..replicas { let (spu_name, spu) = spg_obj.as_spu(i, &services); - debug!(id=i,spu=?spu); + debug!(id=i,spu=?spu,"applying spu"); self.spus .wait_action(&spu_name, WSAction::Apply(spu)) diff --git a/crates/fluvio-sc/src/services/private_api/private_server.rs b/crates/fluvio-sc/src/services/private_api/private_server.rs index 43f12f5062..62c01b7140 100644 --- a/crates/fluvio-sc/src/services/private_api/private_server.rs +++ b/crates/fluvio-sc/src/services/private_api/private_server.rs @@ -1,4 +1,5 @@ use fluvio_controlplane_metadata::partition::Replica; +use fluvio_service::ConnectInfo; use std::sync::Arc; use std::io::Error as IoError; use std::io::ErrorKind; @@ -8,7 +9,6 @@ use std::time::Instant; use tracing::error; use tracing::{debug, info, instrument}; use async_trait::async_trait; -use async_channel::Sender; use futures_util::stream::Stream; use fluvio_types::SpuId; @@ -23,10 +23,10 @@ use fluvio_controlplane::{ use fluvio_controlplane_metadata::message::{ReplicaMsg, Message, SpuMsg}; use crate::core::SharedContext; +use crate::stores::spu::SharedHealthCheck; use crate::stores::{K8ChangeListener}; use crate::stores::partition::{PartitionSpec, PartitionStatus, PartitionResolution}; use crate::stores::spu::SpuSpec; -use crate::controllers::spus::SpuAction; use crate::stores::actions::WSAction; const HEALTH_DURATION: u64 = 30; @@ -45,10 +45,12 @@ impl FlvService for ScInternalService { type Context = SharedContext; type Request = InternalScRequest; + #[instrument(skip(self, context))] async fn respond( self: Arc, context: SharedContext, socket: FluvioSocket, + _connection: ConnectInfo, ) -> Result<(), SocketError> { let (mut sink, mut stream) = socket.split(); let mut api_stream = stream.api_stream::(); @@ -81,51 +83,32 @@ impl FlvService for ScInternalService { info!(spu_id, "SPU connected"); - let health_sender = context.health().sender(); + let health_check = context.health().clone(); - health_sender - .send(SpuAction::up(spu_id)) - .await - .map_err(|err| { - IoError::new( - ErrorKind::BrokenPipe, - format!("unable to send health status: {}", err), - ) - })?; - debug!("send connection health up"); + health_check.update(spu_id, true).await; if let Err(err) = - dispatch_loop(context, spu_id, api_stream, sink, health_sender.clone()).await + dispatch_loop(context, spu_id, api_stream, sink, health_check.clone()).await { error!("error with SPU <{}>, error: {}", spu_id, err); } info!(spu_id, "SPU terminated"); - health_sender - .send(SpuAction::down(spu_id)) - .await - .map_err(|err| { - IoError::new( - ErrorKind::BrokenPipe, - format!("unable to send health status: {}", err), - ) - })?; - - debug!("send connection health down"); + health_check.update(spu_id, false).await; Ok(()) } } // perform internal dispatch -#[instrument(name = "ScInternalService", skip(context, api_stream, health_sender))] +#[instrument(name = "ScInternalService", skip(context, api_stream, health_check))] async fn dispatch_loop( context: SharedContext, spu_id: SpuId, mut api_stream: impl Stream> + Unpin, mut sink: FluvioSink, - health_sender: Sender, + health_check: SharedHealthCheck, ) -> Result<(), SocketError> { let mut time_left = Duration::from_secs(HEALTH_DURATION); @@ -153,15 +136,7 @@ async fn dispatch_loop( _ = sleep(time_left) => { debug!("send spu health up"); - health_sender - .send(SpuAction::up(spu_id)) - .await - .map_err(|err| { - IoError::new( - ErrorKind::BrokenPipe, - format!("unable to send health status: {}", err), - ) - })?; + health_check.update(spu_id,true).await; time_left = Duration::from_secs(HEALTH_DURATION); }, diff --git a/crates/fluvio-sc/src/services/public_api/public_server.rs b/crates/fluvio-sc/src/services/public_api/public_server.rs index 018580b3c6..41843e0819 100644 --- a/crates/fluvio-sc/src/services/public_api/public_server.rs +++ b/crates/fluvio-sc/src/services/public_api/public_server.rs @@ -11,6 +11,7 @@ use std::marker::PhantomData; use std::fmt::Debug; use std::io::Error as IoError; +use fluvio_service::ConnectInfo; use tracing::instrument; use async_trait::async_trait; @@ -47,11 +48,12 @@ where type Context = AuthGlobalContext; type Request = AdminPublicRequest; - #[instrument(skip(self, ctx, socket))] + #[instrument(skip(self, ctx))] async fn respond( self: Arc, ctx: Self::Context, mut socket: FluvioSocket, + _connection: ConnectInfo, ) -> Result<(), SocketError> { let auth_context = ctx .auth diff --git a/crates/fluvio-sc/src/services/public_api/spg/create.rs b/crates/fluvio-sc/src/services/public_api/spg/create.rs index 56ebf998d6..89f363ecb9 100644 --- a/crates/fluvio-sc/src/services/public_api/spg/create.rs +++ b/crates/fluvio-sc/src/services/public_api/spg/create.rs @@ -5,7 +5,9 @@ //! use std::io::{Error, ErrorKind}; +use std::time::Duration; +use fluvio_stream_dispatcher::actions::WSAction; use tracing::{debug, trace, instrument}; use dataplane::ErrorCode; @@ -53,7 +55,15 @@ pub async fn handle_create_spu_group_request( /// Process custom spu, converts spu spec to K8 and sends to KV store #[instrument(skip(ctx, name, spg_spec))] async fn process_custom_spu_request(ctx: &Context, name: String, spg_spec: SpuGroupSpec) -> Status { - if let Err(err) = ctx.spgs().create_spec(name.clone(), spg_spec).await { + if let Err(err) = ctx + .spgs() + .wait_action_with_timeout( + &name, + WSAction::UpdateSpec((name.clone(), spg_spec)), + Duration::from_secs(120), // spg may take long to create + ) + .await + { let error = Some(err.to_string()); Status::new(name, ErrorCode::SpuError, error) } else { diff --git a/crates/fluvio-sc/src/stores/spu.rs b/crates/fluvio-sc/src/stores/spu.rs index 6655c582a1..2650843eb8 100644 --- a/crates/fluvio-sc/src/stores/spu.rs +++ b/crates/fluvio-sc/src/stores/spu.rs @@ -1,6 +1,7 @@ pub use fluvio_controlplane_metadata::spu::store::*; pub use fluvio_controlplane_metadata::spu::*; pub use fluvio_controlplane_metadata::store::k8::K8MetaItem; +pub use health_check::*; pub type SpuAdminMd = SpuMetadata; pub type SpuAdminStore = SpuLocalStore; @@ -24,19 +25,57 @@ pub async fn is_conflict( } mod health_check { - use std::{collections::HashMap, ops::Deref}; + use std::{collections::HashMap, ops::Deref, sync::Arc}; + use tracing::instrument; use async_lock::RwLock; - use fluvio_types::SpuId; + + use fluvio_types::{ + SpuId, + event::offsets::{OffsetChangeListener, OffsetPublisher}, + }; + + pub type SharedHealthCheck = Arc; /// Stores Curret Health Check Data - pub struct HealthCheck(RwLock>); + #[derive(Debug)] + pub struct HealthCheck { + health: RwLock>, + event: Arc, + } impl Deref for HealthCheck { type Target = RwLock>; fn deref(&self) -> &Self::Target { - &self.0 + &self.health + } + } + + impl HealthCheck { + pub fn shared() -> SharedHealthCheck { + Arc::new(Self::new()) + } + + fn new() -> Self { + Self { + health: RwLock::new(HashMap::new()), + event: OffsetPublisher::shared(0), + } + } + + pub fn listener(&self) -> OffsetChangeListener { + self.event.change_listner() + } + + /// update health check + #[instrument(skip(self))] + pub async fn update(&self, spu: SpuId, value: bool) { + let mut write = self.health.write().await; + write.insert(spu, value); + drop(write); + + self.event.update_increment(); } } } diff --git a/crates/fluvio-service/src/server.rs b/crates/fluvio-service/src/server.rs index 1c4911526c..cd81d83f7c 100644 --- a/crates/fluvio-service/src/server.rs +++ b/crates/fluvio-service/src/server.rs @@ -1,3 +1,4 @@ +use std::fmt; use std::fmt::Debug; use std::io::Error as IoError; use std::marker::PhantomData; @@ -38,6 +39,12 @@ impl SocketBuilder for DefaultSocketBuilder { } } +#[derive(Debug)] +pub struct ConnectInfo { + host: String, + peer: String, +} + /// Trait for responding to kf service /// Request -> Response is type specific /// Each response is responsible for sending back to socket @@ -51,11 +58,10 @@ pub trait FlvService { self: Arc, context: Self::Context, socket: FluvioSocket, + connection: ConnectInfo, ) -> Result<(), SocketError>; } -/// Transform Service into Futures 01 -#[derive(Debug)] pub struct InnerFlvApiServer { req: PhantomData, api: PhantomData, @@ -65,6 +71,12 @@ pub struct InnerFlvApiServer { builder: T, } +impl fmt::Debug for InnerFlvApiServer { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "ApiServer({})", self.addr) + } +} + impl InnerFlvApiServer where C: Clone, @@ -120,7 +132,7 @@ where } } - #[instrument(skip(self, listener, shutdown), fields(address = &*self.addr))] + #[instrument(skip(listener, shutdown))] async fn event_loop(self, listener: TcpListener, shutdown: Arc) { use tokio::select; @@ -146,7 +158,7 @@ where } /// process incoming request, for each request, we create async task for serving - #[instrument(skip(self, incoming))] + #[instrument(skip(incoming))] fn serve_incoming(&self, incoming: Option>) { if let Some(incoming_stream) = incoming { match incoming_stream { @@ -154,28 +166,43 @@ where let context = self.context.clone(); let service = self.service.clone(); let builder = self.builder.clone(); + let host = self.addr.clone(); let ft = async move { let address = stream .peer_addr() .map(|addr| addr.to_string()) .unwrap_or_else(|_| "".to_owned()); - info!(peer = &*address, "new peer connection"); + + let peer = address.to_string(); + + info!(server = %host,%peer, "new peer connection"); let socket_res = builder.to_socket(stream); match socket_res.await { Ok(socket) => { - if let Err(err) = service.respond(context.clone(), socket).await { + let connection_info = ConnectInfo { + peer: peer.clone(), + host: host.clone(), + }; + + if let Err(err) = service + .respond(context.clone(), socket, connection_info) + .await + { error!( - "error handling stream: {}, shutdown on: {}", - err, address + "error handling stream: {}, shutdown on: {} from: {}", + err, host, address, ); } else { - info!(peer = &*address, "connection terminated"); + info!(%host,%peer, "connection terminated"); } } Err(err) => { - error!("error on tls handshake: {}, addr: {}", err, address); + error!( + "error on tls handshake: {}, on: {} from: addr: {}", + err, host, peer + ); } } }; diff --git a/crates/fluvio-service/src/test_request.rs b/crates/fluvio-service/src/test_request.rs index 6af82d2530..e160de0ff6 100644 --- a/crates/fluvio-service/src/test_request.rs +++ b/crates/fluvio-service/src/test_request.rs @@ -18,7 +18,7 @@ use fluvio_socket::FluvioSocket; use crate::api_loop; use crate::call_service; -use crate::FlvService; +use crate::{FlvService, ConnectInfo}; #[repr(u16)] #[derive(PartialEq, Debug, Encoder, Decoder, Clone, Copy)] @@ -132,6 +132,7 @@ impl FlvService for TestService { self: Arc, _context: Self::Context, socket: FluvioSocket, + _connection: ConnectInfo, ) -> Result<(), SocketError> { let (mut sink, mut stream) = socket.split(); let mut api_stream = stream.api_stream::(); diff --git a/crates/fluvio-socket/src/multiplexing.rs b/crates/fluvio-socket/src/multiplexing.rs index 4ee2f636f0..1dab510ad0 100644 --- a/crates/fluvio-socket/src/multiplexing.rs +++ b/crates/fluvio-socket/src/multiplexing.rs @@ -127,7 +127,7 @@ impl MultiplexerSocket { use std::env; let var_value = env::var("FLV_SOCKET_WAIT").unwrap_or_default(); - let wait_time: u64 = var_value.parse().unwrap_or(10); + let wait_time: u64 = var_value.parse().unwrap_or(300); // match TCP socket timeout wait_time }); diff --git a/crates/fluvio-spu/Cargo.toml b/crates/fluvio-spu/Cargo.toml index d582a4fe6c..40b234e47b 100644 --- a/crates/fluvio-spu/Cargo.toml +++ b/crates/fluvio-spu/Cargo.toml @@ -56,7 +56,7 @@ dataplane = { version = "0.6.0", path = "../fluvio-dataplane-protocol", package fluvio-service = { path = "../fluvio-service", version = "0.0.0" } flv-tls-proxy = { version = "0.5.0" } flv-util = { version = "0.5.0" } -fluvio-future = { version = "0.3.8", features = ["subscriber", "openssl_tls", "zero_copy"] } +fluvio-future = { version = "0.3.9", features = ["subscriber", "openssl_tls", "zero_copy"] } [dev-dependencies] once_cell = "1.5.2" diff --git a/crates/fluvio-spu/src/control_plane/dispatcher.rs b/crates/fluvio-spu/src/control_plane/dispatcher.rs index d906368ba1..c9bd37660b 100644 --- a/crates/fluvio-spu/src/control_plane/dispatcher.rs +++ b/crates/fluvio-spu/src/control_plane/dispatcher.rs @@ -128,7 +128,7 @@ impl ScDispatcher { let mut status_timer = Timer::interval(MIN_SC_SINK_TIME); loop { - debug!("waiting"); + trace!("waiting"); select! { diff --git a/crates/fluvio-spu/src/services/internal/service_impl.rs b/crates/fluvio-spu/src/services/internal/service_impl.rs index 191058e97d..4beda427c0 100644 --- a/crates/fluvio-spu/src/services/internal/service_impl.rs +++ b/crates/fluvio-spu/src/services/internal/service_impl.rs @@ -1,6 +1,8 @@ use std::sync::Arc; use async_trait::async_trait; +use fluvio_service::ConnectInfo; +use tracing::instrument; use tracing::{debug, warn}; use fluvio_service::{wait_for_request, FlvService}; @@ -26,10 +28,12 @@ impl FlvService for InternalService { type Context = DefaultSharedGlobalContext; type Request = SpuPeerRequest; + #[instrument(skip(self, ctx))] async fn respond( self: Arc, ctx: DefaultSharedGlobalContext, socket: FluvioSocket, + _connection: ConnectInfo, ) -> Result<(), SocketError> { let (mut sink, mut stream) = socket.split(); let mut api_stream = stream.api_stream::(); diff --git a/crates/fluvio-spu/src/services/public/service_impl.rs b/crates/fluvio-spu/src/services/public/service_impl.rs index 70ba349d8a..0c6076fecf 100644 --- a/crates/fluvio-spu/src/services/public/service_impl.rs +++ b/crates/fluvio-spu/src/services/public/service_impl.rs @@ -1,5 +1,6 @@ use std::sync::Arc; +use fluvio_service::ConnectInfo; use tracing::{debug, trace, instrument}; use async_trait::async_trait; use futures_util::stream::StreamExt; @@ -38,6 +39,7 @@ impl FlvService for PublicService { self: Arc, context: DefaultSharedGlobalContext, socket: FluvioSocket, + _connection: ConnectInfo, ) -> Result<(), SocketError> { let (sink, mut stream) = socket.split(); diff --git a/crates/fluvio-stream-dispatcher/Cargo.toml b/crates/fluvio-stream-dispatcher/Cargo.toml index db054fcd87..43dd44834c 100644 --- a/crates/fluvio-stream-dispatcher/Cargo.toml +++ b/crates/fluvio-stream-dispatcher/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "fluvio-stream-dispatcher" edition = "2018" -version = "0.6.2" +version = "0.6.3" authors = ["Fluvio Contributors "] description = "Fluvio Event Stream access" repository = "https://github.com/infinyon/fluvio" diff --git a/crates/fluvio-stream-dispatcher/src/dispatcher/k8_dispatcher.rs b/crates/fluvio-stream-dispatcher/src/dispatcher/k8_dispatcher.rs index b67fcbf470..0d72fd8c78 100644 --- a/crates/fluvio-stream-dispatcher/src/dispatcher/k8_dispatcher.rs +++ b/crates/fluvio-stream-dispatcher/src/dispatcher/k8_dispatcher.rs @@ -101,25 +101,24 @@ where async fn outer_loop(mut self) { loop { debug!("starting rconcilation loop"); - self.reconcillation_loop().await; + if let Err(err) = self.reconcillation_loop().await { + error!( + "error with reconcillation loop: {:#?}, sleep 10 seconds", + err + ); + sleep(Duration::from_secs(10)).await; + } } } /// /// Main Event Loop - async fn reconcillation_loop(&mut self) { + async fn reconcillation_loop(&mut self) -> Result<(), IoError> { use tokio::select; debug!("begin new reconcillation loop"); - let mut resume_stream: Option = None; - // retrieve all items from K8 store first - match self.retrieve_all_k8_items().await { - Ok(items) => { - resume_stream = Some(items); - } - Err(err) => error!("cannot retrieve K8 store objects: {}", err), - }; + let resume_stream = Some(self.retrieve_all_k8_items().await?); let client = self.client.clone(); @@ -179,6 +178,8 @@ where } } + + Ok(()) } /// diff --git a/crates/fluvio-stream-dispatcher/src/store/mod.rs b/crates/fluvio-stream-dispatcher/src/store/mod.rs index 11f940ff2c..3579985e19 100644 --- a/crates/fluvio-stream-dispatcher/src/store/mod.rs +++ b/crates/fluvio-stream-dispatcher/src/store/mod.rs @@ -196,15 +196,29 @@ mod context { } } + /// Wait for action to finish with default duration + pub async fn wait_action( + &self, + key: &S::IndexKey, + action: WSAction, + ) -> Result, IoError> + where + S::IndexKey: Display, + { + self.wait_action_with_timeout(key, action, Duration::from_secs(*MAX_WAIT_TIME)) + .await + } + /// Wait for action to finish. There is no guarantee that the status valus has been applied. /// Only that status has been changed. /// /// This should only used in the imperative code such as API Server where confirmation is needed. /// Controller should only use Action. - pub async fn wait_action( + pub async fn wait_action_with_timeout( &self, key: &S::IndexKey, action: WSAction, + timeout: Duration, ) -> Result, IoError> where S::IndexKey: Display, @@ -214,7 +228,7 @@ mod context { let current_value = self.store.value(key).await; let mut spec_listener = self.change_listener(); - let mut timer = sleep(Duration::from_secs(*MAX_WAIT_TIME)); + let mut timer = sleep(timeout); match self.sender.send(action).await { Ok(_) => loop { diff --git a/crates/fluvio-stream-model/src/store/dual_store.rs b/crates/fluvio-stream-model/src/store/dual_store.rs index 809c846cd2..4f1f542eeb 100644 --- a/crates/fluvio-stream-model/src/store/dual_store.rs +++ b/crates/fluvio-stream-model/src/store/dual_store.rs @@ -391,10 +391,12 @@ mod listener { use std::fmt; use std::sync::Arc; - use tracing::trace; + use tracing::{trace, debug, instrument}; use crate::store::event::EventPublisher; - use crate::store::{ChangeFlag, FULL_FILTER, SPEC_FILTER, STATUS_FILTER, META_FILTER}; + use crate::store::{ + ChangeFlag, FULL_FILTER, META_FILTER, MetadataStoreObject, SPEC_FILTER, STATUS_FILTER, + }; use super::{LocalStore, Spec, MetadataItem, MetadataChanges}; @@ -534,6 +536,19 @@ mod listener { self.set_last_change(changes.epoch); changes } + + /// wait for initial loading and return all as expected + #[instrument()] + pub async fn wait_for_initial_sync(&mut self) -> Vec> { + debug!("waiting"); + self.listen().await; + + let changes = self.sync_changes().await; + assert!(changes.is_sync_all()); + + debug!("finished initial sync"); + changes.parts().0 + } } } diff --git a/crates/fluvio-test/src/tests/smoke/consume.rs b/crates/fluvio-test/src/tests/smoke/consume.rs index 97e5d2aaff..6cfb9b98b2 100644 --- a/crates/fluvio-test/src/tests/smoke/consume.rs +++ b/crates/fluvio-test/src/tests/smoke/consume.rs @@ -10,7 +10,7 @@ use tracing::{info, debug}; use futures_lite::stream::StreamExt; use fluvio_test_util::test_runner::test_driver::{TestDriver, TestDriverType}; -use fluvio::Offset; +use fluvio::{Offset}; use fluvio_command::CommandExt; use crate::get_binary; @@ -84,7 +84,6 @@ async fn validate_consume_message_api( ); let mut lock = test_driver.write().await; - let consumer = lock.get_consumer(&topic_name).await; drop(lock); @@ -194,6 +193,7 @@ async fn validate_consume_message_api( println!("replication status verified"); println!("performing 2nd fetch check. waiting 5 seconds"); + // do complete fetch, since producer has completed, we should retrieve everything sleep(Duration::from_secs(5)).await; @@ -204,7 +204,6 @@ async fn validate_consume_message_api( ); let mut lock = test_driver.write().await; - let consumer = lock.get_consumer(&topic_name).await; drop(lock); diff --git a/dev-tools/sc-pod-log.sh b/dev-tools/sc-pod-log.sh index b930a8ce30..424782a241 100755 --- a/dev-tools/sc-pod-log.sh +++ b/dev-tools/sc-pod-log.sh @@ -1,2 +1,3 @@ #!/bin/bash -kubectl logs -f `(kubectl get pod -l app=fluvio-sc -o jsonpath="{.items[0].metadata.name}")` \ No newline at end of file + +kubectl logs "$@" `(kubectl get pod -l app=fluvio-sc -o jsonpath="{.items[0].metadata.name}")` \ No newline at end of file diff --git a/k8-util/cluster/reset-k3d.sh b/k8-util/cluster/reset-k3d.sh index 161bc92532..8563cc2f70 100755 --- a/k8-util/cluster/reset-k3d.sh +++ b/k8-util/cluster/reset-k3d.sh @@ -3,4 +3,4 @@ # this defaults to docker and assume you have have sudo access set -e k3d cluster delete fluvio -k3d cluster create fluvio \ No newline at end of file +k3d cluster create fluvio --no-lb --no-hostip --no-rollback \ No newline at end of file diff --git a/k8-util/helm/Makefile b/k8-util/helm/Makefile index 57028b1b21..170950539a 100644 --- a/k8-util/helm/Makefile +++ b/k8-util/helm/Makefile @@ -132,12 +132,12 @@ clean: rm -rf pkg_sys; rm -rf pkg_app; -pkg_sys: fluvio-sys/*.* +pkg_sys: fluvio-sys/*.* ../../VERSION rm -rf pkg_sys; mkdir -p pkg_sys; helm package ./fluvio-sys --app-version $(APP_VERSION) -d pkg_sys -pkg_app: fluvio-app/*.* +pkg_app: fluvio-app/*.* ../../VERSION rm -rf pkg_app mkdir -p pkg_app helm package ./fluvio-app --app-version $(APP_VERSION) -d pkg_app diff --git a/tests/upgrade-test.sh b/tests/upgrade-test.sh index 7714906999..ca6c51b09d 100755 --- a/tests/upgrade-test.sh +++ b/tests/upgrade-test.sh @@ -15,7 +15,7 @@ # If DEBUG env var is set, the bash session will be extra verbose # If USE_LATEST is set, cluster will upgrade as if in CI mode, but without the pausing -set -e +set -E # On Mac, use 'greadlink' instead of 'readlink' if [[ "$(uname)" == "Darwin" ]]; then @@ -132,7 +132,7 @@ function validate_upgrade_cluster_to_prerelease() { $FLUVIO_BIN_ABS_PATH cluster upgrade --sys $FLUVIO_BIN_ABS_PATH cluster upgrade --image-version latest echo "Wait for SPU to be upgraded. sleeping 1 minute" - sleep 60 + sleep 10 else echo "Test local image v${PRERELEASE}" TARGET_VERSION=${PRERELEASE::-41} @@ -147,29 +147,25 @@ function validate_upgrade_cluster_to_prerelease() { kubectl get pods kubectl get pod -l app=fluvio-sc -o yaml echo "Wait for SPU to be upgraded. sleeping 1 minute" - sleep 60 + sleep 10 fi popd - ci_check; - # Validate that the development version output matches the expected version from installer output $FLUVIO_BIN_ABS_PATH version validate_cli_version $FLUVIO_BIN_ABS_PATH $TARGET_VERSION validate_platform_version $FLUVIO_BIN_ABS_PATH $TARGET_VERSION - ci_check; echo "Create test topic: ${PRERELEASE_TOPIC}" $FLUVIO_BIN_ABS_PATH topic create ${PRERELEASE_TOPIC} - ci_check; cat data2.txt.tmp | $FLUVIO_BIN_ABS_PATH produce ${PRERELEASE_TOPIC} - ci_check; + echo "Validate test data w/ v${TARGET_VERSION} CLI matches expected data AFTER upgrading cluster + CLI to v${TARGET_VERSION}" $FLUVIO_BIN_ABS_PATH consume -B -d ${PRERELEASE_TOPIC} 2>/dev/null | tee output.txt.tmp - ci_check; + if cat output.txt.tmp | shasum -c prerelease-cli-prerelease-topic.checksum; then echo "${PRERELEASE_TOPIC} topic validated with v${TARGET_VERSION} CLI" @@ -181,11 +177,11 @@ function validate_upgrade_cluster_to_prerelease() { # Exercise older topics cat data2.txt.tmp | $FLUVIO_BIN_ABS_PATH produce ${STABLE_TOPIC} - ci_check; + echo "Validate v${STABLE} test data w/ ${TARGET_VERSION} CLI matches expected data AFTER upgrading cluster + CLI to v${TARGET_VERSION}" $FLUVIO_BIN_ABS_PATH consume -B -d ${STABLE_TOPIC} | tee output.txt.tmp - ci_check; + if cat output.txt.tmp | shasum -c prerelease-cli-stable-topic.checksum; then echo "${STABLE_TOPIC} topic validated with v${TARGET_VERSION} CLI" @@ -255,6 +251,7 @@ function create_test_data() { echo "Create the baseline file #${BASE}" local RANDOM_DATA=$(shuf -zer -n${TEST_DATA_BYTES} {A..Z} {a..z} {0..9}) echo ${RANDOM_DATA} | tee -a data${BASE}.txt.tmp + date done # Test stable cli against stable topic From debf178b71434a7c1302f78d81d619474fc02176 Mon Sep 17 00:00:00 2001 From: Sehyo Chang Date: Sun, 29 Aug 2021 06:51:19 +0000 Subject: [PATCH 15/18] improve upgrade test (#1528) * Fix hourly test by using right image argument * Remove retry logic in dev test --- .github/workflows/cd_dev.yaml | 15 ++++++++------- .github/workflows/hourly.yml | 35 +++++++++++++++++++++++++++++++++-- tests/longevity-producer.sh | 2 +- 3 files changed, 42 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cd_dev.yaml b/.github/workflows/cd_dev.yaml index a6437ca68c..6ea20d1274 100644 --- a/.github/workflows/cd_dev.yaml +++ b/.github/workflows/cd_dev.yaml @@ -48,8 +48,8 @@ jobs: - name: Install Fluvio CLI run: curl -fsS https://packages.fluvio.io/v1/install.sh | VERSION=latest bash - name: Set up K3d for Ubuntu - uses: nolar/setup-k3d-k3s@v1 if: ${{ matrix.os == 'ubuntu-latest' }} + uses: nolar/setup-k3d-k3s@v1 - name: Set up K8 for ubuntu(kind) if: ${{ matrix.os == 'ubuntu-latest' }} run: ./k8-util/cluster/reset-k3d.sh @@ -57,11 +57,10 @@ jobs: if: ${{ matrix.os == 'macos-latest' }} run: ./k8-util/cluster/start-minikube-mac.sh - name: Create Fluvio cluster and run E2E Test - uses: nick-invision/retry@v2 - with: - timeout_minutes: 7 - max_attempts: 3 - command: | + env: + FLV_DISPATCHER_WAIT: 300 + timeout-minutes: 5 + run: | export PATH=~/.fluvio/bin:$PATH if [[ ${{ matrix.cluster_type }} == 'local' ]]; then echo "Installing local cluster" @@ -115,10 +114,12 @@ jobs: FLV_SOCKET_WAIT: 600 steps: - uses: actions/checkout@v2 - - uses: nolar/setup-k3d-k3s@v1 + - name: Setup K3d + run: curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash - name: Run upgrade test env: TEST_DATA_BYTES: 10000 + FLV_DISPATCHER_WAIT: 300 uses: nick-invision/retry@v2 with: timeout_minutes: 15 diff --git a/.github/workflows/hourly.yml b/.github/workflows/hourly.yml index 82b0362ca0..8910819751 100644 --- a/.github/workflows/hourly.yml +++ b/.github/workflows/hourly.yml @@ -6,6 +6,8 @@ permissions: on: schedule: - cron: '0 * * * *' +# pull_request: +# branches: [master] workflow_dispatch: jobs: longevity: @@ -26,13 +28,42 @@ jobs: # If the match, then we've already run a test on this build. Skip this run # If they don't match, then let's run the test - - uses: nolar/setup-k3d-k3s@v1 - + - name: Setup K3d + run: curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash + - name: Create K3d cluster + run: | + ./k8-util/cluster/reset-k3d.sh - name: Install Fluvio CLI run: curl -fsS https://packages.fluvio.io/v1/install.sh | VERSION=latest bash - name: Run longevity test + env: + FLV_DISPATCHER_WAIT: 300 run: make longevity-producer-test + - name: Save logs + if: failure() + run: | + date + uname -a + helm list + kubectl get crd + kubectl get spu + kubectl get partitions + kubectl get statefulset + kubectl get pvc + kubectl get pods + kubectl get svc + kubectl get spg + kubectl logs fluvio-spg-main-0 > /tmp/k8_${{ matrix.run }}_spu0.log || true + kubectl logs fluvio-spg-main-1 > /tmp/k8_${{ matrix.run }}_spu1.log || true + ./dev-tools/sc-pod-log.sh > /tmp/k8_${{ matrix.run }}_sc.log || true + - name: Upload logs + timeout-minutes: 5 + if: failure() + uses: actions/upload-artifact@v2 + with: + name: k8_${{ matrix.run }}_log + path: /tmp/k8_*.log # Uncomment when test is more stable #- name: Slack Notification diff --git a/tests/longevity-producer.sh b/tests/longevity-producer.sh index 23218f16a3..9cef9106b1 100755 --- a/tests/longevity-producer.sh +++ b/tests/longevity-producer.sh @@ -24,7 +24,7 @@ readonly FLUVIO_BIN=~/.fluvio/bin/fluvio function setup() { # Start a cluster - $FLUVIO_BIN cluster start + $FLUVIO_BIN cluster start --image-version latest # Create a topic $FLUVIO_BIN topic create $NEW_TOPIC_NAME || true From e1743f1b88a14436a23f91d4cddb10a659fec2ee Mon Sep 17 00:00:00 2001 From: Sehyo Chang Date: Sun, 29 Aug 2021 17:01:25 +0000 Subject: [PATCH 16/18] Create stale.yml (#1530) from Github suggestion --- .github/workflows/stale.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000000..cd501bcd72 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,22 @@ +name: Mark stale issues and pull requests + +on: + schedule: + - cron: '16 11 * * *' + +jobs: + stale: + + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + + steps: + - uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: 'Stale issue message' + stale-pr-message: 'Stale pull request message' + stale-issue-label: 'no-issue-activity' + stale-pr-label: 'no-pr-activity' From 4c51636f97bb5e65596b8968f678db3103265fd5 Mon Sep 17 00:00:00 2001 From: Nick Mosher Date: Sun, 29 Aug 2021 18:04:31 +0000 Subject: [PATCH 17/18] Cleanup fluvio service streams (#1531) Cleanup in `fluvio-service` --- Cargo.lock | 2 +- .../fluvio-sc/src/services/private_api/mod.rs | 4 +- .../services/private_api/private_server.rs | 4 +- .../fluvio-sc/src/services/public_api/mod.rs | 4 +- .../src/services/public_api/public_server.rs | 8 +- .../src/services/public_api/watch.rs | 8 +- crates/fluvio-service/src/server.rs | 216 ++++++------------ crates/fluvio-service/src/test_request.rs | 6 +- .../fluvio-spu/src/services/internal/mod.rs | 6 +- .../src/services/internal/service_impl.rs | 4 +- crates/fluvio-spu/src/services/public/mod.rs | 6 +- .../src/services/public/service_impl.rs | 10 +- .../src/services/public/stream_fetch.rs | 6 +- crates/fluvio-types/Cargo.toml | 2 +- crates/fluvio-types/src/event.rs | 11 +- 15 files changed, 116 insertions(+), 181 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4d4eea0533..0233dba939 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2003,7 +2003,7 @@ dependencies = [ [[package]] name = "fluvio-types" -version = "0.2.4" +version = "0.2.5" dependencies = [ "event-listener", "fluvio-future", diff --git a/crates/fluvio-sc/src/services/private_api/mod.rs b/crates/fluvio-sc/src/services/private_api/mod.rs index 56867317f2..6637c505d4 100644 --- a/crates/fluvio-sc/src/services/private_api/mod.rs +++ b/crates/fluvio-sc/src/services/private_api/mod.rs @@ -4,7 +4,7 @@ use tracing::info; use tracing::instrument; use private_server::ScInternalService; -use fluvio_service::FlvApiServer; +use fluvio_service::FluvioApiServer; use crate::core::SharedContext; @@ -18,6 +18,6 @@ pub fn start_internal_server(ctx: SharedContext) { info!("starting internal services"); let addr = ctx.config().private_endpoint.clone(); - let server = FlvApiServer::new(addr, ctx, ScInternalService::new()); + let server = FluvioApiServer::new(addr, ctx, ScInternalService::new()); server.run(); } diff --git a/crates/fluvio-sc/src/services/private_api/private_server.rs b/crates/fluvio-sc/src/services/private_api/private_server.rs index 62c01b7140..00f53cbbe4 100644 --- a/crates/fluvio-sc/src/services/private_api/private_server.rs +++ b/crates/fluvio-sc/src/services/private_api/private_server.rs @@ -14,7 +14,7 @@ use futures_util::stream::Stream; use fluvio_types::SpuId; use dataplane::api::RequestMessage; use fluvio_controlplane_metadata::spu::store::SpuLocalStorePolicy; -use fluvio_service::{FlvService, wait_for_request}; +use fluvio_service::{FluvioService, wait_for_request}; use fluvio_socket::{FluvioSocket, SocketError, FluvioSink}; use fluvio_controlplane::{ InternalScRequest, InternalScKey, RegisterSpuResponse, UpdateLrsRequest, UpdateReplicaRequest, @@ -41,7 +41,7 @@ impl ScInternalService { } #[async_trait] -impl FlvService for ScInternalService { +impl FluvioService for ScInternalService { type Context = SharedContext; type Request = InternalScRequest; diff --git a/crates/fluvio-sc/src/services/public_api/mod.rs b/crates/fluvio-sc/src/services/public_api/mod.rs index 2c2253dfb1..8bfc3b7c94 100644 --- a/crates/fluvio-sc/src/services/public_api/mod.rs +++ b/crates/fluvio-sc/src/services/public_api/mod.rs @@ -17,7 +17,7 @@ mod server { use tracing::debug; - use fluvio_service::FlvApiServer; + use fluvio_service::FluvioApiServer; use fluvio_auth::Authorization; use crate::services::auth::AuthGlobalContext; @@ -32,7 +32,7 @@ mod server { { let addr = ctx.global_ctx.config().public_endpoint.clone(); debug!("starting public api service"); - let server = FlvApiServer::new(addr, ctx, PublicService::new()); + let server = FluvioApiServer::new(addr, ctx, PublicService::new()); server.run(); } } diff --git a/crates/fluvio-sc/src/services/public_api/public_server.rs b/crates/fluvio-sc/src/services/public_api/public_server.rs index 41843e0819..57534cfd38 100644 --- a/crates/fluvio-sc/src/services/public_api/public_server.rs +++ b/crates/fluvio-sc/src/services/public_api/public_server.rs @@ -15,14 +15,14 @@ use fluvio_service::ConnectInfo; use tracing::instrument; use async_trait::async_trait; -use fluvio_types::event::SimpleEvent; +use fluvio_types::event::StickyEvent; use fluvio_auth::Authorization; //use fluvio_service::aAuthorization; use fluvio_service::api_loop; use fluvio_service::call_service; use fluvio_socket::FluvioSocket; use fluvio_socket::SocketError; -use fluvio_service::FlvService; +use fluvio_service::FluvioService; use fluvio_sc_schema::AdminPublicApiKey; use fluvio_sc_schema::AdminPublicRequest; @@ -40,7 +40,7 @@ impl PublicService { } #[async_trait] -impl FlvService for PublicService +impl FluvioService for PublicService where A: Authorization + Sync + Send, ::Context: Send + Sync, @@ -72,7 +72,7 @@ where let mut api_stream = stream.api_stream::(); let mut shared_sink = sink.as_shared(); - let end_event = SimpleEvent::shared(); + let end_event = StickyEvent::shared(); api_loop!( api_stream, diff --git a/crates/fluvio-sc/src/services/public_api/watch.rs b/crates/fluvio-sc/src/services/public_api/watch.rs index aef1cee4fd..358c6e59ca 100644 --- a/crates/fluvio-sc/src/services/public_api/watch.rs +++ b/crates/fluvio-sc/src/services/public_api/watch.rs @@ -3,7 +3,7 @@ use std::fmt::Debug; use tracing::{debug, trace, error, instrument}; -use fluvio_types::event::SimpleEvent; +use fluvio_types::event::StickyEvent; use fluvio_socket::ExclusiveFlvSink; use dataplane::core::{Encoder, Decoder}; use dataplane::api::{RequestMessage, RequestHeader, ResponseMessage}; @@ -24,7 +24,7 @@ pub fn handle_watch_request( request: RequestMessage, auth_ctx: &AuthServiceContext, sink: ExclusiveFlvSink, - end_event: Arc, + end_event: Arc, ) { debug!("handling watch request"); let (header, req) = request.get_header_request(); @@ -64,7 +64,7 @@ where response_sink: ExclusiveFlvSink, store: StoreContext, header: RequestHeader, - end_event: Arc, + end_event: Arc, } impl WatchController @@ -78,7 +78,7 @@ where /// start watch controller fn update( response_sink: ExclusiveFlvSink, - end_event: Arc, + end_event: Arc, store: StoreContext, header: RequestHeader, ) { diff --git a/crates/fluvio-service/src/server.rs b/crates/fluvio-service/src/server.rs index cd81d83f7c..4c7b2b7c9b 100644 --- a/crates/fluvio-service/src/server.rs +++ b/crates/fluvio-service/src/server.rs @@ -1,6 +1,5 @@ use std::fmt; use std::fmt::Debug; -use std::io::Error as IoError; use std::marker::PhantomData; use std::process; use std::sync::Arc; @@ -8,36 +7,14 @@ use std::os::unix::io::AsRawFd; use futures_util::StreamExt; use async_trait::async_trait; -use tracing::{debug, error, info}; -use tracing::instrument; -use tracing::trace; +use tracing::{instrument, debug, error, info}; -use fluvio_types::event::SimpleEvent; use fluvio_future::net::{TcpListener, TcpStream}; use fluvio_future::task::spawn; use fluvio_protocol::api::ApiMessage; use fluvio_protocol::Decoder as FluvioDecoder; use fluvio_socket::{FluvioSocket, SocketError}; - -#[async_trait] -pub trait SocketBuilder: Clone { - async fn to_socket(&self, raw_stream: TcpStream) -> Result; -} - -#[derive(Debug, Clone)] -pub struct DefaultSocketBuilder {} - -#[async_trait] -impl SocketBuilder for DefaultSocketBuilder { - async fn to_socket(&self, raw_stream: TcpStream) -> Result { - let fd = raw_stream.as_raw_fd(); - Ok(FluvioSocket::from_stream( - Box::new(raw_stream.clone()), - Box::new(raw_stream), - fd, - )) - } -} +use fluvio_types::event::StickyEvent; #[derive(Debug)] pub struct ConnectInfo { @@ -49,7 +26,7 @@ pub struct ConnectInfo { /// Request -> Response is type specific /// Each response is responsible for sending back to socket #[async_trait] -pub trait FlvService { +pub trait FluvioService { type Request; type Context; @@ -62,159 +39,108 @@ pub trait FlvService { ) -> Result<(), SocketError>; } -pub struct InnerFlvApiServer { +/// Transform Service into Futures 01 +pub struct FluvioApiServer { req: PhantomData, api: PhantomData, context: C, service: Arc, addr: String, - builder: T, } -impl fmt::Debug for InnerFlvApiServer { +impl fmt::Debug for FluvioApiServer { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "ApiServer({})", self.addr) + f.debug_tuple("FluvioApiServer").field(&self.addr).finish() } } -impl InnerFlvApiServer +impl FluvioApiServer where C: Clone, { - pub fn inner_new(addr: String, context: C, service: S, builder: T) -> Self { - InnerFlvApiServer { + pub fn new(addr: String, context: C, service: S) -> Self { + FluvioApiServer { req: PhantomData, api: PhantomData, service: Arc::new(service), context, addr, - builder, } } } -pub type FlvApiServer = InnerFlvApiServer; - -impl FlvApiServer -where - C: Clone, -{ - pub fn new(addr: String, context: C, service: S) -> Self { - Self::inner_new(addr, context, service, DefaultSocketBuilder {}) - } -} - -impl InnerFlvApiServer +impl FluvioApiServer where R: ApiMessage + Send + Debug + 'static, C: Clone + Sync + Send + Debug + 'static, A: Send + FluvioDecoder + Debug + 'static, - S: FlvService + Send + Sync + Debug + 'static, - T: SocketBuilder + Send + Debug + 'static, + S: FluvioService + Send + Sync + Debug + 'static, { - pub fn run(self) -> Arc { - let event = SimpleEvent::shared(); - spawn(self.run_shutdown(event.clone())); - - event + pub fn run(self) -> Arc { + let shutdown = StickyEvent::shared(); + spawn(self.accept_incoming(shutdown.clone())); + shutdown } - async fn run_shutdown(self, shutdown_signal: Arc) { - match TcpListener::bind(&self.addr).await { - Ok(listener) => { - debug!(addr = %self.addr, "starting event loop"); - self.event_loop(listener, shutdown_signal).await; - } + #[instrument(skip(shutdown))] + async fn accept_incoming(self, shutdown: Arc) { + debug!("Binding TcpListener"); + let listener = match TcpListener::bind(&self.addr).await { + Ok(listener) => listener, Err(err) => { - error!("error in shutting down: {}", err); + error!("Error binding TcpListener: {}", err); process::exit(-1); } - } - } - - #[instrument(skip(listener, shutdown))] - async fn event_loop(self, listener: TcpListener, shutdown: Arc) { - use tokio::select; - - let mut incoming = listener.incoming(); - debug!("opened connection listener"); - - loop { - debug!("waiting for client connection"); - - select! { - incoming = incoming.next() => { - self.serve_incoming(incoming) - }, - _ = shutdown.listen() => { - debug!("shutdown signal received"); - break; - } + }; - } - } - - debug!("server terminating"); - } + info!("Opened TcpListener, waiting for connections"); + let mut incoming = listener.incoming().take_until(shutdown.listen_pinned()); - /// process incoming request, for each request, we create async task for serving - #[instrument(skip(incoming))] - fn serve_incoming(&self, incoming: Option>) { - if let Some(incoming_stream) = incoming { - match incoming_stream { + // Accept incoming connections until None, i.e. terminate has triggered + while let Some(incoming) = incoming.next().await { + match incoming { Ok(stream) => { + info!("Received connection, spawning request handler"); let context = self.context.clone(); let service = self.service.clone(); - let builder = self.builder.clone(); let host = self.addr.clone(); - - let ft = async move { - let address = stream - .peer_addr() - .map(|addr| addr.to_string()) - .unwrap_or_else(|_| "".to_owned()); - - let peer = address.to_string(); - - info!(server = %host,%peer, "new peer connection"); - - let socket_res = builder.to_socket(stream); - match socket_res.await { - Ok(socket) => { - let connection_info = ConnectInfo { - peer: peer.clone(), - host: host.clone(), - }; - - if let Err(err) = service - .respond(context.clone(), socket, connection_info) - .await - { - error!( - "error handling stream: {}, shutdown on: {} from: {}", - err, host, address, - ); - } else { - info!(%host,%peer, "connection terminated"); - } - } - Err(err) => { - error!( - "error on tls handshake: {}, on: {} from: addr: {}", - err, host, peer - ); - } - } - }; - - spawn(ft); + spawn(Self::handle_request(stream, context, service, host)); } - Err(err) => { - error!("error with stream: {}", err); + Err(e) => { + error!("Error from TCP Stream: {:?}", e); } } - } else { - trace!("no stream value, ignoring"); + } + + info!("Closed TcpListener"); + } + + #[instrument(skip(stream, context, service))] + async fn handle_request(stream: TcpStream, context: C, service: Arc, host: String) { + let peer_addr = stream + .peer_addr() + .map(|addr| addr.to_string()) + .unwrap_or_else(|_| "".to_owned()); + debug!(%peer_addr, "Handling request"); + + let socket = { + let fd = stream.as_raw_fd(); + FluvioSocket::from_stream(Box::new(stream.clone()), Box::new(stream), fd) + }; + + let connection_info = ConnectInfo { + peer: peer_addr.clone(), + host: host.clone(), + }; + + let result = service.respond(context, socket, connection_info).await; + match result { + Ok(_) => { + info!(%host, %peer_addr, "Response sent successfully, closing connection"); + } + Err(err) => { + error!(%host, %peer_addr, "Error handling stream: {}", err); + } } } } @@ -246,10 +172,14 @@ mod test { fn create_server( addr: String, - ) -> FlvApiServer { + ) -> FluvioApiServer { let ctx = Arc::new(TestContext::new()); - let server: FlvApiServer = - FlvApiServer::new(addr, ctx, TestService::new()); + let server: FluvioApiServer< + TestApiRequest, + TestKafkaApiEnum, + SharedTestContext, + TestService, + > = FluvioApiServer::new(addr, ctx, TestService::new()); server } @@ -260,7 +190,7 @@ mod test { FluvioSocket::connect(&addr).await } - async fn test_client(addr: String, shutdown: Arc) { + async fn test_client(addr: String, shutdown: Arc) { let mut socket = create_client(addr).await.expect("client"); let request = EchoRequest::new("hello".to_owned()); @@ -286,9 +216,7 @@ mod test { let socket_addr = "127.0.0.1:30001".to_owned(); - let server = create_server(socket_addr.clone()); - let shutdown = server.run(); - + let shutdown = create_server(socket_addr.clone()).run(); test_client(socket_addr.clone(), shutdown).await; Ok(()) diff --git a/crates/fluvio-service/src/test_request.rs b/crates/fluvio-service/src/test_request.rs index e160de0ff6..39f2943d92 100644 --- a/crates/fluvio-service/src/test_request.rs +++ b/crates/fluvio-service/src/test_request.rs @@ -18,7 +18,7 @@ use fluvio_socket::FluvioSocket; use crate::api_loop; use crate::call_service; -use crate::{FlvService, ConnectInfo}; +use crate::{FluvioService, ConnectInfo}; #[repr(u16)] #[derive(PartialEq, Debug, Encoder, Decoder, Clone, Copy)] @@ -124,9 +124,9 @@ async fn handle_echo_request( } #[async_trait] -impl FlvService for TestService { - type Context = SharedTestContext; +impl FluvioService for TestService { type Request = TestApiRequest; + type Context = SharedTestContext; async fn respond( self: Arc, diff --git a/crates/fluvio-spu/src/services/internal/mod.rs b/crates/fluvio-spu/src/services/internal/mod.rs index c46ceeabbd..31eeadbb72 100644 --- a/crates/fluvio-spu/src/services/internal/mod.rs +++ b/crates/fluvio-spu/src/services/internal/mod.rs @@ -4,7 +4,7 @@ mod fetch_stream_request; use tracing::info; -use fluvio_service::FlvApiServer; +use fluvio_service::FluvioApiServer; use service_impl::InternalService; use crate::core::DefaultSharedGlobalContext; @@ -15,7 +15,7 @@ pub use self::api::SPUPeerApiEnum; pub use self::api::SpuPeerRequest; pub(crate) type InternalApiServer = - FlvApiServer; + FluvioApiServer; // start server pub fn create_internal_server(addr: String, ctx: DefaultSharedGlobalContext) -> InternalApiServer { @@ -25,5 +25,5 @@ pub fn create_internal_server(addr: String, ctx: DefaultSharedGlobalContext) -> addr ); - FlvApiServer::new(addr, ctx, InternalService::new()) + FluvioApiServer::new(addr, ctx, InternalService::new()) } diff --git a/crates/fluvio-spu/src/services/internal/service_impl.rs b/crates/fluvio-spu/src/services/internal/service_impl.rs index 4beda427c0..5aa79bb6e0 100644 --- a/crates/fluvio-spu/src/services/internal/service_impl.rs +++ b/crates/fluvio-spu/src/services/internal/service_impl.rs @@ -5,7 +5,7 @@ use fluvio_service::ConnectInfo; use tracing::instrument; use tracing::{debug, warn}; -use fluvio_service::{wait_for_request, FlvService}; +use fluvio_service::{wait_for_request, FluvioService}; use fluvio_socket::{FluvioSocket, SocketError}; use crate::core::DefaultSharedGlobalContext; @@ -24,7 +24,7 @@ impl InternalService { } #[async_trait] -impl FlvService for InternalService { +impl FluvioService for InternalService { type Context = DefaultSharedGlobalContext; type Request = SpuPeerRequest; diff --git a/crates/fluvio-spu/src/services/public/mod.rs b/crates/fluvio-spu/src/services/public/mod.rs index b301785a6a..24d40f27aa 100644 --- a/crates/fluvio-spu/src/services/public/mod.rs +++ b/crates/fluvio-spu/src/services/public/mod.rs @@ -7,7 +7,7 @@ mod stream_fetch; use tracing::info; -use fluvio_service::FlvApiServer; +use fluvio_service::FluvioApiServer; use service_impl::PublicService; use fluvio_spu_schema::server::SpuServerRequest; use fluvio_spu_schema::server::SpuServerApiKey; @@ -16,7 +16,7 @@ use crate::core::DefaultSharedGlobalContext; pub use stream_fetch::publishers::StreamPublishers; pub(crate) type PublicApiServer = - FlvApiServer; + FluvioApiServer; // start server pub fn create_public_server(addr: String, ctx: DefaultSharedGlobalContext) -> PublicApiServer { @@ -26,5 +26,5 @@ pub fn create_public_server(addr: String, ctx: DefaultSharedGlobalContext) -> Pu addr ); - FlvApiServer::new(addr, ctx, PublicService::new()) + FluvioApiServer::new(addr, ctx, PublicService::new()) } diff --git a/crates/fluvio-spu/src/services/public/service_impl.rs b/crates/fluvio-spu/src/services/public/service_impl.rs index 0c6076fecf..3605bea43e 100644 --- a/crates/fluvio-spu/src/services/public/service_impl.rs +++ b/crates/fluvio-spu/src/services/public/service_impl.rs @@ -6,10 +6,10 @@ use async_trait::async_trait; use futures_util::stream::StreamExt; use tokio::select; -use fluvio_types::event::SimpleEvent; +use fluvio_types::event::StickyEvent; use fluvio_socket::FluvioSocket; use fluvio_socket::SocketError; -use fluvio_service::{call_service, FlvService}; +use fluvio_service::{call_service, FluvioService}; use fluvio_spu_schema::server::{SpuServerApiKey, SpuServerRequest}; use dataplane::{ErrorCode, api::RequestMessage}; @@ -30,9 +30,9 @@ impl PublicService { } #[async_trait] -impl FlvService for PublicService { - type Context = DefaultSharedGlobalContext; +impl FluvioService for PublicService { type Request = SpuServerRequest; + type Context = DefaultSharedGlobalContext; #[instrument(skip(self, context))] async fn respond( @@ -46,7 +46,7 @@ impl FlvService for PublicService { let mut s_sink = sink.as_shared(); let mut api_stream = stream.api_stream::(); - let end_event = SimpleEvent::shared(); + let end_event = StickyEvent::shared(); loop { debug!("waiting"); diff --git a/crates/fluvio-spu/src/services/public/stream_fetch.rs b/crates/fluvio-spu/src/services/public/stream_fetch.rs index cddf3c7238..e5499dee34 100644 --- a/crates/fluvio-spu/src/services/public/stream_fetch.rs +++ b/crates/fluvio-spu/src/services/public/stream_fetch.rs @@ -6,7 +6,7 @@ use std::io::Error as IoError; use tracing::{info, error, debug, trace, instrument}; use tokio::select; -use fluvio_types::event::{SimpleEvent, offsets::OffsetPublisher}; +use fluvio_types::event::{StickyEvent, offsets::OffsetPublisher}; use fluvio_future::task::spawn; use fluvio_socket::{ExclusiveFlvSink, SocketError}; use dataplane::{ @@ -40,7 +40,7 @@ pub struct StreamFetchHandler { max_fetch_bytes: u32, header: RequestHeader, sink: ExclusiveFlvSink, - end_event: Arc, + end_event: Arc, consumer_offset_listener: OffsetChangeListener, leader_state: SharedFileLeaderState, stream_id: u32, @@ -53,7 +53,7 @@ impl StreamFetchHandler { request: RequestMessage, ctx: DefaultSharedGlobalContext, sink: ExclusiveFlvSink, - end_event: Arc, + end_event: Arc, ) -> Result<(), SocketError> { // first get receiver to offset update channel to we don't missed events let (header, msg) = request.get_header_request(); diff --git a/crates/fluvio-types/Cargo.toml b/crates/fluvio-types/Cargo.toml index 33a49d3dd2..ff08841e3e 100644 --- a/crates/fluvio-types/Cargo.toml +++ b/crates/fluvio-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fluvio-types" -version = "0.2.4" +version = "0.2.5" authors = ["Fluvio Contributors "] edition = "2018" description = "Fluvio common types and objects" diff --git a/crates/fluvio-types/src/event.rs b/crates/fluvio-types/src/event.rs index 2b1f9d28e2..6125747808 100644 --- a/crates/fluvio-types/src/event.rs +++ b/crates/fluvio-types/src/event.rs @@ -6,12 +6,15 @@ use event_listener::Event; const DEFAULT_EVENT_ORDERING: Ordering = Ordering::SeqCst; -pub struct SimpleEvent { +#[deprecated(since = "0.2.5", note = "use StickyEvent instead")] +pub use StickyEvent as SimpleEvent; + +pub struct StickyEvent { flag: AtomicBool, event: Event, } -impl SimpleEvent { +impl StickyEvent { pub fn shared() -> Arc { Arc::new(Self { flag: AtomicBool::new(false), @@ -40,6 +43,10 @@ impl SimpleEvent { listener.await } + pub fn listen_pinned(&self) -> impl std::future::Future + '_ { + Box::pin(self.listen()) + } + pub fn notify(&self) { self.flag.store(true, DEFAULT_EVENT_ORDERING); self.event.notify(usize::MAX); From 6afc897ccffa982763bffddfd8a56df0cac23f2c Mon Sep 17 00:00:00 2001 From: Nick Mosher Date: Mon, 30 Aug 2021 22:45:38 +0000 Subject: [PATCH 18/18] Rename smart_stream module to smartstream (#1542) This updates the smart_stream module in the SPU to be smartstream, for consistency with other places --- crates/fluvio-spu/src/lib.rs | 2 +- crates/fluvio-spu/src/services/public/stream_fetch.rs | 4 ++-- .../src/{smart_stream => smartstream}/aggregate.rs | 4 ++-- .../src/{smart_stream => smartstream}/file_batch.rs | 0 .../fluvio-spu/src/{smart_stream => smartstream}/filter.rs | 4 ++-- crates/fluvio-spu/src/{smart_stream => smartstream}/map.rs | 4 ++-- .../fluvio-spu/src/{smart_stream => smartstream}/memory.rs | 0 crates/fluvio-spu/src/{smart_stream => smartstream}/mod.rs | 6 +++--- 8 files changed, 12 insertions(+), 12 deletions(-) rename crates/fluvio-spu/src/{smart_stream => smartstream}/aggregate.rs (98%) rename crates/fluvio-spu/src/{smart_stream => smartstream}/file_batch.rs (100%) rename crates/fluvio-spu/src/{smart_stream => smartstream}/filter.rs (97%) rename crates/fluvio-spu/src/{smart_stream => smartstream}/map.rs (97%) rename crates/fluvio-spu/src/{smart_stream => smartstream}/memory.rs (100%) rename crates/fluvio-spu/src/{smart_stream => smartstream}/mod.rs (93%) diff --git a/crates/fluvio-spu/src/lib.rs b/crates/fluvio-spu/src/lib.rs index 510f2e1a54..9d716b7efa 100644 --- a/crates/fluvio-spu/src/lib.rs +++ b/crates/fluvio-spu/src/lib.rs @@ -7,7 +7,7 @@ cfg_if::cfg_if! { mod services; mod start; mod replication; - mod smart_stream; + mod smartstream; mod control_plane; mod storage; pub use start::main_loop; diff --git a/crates/fluvio-spu/src/services/public/stream_fetch.rs b/crates/fluvio-spu/src/services/public/stream_fetch.rs index e5499dee34..04be874b66 100644 --- a/crates/fluvio-spu/src/services/public/stream_fetch.rs +++ b/crates/fluvio-spu/src/services/public/stream_fetch.rs @@ -26,8 +26,8 @@ use fluvio_types::event::offsets::OffsetChangeListener; use crate::core::DefaultSharedGlobalContext; use crate::replication::leader::SharedFileLeaderState; use publishers::INIT_OFFSET; -use crate::smart_stream::{SmartStreamEngine, SmartStream}; -use crate::smart_stream::file_batch::FileBatchIterator; +use crate::smartstream::{SmartStreamEngine, SmartStream}; +use crate::smartstream::file_batch::FileBatchIterator; use dataplane::batch::Batch; use dataplane::smartstream::SmartStreamRuntimeError; diff --git a/crates/fluvio-spu/src/smart_stream/aggregate.rs b/crates/fluvio-spu/src/smartstream/aggregate.rs similarity index 98% rename from crates/fluvio-spu/src/smart_stream/aggregate.rs rename to crates/fluvio-spu/src/smartstream/aggregate.rs index ab02b3c483..f986b7e1a9 100644 --- a/crates/fluvio-spu/src/smart_stream/aggregate.rs +++ b/crates/fluvio-spu/src/smartstream/aggregate.rs @@ -11,8 +11,8 @@ use wasmtime::{Caller, Extern, Func, Instance, Trap, TypedFunc, Store}; use dataplane::core::{Decoder, Encoder}; use dataplane::batch::Batch; use dataplane::batch::MemoryRecords; -use crate::smart_stream::{RecordsCallBack, RecordsMemory, SmartStreamEngine, SmartStreamModule}; -use crate::smart_stream::file_batch::FileBatchIterator; +use crate::smartstream::{RecordsCallBack, RecordsMemory, SmartStreamEngine, SmartStreamModule}; +use crate::smartstream::file_batch::FileBatchIterator; use dataplane::smartstream::{ SmartStreamRuntimeError, SmartStreamAggregateInput, SmartStreamInput, SmartStreamOutput, SmartStreamInternalError, diff --git a/crates/fluvio-spu/src/smart_stream/file_batch.rs b/crates/fluvio-spu/src/smartstream/file_batch.rs similarity index 100% rename from crates/fluvio-spu/src/smart_stream/file_batch.rs rename to crates/fluvio-spu/src/smartstream/file_batch.rs diff --git a/crates/fluvio-spu/src/smart_stream/filter.rs b/crates/fluvio-spu/src/smartstream/filter.rs similarity index 97% rename from crates/fluvio-spu/src/smart_stream/filter.rs rename to crates/fluvio-spu/src/smartstream/filter.rs index 72e35117d8..9e09371163 100644 --- a/crates/fluvio-spu/src/smart_stream/filter.rs +++ b/crates/fluvio-spu/src/smartstream/filter.rs @@ -14,8 +14,8 @@ use dataplane::smartstream::{ SmartStreamInput, SmartStreamOutput, SmartStreamRuntimeError, SmartStreamInternalError, }; use fluvio_protocol::{Encoder, Decoder}; -use crate::smart_stream::{RecordsCallBack, RecordsMemory, SmartStreamModule, SmartStreamEngine}; -use crate::smart_stream::file_batch::FileBatchIterator; +use crate::smartstream::{RecordsCallBack, RecordsMemory, SmartStreamModule, SmartStreamEngine}; +use crate::smartstream::file_batch::FileBatchIterator; const FILTER_FN_NAME: &str = "filter"; type FilterFn = TypedFunc<(i32, i32), i32>; diff --git a/crates/fluvio-spu/src/smart_stream/map.rs b/crates/fluvio-spu/src/smartstream/map.rs similarity index 97% rename from crates/fluvio-spu/src/smart_stream/map.rs rename to crates/fluvio-spu/src/smartstream/map.rs index 4b19f28484..202d77eccd 100644 --- a/crates/fluvio-spu/src/smart_stream/map.rs +++ b/crates/fluvio-spu/src/smartstream/map.rs @@ -14,8 +14,8 @@ use dataplane::batch::MemoryRecords; use dataplane::smartstream::{ SmartStreamInput, SmartStreamOutput, SmartStreamRuntimeError, SmartStreamInternalError, }; -use crate::smart_stream::{RecordsCallBack, RecordsMemory, SmartStreamEngine, SmartStreamModule}; -use crate::smart_stream::file_batch::FileBatchIterator; +use crate::smartstream::{RecordsCallBack, RecordsMemory, SmartStreamEngine, SmartStreamModule}; +use crate::smartstream::file_batch::FileBatchIterator; const MAP_FN_NAME: &str = "map"; type MapFn = TypedFunc<(i32, i32), i32>; diff --git a/crates/fluvio-spu/src/smart_stream/memory.rs b/crates/fluvio-spu/src/smartstream/memory.rs similarity index 100% rename from crates/fluvio-spu/src/smart_stream/memory.rs rename to crates/fluvio-spu/src/smartstream/memory.rs diff --git a/crates/fluvio-spu/src/smart_stream/mod.rs b/crates/fluvio-spu/src/smartstream/mod.rs similarity index 93% rename from crates/fluvio-spu/src/smart_stream/mod.rs rename to crates/fluvio-spu/src/smartstream/mod.rs index 1b4cb0de32..2b5f4d1f90 100644 --- a/crates/fluvio-spu/src/smart_stream/mod.rs +++ b/crates/fluvio-spu/src/smartstream/mod.rs @@ -1,9 +1,9 @@ use std::sync::Mutex; use anyhow::Result; use wasmtime::{Memory, Store, Engine, Module}; -use crate::smart_stream::filter::SmartStreamFilter; -use crate::smart_stream::map::SmartStreamMap; -use crate::smart_stream::aggregate::SmartStreamAggregate; +use crate::smartstream::filter::SmartStreamFilter; +use crate::smartstream::map::SmartStreamMap; +use crate::smartstream::aggregate::SmartStreamAggregate; mod memory; pub mod filter;