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:
|
metadata:
|
||||||
name: stac-server
|
name: stac-server
|
||||||
spec:
|
spec:
|
||||||
replicas: 1 # Adjust as needed
|
replicas: {{ .Values.stacServer.replicas }}
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: stac-server
|
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:
|
stacServer:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
replicas: 1
|
||||||
image:
|
image:
|
||||||
repository: "eccr.ecmwf.int/qubed/stac_server"
|
repository: "eccr.ecmwf.int/qubed/stac_server"
|
||||||
tag: "latest"
|
tag: "latest"
|
||||||
|
@ -1,20 +1,18 @@
|
|||||||
|
import json
|
||||||
import os
|
import os
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
import yaml
|
import yaml
|
||||||
from fastapi import Depends, FastAPI, HTTPException, Request
|
from fastapi import Depends, FastAPI, HTTPException, Request
|
||||||
from fastapi.middleware.cors import CORSMiddleware
|
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.security import HTTPAuthorizationCredentials, HTTPBearer
|
||||||
|
from fastapi.staticfiles import StaticFiles
|
||||||
|
from fastapi.templating import Jinja2Templates
|
||||||
from frozendict import frozendict
|
from frozendict import frozendict
|
||||||
from qubed import Qube
|
from qubed import Qube
|
||||||
from qubed.tree_formatters import node_tree_to_html
|
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()
|
app = FastAPI()
|
||||||
security = HTTPBearer()
|
security = HTTPBearer()
|
||||||
@ -67,17 +65,20 @@ else:
|
|||||||
qubes["climate-dt"] = Qube.from_json(
|
qubes["climate-dt"] = Qube.from_json(
|
||||||
requests.get(
|
requests.get(
|
||||||
"https://github.com/ecmwf/qubed/raw/refs/heads/main/tests/example_qubes/climate_dt.json",
|
"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(
|
qubes["extremes-dt"] = Qube.from_json(
|
||||||
requests.get(
|
requests.get(
|
||||||
"https://github.com/ecmwf/qubed/raw/refs/heads/main/tests/example_qubes/extremes_dt.json",
|
"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(
|
mars_language = yaml.safe_load(
|
||||||
requests.get(
|
requests.get(
|
||||||
"https://github.com/ecmwf/qubed/raw/refs/heads/main/config/climate-dt/language.yaml",
|
"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:
|
if "API_KEY" in os.environ:
|
||||||
@ -120,14 +121,19 @@ def validate_api_key(credentials: HTTPAuthorizationCredentials = Depends(securit
|
|||||||
async def favicon():
|
async def favicon():
|
||||||
return FileResponse("favicon.ico")
|
return FileResponse("favicon.ico")
|
||||||
|
|
||||||
|
|
||||||
@app.get("/", response_class=HTMLResponse)
|
@app.get("/", response_class=HTMLResponse)
|
||||||
async def read_root(request: Request):
|
async def read_root(request: Request):
|
||||||
return templates.TemplateResponse("index.html", {"request": request, "config": {
|
return templates.TemplateResponse(
|
||||||
|
"index.html",
|
||||||
|
{
|
||||||
|
"request": request,
|
||||||
|
"config": {
|
||||||
"message": "Hello from the dev server!",
|
"message": "Hello from the dev server!",
|
||||||
},
|
},
|
||||||
"api_url": "/api/v1/stac/climate-dt",
|
"api_url": os.environ.get("API_URL", "/api/v1/stac/climate-dt"),
|
||||||
"request" : request,
|
},
|
||||||
})
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.get("/api/v1/keys/")
|
@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()
|
for key, v in by_path.items()
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@app.get("/api/v1/select/{key}/")
|
@app.get("/api/v1/select/{key}/")
|
||||||
async def get(
|
async def select(
|
||||||
key: str = Depends(validate_key),
|
key: str = Depends(validate_key),
|
||||||
request: dict[str, str | list[str]] = Depends(parse_request),
|
request: dict[str, str | list[str]] = Depends(parse_request),
|
||||||
):
|
):
|
||||||
q = qubes[key].select(request)
|
q = qubes[key].select(request)
|
||||||
return q.to_json()
|
return q.to_json()
|
||||||
|
|
||||||
|
|
||||||
@app.get("/api/v1/query/{key}")
|
@app.get("/api/v1/query/{key}")
|
||||||
async def query(
|
async def query(
|
||||||
key: str = Depends(validate_key),
|
key: str = Depends(validate_key),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user