Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
22c15d1
Update build.yaml
jeffmaki Feb 20, 2025
e4719bf
Cleanup
jeffmaki Feb 20, 2025
77d9424
Update build.yaml
jeffmaki Feb 20, 2025
a842ce2
Update build.yaml
jeffmaki Feb 20, 2025
bea3867
Update build.yaml
jeffmaki Feb 20, 2025
69e6ce2
Update build.yaml
jeffmaki Feb 20, 2025
78b44f4
Update build.yaml
jeffmaki Feb 20, 2025
145f5b7
Update build.yaml
jeffmaki Feb 20, 2025
02798e1
Update build.yaml
jeffmaki Feb 20, 2025
898372b
Update build.yaml
jeffmaki Feb 20, 2025
efe6da6
Update build.yaml
jeffmaki Feb 20, 2025
405944c
Update build.yaml
jeffmaki Feb 20, 2025
46b7a60
Update build.yaml
jeffmaki Feb 20, 2025
314e775
Update build.yaml
jeffmaki Feb 20, 2025
fd6b7fa
Update build.yaml
jeffmaki Feb 20, 2025
fa19254
Update build.yaml
jeffmaki Feb 20, 2025
fd97ff3
Update build.yaml
jeffmaki Feb 20, 2025
b3d12a0
Update README.md
jeffmaki Feb 20, 2025
ff8978e
Update README.md
jeffmaki Feb 20, 2025
be9ee0e
Adding section to README for local development
uwjohnbee Mar 3, 2025
202ca06
Merge pull request #13 from TaskarCenterAtUW/onboarding-john-bee
jeffmaki Mar 3, 2025
58f6233
Format fixes for markdown syntax
uwjohnbee Mar 3, 2025
dc8675d
Merge pull request #14 from TaskarCenterAtUW/onboarding-john-bee
uwjohnbee Mar 3, 2025
12fdbb5
Update frontend
jeffmaki Mar 6, 2025
1910146
Update build.yaml
jeffmaki Mar 6, 2025
7fbf04c
Update README.md
jeffmaki Mar 10, 2025
d6f63f9
Allow POSM DB host to not be strictly tied to env name
jeffmaki Mar 13, 2025
194cfa7
Forgot to pass the GH vars to env vars
jeffmaki Mar 13, 2025
5766d77
Update build.yaml
jeffmaki Mar 13, 2025
390fd1a
Changing URLs of resources to be env tied
jeffmaki Mar 13, 2025
f2179a1
Update tdei_uw.env
jeffmaki Mar 13, 2025
0d24afd
Update frontend repo pointer to workspaces-frontend/master
jeffmaki Mar 18, 2025
e1f3f37
Merge branch 'Frontend-Submodule-Update'
jeffmaki Mar 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 0 additions & 173 deletions .github/build-v2-wip.yaml

This file was deleted.

54 changes: 35 additions & 19 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: "Release"
on:
push:
branches:
- dev
- stage

