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

chore(ci): extend backend startup timeouts and probes #270

Merged
merged 8 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
- name: backend
verification_path: actuator/health
file: backend/openshift.deploy.yml
timeout: 15m
parameters:
-p RESULTS_ENV_OPENSEARCH=test
-p AWS_COGNITO_ISSUER_URI=https://cognito-idp.${{ vars.AWS_REGION }}.amazonaws.com/${{ vars.VITE_USER_POOLS_ID }}
Expand All @@ -72,6 +73,7 @@ jobs:
parameters:
-p ZONE=test
${{ matrix.parameters }}
timeout: ${{ matrix.timeout }}
verification_path: ${{ matrix.verification_path }}

init-prod:
Expand Down Expand Up @@ -129,6 +131,7 @@ jobs:
- name: backend
verification_path: actuator/health
file: backend/openshift.deploy.yml
timeout: 15m
parameters:
-p RESULTS_ENV_OPENSEARCH=production
-p AWS_COGNITO_ISSUER_URI=https://cognito-idp.${{ vars.AWS_REGION }}.amazonaws.com/${{ vars.VITE_USER_POOLS_ID }}
Expand All @@ -147,8 +150,9 @@ jobs:
oc_namespace: ${{ vars.OC_NAMESPACE }}
oc_server: ${{ vars.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
overwrite: ${{ matrix.overwite }}
overwrite: ${{ matrix.overwrite }}
parameters:
-p ZONE=prod
${{ matrix.parameters }}
timeout: ${{ matrix.timeout }}
verification_path: ${{ matrix.verification_path }}
58 changes: 30 additions & 28 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,37 +64,37 @@ jobs:
-p ORACLE_DB_PASSWORD='${{ secrets.DB_PASSWORD }}'
triggers: ('common/' 'backend/' 'frontend/')

builds:
name: Builds
needs: [init]
if: "!github.event.pull_request.head.repo.fork"
runs-on: ubuntu-22.04
permissions:
packages: write
strategy:
matrix:
name: [database, backend, frontend]
include:
- package: database
triggers: ('database/')
- name: backend
triggers: ('backend/')
- name: frontend
triggers: ('frontend/')
steps:
- uses: actions/checkout@v4
- uses: bcgov-nr/[email protected]
with:
package: ${{ matrix.name }}
tag: ${{ github.event.number }}
tag_fallback: test
token: ${{ secrets.GITHUB_TOKEN }}
triggers: ${{ matrix.triggers }}
# builds:
# name: Builds
# needs: [init]
# if: "!github.event.pull_request.head.repo.fork"
# runs-on: ubuntu-22.04
# permissions:
# packages: write
# strategy:
# matrix:
# name: [database, backend, frontend]
# include:
# - package: database
# triggers: ('database/')
# - name: backend
# triggers: ('backend/')
# - name: frontend
# triggers: ('frontend/')
# steps:
# - uses: actions/checkout@v4
# - uses: bcgov-nr/[email protected]
# with:
# package: ${{ matrix.name }}
# tag: ${{ github.event.number }}
# tag_fallback: test
# token: ${{ secrets.GITHUB_TOKEN }}
# triggers: ${{ matrix.triggers }}

deploys:
name: Deploys
if: "!github.event.pull_request.head.repo.fork"
needs: [builds]
# needs: [builds]
runs-on: ubuntu-22.04
strategy:
matrix:
Expand All @@ -107,6 +107,7 @@ jobs:
overwrite: false
- name: backend
file: backend/openshift.deploy.yml
timeout: 15m
verification_path: /actuator/health
parameters:
-p MAX_REPLICAS=1
Expand All @@ -123,7 +124,7 @@ jobs:
- name: fluentbit
file: common/openshift.fluentbit.yml
steps:
- uses: bcgov-nr/action-deployer-openshift@v2.1.0
- uses: bcgov-nr/action-deployer-openshift@v2.3.0
with:
file: ${{ matrix.file }}
oc_namespace: ${{ vars.OC_NAMESPACE }}
Expand All @@ -133,5 +134,6 @@ jobs:
parameters:
-p ZONE=${{ github.event.number }}
${{ matrix.parameters }}
timeout: ${{ matrix.timeout }}
triggers: ('common/' 'backend/' 'frontend/')
verification_path: ${{ matrix.verification_path }}
29 changes: 13 additions & 16 deletions backend/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,36 +173,33 @@ objects:
secretKeyRef:
name: ${NAME}-${ZONE}-database
key: database-user
ports:
- containerPort: 8080
protocol: TCP
resources:
requests:
cpu: "${CPU_REQUEST}"
memory: "${MEMORY_REQUEST}"
limits:
cpu: "${CPU_LIMIT}"
memory: "${MEMORY_LIMIT}"
readinessProbe:
ports:
- name: probe-port
containerPort: 8080
protocol: TCP
startupProbe:
httpGet:
path: /actuator/health
port: 8080
scheme: HTTP
port: probe-port
initialDelaySeconds: 120
periodSeconds: 5
timeoutSeconds: 10
successThreshold: 1
failureThreshold: 30
readinessProbe:
httpGet:
path: /actuator/health
port: probe-port
failureThreshold: 5
livenessProbe:
successThreshold: 1
failureThreshold: 5
httpGet:
path: /actuator/health
port: 8080
scheme: HTTP
initialDelaySeconds: 150
periodSeconds: 30
timeoutSeconds: 5
port: probe-port
failureThreshold: 10
volumes:
- name: ${NAME}-${ZONE}-fluentbit-logs
persistentVolumeClaim:
Expand Down
Loading