Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo PR - Do not merge #62

Open
wants to merge 68 commits into
base: feature/vdyp-demo
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
6249996
Unit test for veteran processing
smithkm Aug 13, 2024
aa23281
Merge branch 'feature/VDYP-433' into feature/VDYP-306
smithkm Aug 13, 2024
393e7ae
Merge remote-tracking branch 'origin/main' into feature/VDYP-306
smithkm Aug 13, 2024
d935f0a
Fixing incorrect computation of lorey height for non-primary species …
smithkm Aug 14, 2024
593b40f
Veteran layer processing test works for primary layer
smithkm Aug 14, 2024
71c0537
Remove .orig files that accidentally got commited
smithkm Aug 14, 2024
795685a
Progress on veteran processing for VRI
smithkm Aug 14, 2024
081f2ed
Progress on veteran processing for VRI
smithkm Aug 14, 2024
509452e
Merge remote-tracking branch 'origin/main' into feature/VDYP-306
smithkm Aug 16, 2024
9fd007b
VRI veteran processing
smithkm Aug 16, 2024
50ef65c
Veteran VRI processing works on standard code path
smithkm Aug 22, 2024
d359c68
Unit test for computeUtilizationComponentsVeteran
smithkm Aug 23, 2024
0c0a71e
Update species percent based on computed base areas
smithkm Aug 28, 2024
d7debb0
Remove incoreect supress warmings annotation for unused, remove unuse…
smithkm Aug 28, 2024
fc7729a
Merge pull request #57 from bcgov/feature/VDYP-306
mjunkin Aug 28, 2024
1088480
initial commit
vividroyjeong Aug 29, 2024
2fdf0d1
Merge pull request #1 from vividroyjeong/feature/initial
vividroyjeong Aug 30, 2024
c1460bb
changed the packages needed for build from devDependencies to depende…
vividroyjeong Aug 30, 2024
51e4f19
added Dockerfile and Caddyfile
vividroyjeong Aug 30, 2024
84dea26
Fix invalid Health Check URL
vividroyjeong Aug 30, 2024
ae832ee
Merge pull request #2 from vividroyjeong/feature/docker
vividroyjeong Aug 30, 2024
b367650
Add github workflow to deploy web-ui to dev
vividroyjeong Sep 3, 2024
6591f15
Add openshift object definition files
vividroyjeong Sep 3, 2024
e2917dd
Merge pull request #3 from vividroyjeong/feature/deploy-config
vividroyjeong Sep 3, 2024
5f916a7
Add host to specify vdyp dev url
vividroyjeong Sep 4, 2024
94cf7b5
Merge pull request #4 from vividroyjeong/feature/deploy-config
vividroyjeong Sep 4, 2024
6e7069e
Replace the target port with the activity port in its place
vividroyjeong Sep 4, 2024
27d110e
Merge pull request #5 from vividroyjeong/feature/deploy-config
vividroyjeong Sep 4, 2024
a39a3e8
Fix metadata name in egress config
vividroyjeong Sep 4, 2024
4fd9562
Merge pull request #6 from vividroyjeong/feature/deploy-config
vividroyjeong Sep 4, 2024
43484cc
Disable Sonar analysis to temporarily run a maven build from a forked…
vividroyjeong Sep 4, 2024
045b100
Create docker.yml
vivid-cpreston Sep 5, 2024
8ba2567
Merge pull request #7 from vivid-cpreston/patch-1
vividroyjeong Sep 5, 2024
42ca7b2
Fix build context
vividroyjeong Sep 5, 2024
ba4e111
Add missing Checkout
vividroyjeong Sep 5, 2024
8d2753d
Add permissions
vividroyjeong Sep 5, 2024
e4a823d
Add metadata step
vivid-cpreston Sep 5, 2024
873ff15
Merge pull request #8 from vivid-cpreston/patch-2
vividroyjeong Sep 5, 2024
ea8ed66
Update actual docker image path
vividroyjeong Sep 5, 2024
7bc4a14
Update caddy run
vividroyjeong Sep 5, 2024
e01ffe2
Modify the execute permission of Caddy
vividroyjeong Sep 5, 2024
56484d0
Define variables used by Caddy
vividroyjeong Sep 5, 2024
c12a788
Remove 'set up environment variables' step
vividroyjeong Sep 5, 2024
bc4015e
Add env variable definitions on deploy
vividroyjeong Sep 5, 2024
74cabc8
Add permissions to access the directory
vividroyjeong Sep 5, 2024
e244bfb
Add permissions for Caddy running
vividroyjeong Sep 5, 2024
a894801
Modify to run as root temporary
vividroyjeong Sep 5, 2024
e0d37be
Remove the unnecessary capability
vividroyjeong Sep 5, 2024
4362859
Remove comment
vividroyjeong Sep 5, 2024
84a1790
Revert changes into quickstart-openshift Dockerfile caddy config part
vividroyjeong Sep 5, 2024
6d46e83
Add overwrite option
vividroyjeong Sep 5, 2024
172e982
Grant exec permissions on Caddy to anonymous user
vividroyjeong Sep 5, 2024
4faa41a
add NET_BIND_SERVICE capability
vividroyjeong Sep 5, 2024
bae4eeb
Add exe permission to non-root user
vividroyjeong Sep 5, 2024
d832997
Merge branch 'main' of https://github.com/vividroyjeong/NR-VDYP
vividroyjeong Sep 5, 2024
ff6ba39
Update Dockerfile
vivid-cpreston Sep 5, 2024
0b0fc16
Update vdyp-web-ui-deployment.yaml
vivid-cpreston Sep 5, 2024
b19c1fe
Merge branch 'feature/vdyp-demo' of https://github.com/vivid-cpreston…
vivid-cpreston Sep 6, 2024
42bbb87
Update demo-openshift.yml
vivid-cpreston Sep 6, 2024
5c0e13a
Use branchname for tag
vivid-cpreston Sep 6, 2024
3b5cd79
Temporarily disable triggers
vivid-cpreston Sep 6, 2024
1bfea73
Merge pull request #1 from vivid-cpreston/feature/vdyp-demo
vivid-cpreston Sep 6, 2024
c747b49
Rearrange directories
vivid-cpreston Sep 6, 2024
292601e
Update demo-openshift.yml
vivid-cpreston Sep 6, 2024
49a1335
Re-add PR triggers
vivid-cpreston Sep 6, 2024
433c983
Uncomment sonar analysis
vivid-cpreston Sep 6, 2024
f650f7d
test input
vividroyjeong Sep 6, 2024
d35086d
Add vdyp-web-ui into PR path
vividroyjeong Sep 6, 2024
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
26 changes: 12 additions & 14 deletions .github/workflows/demo-openshift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ on:
workflow_dispatch:
pull_request:
paths:
- 'vdyp-web-ui/**'
- 'vdyp-api/**'
- 'vdyp-buildtools/migrations'

