From 7a9d6aa8a9aefcbaefc32c526c2d18b528baa1e4 Mon Sep 17 00:00:00 2001 From: Vincent Emonet Date: Thu, 10 Oct 2024 09:37:44 +0200 Subject: [PATCH] improve docker setup, add 1 test --- compose.yml | 1 + deploy.sh | 7 +++++++ notebooks/test_expasy_chat.ipynb | 16 ++++++++++++++++ 3 files changed, 24 insertions(+) diff --git a/compose.yml b/compose.yml index 8c2f4e9..d902975 100644 --- a/compose.yml +++ b/compose.yml @@ -17,6 +17,7 @@ services: api: build: . container_name: api + restart: unless-stopped depends_on: - vectordb ports: diff --git a/deploy.sh b/deploy.sh index fd4b3b2..fadf893 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,13 +1,20 @@ if [ "$1" = "--build" ]; then echo "📦️ Re-building" ssh expasychat 'sudo -u podman bash -c "cd /var/containers/podman/sparql-llm ; git pull ; podman-compose up --force-recreate --build -d"' + +elif [ "$1" = "--clean" ]; then + echo "🧹 Cleaning up the vector database" + ssh expasychat 'sudo -u podman bash -c "cd /var/containers/podman/sparql-llm ; git pull ; rm -rf data/qdrant ; podman-compose up --force-recreate -d"' + elif [ "$1" = "--logs" ]; then ssh expasychat 'sudo -u podman bash -c "cd /var/containers/podman/sparql-llm ; podman-compose logs api"' + elif [ "$1" = "--likes" ]; then mkdir -p data/prod scp expasychat:/var/containers/podman/sparql-llm/data/logs/likes.jsonl ./data/prod/ scp expasychat:/var/containers/podman/sparql-llm/data/logs/dislikes.jsonl ./data/prod/ scp expasychat:/var/containers/podman/sparql-llm/data/logs/user_questions.log ./data/prod/ + else ssh expasychat 'sudo -u podman bash -c "cd /var/containers/podman/sparql-llm ; git pull ; podman-compose up --force-recreate -d"' fi diff --git a/notebooks/test_expasy_chat.ipynb b/notebooks/test_expasy_chat.ipynb index 1910921..494679a 100644 --- a/notebooks/test_expasy_chat.ipynb +++ b/notebooks/test_expasy_chat.ipynb @@ -276,6 +276,22 @@ "}\n", "\"\"\",\n", " },\n", + " {\n", + " \"question\": \"What is the function of APOC1? Return ?function\",\n", + " \"endpoint\": \"https://sparql.uniprot.org/sparql/\",\n", + " \"query\": \"\"\"PREFIX up: \n", + "PREFIX rdfs: \n", + "PREFIX dcterms: \n", + "SELECT DISTINCT ?function WHERE {\n", + " ?protein a up:Protein ;\n", + " up:mnemonic \"APOC1_HUMAN\" ;\n", + " up:annotation ?annotation .\n", + " ?annotation a up:Function_Annotation ;\n", + " rdfs:comment ?function .\n", + "}\n", + "\"\"\",\n", + " },\n", + "\n", "\n", " # New queries to test:\n", " # Find all proteins linked to arachidonate (CHEBI:32395) and their associated pathways\n",