workflow_dispatch:
inputs:
build_flag:
Expand All @@ -13,9 +18,9 @@ on:
jobs:
build:
runs-on: ubuntu-latest
name: Build, Push, Deploy (dev)
environment: "dev"
timeout-minutes: 45
name: Build, Push, Deploy
environment: ${{ github.ref_name }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -27,13 +32,19 @@ jobs:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: "Build Changelog"
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v5
with:
fromTag: "0.1"
toTag: ${{ github.sha }}
mode: "HYBRID"
# - name: Get last tag
# run: echo "TAG_LAST=$(git describe --tags --abbrev=0 --always)" >> $GITHUB_ENV

# - name: "Build Changelog"
# id: build_changelog
# uses: mikepenz/release-changelog-builder-action@v5
# with:
# toTag: "${{ github.ref }}"
# mode: "HYBRID"
# outputFile: "CHANGELOG.md"

# - name: Print CHANGELOG.md
# run: cat CHANGELOG.md

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -44,9 +55,12 @@ jobs:
docker compose -f docker-compose.build.yml --env-file tdei_uw.env push
env:
ENV: ${{ vars.ENV }}
WS_DOCKER_REGISTRY: ${{ vars.WS_DOCKER_REGISTRY }}
CODE_VERSION: ${{ github.sha }}


# hosts
WS_DOCKER_REGISTRY: ${{ vars.WS_DOCKER_REGISTRY }}
WS_POSM_DB_HOST: ${{ vars.WS_POSM_DB_HOST }}

# passwords
WS_API_DB_PASS: ${{ secrets.WS_API_DB_PASS }}
WS_MAPBOX_ACCESS_TOKEN: ${{ secrets.WS_MAPBOX_ACCESS_TOKEN }}
Expand All @@ -59,15 +73,18 @@ jobs:
- name: Deploy
env:
ENV: ${{ vars.ENV }}
WS_DOCKER_REGISTRY: ${{ vars.WS_DOCKER_REGISTRY }}
CODE_VERSION: ${{ github.sha }}

# machine to deploy to
AZURE_DOCKER_HOST_IP: ${{ vars.AZURE_DOCKER_HOST_IP }}

# tag to deploy
WS_DOCKER_TAG: ${{ github.sha }}


# hosts
WS_DOCKER_REGISTRY: ${{ vars.WS_DOCKER_REGISTRY }}
WS_POSM_DB_HOST: ${{ vars.WS_POSM_DB_HOST }}

# passwords
WS_API_DB_PASS: ${{ secrets.WS_API_DB_PASS }}
WS_MAPBOX_ACCESS_TOKEN: ${{ secrets.WS_MAPBOX_ACCESS_TOKEN }}
Expand All @@ -88,8 +105,8 @@ jobs:
ssh-add ~/.ssh/github_actions

echo Configuring docker context
docker context create dev --docker "host=ssh://github-actions@${{ vars.AZURE_DOCKER_HOST_IP }}"
docker context use dev
docker context create ${{ vars.ENV }} --docker "host=ssh://github-actions@${{ vars.AZURE_DOCKER_HOST_IP }}"
docker context use ${{ vars.ENV }}

# remove images no longer in use--may need disk space to pull
echo Pruning old docker images
Expand All @@ -103,6 +120,5 @@ jobs:
sleep 30s

echo Deploy list
docker ps


docker ps

88 changes: 79 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# Contents of This Repo
# Dev Standards

## Frontend Tier
### Branch Strategy

* **main**: day to day work goes here.
* **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.
* **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.
* **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.

### GH Actions

See GitHub's actions tab in this repo for more deployment examples/steps.

# System Overview

### Frontend Tier
* ```frontend```: The Workspaces frontend (VueJS app).
* Code here: https://github.com/TaskarCenterAtUW/workspaces-frontend.
* Uses the other components within this repo, e.g. ```osm-rails```, ```osm-cgimap``` and ```tasking-manager``` as an API backend.
Expand All @@ -10,30 +23,87 @@
* Workspaces version in the ```workspaces``` branch. Need to pull from public version periodically to keep up to date.
* Public version: tries to be a match to ```main``` of upstream.

## Backend Tier
### Backend Tier
* ```osm-web```: Reverse proxy that dispatches requests to osm-cgimap or osm-rails depending on performance requirements.
* ```osm-log-proxy```: sits in front of the below two services, logs requests for debugging purposes.
* ```osm-rails```: “reference implementation” for OSM API for editing. Slow.
* ```osm-cgimap```: Faster version of osm-rails. API format the same as osm-rails. Only some functions of osm-rails.
* ```tasking-manager```: Not currently using, but task manager for OSM.

# To build images

# Getting Started

### To build images for deploy

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

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

```docker-compose --env-file XXX.env push```
```docker-compose -f docker-compose.build.yml push```

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

# To update docker daemon to run with latest images
### To update docker daemon to run with latest images

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

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

# Other Files
### Other Files

* ```example.env```: template of the .env file required by the Docker compose YAML files
* ```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.
* ```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.

# Local Development

### To build images for local development

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.

Add (or merge) the following to your ```/etc/hosts``` file:

```127.0.0.1 localhost workspaces.local api.workspaces.local rapid.workspaces.local osm.workspaces.local pathways.workspaces.local tasks.workspaces.local```

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.

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

Comment out the ```osm-log-proxy``` section from ```docker-compose.yml``` as aggregate logging is not available locally.

```docker-compose build```

```cp local.dev.env .env```

```docker-compose up -d```

Now we are ready to finalize configuration on each container.

```
docker-compose run --rm --entrypoint=bash frontend
npm i
exit
```

```
docker-compose run --rm --entrypoint=bash rapid
npm i
exit
```

```
docker-compose run --rm --entrypoint=bash pathways-editor
npm i
exit
```

```
docker-compose run --rm --entrypoint=bash osm-rails
cp /config/example.storage.yml /config/storage.yml
bundle install
exit
```

Note that there are two different ways to run individual containers depending on your dev context.

Using the frontend container as an example:
* To debug / step through run ```docker-compose run --rm frontend```
* To run while working on another service run ```docker-compose up -d frontend```
Loading