[monorepo] tweaks for Jenkins/CI (#27761)

* [packer] jenkins-worker: install htop and lsof

* [web] trim tailing space in Jenkinsfile

* [web] cleanup after finishing Jenkins pipeline

* [server-ce] test: cleanup after finishing Jenkins pipeline

* [saas-e2e] add timeout to waiting for rail/web startup

* [monorepo] add 60s timeout for waiting on mongo to startup

* [saas-e2e] cleanup after finishing Jenkins pipeline

GitOrigin-RevId: 9954ab17b4db6a95c444e8e0b55cebb8d5daae59
This commit is contained in:
Jakob Ackermann
2025-08-08 17:03:48 +02:00
committed by Copybot
parent 29249c55a2
commit ac9c20e8d2
19 changed files with 73 additions and 55 deletions

View File

@@ -218,6 +218,13 @@ pipeline {
}
}
}
post {
cleanup {
dir('server-ce/test') {
sh 'make clean'
}
}
}
}
// vim: set ft=groovy :

View File

@@ -32,8 +32,22 @@ test-e2e-open:
docker compose up --detach --wait mongo || (docker compose logs mongo && exit 42)
docker compose up --no-log-prefix --exit-code-from=e2e-open e2e-open host-admin || (docker compose logs mongo && exit 42)
clean:
docker compose down --volumes --timeout 0
SHARD_PROJECT_NAMES = \
test-ce-default \
test-ce-custom-1 \
test-pro-default-1 \
test-pro-default-2 \
test-pro-custom-1 \
test-pro-custom-2 \
test-pro-custom-3 \
test-pro-custom-4
CLEAN_SHARDS=$(addprefix clean/,$(SHARD_PROJECT_NAMES))
clean: $(CLEAN_SHARDS)
-docker compose run --no-deps --rm --entrypoint rm host-admin -rf docker-compose.override.yml docker-compose.*_*.yml data/
-docker compose down --volumes --timeout 0
$(CLEAN_SHARDS): clean/%:
-COMPOSE_PROJECT_NAME=$* docker compose down --timeout=0 --volumes
prefetch: prefetch_default
prefetch_default: prefetch_default_compose

View File

@@ -28,7 +28,7 @@ services:
mongo:
condition: service_started
user: node
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=0 --
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:acceptance

View File

@@ -38,7 +38,7 @@ services:
depends_on:
mongo:
condition: service_started
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=0 --
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:acceptance
mongo:

View File

@@ -28,7 +28,7 @@ services:
mongo:
condition: service_started
user: node
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=0 --
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:acceptance

View File

@@ -38,7 +38,7 @@ services:
depends_on:
mongo:
condition: service_started
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=0 --
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:acceptance
mongo:

View File

@@ -33,7 +33,7 @@ services:
gcs:
condition: service_healthy
user: node
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=0 --
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:acceptance

View File

@@ -43,7 +43,7 @@ services:
condition: service_started
gcs:
condition: service_healthy
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=0 --
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:acceptance
mongo:

View File

@@ -34,7 +34,7 @@ services:
redis:
condition: service_healthy
user: node
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=0 --
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:acceptance

View File

@@ -44,7 +44,7 @@ services:
condition: service_started
redis:
condition: service_healthy
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=0 --
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:acceptance
redis:

View File

@@ -57,7 +57,7 @@ services:
gcs:
condition: service_healthy
user: node
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=0 --
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:acceptance

View File

@@ -73,7 +73,7 @@ services:
condition: service_completed_successfully
gcs:
condition: service_healthy
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=0 --
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:acceptance
redis:

View File

@@ -28,7 +28,7 @@ services:
mongo:
condition: service_started
user: node
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=0 --
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:acceptance

View File

@@ -38,7 +38,7 @@ services:
depends_on:
mongo:
condition: service_started
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=0 --
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:acceptance
mongo:

View File

@@ -34,7 +34,7 @@ services:
redis:
condition: service_healthy
user: node
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=0 --
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:acceptance

View File

@@ -44,7 +44,7 @@ services:
condition: service_started
redis:
condition: service_healthy
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=0 --
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:acceptance
redis:

View File

