Skip to content

Commit

Permalink
Merge pull request #3 from LasLabs/feature/add-runbot
Browse files Browse the repository at this point in the history
[ADD] Runbot Template
  • Loading branch information
lasley authored Jan 4, 2018
2 parents d9b6c90 + 15dffa6 commit 3c64c75
Show file tree
Hide file tree
Showing 7 changed files with 339 additions and 2 deletions.
2 changes: 1 addition & 1 deletion templates/confluence/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ description: |
behind a Traefik proxy.
version: v0.1.0
category: CMS
maintainer: LasLabs Inc.
maintainer: LasLabs Inc. <support@laslabs.com>
license: Apache 2.0
projectURL: https://github.com/LasLabs/rancher-catalog
2 changes: 1 addition & 1 deletion templates/jira/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ description: |
behind a Traefik proxy.
version: v0.1.0
category: Project Management
maintainer: LasLabs Inc.
maintainer: LasLabs Inc. <support@laslabs.com>
license: Apache 2.0
projectURL: https://github.com/LasLabs/rancher-catalog
158 changes: 158 additions & 0 deletions templates/runbot/0/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
---
version: '2'

volumes:
runbot-web-data:
driver: ${VOLUME_DRIVER}
runbot-db-data:
driver: ${VOLUME_DRIVER}
runbot-build-data:
driver: ${VOLUME_DRIVER}
runbot-ssh-data:
driver: ${VOLUME_DRIVER}
runbot-private-addons:
driver: ${VOLUME_DRIVER}
runbot-traefik-certs:
driver: ${VOLUME_DRIVER}

services:

runbot-install:
image: laslabs/runbot:9.0
environment:
PGPASSWORD: "${PSQL_PASSWORD}"
PGUSER: "${PSQL_USER}"
WITHOUT_DEMO: "all"
command: 'install-addons'
links:
- postgresql:db
volumes:
- runbot-web-data:/var/lib/odoo
- runbot-build-data:/opt/odoo/custom/src/odoo-extra/runbot/static
- runbot-private-addons:/opt/odoo/custom/src/private
tty: true
labels:
io.rancher.container.pull_image: 'always'
io.rancher.container.start_once: 'true'

runbot-web:
image: laslabs/runbot:9.0
environment:
ADMIN_PASSWORD: "${ODOO_ADMIN_PASSWORD}"
PGPASSWORD: "${PSQL_PASSWORD}"
PGUSER: "${PSQL_USER}"
PROXY_MODE: "true"
WAIT_NOHOST: runbot-install
volumes:
- runbot-web-data:/var/lib/odoo
- runbot-build-data:/opt/odoo/custom/src/odoo-extra/runbot/static
- runbot-private-addons:/opt/odoo/custom/src/private
tty: true
links:
- postgresql:db
command:
- "/usr/local/bin/odoo"
- "--max-cron-threads=0"
- "--workers=${ODOO_WORKERS}"
labels:
{{- if ne .Values.TRAEFIK_DOMAIN "" }}
traefik.domain: "${TRAEFIK_DOMAIN}"
{{- end }}
{{- if ne .Values.TRAEFIK_HOST "" }}
traefik.frontend.rule: 'Host: ${TRAEFIK_HOST}'
{{- end }}
traefik.enable: 'true'
traefik.port: '8069'
io.rancher.container.hostname_override: container_name
io.rancher.container.pull_image: always
traefik.frontend.passHostHeader: 'true'
traefik.frontend.priority: 10

