From 90b6031d96c1c8d0bca5cbaa40f803f5d07c97bc Mon Sep 17 00:00:00 2001 From: geek Date: Wed, 2 Aug 2017 16:56:53 -0500 Subject: [PATCH] feat: add getting start guide --- README.md | 97 +++++++++++++++++++++++++++++++++++++----- copilot.png | Bin 0 -> 8063 bytes docker-compose.yml | 104 ++++++++++++++++++++++++++------------------- local-compose.yml | 3 -- triton-compose.yml | 68 ++++++++++++----------------- 5 files changed, 175 insertions(+), 97 deletions(-) create mode 100644 copilot.png diff --git a/README.md b/README.md index 54080150..e695dac6 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,110 @@ -# container-pilot-dashboard +![CoPilot Logo](./copilot.png) + [![CircleCI](https://img.shields.io/circleci/project/github/yldio/joyent-portal/master.svg)](https://circleci.com/gh/yldio/joyent-portal) [![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) -> TODO: Fill out this long short description - -TODO: Fill out this long description. - ## Table of Contents -- [Background](#background) +- [Requirements](#requirements) - [Install](#install) - [Usage](#usage) -- [Maintainers](#maintainers) - [Contribute](#contribute) - [License](#license) -## Background +## Requirements + +- [Triton account](https://sso.joyent.com/signup) +- [Triton CLI](https://www.npmjs.com/package/triton) +- [Docker](https://www.docker.com/) ## Install +### Set local environment variables + +There is a [`setup.sh`](./setup.sh) script that is used to create an environment (`_env`) file that will contain the keys you use to connect to Triton as well as the keys used to secure the CoPilot installation. In order for this to work correctly you will need to first load the Triton environment variables with the `triton profile` you plan to use. Below is an example of setting these environment variables using the `triton` CLI. + +```sh +$ eval "$(triton env)" ``` + +Additionally, you will need a Certificate Authority certificate file, a server certificate, and a server key file. In the subsection below is an example of generating these files. + +### Generating Certificates to Secure CoPilot + +Credit is due to this [CodeShip blog post](https://blog.codeship.com/how-to-set-up-mutual-tls-authentication/) for the original instructions. + +Create the appropriate folders to contain the _ca_, _server_, and _client_ certificate files. + +```sh +$ mkdir -p ca server client +``` + +Generate the CA key and certificate files +```sh +$ openssl genrsa -aes256 -out ca/ca.key 4096 chmod 400 ca/ca.key +$ openssl req -new -x509 -sha256 -days 730 -key ca/ca.key -out ca/ca.crt +$ chmod 444 ca/ca.crt +``` + +Generate the server key files. The FQDN for your host should be specified. In the example below the host that the server will reside on is 'workshop.host' (please change to whatever host CoPilot will be accessible from). +```sh +$ openssl genrsa -out server/workshop.host.key 2048 +$ chmod 400 server/workshop.host.key +$ openssl req -new -key server/workshop.host.key -sha256 -out server/workshop.host.csr +$ openssl x509 -req -days 365 -sha256 -in server/workshop.host.csr -CA ca/ca.crt -CAkey ca/ca.key -set_serial 1 -out server/workshop.host.crt +$ chmod 444 server/workshop.host.crt +``` + +Generate the client certificates that will be installed into the browser. +```sh +$ openssl genrsa -out client/browser.key 2048 +$ openssl req -new -key client/browser.key -out client/browser.csr +$ openssl x509 -req -days 365 -sha256 -in client/browser.csr -CA ca/ca.crt -CAkey ca/ca.key -set_serial 2 -out client/browser.crt +$ openssl pkcs12 -export -clcerts -in client/browser.crt -inkey client/browser.key -out client/browser.p12 +``` + +Next you should install the _client/browser.p12_ certificate in your browser. + + +### Generate `_env` file from _setup.sh_ + +Execute the _setup.sh_ script with the path to your key files. + +```sh +$ ./setup.sh ~/.ssh/id_rsa ca/ca.crt server/workshop.host.key server/workshop.host.crt ``` ## Usage -``` +You have 3 options for where to run CoPilot. You can either run it using the published docker images locally, or on Triton. The last option is to build the docker images and run docker containers from these locally built images. + +### Start CoPilot using published docker images locally + +```sh +$ docker-compose up -d ``` -## Maintainers +Navigate to [https://localhost]() to load the dashboard. + + +### Deploy and run CoPilot on Triton + +```sh +$ docker-compose -f triton-compose.yml up -d +``` + +Optionally use [_triton-docker_](https://github.com/joyent/triton-docker-cli) +```sh +$ triton-compose -f triton-compose.yml up -d +``` + +### Build and run CoPilot locally + +```sh +$ docker-compose -f local-compose.yml up -d +``` ## Contribute @@ -37,4 +112,4 @@ See [the contribute file](CONTRIBUTING.md)! ## License -MPL-2.0 +[MPL-2.0](LICENSE) diff --git a/copilot.png b/copilot.png new file mode 100644 index 0000000000000000000000000000000000000000..ef781ee366501f34d53b110e5106c7c8c3a3d1c5 GIT binary patch literal 8063 zcmd^k^ol>Ji8Ko$l5(9^T z(%qxuJ}BSk`3LUb?q7JZ^Sbtq>zvQo=Y3s)+M3GbWLL=`5D2-d%3WOuglG}`-v%QA zf30(zjv)|cCDprfde4cLlC(OQ8aYcQ_k|m3#6Q4y6xg|E>L# z<+rY^on{Y*Cgtb6ca(SN6NR3UwQ$fUnrAS{`@#9Cv{}xvu_>lrX3K=VX1&Yv-jJoS z#Kbctj(M?K(%aR$OhTe;A2Bx|xw5gi-0||Uo3vnAby+_DuTp~ZS7IWVEQFZqm25B6 zfICT?`rPT~FMg1QY1vm0C<}xLW+@9Xv({GOxCnq?f83Gt6G>PQZ>Y*4I^N zx12P^!c7d5$nIq;kb`o}k;9j-;|lh(Ro|BTJ}bQiWuf{2X$ZZLIJ?LCsMNG304AF%M&vh=cm-*xlzJVdF5N3a?FR^=01Z)O-Mu;jecXz7eOn#^Wd+TM zgJ#@GBcw%r6iX`^+0pEBFd|syJ&0NM1M$pGjnqO6A8{s{1I7yR(IaJ9)Km9&t|AqR zsZjJg4ZsEhnCFIbi4qlI_~cKa{V>5OS{=IxDy2stNh1EW zie&>(wsx-(sAE)x740eXJb<3hTkO+dF$7Uhp?DB=n5*sR7t|3%WjKXu0H{X%V!Os8 zo>CFWX;o;@KRUuvMh@B~y^oWRg!iT&ByPJM>%V-ww8v@{Tmufj6u?ONaN}d3v9Y1F z*;<~T*V{Xek;kGlv{rL*}DTjpmvn`ckLdgG-`6>?5uoY=htqGgtU$QL~(LSw_ zi5NDl5P}xx49_p0X~n-{{kKa(oUe)#s4Wh803oi72>6{-_PGH2G{zWsj4Xez9UJP* z=@Hfj(F@gs2=1)m*m9{-k?_;#E}&%bXrpXH;#@U}yEu|lW*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(<;_CGwLBAsZtPebwqdFz*solO+Da z@n)|GB1N)9=(8ic0@bT8+(19$zOf^uO$;<-kpLDjEM%#|eEtA+@0-Ac&djq|47pm@ z$?zZKM|Jreh#2a~WW`V4icg*7IRPufeAa-KF>!4{XR5pqfHhCRPXL%6fD6}|6zvk) z0QhfYMF0lU?*#9L+{_R!$~Us~M9!dQg*K@Ib+7E#xep8A$2Xc5ObrFjFxLOn#GJ%W zoB$ko0wx1s4FIk_I2W;BX@%C-4F>{B?}>CzCDJU5gJL5q;XsO6{tb!^-W%4aQAAPpG+7oK#orZ-b0-2s@Qqr5)js01uUaamen9; zhJmZzy(iMW+?+0m%tHe#fj*$}+Uo7_s}g&*<5Qhk0U6Guz^p(3MsM7HnL_KM2cqMn zLC!po^NS=^J) z?&z=rX60cR(x30qtUYu-goRI+@(qemC^ywbkXq-I zrIZ*eh3mDAd8|Z?3vheM$%PfS6WVUp)I8<*`p8SS)_r{k|K5s#}OV3aGk_f!oYob z3u&NeXl^p0Q8B@{U>De59V$SGl^|wt(gsV?%I`E|;LbNUQ{Mi5L~99M~bffaL3KXIb%-VM;P1Eb+29dRxY&2wWf z%;hPjqQIhY;}^SqC66-TtQd@4C{N zRffTlr=QXRdpZs@SN__tvR{DJu>ZN_(!WnE*TH%Czx~A>??N%?RC+n=DKOR{s*0L- J3*{fZ{vRQ#%WnVx literal 0 HcmV?d00001 diff --git a/docker-compose.yml b/docker-compose.yml index aedd3b28..aab29420 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,22 +6,20 @@ # turn this into an HA Consul raft. ############################################################################# consul: - image: autopilotpattern/consul:latest + image: autopilotpattern/consul:0.7.2-r0.8 command: > /usr/local/bin/containerpilot /bin/consul agent -server - -bootstrap-expect 3 - -config-dir=/etc/consul - -ui-dir /ui + -config-dir=/etc/consul + -log-level=err + -bootstrap-expect 1 + -ui-dir /ui restart: always mem_limit: 128m ports: - - 8500 + - 8500:8500 dns: - 127.0.0.1 - labels: - - triton.cns.services=consul-$CIRCLE_BRANCH - - com.docker.swarm.affinities=["container!=~*"] ############################################################################# # PROMETHEUS @@ -30,58 +28,78 @@ consul: # it is included here for demo purposes and is not required ############################################################################# prometheus: - image: autopilotpattern/prometheus:latest + image: autopilotpattern/prometheus:1.7.1-r20 restart: always mem_limit: 1g ports: - - 9090 - labels: - - triton.cns.services=prometheus-$CIRCLE_BRANCH - - com.docker.swarm.affinities=["container!=~*prometheus*"] - -############################################################################# -# STYLEGUIDE -############################################################################# -styleguide: - image: quay.io/yldio/joyent-ui-toolkit:$CIRCLE_BRANCH - ports: - - 6060 - mem_limit: 512m - labels: - - triton.cns.services=styleguide-$CIRCLE_BRANCH - - com.docker.swarm.affinities=["container!=~*styleguide*"] + - 9090:9090 + links: + - consul:consul environment: + - CONSUL=consul - CONSUL_AGENT=1 - - PORT=6060 + dns: + - 127.0.0.1 + ############################################################################# # FRONTEND ############################################################################# -cp-frontend: - image: quay.io/yldio/joyent-cp-frontend:$CIRCLE_BRANCH +frontend: + image: joyent/copilot-frontend mem_limit: 512m - labels: - - triton.cns.services=cp-frontend-$CIRCLE_BRANCH - - com.docker.swarm.affinities=["container!=~*cp-frontend*"] + links: + - consul:consul + env_file: + - _env environment: - - CONSUL_AGENT=1 - - PORT=3069 - - REACT_APP_GQL_HOSTNAME=gql-mock-server-$CIRCLE_BRANCH.svc.f4b20699-b323-4452-9091-977895896da6.eu-ams-1.triton.zone - - REACT_APP_GQL_PORT=3000 + - CONSUL=consul + - PORT=443 ports: - - 3069 + - "80:80" + - "443:443" + dns: + - 127.0.0.1 + ############################################################################# # BACKEND ############################################################################# -gql-mock-server: - image: quay.io/yldio/joyent-cp-gql-mock-server:$CIRCLE_BRANCH +api: + image: joyent/copilot-api mem_limit: 512m - labels: - - triton.cns.services=gql-mock-server-$CIRCLE_BRANCH - - com.docker.swarm.affinities=["container!=~*gql-mock-server*"] + links: + - consul:consul + - rethinkdb:rethinkdb + env_file: + - _env environment: - - CONSUL_AGENT=1 + - CONSUL=consul - PORT=3000 - ports: + - RETHINK_HOST=rethinkdb + expose: - 3000 + +# Docker-compose wrapper +# Create _env file from running ./setup.sh +compose-api: + image: joyent/copilot-compose + links: + - consul:consul + expose: + - 4242 + env_file: + - _env + environment: + - CONSUL=consul + restart: always + +rethinkdb: + image: rethinkdb + restart: always + mem_limit: 1g + ports: + - 8080:8080 + expose: + - 28015 + - 29015 diff --git a/local-compose.yml b/local-compose.yml index b2fce420..faab683b 100644 --- a/local-compose.yml +++ b/local-compose.yml @@ -56,9 +56,6 @@ frontend: environment: - CONSUL=consul - PORT=443 - - REACT_APP_GQL_HOSTNAME=workshop.host - - REACT_APP_GQL_PORT=443 - - REACT_APP_GQL_PROTOCOL=https ports: - "80:80" - "443:443" diff --git a/triton-compose.yml b/triton-compose.yml index 550d7860..e07d46b3 100644 --- a/triton-compose.yml +++ b/triton-compose.yml @@ -10,22 +10,18 @@ consul: command: > /usr/local/bin/containerpilot /bin/consul agent -server - -bootstrap-expect 1 -config-dir=/etc/consul + -log-level=err + -bootstrap-expect 1 -ui-dir /ui - # Change "-bootstrap" to "-bootstrap-expect 3", then scale to 3 or more to - # turn this into an HA Consul raft. restart: always mem_limit: 128m - ports: - # As above, this port declaration should not be made for production. - - 8500 labels: - triton.cns.services=copilot-consul + ports: + - 8500:8500 dns: - 127.0.0.1 - env_file: _env - ############################################################################# # PROMETHEUS @@ -34,7 +30,11 @@ consul: # it is included here for demo purposes and is not required ############################################################################# prometheus: - image: autopilotpattern/prometheus:latest + image: autopilotpattern/prometheus:1.7.1-r20 + restart: always + mem_limit: 1g + ports: + - 9090:9090 labels: # This label sets the CNS name, Triton's automatic DNS # Learn more at https://docs.joyent.com/public-cloud/network/cns @@ -42,60 +42,49 @@ prometheus: # This label selects the proper Joyent resource package # https://www.joyent.com/blog/optimizing-docker-on-triton#ram-cpu-and-disk-resources-for-your-containers - com.joyent.package=g4-highcpu-1G - restart: always - ports: - # You may not want these port declarations for production. Without them, Prometheus will only - # listen on the private network. This will also result in a public prometheus CNS record being created, - # in the triton.zone domain. - - 9090 - env_file: _env environment: - CONSUL_AGENT=1 dns: - 127.0.0.1 + ############################################################################# # FRONTEND ############################################################################# frontend: - image: d0cker/copilot-frontend + image: joyent/copilot-frontend + mem_limit: 512m + env_file: + - _env environment: - - PORT=8080 - - REACT_APP_GQL_PORT=80 - expose: - - 8080 - restart: always - -traefik: - image: d0cker/traefik - labels: - - triton.cns.services=copilot + - PORT=443 ports: - - 80 - - 8080 - restart: always + - "80:80" + - "443:443" + dns: + - 127.0.0.1 ############################################################################# # BACKEND ############################################################################# api: - image: d0cker/copilot-api + image: joyent/copilot-api + mem_limit: 512m links: - rethinkdb:rethinkdb env_file: - _env environment: - - PORT=8080 + - PORT=3000 - RETHINK_HOST=rethinkdb expose: - - 8080 - restart: always + - 3000 # Docker-compose wrapper # Create _env file from running ./setup.sh -composeapi: - image: d0cker/compose-api +compose-api: + image: joyent/copilot-compose expose: - 4242 env_file: @@ -106,11 +95,10 @@ rethinkdb: image: rethinkdb restart: always mem_limit: 1g - # You may not want these port declarations for production. It + labels: + - triton.cns.services=copilot-rethinkdb ports: - - 8080 + - 8080:8080 expose: - 28015 - 29015 - labels: - - triton.cns.services=copilot-rethinkdb