Skip to content

Commit

Permalink
returning an error from the blob store instead of crashing (#669)
Browse files Browse the repository at this point in the history
* removing unwrap

* update readme of k8s

* format

* remove file
  • Loading branch information
diptanu authored Jun 21, 2024
1 parent 3d1ea19 commit eaa4958
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 11 deletions.
13 changes: 7 additions & 6 deletions operations/k8s/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Kubernetes

## Components
## Cluster Standup

### Components

The resources have been split into separate components:

Expand All @@ -21,11 +23,6 @@ The resources have been split into separate components:
To run locally, you can apply the [local](kustomize/local) setup and then go
through the getting started guide.

```bash
kubectl apply -k kustomize/local
```

## Cluster Standup

### Local

Expand All @@ -34,10 +31,14 @@ Kubernetes ([k3s][k3s]) entirely within docker on your local system.

[k3s]: https://k3s.io


```bash
k3d cluster create -p "8081:80@loadbalancer" indexify
```

```bash
kubectl apply -k kustomize/local
```
When using this setup, Indexify will be exposed via k3d's ingress which will be
[http://localhost:8081](http://localhost:8081). You'll want to configure
`IndexifyClient(service_url="http://localhost:8081")`.
2 changes: 1 addition & 1 deletion operations/k8s/kustomize/base/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ spec:

containers:
- name: indexify
image: tensorlake/indexify:stable
image: tensorlake/indexify:latest

command: ['indexify']
args:
Expand Down
15 changes: 12 additions & 3 deletions src/coordinator_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ impl CoordinatorClient {
async fn create_tls_channel(&self) -> Result<CoordinatorServiceClient> {
let channel = if let Some(tls_config) = self.config.coordinator_client_tls.as_ref() {
if tls_config.api {
tracing::info!("connecting via mTLS to coordinator service");
tracing::info!(
"connecting via mTLS to coordinator service, address: {}",
&self.addr
);
let cert = std::fs::read(tls_config.cert_file.clone())?;
let key = std::fs::read(tls_config.key_file.clone())?;
let ca_cert = tls_config
Expand All @@ -106,11 +109,17 @@ impl CoordinatorClient {
.domain_name("localhost");
Channel::from_shared(format!("https://{}", &self.addr))?.tls_config(tls_config)?
} else {
tracing::info!("connecting without TLS to coordinator service");
tracing::info!(
"connecting without TLS to coordinator service, address: {}",
&self.addr
);
Channel::from_shared(format!("http://{}", &self.addr))?
}
} else {
tracing::info!("connecting without TLS to coordinator service");
tracing::info!(
"connecting without TLS to coordinator service, address: {}",
&self.addr
);
Channel::from_shared(format!("http://{}", &self.addr))?
};
let channel = channel.connect().await?;
Expand Down
7 changes: 6 additions & 1 deletion src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ impl Server {
let mut attempt = 0;
let delay = 2;
let ingestion_server_id = ingestion_server_id.to_string();
let coordinator_addr = self.config.coordinator_addr.clone();

tokio::spawn(async move {
loop {
Expand Down Expand Up @@ -438,7 +439,11 @@ impl Server {
}
}
Err(e) => {
tracing::error!("Failed to start gc_tasks_stream: {}, retrying...", e);
tracing::error!(
"Failed to start gc_tasks_stream: {}, address: {}, retrying...",
e,
coordinator_addr.clone()
);
attempt += 1;
tokio::time::sleep(Duration::from_secs(delay)).await;

Expand Down

0 comments on commit eaa4958

Please sign in to comment.