Skip to content
Snippets Groups Projects
Commit 8d760235 authored by Christof Bauer's avatar Christof Bauer
Browse files

Merge branch 'main' into production

parents f3d25ad6 fcc3113c
No related branches found
No related tags found
No related merge requests found
......@@ -39,7 +39,7 @@ variables:
# TODO should/could we roll back the service to the last working revision on test failure?
cache_lint:
image: 'europe-north1-docker.pkg.dev/holi-shared/docker-hub-remote/denoland/deno:2.1.9'
image: 'europe-north1-docker.pkg.dev/holi-shared/docker-hub-remote/denoland/deno:2.1.10'
stage: 'test'
script:
- deno cache --allow-import --lock=deno.lock app/deps.ts app/dev_deps.ts
......
FROM europe-north1-docker.pkg.dev/holi-shared/docker-hub-remote/denoland/deno:2.1.9
FROM europe-north1-docker.pkg.dev/holi-shared/docker-hub-remote/denoland/deno:2.1.10
# The port that your application listens to.
EXPOSE 8089
......
......@@ -81,7 +81,18 @@ export type GraphQLServer = any
export const startServer = (config: ServerConfig): Promise<void> => {
const graphQLServer: GraphQLServer = createGraphQLServer(config)
return serve(graphQLServer, {
const handler = (request: Request): Response => {
const url = new URL(request.url)
if (url.pathname === '/health') {
return new Response('OK', { status: 200 })
}
return graphQLServer.handleRequest(request)
}
return serve(handler, {
port: config.port,
onListen({ port, hostname }) {
logger.info(
......
......@@ -78,6 +78,24 @@ resource "google_cloud_run_v2_service" "translation_api_service" {
cpu_idle = true
startup_cpu_boost = true
}
startup_probe {
http_get {
path = "/health"
}
initial_delay_seconds = 5
failure_threshold = 3
period_seconds = 5
timeout_seconds = 2
}
liveness_probe {
http_get {
path = "/health"
}
initial_delay_seconds = 10
period_seconds = 30
timeout_seconds = 2
failure_threshold = 3
}
}
scaling {
......@@ -106,8 +124,12 @@ resource "google_cloud_run_v2_service" "translation_api_service" {
traffic {
percent = 100
type = "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST"
}
depends_on = [google_project_service.service]
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment