Skip to content

Commit 4da88dc

Browse files
authored
Merge pull request #78 from datakind/bugfix/pgvector-assistant
Bugfix/pgvector assistant
2 parents 6a82f22 + d87c800 commit 4da88dc

File tree

7 files changed

+19
-12
lines changed

7 files changed

+19
-12
lines changed

.github/workflows/e2e_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ jobs:
8181
# TODO this should be enhanced to use a buildx bake to leverage layer caching for faster builds, or push to repo and simply have a pull for the run
8282
# TODO docker-compose files should be refactored to use scopes instead of different versions for each environment
8383
echo "Starting docker containers for dbs and server ..."
84-
docker-compose pull
85-
docker-compose up -d --build datadb recipedb server chat
84+
docker compose pull
85+
docker compose up -d --build datadb recipedb server chat
8686
8787
# TODO: For some reason, maybe buildkit, in Github docker compose builds the image differently, and it doesn't work. Individual image build works.
8888
docker build --build-arg OPENAI_API_KEY=$ASSISTANTS_API_KEY \

.github/workflows/get_memory_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ jobs:
7777
ls data/datadb
7878
7979
echo "Starting docker containers for dbs and server ..."
80-
docker-compose pull
81-
docker-compose up -d --build datadb recipedb server datadb
80+
docker compose pull
81+
docker compose up -d --build datadb recipedb server datadb
8282
8383
sleep 10
8484

deployment/deploy_azure.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import docker
1515
from dotenv import load_dotenv
1616

17+
# client = docker.from_env()
1718
load_dotenv()
1819

1920
container_registry = os.getenv("AZURE_CONTAINER_REGISTRY")
@@ -25,8 +26,11 @@
2526

2627
if sys.platform == "darwin":
2728
print("Running on Mac")
29+
print(f"container_registry: {container_registry}")
30+
print(f"repo: {repo}")
2831
client = docker.DockerClient(
29-
base_url="unix:///Users/matthewharris/.docker/run/docker.sock "
32+
# base_url="unix:///Users/matthewharris/.docker/run/docker.sock "
33+
base_url="unix:///Users/t.o./.docker/run/docker.sock "
3034
)
3135
else:
3236
client = docker.from_env()
@@ -72,8 +76,8 @@ def deploy():
7276
sys.exit()
7377

7478
tags = {
75-
"data-recipes-ai-server": [f"{container_registry}/{repo}", "server"],
76-
"data-recipes-ai-chat": [f"{container_registry}/{repo}", "chat"],
79+
"data-recipes-ai-server:latest": [f"{container_registry}/{repo}", "server"],
80+
"data-recipes-ai-chat:latest": [f"{container_registry}/{repo}", "chat"],
7781
}
7882

7983
run_cmd("az login")
@@ -87,13 +91,15 @@ def deploy():
8791
f"DOCKER_DEFAULT_PLATFORM={azure_platform} && docker compose -f {docker_compose_file} build"
8892
)
8993

94+
# run_cmd("docker compose build")
95+
9096
for image in tags.keys():
9197
print(f"Tagging {image} image ... with tag {tags[image][0]}:{tags[image][1]}")
9298
client.images.get(image).tag(tags[image][0], tags[image][1])
9399
print(f"Pushing {image} image ... to {tags[image][0]}:{tags[image][1]}")
94100
client.images.push(tags[image][0], tags[image][1])
95101

96-
sys.exit()
102+
# sys.exit()
97103

98104
run_cmd(f"docker compose -f {docker_compose_file} down")
99105
run_cmd(f"docker compose -f {docker_compose_file} pull")

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ langchain_openai==0.1.7
1818
literalai==0.0.604
1919
matplotlib==3.9.0
2020
pandas==2.2.2
21-
pgvector==0.2.4
21+
pgvector==0.2.5
2222
plotly==5.22.0
2323
psycopg2_binary==2.9.9
2424
pyarrow==16.1.0

server/robocorp/actions_plugins/recipe-server/package.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ dependencies:
2121
- robocorp-actions=0.0.7
2222
- langchain=0.1.16
2323
- langchain_community=0.0.34
24-
- langchain_openai=0.1.3
25-
- psycopg2-binary=2.9.3
24+
- langchain_openai=0.1.3
2625
- pgvector=0.2.5
2726
- python-dotenv=0.19.1
2827
- pillow=10.3.0
@@ -32,3 +31,4 @@ dependencies:
3231
- seaborn=0.13.2
3332
- geopandas=0.10.2
3433
- hdx_python_api=6.2.4
34+
- psycopg2-binary=2.9.3

server/robocorp/package.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ dependencies:
2323
- langchain=0.1.16
2424
- langchain_community=0.0.34
2525
- langchain_openai=0.1.3
26-
- psycopg2-binary=2.9.3
2726
- pgvector=0.2.5
27+
- psycopg2-binary=2.9.3
2828

utils/recipes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ def initialize_vector_db():
9696
collection_name=COLLECTION_NAME,
9797
connection_string=CONNECTION_STRING,
9898
embedding_function=embedding_model,
99+
create_extension=False,
99100
)
100101

101102
return db

0 commit comments

Comments
 (0)