Skip to content

Commit d4e05c8

Browse files
authored
Merge pull request #16 from TaskarCenterAtUW/main
Sync stage with main
2 parents 8ffbce4 + 7fbf04c commit d4e05c8

File tree

5 files changed

+105
-399
lines changed

5 files changed

+105
-399
lines changed

.github/build-v2-wip.yaml

Lines changed: 0 additions & 173 deletions
This file was deleted.

.github/workflows/build.yaml

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: "Release"
22
on:
3+
push:
4+
branches:
5+
- dev
6+
- stage
7+
38
workflow_dispatch:
49
inputs:
510
build_flag:
@@ -13,9 +18,9 @@ on:
1318
jobs:
1419
build:
1520
runs-on: ubuntu-latest
16-
name: Build, Push, Deploy (dev)
17-
environment: "dev"
18-
timeout-minutes: 45
21+
name: Build, Push, Deploy
22+
environment: ${{ github.ref_name }}
23+
timeout-minutes: 30
1924
steps:
2025
- uses: actions/checkout@v2
2126
with:
@@ -27,13 +32,19 @@ jobs:
2732
username: ${{ vars.DOCKERHUB_USERNAME }}
2833
password: ${{ secrets.DOCKERHUB_TOKEN }}
2934

30-
- name: "Build Changelog"
31-
id: build_changelog
32-
uses: mikepenz/release-changelog-builder-action@v5
33-
with:
34-
fromTag: "0.1"
35-
toTag: ${{ github.sha }}
36-
mode: "HYBRID"
35+
# - name: Get last tag
36+
# run: echo "TAG_LAST=$(git describe --tags --abbrev=0 --always)" >> $GITHUB_ENV
37+
38+
# - name: "Build Changelog"
39+
# id: build_changelog
40+
# uses: mikepenz/release-changelog-builder-action@v5
41+
# with:
42+
# toTag: "${{ github.ref }}"
43+
# mode: "HYBRID"
44+
# outputFile: "CHANGELOG.md"
45+
46+
# - name: Print CHANGELOG.md
47+
# run: cat CHANGELOG.md
3748

3849
- name: Set up Docker Buildx
3950
uses: docker/setup-buildx-action@v3
@@ -88,8 +99,8 @@ jobs:
8899
ssh-add ~/.ssh/github_actions
89100
90101
echo Configuring docker context
91-
docker context create dev --docker "host=ssh://github-actions@${{ vars.AZURE_DOCKER_HOST_IP }}"
92-
docker context use dev
102+
docker context create ${{ vars.ENV }} --docker "host=ssh://github-actions@${{ vars.AZURE_DOCKER_HOST_IP }}"
103+
docker context use ${{ vars.ENV }}
93104
94105
# remove images no longer in use--may need disk space to pull
95106
echo Pruning old docker images
@@ -103,6 +114,5 @@ jobs:
103114
sleep 30s
104115
105116
echo Deploy list
106-
docker ps
107-
108-
117+
docker ps
118+

README.md

Lines changed: 79 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
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 (or your feature branch). Committing/pushing here causes a deployment to the dev infrastructure.
7+
* **stage**: current code of the stage environment. No commits allowed directly; you'll need to open a PR from dev. Committing/pushing here causes a deployment to the stage infrastructure.
8+
* **prod**: current code of the prod environment. No commits allowed directly; you'll need to open a PR from stage. Committing/pushing here causes a deployment to the prod infrastructure.
9+
10+
### GH Actions
11+
12+
See GitHub's actions tab in this repo for more deployment examples/steps.
13+
14+
# System Overview
15+
16+
### Frontend Tier
417
* ```frontend```: The Workspaces frontend (VueJS app).
518
* Code here: https://github.com/TaskarCenterAtUW/workspaces-frontend.
619
* Uses the other components within this repo, e.g. ```osm-rails```, ```osm-cgimap``` and ```tasking-manager``` as an API backend.
@@ -10,30 +23,87 @@
1023
* Workspaces version in the ```workspaces``` branch. Need to pull from public version periodically to keep up to date.
1124
* Public version: tries to be a match to ```main``` of upstream.
1225

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

2237
```git clone --recursive https://github.com/TaskarCenterAtUW/workspaces-stack.git```
2338

2439
```docker-compose -f docker-compose.build.yml --env-file XXX.env build```
2540

26-
```docker-compose --env-file XXX.env push```
41+
```docker-compose -f docker-compose.build.yml push```
2742

2843
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).
2944

30-
# To update docker daemon to run with latest images
45+
### To update docker daemon to run with latest images
3146

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

3449
Replace XXX.env with the environment definition file of the environment for which you are deploying.
3550

36-
# Other Files
51+
### Other Files
3752

3853
* ```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.
54+
* ```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.
55+
56+
# Local Development
57+
58+
### To build images for local development
59+
60+
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.
61+
62+
Add (or merge) the following to your ```/etc/hosts``` file:
63+
64+
```127.0.0.1 localhost workspaces.local api.workspaces.local rapid.workspaces.local osm.workspaces.local pathways.workspaces.local tasks.workspaces.local```
65+
66+
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.
67+
68+
```git clone --recursive https://github.com/TaskarCenterAtUW/workspaces-stack.git```
69+
70+
Comment out the ```osm-log-proxy``` section from ```docker-compose.yml``` as aggregate logging is not available locally.
71+
72+
```docker-compose build```
73+
74+
```cp local.dev.env .env```
75+
76+
```docker-compose up -d```
77+
78+
Now we are ready to finalize configuration on each container.
79+
80+
```
81+
docker-compose run --rm --entrypoint=bash frontend
82+
npm i
83+
exit
84+
```
85+
86+
```
87+
docker-compose run --rm --entrypoint=bash rapid
88+
npm i
89+
exit
90+
```
91+
92+
```
93+
docker-compose run --rm --entrypoint=bash pathways-editor
94+
npm i
95+
exit
96+
```
97+
98+
```
99+
docker-compose run --rm --entrypoint=bash osm-rails
100+
cp /config/example.storage.yml /config/storage.yml
101+
bundle install
102+
exit
103+
```
104+
105+
Note that there are two different ways to run individual containers depending on your dev context.
106+
107+
Using the frontend container as an example:
108+
* To debug / step through run ```docker-compose run --rm frontend```
109+
* To run while working on another service run ```docker-compose up -d frontend```

0 commit comments

Comments
 (0)