From 39e3d9abf3ae2d7c7044e9aa145e0cdddaa64086 Mon Sep 17 00:00:00 2001 From: William Jimenez Date: Tue, 28 Mar 2017 14:04:54 -0700 Subject: [PATCH] New catalog item for Iron Functions, a serverless platform for Docker --- templates/iron-functions/0/docker-compose.yml | 75 +++++++++++++++++++ .../iron-functions/0/rancher-compose.yml | 52 +++++++++++++ templates/iron-functions/config.yml | 5 ++ 3 files changed, 132 insertions(+) create mode 100644 templates/iron-functions/0/docker-compose.yml create mode 100644 templates/iron-functions/0/rancher-compose.yml create mode 100644 templates/iron-functions/config.yml diff --git a/templates/iron-functions/0/docker-compose.yml b/templates/iron-functions/0/docker-compose.yml new file mode 100644 index 0000000..bc9954e --- /dev/null +++ b/templates/iron-functions/0/docker-compose.yml @@ -0,0 +1,75 @@ +version: '2' +services: + functions-ui: + image: iron/functions-ui + environment: + API_URL: http://api:8080 + stdin_open: true + tty: true + links: + - api-lb:api + labels: + io.rancher.container.pull_image: always + api-lb: + image: rancher/lb-service-haproxy:v0.6.2 + ports: + - 8080:8080/tcp + - 4000:4000/tcp + labels: + io.rancher.container.agent.role: environmentAdmin + io.rancher.container.create_agent: 'true' + setup-dbuser: + image: wjimenez5271/postgres_client + environment: + PGPASSWORD: ironfunctions + PGUSER: postgres + PGHOST: postgres + PGQUERY: GRANT ALL PRIVILEGES ON DATABASE funcs TO postgres; + SLEEP_BEFORE_EXEC: '5' + stdin_open: true + tty: true + labels: + io.rancher.container.pull_image: always + io.rancher.container.start_once: 'true' + functions-worker: + image: iron/functions + environment: + MQ_URL: redis://redis:6379/ + DB_URL: postgres://postgres:ironfunctions@postgres/funcs?sslmode=disable + stdin_open: true + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - /opt/ironfunc/:/app/data + tty: true + links: + - postgres:postgres + - redis:redis + labels: + io.rancher.container.pull_image: always + setup-db: + image: wjimenez5271/postgres_client + environment: + PGPASSWORD: ironfunctions + PGUSER: postgres + PGHOST: postgres + PGQUERY: CREATE DATABASE funcs; + stdin_open: true + tty: true + labels: + io.rancher.container.pull_image: always + io.rancher.container.start_once: 'true' + postgres: + image: postgres + environment: + POSTGRES_PASSWORD: ironfunctions + stdin_open: true + tty: true + labels: + io.rancher.container.pull_image: always + io.rancher.sidekicks: setup-db,setup-dbuser + redis: + image: redis + stdin_open: true + tty: true + labels: + io.rancher.container.pull_image: always diff --git a/templates/iron-functions/0/rancher-compose.yml b/templates/iron-functions/0/rancher-compose.yml new file mode 100644 index 0000000..9998963 --- /dev/null +++ b/templates/iron-functions/0/rancher-compose.yml @@ -0,0 +1,52 @@ +.catalog: + name: "IronFunctions" + version: "v0.0.1" + description: "Serverless platform using Docker" + uuid: ironfunc-0 + minimum_rancher_version: v1.5.0 + + +version: '2' +services: + functions-ui: + scale: 1 + start_on_create: true + api-lb: + scale: 1 + start_on_create: true + lb_config: + certs: [] + port_rules: + - priority: 1 + protocol: tcp + service: functions-worker + source_port: 8080 + target_port: 8080 + - path: '' + priority: 2 + protocol: tcp + service: functions-ui + source_port: 4000 + target_port: 4000 + health_check: + healthy_threshold: 2 + response_timeout: 2000 + port: 42 + unhealthy_threshold: 3 + interval: 2000 + strategy: recreate + setup-dbuser: + scale: 1 + start_on_create: true + functions-worker: + scale: 1 + start_on_create: true + setup-db: + scale: 1 + start_on_create: true + postgres: + scale: 1 + start_on_create: true + redis: + scale: 1 + start_on_create: true diff --git a/templates/iron-functions/config.yml b/templates/iron-functions/config.yml new file mode 100644 index 0000000..e155842 --- /dev/null +++ b/templates/iron-functions/config.yml @@ -0,0 +1,5 @@ +name: IronFunctions +description: | + Serverless platform using Docker +version: v0.0.1 +category: Platform