From 4d8f904d8616eeb615199c2288329d235de985ed Mon Sep 17 00:00:00 2001 From: sido Date: Thu, 19 Apr 2018 13:29:09 +0200 Subject: [PATCH 1/4] feat(docker-compose): add helath checks --- templates/jenkins/0/docker-compose.yml | 29 +++++++++++++++++------- templates/jenkins/0/rancher-compose.yml | 10 -------- templates/molgenis/0/docker-compose.yml | 14 ++++++++++-- templates/molgenis/0/rancher-compose.yml | 12 +--------- 4 files changed, 34 insertions(+), 31 deletions(-) diff --git a/templates/jenkins/0/docker-compose.yml b/templates/jenkins/0/docker-compose.yml index 1b1b47e..f1c3b12 100644 --- a/templates/jenkins/0/docker-compose.yml +++ b/templates/jenkins/0/docker-compose.yml @@ -1,25 +1,38 @@ -version: '2' +version: '2.1' services: - jenkins: - image: jenkins/jenkins:lts + jenkins-master: + image: registry.molgenis.org/docker-molgenis-ops-releases/jenkins-master:lts ports: - 8080 + - 50000 volumes: - molgenis-jenkins:/var/jenkins_home + restart: always labels: io.rancher.container.pull_image: always - traefik.frontend.rule: Host:${DOMAINS} - traefik.backend: ${TRAEFIK_BACKEND} + traefik.frontend.rule: Host:test + traefik.backend: test traefik.enable: true traefik.port: 8080 + healthcheck: + test: ["CMD", "curl", "-sS", "http://localhost:50000" ] + interval: 5s + timeout: 10s + retries: 5 jenkins-agent-buildtools: - image: registry.molgenis.org/docker-molgenis-ops-releases/jenkins-agent-buildtools:latest - ports: - - 22 + image: registry.registry.molgenis.org/docker-molgenis-ops-releases/jenkins-agent-buildtools:lts + environment: + - JENKINS_URL=http://localhost:8080 + - JENKINS_SECRET=paradoxa + - JENKINS_AGENT_NAME=buildtools volumes: - molgenis-jenkins-agent-buildtools:/var/jenkins_home + depends_on: + jenkins-master: + condition: service_healthy + restart: always volumes: molgenis-jenkins: diff --git a/templates/jenkins/0/rancher-compose.yml b/templates/jenkins/0/rancher-compose.yml index 7a18a28..1e5b407 100644 --- a/templates/jenkins/0/rancher-compose.yml +++ b/templates/jenkins/0/rancher-compose.yml @@ -16,13 +16,3 @@ required: true default: "test.molgenis.org" type: "string" - - start_on_create: true - scale: 1 - health_check: - port: 8080 - interval: 5000 - unhealthy_threshold: 3 - request_line: 'GET / HTTP/1.0' - healthy_threshold: 2 - response_timeout: 5000 diff --git a/templates/molgenis/0/docker-compose.yml b/templates/molgenis/0/docker-compose.yml index bca991a..9450bde 100644 --- a/templates/molgenis/0/docker-compose.yml +++ b/templates/molgenis/0/docker-compose.yml @@ -2,7 +2,7 @@ version: '2' services: molgenis: - image: registry.webhosting.rug.nl/molgenis/molgenis:latest + image: registry.molgenis.org/molgenis/molgenis:latest ports: - 8080 links: @@ -39,11 +39,21 @@ services: - postgres-data ports: - 5432 + healthcheck: + test: ["CMD", "curl", "sS", "http://localhost:8080"] + interval: 5s + timeout: 10s + retries: 5 opencpu: - image: registry.webhosting.rug.nl/molgenis/molgenis-opencpu:latest + image: registry.molgenis.org/molgenis/molgenis-opencpu:latest ports: - 8004 + healthcheck: + test: ["CMD", "curl", "sS", "http://localhost:8084"] + interval: 5s + timeout: 10s + retries: 5 elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:5.5.1 diff --git a/templates/molgenis/0/rancher-compose.yml b/templates/molgenis/0/rancher-compose.yml index f0f0073..7610f58 100644 --- a/templates/molgenis/0/rancher-compose.yml +++ b/templates/molgenis/0/rancher-compose.yml @@ -51,14 +51,4 @@ label: "Initial and maximum size:" required: true default: "2g" - type: "string" - - start_on_create: true - scale: 1 - health_check: - port: 8080 - interval: 5000 - unhealthy_threshold: 3 - request_line: 'GET / HTTP/1.0' - healthy_threshold: 2 - response_timeout: 5000 + type: "string" \ No newline at end of file From 82a074b1897179dbc7d4db62b450de72b3fe610e Mon Sep 17 00:00:00 2001 From: sido Date: Thu, 19 Apr 2018 20:27:05 +0200 Subject: [PATCH 2/4] feat(docker-compose): use other image --- templates/jenkins/0/docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/jenkins/0/docker-compose.yml b/templates/jenkins/0/docker-compose.yml index f1c3b12..de485b0 100644 --- a/templates/jenkins/0/docker-compose.yml +++ b/templates/jenkins/0/docker-compose.yml @@ -2,7 +2,7 @@ version: '2.1' services: jenkins-master: - image: registry.molgenis.org/docker-molgenis-ops-releases/jenkins-master:lts + image: jenkinsci/blueocean:latest ports: - 8080 - 50000 @@ -22,7 +22,7 @@ services: retries: 5 jenkins-agent-buildtools: - image: registry.registry.molgenis.org/docker-molgenis-ops-releases/jenkins-agent-buildtools:lts + image: registry.molgenis.org/docker-molgenis-ops-releases/jenkins-agent-buildtools:lts environment: - JENKINS_URL=http://localhost:8080 - JENKINS_SECRET=paradoxa From fb8b199d95fb87d8b9343f5ff6e8987828a7c2b8 Mon Sep 17 00:00:00 2001 From: sido Date: Thu, 19 Apr 2018 20:35:57 +0200 Subject: [PATCH 3/4] fix(docker-compose): use other jenkins image --- templates/jenkins/0/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/jenkins/0/docker-compose.yml b/templates/jenkins/0/docker-compose.yml index de485b0..838d7a8 100644 --- a/templates/jenkins/0/docker-compose.yml +++ b/templates/jenkins/0/docker-compose.yml @@ -21,7 +21,7 @@ services: timeout: 10s retries: 5 - jenkins-agent-buildtools: + jenkins-agent-maven: image: registry.molgenis.org/docker-molgenis-ops-releases/jenkins-agent-buildtools:lts environment: - JENKINS_URL=http://localhost:8080 From eff463e31a67ae803fc25aaf509b6cf07e5affd7 Mon Sep 17 00:00:00 2001 From: sido Date: Fri, 20 Apr 2018 07:47:42 +0200 Subject: [PATCH 4/4] chore(docker-compose): set back env variables --- templates/jenkins/0/docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/jenkins/0/docker-compose.yml b/templates/jenkins/0/docker-compose.yml index 838d7a8..34b642b 100644 --- a/templates/jenkins/0/docker-compose.yml +++ b/templates/jenkins/0/docker-compose.yml @@ -11,8 +11,8 @@ services: restart: always labels: io.rancher.container.pull_image: always - traefik.frontend.rule: Host:test - traefik.backend: test + traefik.frontend.rule: Host:${DOMAINS} + traefik.backend: ${TRAEFIK_BACKEND} traefik.enable: true traefik.port: 8080 healthcheck: