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

Commit fa31345

Browse files
authored
Merge pull request #237 from stacklok/fix_local_backup
fix: deal with weaviate multiple network issues
2 parents 7358b80 + 2d176b8 commit fa31345

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,19 @@ source venv/bin/activate # On Windows: venv\Scripts\activate
123123
pip install -e ".[dev]"
124124
```
125125

126+
### Running locally with several network interfaces
127+
128+
By default weaviate is picking the default route as the ip for the cluster nodes. It may cause
129+
some issues when dealing with multiple interfaces. To make it work, localhost needs to be the
130+
default route:
131+
132+
```bash
133+
sudo route delete default
134+
sudo route add default 127.0.0.1
135+
sudo route add -net 0.0.0.0/1 <public_ip_gateway>
136+
sudo route add -net 128.0.0.0/1 <public_ip_gateway>
137+
```
138+
126139
### Testing
127140
```bash
128141
pytest

scripts/import_packages.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import os
44
import shutil
55

6+
67
import weaviate
78
from weaviate.classes.config import DataType, Property
89
from weaviate.embedded import EmbeddedOptions
@@ -53,11 +54,14 @@ def take_backup(self):
5354
shutil.rmtree(backup_path)
5455

5556
#  take a backup of the data
56-
self.client.backup.create(
57-
backup_id=os.getenv("BACKUP_TARGET_ID", "backup"),
58-
backend="filesystem",
59-
wait_for_completion=True,
60-
)
57+
try:
58+
self.client.backup.create(
59+
backup_id=os.getenv("BACKUP_TARGET_ID", "backup"),
60+
backend="filesystem",
61+
wait_for_completion=True,
62+
)
63+
except Exception as e:
64+
print(f"Failed to take backup: {e}")
6165

6266
def setup_schema(self):
6367
if not self.client.collections.exists("Package"):

0 commit comments

Comments
 (0)