From 86662ae1707f08f1cfaa7ccde3c1f3ea54abb099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Ramos?= Date: Tue, 20 Jun 2017 00:18:34 +0100 Subject: [PATCH] build: update config files to support containerpilot v3 --- .dockerignore | 1 + packages/cp-frontend/Dockerfile | 7 ++- packages/cp-frontend/README.md | 4 +- packages/cp-frontend/etc/containerpilot.json | 49 ++++--------------- packages/cp-gql-mock-server/Dockerfile | 7 ++- .../etc/containerpilot.json | 47 +++--------------- packages/ui-toolkit/Dockerfile | 9 ++-- packages/ui-toolkit/README.md | 4 +- packages/ui-toolkit/etc/containerpilot.json | 49 ++++--------------- 9 files changed, 41 insertions(+), 136 deletions(-) diff --git a/.dockerignore b/.dockerignore index 70c5f859..49c4e899 100644 --- a/.dockerignore +++ b/.dockerignore @@ -159,5 +159,6 @@ packages/*/dist packages/*/buid packages/ui-toolkit/styleguide packages/*/node_modules +packages/*/Dockerfile legacy diff --git a/packages/cp-frontend/Dockerfile b/packages/cp-frontend/Dockerfile index fa4aa50a..daaa2a1b 100644 --- a/packages/cp-frontend/Dockerfile +++ b/packages/cp-frontend/Dockerfile @@ -1,11 +1,10 @@ -# todo change to 7 FROM quay.io/yldio/alpine-node-containerpilot:latest RUN yarn add lerna@^2.0.0-rc.5 serve \ && ./node_modules/.bin/lerna clean --yes --scope joyent-cp-frontend --include-filtered-dependencies \ && ./node_modules/.bin/lerna bootstrap --scope joyent-cp-frontend --include-filtered-dependencies -WORKDIR /home/node/app/packages/cp-frontend +WORKDIR /opt/app/packages/cp-frontend COPY packages/cp-frontend/etc/containerpilot.json /etc/ ARG CIRCLE_BRANCH @@ -13,5 +12,5 @@ ENV REACT_APP_GQL_HOSTNAME gql-mock-server-$CIRCLE_BRANCH.svc.f4b20699-b323-4452 RUN yarn run build -EXPOSE 5000 -CMD ["/bin/containerpilot", "../../node_modules/.bin/serve", "-s", "build"] +EXPOSE 3069 +CMD ["/bin/containerpilot"] diff --git a/packages/cp-frontend/README.md b/packages/cp-frontend/README.md index fe40ea38..77a4d24a 100644 --- a/packages/cp-frontend/README.md +++ b/packages/cp-frontend/README.md @@ -3,8 +3,8 @@ [![Docker Repository on Quay](https://quay.io/repository/yldio/joyent-cp-frontend/status)](https://quay.io/repository/yldio/joyent-cp-frontend) [![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0) [![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg)](https://github.com/RichardLitt/standard-readme) -[![demo master](https://img.shields.io/badge/demo-master-3B47CC.svg)](http://cp-frontend-master.svc.f4b20699-b323-4452-9091-977895896da6.eu-ams-1.triton.zone:5000) -[![demo staging](https://img.shields.io/badge/demo-staging-3B47CC.svg)](http://cp-frontend-staging.svc.f4b20699-b323-4452-9091-977895896da6.eu-ams-1.triton.zone:5000) +[![demo master](https://img.shields.io/badge/demo-master-3B47CC.svg)](http://cp-frontend-master.svc.f4b20699-b323-4452-9091-977895896da6.eu-ams-1.triton.zone:3069) +[![demo staging](https://img.shields.io/badge/demo-staging-3B47CC.svg)](http://cp-frontend-staging.svc.f4b20699-b323-4452-9091-977895896da6.eu-ams-1.triton.zone:3069) ## Table of Contents diff --git a/packages/cp-frontend/etc/containerpilot.json b/packages/cp-frontend/etc/containerpilot.json index e42ac9a9..d7e393fa 100644 --- a/packages/cp-frontend/etc/containerpilot.json +++ b/packages/cp-frontend/etc/containerpilot.json @@ -1,46 +1,15 @@ { "consul": "0.0.0.0:8500", - "services": [ + "jobs": [ { "name": "cp-frontend", "port": 3069, - "health": "/usr/bin/curl -o /dev/null --fail -s http://0.0.0.0:3069/", - "poll": 3, - "ttl": 10 - } - ], - "backends": [], - "telemetry": { - "port": 9090, - "sensors": [ - { - "name": "frontend_memory_percent", - "help": "percentage of memory used", - "type": "gauge", - "poll": 5, - "check": ["/bin/sensors", "memory"] - }, - { - "name": "frontend_cpu_load", - "help": "cpu load", - "type": "gauge", - "poll": 5, - "check": ["/bin/sensors", "cpu"] - }, - { - "name": "frontend_disk_capacity", - "help": "disk capacity", - "type": "gauge", - "poll": 60, - "check": ["/bin/sensors", "diskcapacity"] - }, - { - "name": "frontend_disk_usage", - "help": "disk usage", - "type": "gauge", - "poll": 60, - "check": ["/bin/sensors", "diskusage"] + "exec": "../../node_modules/.bin/serve --single build --port 3069", + "health": { + "exec": "/usr/bin/curl -o /dev/null --fail -s http://0.0.0.0:5000/", + "interval": 3, + "ttl": 10 } - ] - } -} \ No newline at end of file + } + ] +} diff --git a/packages/cp-gql-mock-server/Dockerfile b/packages/cp-gql-mock-server/Dockerfile index 7d59591a..26bedcf0 100644 --- a/packages/cp-gql-mock-server/Dockerfile +++ b/packages/cp-gql-mock-server/Dockerfile @@ -1,14 +1,13 @@ -# todo change to 7 FROM quay.io/yldio/alpine-node-containerpilot:latest -RUN yarn add lerna@^2.0.0-rc.5 \ +RUN yarn add lerna@^2.0.0-rc.5 serve \ && ./node_modules/.bin/lerna clean --yes --scope joyent-cp-gql-mock-server --include-filtered-dependencies \ && ./node_modules/.bin/lerna bootstrap --scope joyent-cp-gql-mock-server --include-filtered-dependencies -WORKDIR /home/node/app/packages/cp-gql-mock-server +WORKDIR /opt/app/packages/cp-gql-mock-server COPY packages/cp-gql-mock-server/etc/containerpilot.json /etc/ ARG CIRCLE_BRANCH EXPOSE 3000 -CMD ["/bin/containerpilot", "yarn", "run", "start"] +CMD ["/bin/containerpilot"] diff --git a/packages/cp-gql-mock-server/etc/containerpilot.json b/packages/cp-gql-mock-server/etc/containerpilot.json index a6c55623..0632c600 100644 --- a/packages/cp-gql-mock-server/etc/containerpilot.json +++ b/packages/cp-gql-mock-server/etc/containerpilot.json @@ -1,46 +1,15 @@ { "consul": "0.0.0.0:8500", - "services": [ + "jobs": [ { "name": "cp-gql-mock-server", "port": 3000, - "health": "/usr/bin/curl -o /dev/null --fail -s http://0.0.0.0:3000/", - "poll": 3, - "ttl": 10 - } - ], - "backends": [], - "telemetry": { - "port": 9090, - "sensors": [ - { - "name": "frontend_memory_percent", - "help": "percentage of memory used", - "type": "gauge", - "poll": 5, - "check": ["/bin/sensors", "memory"] - }, - { - "name": "frontend_cpu_load", - "help": "cpu load", - "type": "gauge", - "poll": 5, - "check": ["/bin/sensors", "cpu"] - }, - { - "name": "frontend_disk_capacity", - "help": "disk capacity", - "type": "gauge", - "poll": 60, - "check": ["/bin/sensors", "diskcapacity"] - }, - { - "name": "frontend_disk_usage", - "help": "disk usage", - "type": "gauge", - "poll": 60, - "check": ["/bin/sensors", "diskusage"] + "exec": "yarn run start", + "health": { + "exec": "/usr/bin/curl -o /dev/null --fail -s http://0.0.0.0:3000/", + "interval": 3, + "ttl": 10 } - ] - } + } + ] } \ No newline at end of file diff --git a/packages/ui-toolkit/Dockerfile b/packages/ui-toolkit/Dockerfile index 655a732b..e1697f39 100644 --- a/packages/ui-toolkit/Dockerfile +++ b/packages/ui-toolkit/Dockerfile @@ -1,16 +1,15 @@ -# todo change to 7 FROM quay.io/yldio/alpine-node-containerpilot:latest RUN yarn add lerna@^2.0.0-rc.5 serve \ && ./node_modules/.bin/lerna clean --yes --scope joyent-ui-toolkit --include-filtered-dependencies \ && ./node_modules/.bin/lerna bootstrap --scope joyent-ui-toolkit --include-filtered-dependencies -WORKDIR /home/node/app/packages/ui-toolkit -COPY packages/ui-toolkit/etc/containerpilot.json /etc/ +WORKDIR /opt/app/packages/ui-toolkit ARG CIRCLE_BRANCH RUN yarn run styleguide:build +COPY packages/ui-toolkit/etc/containerpilot.json /etc/ -EXPOSE 5000 -CMD ["/bin/containerpilot", "../../node_modules/.bin/serve", "-s", "styleguide"] +EXPOSE 6060 +CMD ["/bin/containerpilot"] diff --git a/packages/ui-toolkit/README.md b/packages/ui-toolkit/README.md index 28674d0f..f962f40e 100644 --- a/packages/ui-toolkit/README.md +++ b/packages/ui-toolkit/README.md @@ -3,8 +3,8 @@ [![Docker Repository on Quay](https://quay.io/repository/yldio/joyent-ui-toolkit/status)](https://quay.io/repository/yldio/joyent-ui-toolkit) [![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0) [![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg)](https://github.com/RichardLitt/standard-readme) -[![demo master](https://img.shields.io/badge/demo-master-3B47CC.svg)](http://styleguide-master.svc.f4b20699-b323-4452-9091-977895896da6.eu-ams-1.triton.zone:5000) -[![demo staging](https://img.shields.io/badge/demo-staging-3B47CC.svg)](http://styleguide-staging.svc.f4b20699-b323-4452-9091-977895896da6.eu-ams-1.triton.zone:5000) +[![demo master](https://img.shields.io/badge/demo-master-3B47CC.svg)](http://styleguide-master.svc.f4b20699-b323-4452-9091-977895896da6.eu-ams-1.triton.zone:6060) +[![demo staging](https://img.shields.io/badge/demo-staging-3B47CC.svg)](http://styleguide-staging.svc.f4b20699-b323-4452-9091-977895896da6.eu-ams-1.triton.zone:6060) ## Table of Contents diff --git a/packages/ui-toolkit/etc/containerpilot.json b/packages/ui-toolkit/etc/containerpilot.json index e0e73a73..3e06dc7b 100644 --- a/packages/ui-toolkit/etc/containerpilot.json +++ b/packages/ui-toolkit/etc/containerpilot.json @@ -1,46 +1,15 @@ { "consul": "0.0.0.0:8500", - "services": [ + "jobs": [ { "name": "ui-toolkit", "port": 6060, - "health": "/usr/bin/curl -o /dev/null --fail -s http://0.0.0.0:6060/", - "poll": 3, - "ttl": 10 - } - ], - "backends": [], - "telemetry": { - "port": 9090, - "sensors": [ - { - "name": "frontend_memory_percent", - "help": "percentage of memory used", - "type": "gauge", - "poll": 5, - "check": ["/bin/sensors", "memory"] - }, - { - "name": "frontend_cpu_load", - "help": "cpu load", - "type": "gauge", - "poll": 5, - "check": ["/bin/sensors", "cpu"] - }, - { - "name": "frontend_disk_capacity", - "help": "disk capacity", - "type": "gauge", - "poll": 60, - "check": ["/bin/sensors", "diskcapacity"] - }, - { - "name": "frontend_disk_usage", - "help": "disk usage", - "type": "gauge", - "poll": 60, - "check": ["/bin/sensors", "diskusage"] + "exec": "../../node_modules/.bin/serve --single styleguide --port 6060", + "health": { + "exec": "/usr/bin/curl -o /dev/null --fail -s http://0.0.0.0:6060/", + "interval": 3, + "ttl": 10 } - ] - } -} \ No newline at end of file + } + ] +}