- "frontend/**"
- "backend/**"
- "migrations/**"
- "vdyp-web-ui/**"
concurrency:
# Cancel in progress for PR open and close
group: ${{ github.event.number }}
# Cancel if re-attempted
group: ${{ github.event_name }}
cancel-in-progress: true

jobs:
Expand All @@ -20,13 +20,12 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
package: [vdyp-api/backend, vdyp-web-ui/frontend, vdyp-buildtools/migrations]
package: [backend, frontend, migrations, vdyp-web-ui]
timeout-minutes: 10
steps:
- uses: bcgov-nr/action-builder-ghcr@v2.0.2
- uses: bcgov-nr/action-builder-ghcr@v2.2.0
with:
build_context: ${{ matrix.build_context }}
keep_versions: 10
keep_versions: 50
package: ${{ matrix.package }}
tag: ${{ github.event.number }}
tag_fallback: latest
Expand All @@ -36,14 +35,13 @@ jobs:
deploys:
name: Deploys
needs: [builds]
uses: bcgov/quickstart-openshift-helpers/.github/workflows/.deployer.yml@v0.4.1
uses: bcgov/quickstart-openshift-helpers/.github/workflows/.deployer.yml@v0.6.1
secrets:
oc_namespace: ${{ secrets.OC_NAMESPACE }}
oc_token: ${{ secrets.OC_TOKEN }}
with:
triggers: ('vdyp-api/backend/' 'vdyp-web-ui/frontend/' 'vdyp-tools/migrations/')
params:
--set global.secrets.persist=false
triggers: ('backend/' 'frontend/' 'migrations/' 'vdyp-web-ui/')
params: --set global.secrets.persist=false

# tests:
# name: Tests
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
permissions:
contents: read
packages: write

on:
workflow_dispatch:
inputs:
BUILD_TARGET:
type: choice
description: 'Name of project to build'
options:
- vdyp-web-ui
required: true
TAG:
required: false
type: string
default: "latest"
description: 'Additional tag to add to docker image'


jobs:
docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Github Container Repository
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- id: trimBranchName
name: trim branch name if necessary
run: |
export branchTag="${{ github.ref_name }}"
trimTag="${branchTag##*/}"
echo "BRANCH_TAG=$trimTag" >> $GITHUB_OUTPUT

