Skip to content

Commit 9051be3

Browse files
authored
Merge pull request #15 from TaskarCenterAtUW/main
Dev Deploy
2 parents e82ea5e + 12fdbb5 commit 9051be3

File tree

2 files changed

+75
-11
lines changed

2 files changed

+75
-11
lines changed

README.md

Lines changed: 74 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1-
# Contents of This Repo
1+
# Dev Standards
22

3-
## Frontend Tier
3+
### Branch Strategy
4+
5+
* **main**: day to day work goes here.
6+
* **dev**: current code of the dev environment. No commits allowed directly; you'll need to open a PR from main. Committing/pushing here causes a deployment to the dev infrastructure.
7+
8+
### GH Actions
9+
10+
See GitHub's actions tab in this repo for more deployment examples/steps.
11+
12+
# System Overview
13+
14+
### Frontend Tier
415
* ```frontend```: The Workspaces frontend (VueJS app).
516
* Code here: https://github.com/TaskarCenterAtUW/workspaces-frontend.
617
* Uses the other components within this repo, e.g. ```osm-rails```, ```osm-cgimap``` and ```tasking-manager``` as an API backend.
@@ -10,14 +21,16 @@
1021
* Workspaces version in the ```workspaces``` branch. Need to pull from public version periodically to keep up to date.
1122
* Public version: tries to be a match to ```main``` of upstream.
1223

13-
## Backend Tier
24+
### Backend Tier
1425
* ```osm-web```: Reverse proxy that dispatches requests to osm-cgimap or osm-rails depending on performance requirements.
1526
* ```osm-log-proxy```: sits in front of the below two services, logs requests for debugging purposes.
1627
* ```osm-rails```: “reference implementation” for OSM API for editing. Slow.
1728
* ```osm-cgimap```: Faster version of osm-rails. API format the same as osm-rails. Only some functions of osm-rails.
1829
* ```tasking-manager```: Not currently using, but task manager for OSM.
19-
20-
# To build images
30+
31+
# Getting Started
32+
33+
### To build images for deploy
2134

2235
```git clone --recursive https://github.com/TaskarCenterAtUW/workspaces-stack.git```
2336

@@ -27,17 +40,68 @@
2740

2841
Replace XXX.env with the environment definition file of the environment for which you want to build an image. This can be overridden when running (see below).
2942

30-
# To update docker daemon to run with latest images
43+
### To update docker daemon to run with latest images
3144

3245
```docker-compose -f docker-compose.deploy.yml --env-file XXX.env up -d -pull always --force-recreate --remove-orphans```
3346

3447
Replace XXX.env with the environment definition file of the environment for which you are deploying.
3548

36-
# Other Files
49+
### Other Files
3750

3851
* ```example.env```: template of the .env file required by the Docker compose YAML files
39-
* ```tdei_uw.env```: .env for deployment at UW's TDEI center. Only UW should use this, new users should adapt example.env to suit their needs. LTG: remove this file from this repo.
52+
* ```tdei_uw.env```: .env for deployment at UW's TDEI center. Only UW should use this, new users should adapt example.env to suit their needs. LTG: remove this file from this repo.
53+
54+
# Local Development
55+
56+
### To build images for local development
57+
58+
You will need access to prepopulated .env files that are not in version control. Specifically local.dev.env for the rest of these steps, which is assumed to be found in the workspaces-stack root directory.
59+
60+
Add (or merge) the following to your ```/etc/hosts``` file:
61+
62+
```127.0.0.1 localhost workspaces.local api.workspaces.local rapid.workspaces.local osm.workspaces.local pathways.workspaces.local tasks.workspaces.local```
63+
64+
You will also need to increase the total amount of system memory available to Docker containers to 10+ GB. In Docker Desktop you find this in Settings -> Resources -> Memory Limit.
65+
66+
```git clone --recursive https://github.com/TaskarCenterAtUW/workspaces-stack.git```
67+
68+
Comment out the ```osm-log-proxy``` section from ```docker-compose.yml``` as aggregate logging is not available locally.
69+
70+
```docker-compose build```
71+
72+
```cp local.dev.env .env```
73+
74+
```docker-compose up -d```
75+
76+
Now we are ready to finalize configuration on each container.
77+
78+
```
79+
docker-compose run --rm --entrypoint=bash frontend
80+
npm i
81+
exit
82+
```
83+
84+
```
85+
docker-compose run --rm --entrypoint=bash rapid
86+
npm i
87+
exit
88+
```
89+
90+
```
91+
docker-compose run --rm --entrypoint=bash pathways-editor
92+
npm i
93+
exit
94+
```
95+
96+
```
97+
docker-compose run --rm --entrypoint=bash osm-rails
98+
cp /config/example.storage.yml /config/storage.yml
99+
bundle install
100+
exit
101+
```
40102

41-
# GH Actions
103+
Note that there are two different ways to run individual containers depending on your dev context.
42104

43-
See GitHub's actions tab in this repo for more deployment examples/steps.
105+
Using the frontend container as an example:
106+
* To debug / step through run ```docker-compose run --rm frontend```
107+
* To run while working on another service run ```docker-compose up -d frontend```

frontend

0 commit comments

Comments
 (0)