Skip to content

Commit

Permalink
updated to make the devcontainer env work with all the services
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Harrison committed Feb 28, 2024
1 parent bfcdfd9 commit cffb06a
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 11 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
FROM python:3.11-slim-bookworm
FROM python:3.11-bookworm

ARG USERNAME=llmware
ARG USER_UID=1000
ARG USER_GID=$USER_UID
ENV PYTHONPATH=/llmware


RUN apt-get update \
&& apt-get install -y --no-install-recommends git bash \
&& apt-get purge -y --auto-remove
&& apt-get install -y git bash postgresql musl-dev \
&& pip install --no-cache-dir psycopg \
&& apk del --no-cache .build-deps

RUN git clone https://github.com/llmware-ai/llmware.git
RUN /llmware/scripts/dev/load_native_libraries.sh
RUN cd llmware/llmware && pip install -r requirements.txt


# Create the user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& chown -R $USERNAME:$USER_GID /llmware
ENV PYTHONPATH=/llmware

WORKDIR /llmware

CMD /bin/bash
7 changes: 5 additions & 2 deletions devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"name": "LLMWARE Dev",
//"build": { "dockerfile": "../Dockerfile" },
"image": "provocoai/llmware:dev-01", //
"RemoteUser": "${localEnv:USER}",
//"image": "provocoai/llmware:dev-01", //
"dockerComposeFile": "../docker-compose.yaml",
"service": "llmware",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
//"remoteUser": "llmware",


"runArgs": [
Expand Down
39 changes: 35 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
version: "3.5"

services:
llmware:
container_name: llmware
image: provocoai/llmware:dev-01
volumes:
- $HOME/code/provoco:/code:Z
- $HOME/.vscode:/root/.vscode:Z
network_mode: service:mongodb
# - service:milvus
# - service:etcd
# - service:minio
# - service:devneo4j
command: sleep infinity

mongodb:
container_name: mongodb
image: mongo:5.0.10
Expand All @@ -10,7 +23,7 @@ services:
# - MONGO_INITDB_ROOT_USERNAME=admin
# - MONGO_INITDB_ROOT_PASSWORD=changeme
volumes:
- llmware-mongodb:/data/db
- llmware-mongodb:/data/db:Z
ports:
- '27017:27017'

Expand All @@ -23,7 +36,7 @@ services:
- ETCD_QUOTA_BACKEND_BYTES=4294967296
- ETCD_SNAPSHOT_COUNT=50000
volumes:
- llmware-etcd:/etcd
- llmware-etcd:/etcd:Z
command: etcd -advertise-client-urls=http://127.0.0.1:2379 -listen-client-urls http://0.0.0.0:2379 --data-dir /etcd
healthcheck:
test: ["CMD", "etcdctl", "endpoint", "health"]
Expand All @@ -41,7 +54,7 @@ services:
- "9001:9001"
- "9000:9000"
volumes:
- llmware-minio:/minio_data
- llmware-minio:/minio_data:Z
command: minio server /minio_data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
Expand All @@ -57,7 +70,7 @@ services:
ETCD_ENDPOINTS: etcd:2379
MINIO_ADDRESS: minio:9000
volumes:
- llmware-milvus:/var/lib/milvus
- llmware-milvus:/var/lib/milvus:Z
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9091/healthz"]
interval: 30s
Expand All @@ -71,6 +84,23 @@ services:
- "etcd"
- "minio"


dev-neo4j:
container_name: devneo4j
hostname: neo4j
image: neo4j:5.15.0-community
ports:
- 7474:7474
- 7687:7687
restart: always

volumes:
- $HOME/neo4j/data:/data:Z
- $HOME/neo4j/logs:/logs:Z

environment:
- NEO4J_AUTH=none

volumes:
llmware-mongodb:
driver: local
Expand All @@ -80,4 +110,5 @@ volumes:
driver: local
llmware-milvus:
driver: local


0 comments on commit cffb06a

Please sign in to comment.