Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ steps:
commands:
- git submodule init
- 'git config --global url."https://github.com/".insteadOf [email protected]:'
- "git submodule update --recursive --remote"
- "git submodule update --recursive"
- name: build and publish
image: plugins/docker
settings:
Expand Down Expand Up @@ -73,7 +73,7 @@ steps:
commands:
- git submodule init
- 'git config --global url."https://github.com/".insteadOf [email protected]:'
- "git submodule update --recursive --remote"
- "git submodule update --recursive"
- name: build and publish
image: plugins/docker
settings:
Expand Down Expand Up @@ -109,7 +109,7 @@ steps:
commands:
- git submodule init
- 'git config --global url."https://github.com/".insteadOf [email protected]:'
- "git submodule update --recursive --remote"
- "git submodule update --recursive"
- name: build and publish
image: plugins/docker
settings:
Expand Down Expand Up @@ -138,7 +138,7 @@ steps:
commands:
- git submodule init
- 'git config --global url."https://github.com/".insteadOf [email protected]:'
- "git submodule update --recursive --remote"
- "git submodule update --recursive"
- name: build and publish
image: plugins/docker
settings:
Expand Down
22 changes: 20 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
import os
import logging
from fastapi import FastAPI, responses, status
from fastapi.encoders import jsonable_encoder
from pydantic import BaseModel
from submodules.model.business_objects import general
import util
from submodules.model import session
from submodules.model import session, telemetry

app = FastAPI()

OTLP_GRPC_ENDPOINT = os.getenv("OTLP_GRPC_ENDPOINT", "tempo:4317")

app_name = "refinery-updater"
app = FastAPI(title=app_name)

if telemetry.ENABLE_TELEMETRY:
print("WARNING: Running telemetry.", flush=True)
telemetry.setting_app_name(app_name)
telemetry.setting_otlp(app, app_name=app_name, endpoint=OTLP_GRPC_ENDPOINT)
app.add_middleware(telemetry.PrometheusMiddleware, app_name=app_name)
app.add_route("/metrics", telemetry.metrics)

# Filter out /metrics
logging.getLogger("uvicorn.access").addFilter(
lambda record: "GET /metrics" not in record.getMessage()
)


@app.post("/update_to_newest")
Expand Down
11 changes: 0 additions & 11 deletions daemon.py

This file was deleted.

2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-r requirements.txt
httpx==0.25.0
httpx==0.28.1
pytest==8.1.1
debugpy==1.8.12
5 changes: 4 additions & 1 deletion start
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

DEBUG_MODE=false
DEBUG_PORT=15674
ENABLE_TELEMETRY=false

while getopts d flag
while getopts dg flag
do
case "${flag}" in
d) DEBUG_MODE=true;;
g) ENABLE_TELEMETRY=true;;
esac
done

Expand Down Expand Up @@ -39,6 +41,7 @@ docker run -d --rm \
-e NEURAL_SEARCH=http://refinery-neural-search:80 \
-e COGNITION_GATEWAY=http://cognition-gateway:80 \
-e POSTGRES=postgresql://postgres:kern@graphql-postgres:5432 \
-e ENABLE_TELEMETRY=$ENABLE_TELEMETRY \
--mount type=bind,source="$(pwd)"/,target=/app \
-v /var/run/docker.sock:/var/run/docker.sock \
--network dev-setup_default \
Expand Down