- name: Extract metadata (tags, labels) for Docker
id: meta_pr
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ghcr.io/${{ github.repository }}-${{ inputs.BUILD_TARGET }}
tags: |
type=schedule
type=raw,value=${{ steps.trimBranchName.outputs.BRANCH_TAG }}
type=ref,event=tag
type=raw,value=${{ inputs.TAG }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./${{inputs.BUILD_TARGET}}
push: true
tags: ${{ steps.meta_pr.outputs.tags }}
labels: ${{ steps.meta_pr.outputs.labels }}


52 changes: 52 additions & 0 deletions .github/workflows/openshift-deploy-web-ui-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Deploy web-ui to Openshift Dev
on:
workflow_dispatch:
inputs:
TAG:
required: false
description: The docker image to deploy e.g. 1.0.0, 1.1.2, etc
type: string
default: latest
jobs:
build:
runs-on: ubuntu-latest
environment:
name: dev # read secrets from test environment in github.
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Copy openshift yaml files
run: mkdir staging && cp openshift/vdyp-web-ui*.yaml staging/

- name: Fill yaml files
uses: cschleiden/[email protected]
with:
files: staging/**.yaml
env:
#Common variables
ENV: dev
NAMESPACE: ${{ vars.OC_NAMESPACE }}
TAG: ${{ inputs.TAG }}

#Frontend variables
ACTIVE_PORT: ${{ vars.TARGET_PORT }}
LOG_LEVEL: ${{ vars.LOG_LEVEL }}
BACKEND_URL: ${{ vars.BACKEND_URL }}

- name: Authenticate and set context
uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{secrets.OPENSHIFT_SERVER_URL}}
openshift_token: ${{secrets.OC_TOKEN}}
namespace: ${{ vars.OC_NAMESPACE }}

- name: Apply .yaml files to openshift
run: |
for file in staging/*
do
oc apply -f "$file"
done
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion vdyp-web-ui/frontend/package.json → frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@vitejs/plugin-react": "^4.0.0",
"axios": "^1.6.8",
"mui-datatables": "^4.3.0",
"quickstart-openshift-react-frontend": "file:",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router": "^6.12.1",
Expand All @@ -46,8 +47,8 @@
"cypress-file-upload": "^5.0.8",
"cypress-plugin-api": "^2.11.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.0.0",
"eslint-config-love": "^48.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-cypress": "^2.13.3",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions openshift/vdyp-web-ui-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
kind: ConfigMap
apiVersion: v1
metadata:
name: vdyp-web-ui-config-#{ENV}#
namespace: "#{NAMESPACE}#"
managedFields:
- manager: Mozilla
operation: Update
apiVersion: v1
time: "2024-04-15T22:11:17Z"
fieldsType: FieldsV1
immutable: false
data:
ACTIVE_PORT: "#{ACTIVE_PORT}#"
49 changes: 49 additions & 0 deletions openshift/vdyp-web-ui-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: "#{NAMESPACE}#"
name: "vdyp-web-ui-deployment-#{ENV}#"
spec:
selector:
matchLabels:
app: vdyp-web-ui-#{ENV}#
replicas: 2
template:
metadata:
labels:
app: vdyp-web-ui-#{ENV}#
project: vdyp-#{ENV}#
spec:
containers:
- name: container
image: >-
ghcr.io/vivid-cpreston/nr-vdyp-vdyp-web-ui:latest
ports:
- containerPort: #{ACTIVE_PORT}#
protocol: TCP
env:
- name: ACTIVE_PORT
valueFrom:
configMapKeyRef:
name: vdyp-web-ui-config-#{ENV}#
key: ACTIVE_PORT
- name: LOG_LEVEL
value: "#{LOG_LEVEL}#"
- name: BACKEND_URL
value: "#{BACKEND_URL}#"
securityContext:
capabilities:
add:
- NET_BIND_SERVICE
resources:
requests:
cpu: 100m
memory: 200Mi
limits:
cpu: 200m
memory: 400Mi
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 50%
maxUnavailable: 50%
13 changes: 13 additions & 0 deletions openshift/vdyp-web-ui-egress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: vdyp-web-ui-egress-#{ENV}#
namespace: "#{NAMESPACE}#"
spec:
podSelector:
matchLabels:
app: vdyp-web-ui-#{ENV}#
policyTypes:
- Egress
egress:
- {}
17 changes: 17 additions & 0 deletions openshift/vdyp-web-ui-route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
kind: Route
apiVersion: route.openshift.io/v1
metadata:
name: vdyp-web-ui-route-#{ENV}#
namespace: "#{NAMESPACE}#"
labels: {}
spec:
host: vdyp-ui-dev.apps.silver.devops.gov.bc.ca
to:
kind: Service
name: vdyp-web-ui-service-#{ENV}#
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
destinationCACertificate: ""
port:
targetPort: #{ACTIVE_PORT}#
12 changes: 12 additions & 0 deletions openshift/vdyp-web-ui-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: vdyp-web-ui-service-#{ENV}#
namespace: "#{NAMESPACE}#"
spec:
selector:
app: vdyp-web-ui-#{ENV}#
ports:
- protocol: TCP
port: #{ACTIVE_PORT}#
targetPort: #{ACTIVE_PORT}#
5 changes: 5 additions & 0 deletions vdyp-buildtools/tests/integration/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vdyp-buildtools/tests/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"dependencies": {
"axios": "^1.6.8",
"dotenv": "^16.3.1",
"integration-tests": "file:",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21"
}
Expand Down
Loading
Loading