Skip to content

Commit 8e71051

Browse files
author
Christopher Harrison
committedFeb 28, 2024
allow devcontainers to work with full services
1 parent cffb06a commit 8e71051

File tree

3 files changed

+191
-18
lines changed

3 files changed

+191
-18
lines changed
 

‎devcontainer/devcontainer.json

+30-18
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,48 @@
11
{
2+
23
"name": "LLMWARE Dev",
3-
//"build": { "dockerfile": "../Dockerfile" },
4-
//"image": "provocoai/llmware:dev-01", //
5-
"dockerComposeFile": "../docker-compose.yaml",
6-
"service": "llmware",
7-
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
8-
//"remoteUser": "llmware",
94

5+
// This is the image to use if doing development on only the llmware code base
6+
//"image": "provocoai/llmware:dev-01", /
7+
// using the dockerComposeFile option allows us to setup
8+
// the full env around the llm code base include milvus and mongodb.
9+
"dockerComposeFile": "docker-compose.yaml",
10+
11+
"service": "llmware", // we define the container to connect too
12+
13+
// update based on individual perference and mount point defined below
14+
"workspaceFolder": "/llmware",
15+
16+
// "remoteUser": "llmware", //used with docker instead of podman
17+
// "containerUser": "llmware", // used with docker instead of podman
1018

19+
// when we close the devcontainer env make sure we clean up after ourselfs
20+
"shutdownAction": "stopCompose",
21+
22+
// needed for podman to keep the id's the same
1123
"runArgs": [
12-
"--name",
13-
"${localWorkspaceFolderBasename}", // Container name
14-
"-it",
15-
"-l",
16-
"com.docker.compose.project=devcontainers" // Container group name
24+
"--userns=keep-id"
1725
],
18-
// you can setup your local directory in the devcontainer here. The mount line is an example and mounts your home directory into the /code directory
26+
27+
// Define the mountpoints into the llmware container.
28+
// I use $HOMEDIR/code/provoco as my default codebase and
29+
// then set the target to /code so I have access to all my code in /code
1930
"mounts" : [
20-
//"source=${localEnv:HOME},target=/code,type=bind,consistency=cached"
31+
"source=${localEnv:HOME}/code/provoco,target=/code,Z,type=bind,consistency=cached"
32+
// "source=${localENV:HOME}/.vscode-server,target=/root/.vscode-server,Z,type=bind,consistency=cached"
2133
],
34+
35+
// setup the github cli feature so we can commit within the UI
2236
"features": {
23-
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
24-
"dockerDashComposeVersion": "v2"
25-
},
26-
"ghcr.io/devcontainers/features/github-cli:1": {}
37+
"ghcr.io/devcontainers/features/github-cli:1": {}
2738
},
39+
2840
"customizations": {
2941
"vscode": {
3042
"extensions": [
3143
"esbenp.prettier-vscode", // prettify the code extension
3244
"ms-python.python", //python code extensions
33-
"ms-python.vscode-pylance" / vscode python extension
45+
"ms-python.vscode-pylance" // vscode python extension
3446
]
3547
}
3648
}
+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"name": "LLMWARE Dev",
3+
//"build": { "dockerfile": "../Dockerfile" },
4+
"containerUser": "llmware",
5+
"updateRemoteUserUID": true,
6+
"image": "provocoai/llmware:dev-01",
7+
"remoteUser": "llmware",
8+
"runArgs": [
9+
"--userns=keep-id:uid=1000,gid=1000"
10+
],
11+
12+
13+
// "runArgs": [
14+
// "--name",
15+
// "${localWorkspaceFolderBasename}", // Container name
16+
// "-it",
17+
// "-l",
18+
// "com.docker.compose.project=devcontainers" // Container group name
19+
// ],
20+
// you can setup your local directory in the devcontainer here. The mount line is an example and mounts your home directory into the /code directory
21+
"mounts" : [
22+
"source=/home/harrison/code/provoco,target=/code,type=bind,consistency=cached,Z",
23+
"source=/home/harrison/.vscode,target=/root/.vscode,type=bind,consistency=cached,Z"
24+
],
25+
"customizations": {
26+
// Configure properties specific to VS Code.
27+
"vscode": {
28+
// Add the IDs of extensions you want installed when the container is created.
29+
"extensions": [
30+
//"mongodb.mongodb-vscode",
31+
"ms-python.python"
32+
//"ms-azuretools.vscode-docker"
33+
]
34+
}
35+
},
36+
"postCreateCommand": "apt-get install ",
37+
"features": {}
38+
// "features": {
39+
// "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
40+
// "dockerDashComposeVersion": "v2"
41+
// },
42+
// "ghcr.io/devcontainers/features/github-cli:1": {}
43+
// },
44+
// "customizations": {
45+
// "vscode": {
46+
// "extensions": [
47+
// "esbenp.prettier-vscode", // prettify the code extension
48+
// "ms-python.python", //python code extensions
49+
// "ms-python.vscode-pylance" // vscode python extension
50+
// ]
51+
// }
52+
// }
53+
}

