Skip to content

Commit

Permalink
show more information about cluster installer status (#1346)
Browse files Browse the repository at this point in the history
add more wait between SPU check
  • Loading branch information
sehz committed Aug 1, 2021
1 parent 1494dee commit e14f564
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,14 @@ jobs:

# Run all checks and unit test. This always run on debug mode
check:
name: ${{ matrix.check }} (${{ matrix.rust-target }})
name: Rust check ${{ matrix.check }} (${{ matrix.rust-target }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
rust: [stable]
rust-target: [x86_64-unknown-linux-gnu]
check: [clippy, doc, test, integration]
check: [fmt, clippy, doc, test, integration]
env:
RUST_BACKTRACE: full
RUSTV: ${{ matrix.rust }}
Expand All @@ -225,7 +225,9 @@ jobs:
- uses: Swatinem/rust-cache@v1
with:
key: ${{ matrix.rust-target }}-${{ matrix.check }}

- name: Fmt
if: ${{ matrix.check == 'fmt' }}
run: make check-fmt
- name: Clippy
if: ${{ matrix.check == 'clippy' }}
run: make check-clippy
Expand Down
6 changes: 3 additions & 3 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,12 @@ sudo apt-get install clang-11 lldb-11 lld-11

## Building the image

In order to deploy to minikube, the Docker image version must be built and loaded into minikube.
In order to deploy to Kubernetes, the Docker image version must be built and loaded into cluster. This is different for each cluster type.

Run following command to build the image

```
$ make minikube_image
$ make build_k8_image
```

## Cleanup
Expand All @@ -283,7 +283,7 @@ $ flvd cluster delete --local
$ flvd cluster delete
```

## Install in minikube
## Install Fluvio components as Kubernetes

Run command below now to run install with image just built

Expand Down
2 changes: 1 addition & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ inputs:
rust-log:
description: "Add rust log options (e.g. debug, warn, info)"
required: false
default: 'info'
default: 'warn'
version:
description: "Use a specific version of the fluvio CLI (e.g. latest, 0.6.0)"
required: false
Expand Down
19 changes: 8 additions & 11 deletions src/cluster/src/start/k8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ impl ClusterInstaller {
.wait_for_sc_service(namespace)
.await
.map_err(|_| K8InstallError::UnableToDetectService)?;
info!(addr = %address, "Fluvio SC is up:");
println!("Fluvio SC is up at: {}", address);

if self.config.save_profile {
self.update_profile(address.clone())?;
Expand All @@ -696,7 +696,7 @@ impl ClusterInstaller {
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");
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;

Expand Down Expand Up @@ -1065,7 +1065,7 @@ impl ClusterInstaller {
/// Wait until all SPUs are ready and have ingress
#[instrument(skip(self, ns))]
async fn wait_for_spu(&self, ns: &str) -> Result<bool, K8InstallError> {
info!("waiting for SPU with: {} loop", *MAX_SC_NETWORK_LOOP);
debug!("waiting for SPU with: {} loop", *MAX_SC_NETWORK_LOOP);
for i in 0..*MAX_SC_NETWORK_LOOP {
debug!("retrieving spu specs");
let items = self.kube_client.retrieve_items::<SpuSpec, _>(ns).await?;
Expand Down Expand Up @@ -1106,7 +1106,7 @@ impl ClusterInstaller {
.count();

if self.config.spu_replicas as usize == ready_spu {
info!(spu_count, "All SPUs are ready");
println!("All SPUs({}) are ready", ready_spu);
return Ok(true);
} else {
debug!(
Expand All @@ -1115,14 +1115,11 @@ impl ClusterInstaller {
attempt = i,
"Not all SPUs are ready. Waiting",
);
info!(
attempt = i,
"{} of {} spu ready, sleeping for {} ms",
ready_spu,
self.config.spu_replicas,
NETWORK_SLEEP_MS
println!(
"{} of {} spu are ready, sleeping 10 seconds...",
ready_spu, self.config.spu_replicas,
);
sleep(Duration::from_millis(NETWORK_SLEEP_MS)).await;
sleep(Duration::from_secs(10)).await;
}
}

Expand Down

0 comments on commit e14f564

Please sign in to comment.