Public | Automated Build

Last pushed: 7 months ago
Short Description
Authenticated proxy code
Full Description

Synopsis

Contains dashboard UI code (frontend and backend).

Folder structure

  • /src App server, API and frontend source code.
  • /src/frontend Frontend UI app.
  • /src/backend API and App Server.
  • /lib Supporting configuration. Mainly used for Vagrant provisioning.

Packaging

API, Nginx, and all supporting materials run in Docker containers. In development, we use a Vagrant image for this. The list of containers is:

  1. apiserver (API and frontend Node process).
  2. Elasticsearch and Kibana.
  3. nginx proxying to apiserver (TCP 3000) and Elasticsearch (TCP 9200)

Consumer Usage

Vagrant provisioner will spin up everything needed above including building the Docker container for the apiserver. Therefore, you should be able to simply vagrant up and access the dashboard at http://localhost:3000.

Development Usage

To modify the contents of the API server, you can either rebuild the image with each change or start a development instance on a different port (other than 3000 or 9200). The endpoint required is already being exposed via Vagrant on TCP 8080. To re-route the API, set the following variable in your env before starting: PROXY=localhost and PROXY_PORT=8080. The API will start on TCP 3000 by default. Override this with PORT=[port num].

Developer pre-reqs:

  1. NodeJS

Setup (abridged):

Start Elasticsearch, Kibana and Nginx containers. Also builds and starts apiserver container based on current directory contents. Note that the containers do not restart automatically if the Vagrant machine is rebooted.

vagrant up

Test that Elasticsearch is happy:

curl localhost:9200/_cluster/health?pretty -u [username]:[password]

Install backend dependencies

(cd src/backend && npm install)

Install frontend dependencies

(cd src/frontend && npm install)

Build/minify/package frontend components

(cd src/frontend && npm pack)

Start development server

export PORT=3004
export PROXY=localhost
export PROXY_PORT=5601
(cd src/backend && npm start)

Connect to VA ES cluster:

ssh -A cloud-user@128.107.33.31 -i /vagrant/oss20.key -L 172.18.0.1:9200:10.0.5.66:9200

Deploy updated code in VA (manual)

  1. Get CONSUL URI and customer name. As of the last update to this doc, the CONSUL URI in VA is 10.0.5.97:8500. These go in CONSUL and CUSTOMER_ID environment variables.
  2. For customer0 SSH to web server at 10.0.5.95. Substitute correct IP for other customers.
  3. Pull latest images:

     CONSUL=10.0.5.97:8500 CUSTOMER_ID=customer0 docker-compose \
         -f docker-compose-va-cd.yml pull
    
  4. Run the containers

     CONSUL=10.0.5.97:8500 CUSTOMER_ID=customer0 docker-compose \
         -f docker-compose-va-cd.yml up \
         --force-recreate -d
    
Docker Pull Command
Owner
ccfoss
Source Repository

Comments (0)