clean up chart
This commit is contained in:
parent
ab2f8cf3f3
commit
79983f85a1
@ -1,11 +0,0 @@
|
||||
# apiVersion: v1
|
||||
# kind: ConfigMap
|
||||
# metadata:
|
||||
# name: stack-server
|
||||
# data:
|
||||
# file1.txt: |-
|
||||
# {{ .Files.Get "files/file1.txt" | nindent 2 }}
|
||||
# file2.txt: |-
|
||||
# {{ .Files.Get "files/file2.txt" | nindent 2 }}
|
||||
# file3.txt: |-
|
||||
# {{ .Files.Get "files/file3.txt" | nindent 2 }}
|
@ -5,7 +5,7 @@ kind: Deployment
|
||||
metadata:
|
||||
name: stac-server
|
||||
spec:
|
||||
replicas: 1 # Adjust as needed
|
||||
replicas: {{ .Values.stacServer.replicas }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: stac-server
|
||||
|
@ -1,37 +0,0 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: web-query-builder
|
||||
spec:
|
||||
replicas: {{ .Values.webQueryBuilder.replicas }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: web-query-builder
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: web-query-builder
|
||||
spec:
|
||||
containers:
|
||||
- name: web-query-builder
|
||||
image: "{{ .Values.webQueryBuilder.image.repository }}:{{ .Values.webQueryBuilder.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.webQueryBuilder.image.pullPolicy }}
|
||||
env:
|
||||
- name: API_HOST
|
||||
value: "https://{{ .Values.ingress.hostname }}/api/v1/stac/climate-dt"
|
||||
ports:
|
||||
- containerPort: {{ .Values.webQueryBuilder.servicePort }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: web-query-builder
|
||||
spec:
|
||||
selector:
|
||||
app: web-query-builder
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: {{ .Values.webQueryBuilder.servicePort }}
|
||||
targetPort: {{ .Values.webQueryBuilder.servicePort }}
|
||||
type: ClusterIP
|
@ -1,5 +1,6 @@
|
||||
stacServer:
|
||||
enabled: true
|
||||
replicas: 1
|
||||
image:
|
||||
repository: "eccr.ecmwf.int/qubed/stac_server"
|
||||
tag: "latest"
|
||||
|
@ -1,20 +1,18 @@
|
||||
import json
|
||||
import os
|
||||
from collections import defaultdict
|
||||
from pathlib import Path
|
||||
|
||||
import requests
|
||||
import yaml
|
||||
from fastapi import Depends, FastAPI, HTTPException, Request
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.responses import FileResponse
|
||||
from fastapi.responses import FileResponse, HTMLResponse
|
||||
from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from fastapi.templating import Jinja2Templates
|
||||
from frozendict import frozendict
|
||||
from qubed import Qube
|
||||
from qubed.tree_formatters import node_tree_to_html
|
||||
from fastapi.templating import Jinja2Templates
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from fastapi.responses import HTMLResponse
|
||||
import json
|
||||
|
||||
app = FastAPI()
|
||||
security = HTTPBearer()
|
||||
@ -67,17 +65,20 @@ else:
|
||||
qubes["climate-dt"] = Qube.from_json(
|
||||
requests.get(
|
||||
"https://github.com/ecmwf/qubed/raw/refs/heads/main/tests/example_qubes/climate_dt.json",
|
||||
timeout=1).json()
|
||||
timeout=1,
|
||||
).json()
|
||||
)
|
||||
qubes["extremes-dt"] = Qube.from_json(
|
||||
requests.get(
|
||||
"https://github.com/ecmwf/qubed/raw/refs/heads/main/tests/example_qubes/extremes_dt.json",
|
||||
timeout=1).json()
|
||||
timeout=1,
|
||||
).json()
|
||||
)
|
||||
mars_language = yaml.safe_load(
|
||||
requests.get(
|
||||
"https://github.com/ecmwf/qubed/raw/refs/heads/main/config/climate-dt/language.yaml",
|
||||
timeout=1).content
|
||||
timeout=1,
|
||||
).content
|
||||
)
|
||||
|
||||
if "API_KEY" in os.environ:
|
||||
@ -120,14 +121,19 @@ def validate_api_key(credentials: HTTPAuthorizationCredentials = Depends(securit
|
||||
async def favicon():
|
||||
return FileResponse("favicon.ico")
|
||||
|
||||
|
||||
@app.get("/", response_class=HTMLResponse)
|
||||
async def read_root(request: Request):
|
||||
return templates.TemplateResponse("index.html", {"request": request, "config": {
|
||||
"message": "Hello from the dev server!",
|
||||
},
|
||||
"api_url": "/api/v1/stac/climate-dt",
|
||||
"request" : request,
|
||||
})
|
||||
return templates.TemplateResponse(
|
||||
"index.html",
|
||||
{
|
||||
"request": request,
|
||||
"config": {
|
||||
"message": "Hello from the dev server!",
|
||||
},
|
||||
"api_url": os.environ.get("API_URL", "/api/v1/stac/climate-dt"),
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
@app.get("/api/v1/keys/")
|
||||
@ -175,14 +181,16 @@ def follow_query(request: dict[str, str | list[str]], qube: Qube):
|
||||
for key, v in by_path.items()
|
||||
]
|
||||
|
||||
|
||||
@app.get("/api/v1/select/{key}/")
|
||||
async def get(
|
||||
async def select(
|
||||
key: str = Depends(validate_key),
|
||||
request: dict[str, str | list[str]] = Depends(parse_request),
|
||||
):
|
||||
q = qubes[key].select(request)
|
||||
return q.to_json()
|
||||
|
||||
|
||||
@app.get("/api/v1/query/{key}")
|
||||
async def query(
|
||||
key: str = Depends(validate_key),
|
||||
|
Loading…
x
Reference in New Issue
Block a user