Skip to content

Commit

Permalink
Update readme and dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
morganmcg1 committed Jan 9, 2025
1 parent 0da7bdc commit b6fd1d6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.
*.py[cod]
*$py.class

temp_index/

# C extensions
*.so

Expand Down
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ WandBot is a question-answering bot designed specifically for Weights & Biases M
## What's New

### wandbot v1.3.0
Note that to trigger the final initalization after running `run.sh`, a request has to be made to the `/startup` endpoint, as tiggering the heavy initialzations during app startup causes replit to timeout:

```bash
curl https://wandbot.replit.app/startup
```
**New:**

- **Move to uv for package management**: Installs and dependency checks cut down from minutes to seconds
Expand Down
1 change: 1 addition & 0 deletions download_vectordb_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class Config:
api = wandb.Api()
art = api.artifact(config.artifact_url) # Download vectordb index from W&B
print(f"Downloading index to {config.index_dir}")
os.makedirs(config.index_dir, exist_ok=True)
save_dir = art.download(config.index_dir)

print(f"Downloaded index to {save_dir}")
33 changes: 17 additions & 16 deletions e2b.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM e2bdev/code-interpreter:latest

# Set working directory
WORKDIR /workspace
WORKDIR /home/user

# Install Python 3.12 and set it as default
RUN apt-get update && apt-get install -y \
Expand All @@ -23,32 +23,33 @@ RUN apt-get update && apt-get install -y \
# to invalidate the cache from here and trigger a fresh git pull and build from here
ARG WANDBOT_COMMIT
ARG CACHE_BUST=1
RUN git clone https://github.com/wandb/wandbot.git /workspace/wandbot && \
cd /workspace/wandbot && \
RUN git clone https://github.com/wandb/wandbot.git /home/user/wandbot && \
cd /home/user/wandbot && \
git checkout $WANDBOT_COMMIT

RUN pip install uv

# Set LD_LIBRARY_PATH before running build.sh
RUN cd /workspace/wandbot && \
RUN cd /home/user/wandbot && \
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH && \
(bash build.sh || true)

RUN cd /workspace/wandbot && . wandbot_venv/bin/activate && uv pip install .
RUN cd /workspace/wandbot && . wandbot_venv/bin/activate && uv pip install poetry
RUN cd /workspace/wandbot && . wandbot_venv/bin/activate && poetry install
RUN cd /home/user/wandbot && . wandbot_venv/bin/activate && uv pip install .
RUN cd /home/user/wandbot && . wandbot_venv/bin/activate && uv pip install poetry
RUN cd /home/user/wandbot && . wandbot_venv/bin/activate && poetry install

# Copy the index files to wandbot index_dir as defined in the vectorstore config
RUN cd /workspace/wandbot && \
. wandbot_venv/bin/activate && \
export INDEX_DIR=$(python -c """from wandbot.configs.vectorstore_config import VectorStoreConfig;\
index_dir = VectorStoreConfig().index_dir;\
print(index_dir, end='')""") && \
mkdir -p $INDEX_DIR
# Copy in the vector index
COPY temp_index/* /home/user/temp_index/

COPY temp_index /workspace/wandbot/$INDEX_DIR
RUN cd /home/user/wandbot && \
. wandbot_venv/bin/activate && \
export INDEX_DIR=$(python -c 'from wandbot.configs.vectorstore_config import VectorStoreConfig; \
index_dir = VectorStoreConfig().index_dir; \
print(index_dir, end="")') && \
mkdir -p $INDEX_DIR && \
cp -r /home/user/temp_index/* $INDEX_DIR/

# Ensure we're in the wandbot directory when container starts
WORKDIR /workspace/wandbot
WORKDIR /home/user


0 comments on commit b6fd1d6

Please sign in to comment.