runbot-cron:
privileged: true
image: laslabs/runbot:9.0
environment:
ADMIN_PASSWORD: "${ODOO_ADMIN_PASSWORD}"
PGPASSWORD: "${PSQL_PASSWORD}"
PGUSER: "${PSQL_USER}"
DOCKER_REGISTRY_DOCKERHUB_USERNAME: "${DOCKERHUB_USERNAME}"
DOCKER_REGISTRY_DOCKERHUB_PASSWORD: "${DOCKERHUB_PASSWORD}"
WAIT_NOHOST: runbot-install
volumes:
- runbot-web-data:/var/lib/odoo
- runbot-build-data:/opt/odoo/custom/src/odoo-extra/runbot/static
- runbot-ssh-data:/home/odoo/.ssh
- runbot-private-addons:/opt/odoo/custom/src/private
- /var/run/docker.sock:/var/run/docker.sock
tty: true
links:
- postgresql:db
command:
- "/usr/local/bin/odoo"
- "--max-cron-threads=${ODOO_MAX_CRON_THREADS}"
- "--workers=0"
- "--limit-time-real=${ODOO_CRON_LIMIT_TIME_REAL}"
- "--limit-time-cpu=${ODOO_CRON_LIMIT_TIME_CPU}"
labels:
io.rancher.scheduler.affinity:host_label: "${HOST_LABEL_WORKER}"
io.rancher.container.hostname_override: container_name
io.rancher.container.pull_image: always

runbot-longpolling:
image: laslabs/runbot:9.0
environment:
ADMIN_PASSWORD: "${ODOO_ADMIN_PASSWORD}"
PGPASSWORD: "${PSQL_PASSWORD}"
PGUSER: "${PSQL_USER}"
PROXY_MODE: "true"
WAIT_NOHOST: runbot-install
volumes:
- runbot-web-data:/var/lib/odoo
- runbot-build-data:/opt/odoo/custom/src/odoo-extra/runbot/static
- runbot-private-addons:/opt/odoo/custom/src/private
tty: true
links:
- postgresql:db
command:
- "/usr/local/bin/odoo"
- "--max-cron-threads=0"
- "--workers=0"
labels:
{{- if ne .Values.TRAEFIK_HOST "" }}
traefik.frontend.rule: 'Host: ${TRAEFIK_HOST}; PathPrefix: /longpolling/;'
{{- else }}
traefik.frontend.rule: 'PathPrefix: /longpolling/;'
{{- end }}
traefik.domain: "${TRAEFIK_DOMAIN}"
traefik.enable: 'true'
traefik.port: '8069'
io.rancher.container.hostname_override: container_name
io.rancher.container.pull_image: always
traefik.frontend.passHostHeader: 'true'
traefik.frontend.priority: 10

postgresql:
image: postgres:9.6-alpine
hostname: db
environment:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_PASSWORD: "${PSQL_PASSWORD}"
POSTGRES_USER: "${PSQL_USER}"
volumes:
- runbot-db-data:/var/lib/postgresql/data/

traefik:
image: laslabs/runbot-traefik:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- runbot-traefik-certs:/opt/traefik/certs
command:
- --web
labels:
traefik.enable: 'true'
traefik.domain: "${TRAEFIK_DOMAIN}"
traefik.frontend.rule: 'HostRegexp: {subdomain:[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+}.${TRAEFIK_DOMAIN};'
traefik.port: '80'
io.rancher.container.pull_image: always
traefik.frontend.passHostHeader: 'true'
traefik.frontend.priority: 1
157 changes: 157 additions & 0 deletions templates/runbot/0/rancher-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
version: "2"

catalog:
name: Odoo Runbot
version: "v9.0.0.1.0"
description: \
Runbot is a Continuous Integration server for Odoo.
Meant to be proxied by Traefik.
uuid: laslabs-runbot-0
minimum_rancher_version: v1.0.0
questions:

- variable: "VOLUME_DRIVER"
description: "The volume driver to use for persistent storage."
label: "Volume Driver"
required: true
type: "enum"
default: "local"
options:
- local
- rancher-ebs
- rancher-efs
- rancher-nfs

- variable: "PSQL_USER"
description: "Username to use for the PostgreSQL server."
label: "PostgreSQL User"
default: "odoo"
type: "string"
required: true