@@ -68,7 +68,7 @@ pipeline {
stage('Build Deps') {
steps {
script {
waitUntil {
waitUntil {
return action_pull_cache
}
}
@@ -83,7 +83,7 @@ pipeline {
stage('Push Deps') {
steps {
script {
waitUntil {
waitUntil {
return action_build_deps
}
}
@@ -95,7 +95,7 @@ pipeline {
stage('Build Dev') {
steps {
script {
waitUntil {
waitUntil {
return action_build_deps && action_copy_external_pages
}
}
@@ -110,7 +110,7 @@ pipeline {
stage ('Format') {
steps {
script {
waitUntil {
waitUntil {
return action_build_dev
}
}
@@ -122,7 +122,7 @@ pipeline {
stage('Lint') {
steps {
script {
waitUntil {
waitUntil {
return action_build_dev
}
}
@@ -141,7 +141,7 @@ pipeline {
stage('Acceptance SaaS') {
steps {
script {
waitUntil {
waitUntil {
return action_build_dev
}
}
@@ -156,7 +156,7 @@ pipeline {
stage('Acceptance Server CE') {
steps {
script {
waitUntil {
waitUntil {
return action_build_dev
}
}
@@ -168,10 +168,10 @@ pipeline {
stage('Acceptance Server Pro') {
steps {
script {
waitUntil {
waitUntil {
return action_build_dev
}
}
}
dir('services/web') {
sh "make test_acceptance_app_server_pro"
}
@@ -183,7 +183,7 @@ pipeline {
stage('test_acceptance_modules_merged_saas_1') {
steps {
script {
waitUntil {
waitUntil {
return action_build_dev
}
}
@@ -195,7 +195,7 @@ pipeline {
stage('test_acceptance_modules_merged_saas_2') {
steps {
script {
waitUntil {
waitUntil {
return action_build_dev
}
}
@@ -207,7 +207,7 @@ pipeline {
stage('test_acceptance_modules_merged_saas_3') {
steps {
script {
waitUntil {
waitUntil {
return action_build_dev
}
}
@@ -219,7 +219,7 @@ pipeline {
stage('test_acceptance_modules_merged_saas_4') {
steps {
script {
waitUntil {
waitUntil {
return action_build_dev
}
}
@@ -231,7 +231,7 @@ pipeline {
stage('test_acceptance_modules_merged_server_ce') {
steps {
script {
waitUntil {
waitUntil {
return action_build_dev
}
}
@@ -243,7 +243,7 @@ pipeline {
stage('test_acceptance_modules_merged_server_pro') {
steps {
script {
waitUntil {
waitUntil {
return action_build_dev
}
}
@@ -255,7 +255,7 @@ pipeline {
stage('test_frontend') {
steps {
script {
waitUntil {
waitUntil {
return action_build_dev
}
}
@@ -267,7 +267,7 @@ pipeline {
stage('test_frontend_ct_build') {
steps {
script {
waitUntil {
waitUntil {
return action_build_dev
}
}
@@ -375,7 +375,7 @@ pipeline {
stage('Build Webpack'){
steps {
script {
waitUntil {
waitUntil {
return action_build_dev && action_test_acceptance_app_server_pro
}
}
@@ -390,7 +390,7 @@ pipeline {
stage('Build Pug') {
steps {
script {
waitUntil {
waitUntil {
return action_build_dev && action_test_acceptance_app_server_pro
}
}
@@ -405,9 +405,9 @@ pipeline {
stage('CDN Upload Image') {
steps {
script {
waitUntil {
waitUntil {
return action_build_webpack
}
}
}
dir('services/web') {
sh 'make tar'
@@ -437,14 +437,14 @@ pipeline {
return action_build_webpack & action_build_production
}
}
dir('services/web') {
dir('services/web') {
sh 'gcloud secrets versions access latest --secret=web-sentryclirc > .sentryclirc'
}
script {
action_fetch_sentry_secret = true
}
}
}
}
stage('Sentry Upload') {
agent {
docker {
@@ -459,7 +459,7 @@ pipeline {
return action_fetch_sentry_secret
}
}
dir('services/web') {
dir('services/web') {
sh 'bin/sentry_upload'
}
}
@@ -474,16 +474,13 @@ pipeline {
}
}
}
}
post {
cleanup {
dir('services/web') {
sh 'make clean'
}
}
}
}
// vim: set ft=groovy :

View File

@@ -13,7 +13,7 @@ services:
user: node
volumes:
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=0 --
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:unit:app
working_dir: /overleaf/services/web
env_file: docker-compose.common.env
@@ -42,7 +42,7 @@ services:
- 'www.overleaf.test:127.0.0.1'
volumes:
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=0 --
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:acceptance:app
user: root
depends_on:

View File

@@ -19,7 +19,7 @@ services:
LOG_LEVEL: ${LOG_LEVEL:-}
NODE_ENV: test
NODE_OPTIONS: "--unhandled-rejections=strict"
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=0 --
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:unit:app
user: node
depends_on:
@@ -51,7 +51,7 @@ services:
- mongo
- saml
- ldap
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=0 --
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:acceptance:app
test_frontend: