Merge pull request #23700 from overleaf/bg-history-redis

add redis to history-v1

GitOrigin-RevId: def900c4b560ea0a297b11b6c0ecc8cc8caa5b49
This commit is contained in:
Brian Gough
2025-02-20 09:06:54 +00:00
committed by Copybot
parent 761af696b2
commit 3deeda447b
5 changed files with 49 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
history-v1
--dependencies=postgres,gcs,mongo,s3
--dependencies=postgres,gcs,mongo,redis,s3
--docker-repos=us-east1-docker.pkg.dev/overleaf-ops/ol-docker
--env-add=
--env-pass-through=

View File

@@ -82,5 +82,12 @@
"clusterWorkers": "CLUSTER_WORKERS",
"maxFileUploadSize": "MAX_FILE_UPLOAD_SIZE",
"httpsOnly": "HTTPS_ONLY",
"httpRequestTimeout": "HTTP_REQUEST_TIMEOUT"
"httpRequestTimeout": "HTTP_REQUEST_TIMEOUT",
"redis": {
"queue": {
"host": "REDIS_HOST",
"password": "REDIS_PASSWORD",
"port": "REDIS_PORT"
}
}
}

View File

@@ -19,6 +19,9 @@ services:
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
environment:
ELASTIC_SEARCH_DSN: es:9200
REDIS_HOST: redis
QUEUES_REDIS_HOST: redis
ANALYTICS_QUEUES_REDIS_HOST: redis
MONGO_HOST: mongo
POSTGRES_HOST: postgres
AWS_S3_ENDPOINT: https://minio:9000
@@ -38,6 +41,8 @@ services:
depends_on:
mongo:
condition: service_healthy
redis:
condition: service_healthy
postgres:
condition: service_healthy
certs:
@@ -59,6 +64,13 @@ services:
- ./:/tmp/build/
command: tar -czf /tmp/build/build.tar.gz --exclude=build.tar.gz --exclude-vcs .
user: root
redis:
image: redis
healthcheck:
test: ping="$$(redis-cli ping)" && [ "$$ping" = 'PONG' ]
interval: 1s
retries: 20
mongo:
image: mongo:6.0.13
command: --replSet overleaf

View File

@@ -36,6 +36,9 @@ services:
working_dir: /overleaf/services/history-v1
environment:
ELASTIC_SEARCH_DSN: es:9200
REDIS_HOST: redis
QUEUES_REDIS_HOST: redis
ANALYTICS_QUEUES_REDIS_HOST: redis
MONGO_HOST: mongo
POSTGRES_HOST: postgres
AWS_S3_ENDPOINT: https://minio:9000
@@ -55,6 +58,8 @@ services:
depends_on:
mongo:
condition: service_healthy
redis:
condition: service_healthy
postgres:
condition: service_healthy
certs:
@@ -67,6 +72,13 @@ services:
condition: service_healthy
command: npm run --silent test:acceptance
redis:
image: redis
healthcheck:
test: ping=$$(redis-cli ping) && [ "$$ping" = 'PONG' ]
interval: 1s
retries: 20
mongo:
image: mongo:6.0.13
command: --replSet overleaf

View File

@@ -0,0 +1,16 @@
import redis from '@overleaf/redis-wrapper'
import config from 'config'
const redisOptions = config.get('redis.queue')
console.log('REDIS CONFIG', redisOptions)
const rclient = redis.createClient(redisOptions)
try {
await rclient.healthCheck()
console.log('REDIS HEALTHCHECK SUCCEEDED')
} catch (error) {
console.error('REDIS HEALTHCHECK FAILED', error)
} finally {
await rclient.quit()
}