- variable: "PSQL_PASSWORD"
description: "Password to use for the PostgreSQL server."
label: "PostgreSQL Password"
type: "password"
required: true

- variable: "ODOO_ADMIN_PASSWORD"
description: "Password to Odoo database management interface."
label: "Odoo Admin Password"
type: "password"
required: true

- variable: "DOCKERHUB_USERNAME"
description: "Username to use when logging into DockerHub."
label: "DockerHub Username"
type: "string"

- variable: "DOCKERHUB_PASSWORD"
description: "Password to use when logging into DockerHub."
label: "DockerHub Password"
type: "password"

- variable: "ODOO_CRON_LIMIT_TIME_REAL"
description: "Real time limit for the Runbot workers."
label: "Odoo Worker Time Limit (Real)"
type: "int"
required: true
default: 6000

- variable: "ODOO_CRON_LIMIT_TIME_CPU"
description: "CPU time limit for the Runbot workers."
label: "Odoo Worker Time Limit (CPU)"
type: "int"
required: true
default: 600

- variable: "ODOO_WORKERS"
description: "Amount of workers allowed per web instance."
label: "Odoo Workers"
type: "int"
required: true
default: 4

- variable: "ODOO_MAX_CRON_THREADS"
description: "Maximum amount of threads allowed for crons (per cron instance)."
label: "Odoo Cron Threads"
type: "int"
required: true
default: 1

- variable: "HOST_LABEL_WORKER"
description: \
Host label and value that must be applied to any host that is allowed to have
a Runbot build worker.
label: "Worker Label"
type: "string"
required: true
default: "runbot_worker=true"

- variable: "TRAEFIK_DOMAIN"
description: "Base domain to define in Traefik."
label: "Traefik Domain"
type: "string"
required: true
default: rancher.internal

- variable: "TRAEFIK_HOST"
description: \
Additional domain name that should be advertised through Traefik.
Comma separate to include more than one.
label: "Traefik Host"
type: "string"

services:

runbot-web:
scale: 1
start_on_create: true
health_check:
healthy_threshold: 2
response_timeout: 2000
port: 8069
unhealthy_threshold: 10
initializing_timeout: 60000
interval: 5000
strategy: recreate
request_line: GET "/" "HTTP/1.0"

runbot-cron:
scale: 1
start_on_create: true
health_check:
healthy_threshold: 2
response_timeout: 2000
port: 8069
unhealthy_threshold: 250
initializing_timeout: 60000
interval: 10000
strategy: recreate
request_line: GET "/" "HTTP/1.0"

runbot-longpolling:
scale: 1
start_on_create: true
health_check:
healthy_threshold: 2
response_timeout: 2000
port: 8069
unhealthy_threshold: 10
initializing_timeout: 60000
interval: 5000
strategy: recreate
request_line: GET "/" "HTTP/1.0"

postgresql:
scale: 1
start_on_create: true
health_check:
healthy_threshold: 2
response_timeout: 2000
port: 5432
unhealthy_threshold: 20
initializing_timeout: 60000
interval: 5000
strategy: recreate
reinitializing_timeout: 60000
10 changes: 10 additions & 0 deletions templates/runbot/catalogIcon-odoo-runbot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions templates/runbot/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Odoo Runbot
description: |
Runbot is a Continuous Integration server for Odoo.
This build is meant to be behind a Traefik proxy.
version: v9.0.0.1.0
category: Continuous Integration
maintainer: LasLabs Inc. <support@laslabs.com>
license: Apache 2.0
projectURL: https://github.com/LasLabs/rancher-catalog
3 changes: 3 additions & 0 deletions templates/sentry/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ description: |
This build is meant to be behind a Traefik proxy.
version: v0.1.0
category: CMS
maintainer: LasLabs Inc. <support@laslabs.com>
license: Apache 2.0
projectURL: https://github.com/LasLabs/rancher-catalog

0 comments on commit 3c64c75

Please sign in to comment.