Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

fix: deal with weaviate multiple network issues #237

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,19 @@ source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -e ".[dev]"
```

### Running locally with several network interfaces

By default weaviate is picking the default route as the ip for the cluster nodes. It may cause
some issues when dealing with multiple interfaces. To make it work, localhost needs to be the
default route:

```bash
sudo route delete default
sudo route add default 127.0.0.1
sudo route add -net 0.0.0.0/1 <public_ip_gateway>
sudo route add -net 128.0.0.0/1 <public_ip_gateway>
```

### Testing
```bash
pytest
Expand Down
14 changes: 9 additions & 5 deletions scripts/import_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import shutil


import weaviate
from weaviate.classes.config import DataType, Property
from weaviate.embedded import EmbeddedOptions
Expand Down Expand Up @@ -53,11 +54,14 @@ def take_backup(self):
shutil.rmtree(backup_path)

#  take a backup of the data
self.client.backup.create(
backup_id=os.getenv("BACKUP_TARGET_ID", "backup"),
backend="filesystem",
wait_for_completion=True,
)
try:
self.client.backup.create(
backup_id=os.getenv("BACKUP_TARGET_ID", "backup"),
backend="filesystem",
wait_for_completion=True,
)
except Exception as e:
print(f"Failed to take backup: {e}")

def setup_schema(self):
if not self.client.collections.exists("Package"):
Expand Down
Loading