‎devcontainer/docker-compose.yaml

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
version: "3.5"
2+
3+
services:
4+
llmware:
5+
container_name: llmware
6+
image: provocoai/llmware:dev-01
7+
depends_on:
8+
- "milvus"
9+
- "mongodb"
10+
command: sleep infinity
11+
network_mode: host
12+
13+
mongodb:
14+
container_name: mongodb
15+
image: mongo:5.0.10
16+
# To secure MongoDB, uncomment and set the following values
17+
# environment:
18+
# - MONGO_INITDB_DATABASE=admin
19+
# - MONGO_INITDB_ROOT_USERNAME=admin
20+
# - MONGO_INITDB_ROOT_PASSWORD=changeme
21+
volumes:
22+
- llmware-mongodb:/data/db:Z
23+
ports:
24+
- '27017:27017'
25+
26+
etcd:
27+
container_name: milvus-etcd
28+
image: quay.io/coreos/etcd:v3.5.5
29+
environment:
30+
- ETCD_AUTO_COMPACTION_MODE=revision
31+
- ETCD_AUTO_COMPACTION_RETENTION=1000
32+
- ETCD_QUOTA_BACKEND_BYTES=4294967296
33+
- ETCD_SNAPSHOT_COUNT=50000
34+
volumes:
35+
- llmware-etcd:/etcd:Z
36+
command: etcd -advertise-client-urls=http://127.0.0.1:2379 -listen-client-urls http://0.0.0.0:2379 --data-dir /etcd
37+
healthcheck:
38+
test: ["CMD", "etcdctl", "endpoint", "health"]
39+
interval: 30s
40+
timeout: 20s
41+
retries: 3
42+
43+
minio:
44+
container_name: milvus-minio
45+
image: minio/minio:RELEASE.2023-03-20T20-16-18Z
46+
environment:
47+
MINIO_ACCESS_KEY: minioadmin
48+
MINIO_SECRET_KEY: minioadmin
49+
ports:
50+
- "9001:9001"
51+
- "9000:9000"
52+
volumes:
53+
- llmware-minio:/minio_data:Z
54+
command: minio server /minio_data --console-address ":9001"
55+
healthcheck:
56+
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
57+
interval: 30s
58+
timeout: 20s
59+
retries: 3
60+
61+
milvus:
62+
container_name: milvus
63+
image: milvusdb/milvus:v2.3.0
64+
command: ["milvus", "run", "standalone"]
65+
environment:
66+
ETCD_ENDPOINTS: etcd:2379
67+
MINIO_ADDRESS: minio:9000
68+
volumes:
69+
- llmware-milvus:/var/lib/milvus:Z
70+
healthcheck:
71+
test: ["CMD", "curl", "-f", "http://localhost:9091/healthz"]
72+
interval: 30s
73+
start_period: 90s
74+
timeout: 20s
75+
retries: 3
76+
ports:
77+
- "19530:19530"
78+
- "9091:9091"
79+
depends_on:
80+
- "etcd"
81+
- "minio"
82+
83+
84+
dev-neo4j:
85+
container_name: devneo4j
86+
hostname: neo4j
87+
image: neo4j:5.15.0-community
88+
ports:
89+
- 7474:7474
90+
- 7687:7687
91+
restart: always
92+
93+
volumes:
94+
- $HOME/neo4j/data:/data:Z
95+
- $HOME/neo4j/logs:/logs:Z
96+
97+
environment:
98+
- NEO4J_AUTH=none
99+
100+
volumes:
101+
llmware-mongodb:
102+
driver: local
103+
llmware-etcd:
104+
driver: local
105+
llmware-minio:
106+
driver: local
107+
llmware-milvus:
108+
driver: local

0 commit comments

Comments
 (0)
Please sign in to comment.