Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terarium dataservice migration changes #177

Merged
merged 30 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
12d13a5
Data service updates
dvince2 Jan 10, 2024
581d039
Data service updates
dvince2 Jan 10, 2024
b868d8b
Data service updates
dvince2 Jan 10, 2024
6504f78
Data service updates
dvince2 Jan 10, 2024
2001534
Data service updates
dvince2 Jan 11, 2024
ad51e35
Data service updates
dvince2 Jan 12, 2024
11f61d7
Add get document status check
kbirk Jan 23, 2024
b5e9cd5
Data service updates
dvince2 Jan 23, 2024
dabbe5b
Merge remote-tracking branch 'origin/2242-new-data-service' into 2242…
dvince2 Jan 23, 2024
d38e66c
Data service updates
dvince2 Jan 23, 2024
4c14960
changed "documents" to "document-asset"
dgauldie Jan 23, 2024
c6354ff
Data service updates
dvince2 Jan 24, 2024
6bc5a5b
fixed tds urls
dgauldie Jan 24, 2024
06fd979
Merge remote-tracking branch 'origin/2242-new-data-service' into 2242…
dgauldie Jan 24, 2024
03e58cf
fix url
dgauldie Jan 24, 2024
1964943
Add a local version of docker compose
YohannParis Feb 5, 2024
8232f42
add for local dev
YohannParis Feb 5, 2024
9620f93
Update docker-compose.prod.yaml
YohannParis Feb 5, 2024
b850289
Update docker-compose.yaml
YohannParis Feb 5, 2024
af5927b
Update .env.local
YohannParis Feb 5, 2024
daca796
Update .env.local
YohannParis Feb 5, 2024
cdce90d
fix tests
dgauldie Feb 5, 2024
5ab3c89
uncomment test
dgauldie Feb 5, 2024
84a2ea5
Fix Dockerfiles so seeding doesn't crash
fivegrant Feb 5, 2024
d36a865
Add extra logging before seeding begins
fivegrant Feb 5, 2024
c1490a3
adding id to update payloads
dgauldie Feb 6, 2024
ac91b55
Merge remote-tracking branch 'origin/2242-new-data-service' into 2242…
dgauldie Feb 6, 2024
e21da56
Update utils.py
YohannParis Feb 20, 2024
3cbba46
Update utils.py
YohannParis Feb 26, 2024
8c84856
Update poetry.lock
YohannParis Feb 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
REDIS_HOST=host.docker.internal
REDIS_PORT=6379
TDS_URL=host.docker.internal:3000
LOG_LEVEL=DEBUG
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,8 @@ restart:docker-compose.yaml
up-prod:docker-compose.yaml
$(DOCKER_COMPOSE) -f docker-compose.prod.yaml up -d

# Turn project on for local Terarium development
# No internal docker connection to TDS, nor Redis
.PHONY:up-local
up-local:docker-compose.yaml
$(DOCKER_COMPOSE) -f docker-compose.local.yaml up -d
31 changes: 31 additions & 0 deletions docker-compose.local.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
version: "3.9"
networks:
knowledge-middleware:
driver: bridge
name: knowledge-middleware
services:
api:
container_name: api-knowledge-middleware
build:
context: ./
dockerfile: api/Dockerfile
ports:
- "8010:8000"
env_file:
- .env.local
networks:
- knowledge-middleware
volumes:
- $PWD/api:/api
extra_hosts:
- "host.docker.internal:host-gateway"
rqworker:
container_name: worker-knowledge-middleware
build:
context: ./
dockerfile: worker/Dockerfile
env_file:
- .env.local
networks:
- knowledge-middleware
17 changes: 17 additions & 0 deletions lib/auth.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""
Module used to interact with the Terarium Data Service (TDS).
"""

from lib.settings import settings
import requests

TDS_URL = settings.TDS_URL
TDS_USER = settings.TDS_USER
TDS_PASSWORD = settings.TDS_PASSWORD


def auth_session():
session = requests.Session()
session.auth = (TDS_USER, TDS_PASSWORD)
session.headers.update({"Content-Type": "application/json", "X-Enable-Snake-Case": "true"})
return session
2 changes: 2 additions & 0 deletions lib/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class Settings(BaseSettings):
SKEMA_RS_URL: str = "http://skema-rs.staging.terarium.ai"
MIT_TR_URL: str = "http://mit-tr.staging.terarium.ai"
TDS_URL: str = "http://data-service.staging.terarium.ai:8000"
TDS_USER: str = "user"
TDS_PASSWORD: str = "password"
COSMOS_URL: str = "http://xdd.wisc.edu/cosmos_service"
OPENAI_API_KEY: str = "foo"
LOG_LEVEL: str = "INFO"
Expand Down
Loading
Loading