Skip to content

Commit

Permalink
[deploy] Fix: helm resources; workflow ubuntu; Docker logging (#3405)
Browse files Browse the repository at this point in the history
  • Loading branch information
imnasnainaec authored Oct 30, 2024
1 parent 55384c3 commit e349e02
Show file tree
Hide file tree
Showing 30 changed files with 124 additions and 74 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,14 @@ jobs:
github.com:443
md-hdd-t032zjxllntc.z26.blob.storage.azure.net:443
objects.githubusercontent.com:443
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup dotnet
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Install ffmpeg
uses: FedericoCarboni/setup-ffmpeg@36c6454b5a2348e7794ba2d82a21506605921e3d # v3

# Coverage.
- name: Run coverage tests
run: dotnet test Backend.Tests/Backend.Tests.csproj
shell: bash
Expand All @@ -54,19 +53,16 @@ jobs:
name: coverage
path: Backend.Tests/coverage.cobertura.xml
retention-days: 7

# Development build.
- run: dotnet build BackendFramework.sln

# Release build.
- run: dotnet publish BackendFramework.sln

# Fmt.
- run: dotnet format --verify-no-changes
- name: Development build
run: dotnet build BackendFramework.sln
- name: Release build
run: dotnet publish BackendFramework.sln
- name: Format check
run: dotnet format --verify-no-changes

upload_coverage:
needs: test_build
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
# See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on
# configuring harden-runner and identifying allowed endpoints.
Expand Down Expand Up @@ -146,8 +142,8 @@ jobs:
uses: github/codeql-action/analyze@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3

docker_build:
if: ${{ github.event.type }} == "PullRequest"
runs-on: ubuntu-22.04
# if: ${{ github.event.type }} == "PullRequest"
steps:
# See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on
# configuring harden-runner and identifying allowed endpoints.
Expand All @@ -170,7 +166,8 @@ jobs:
ts-crl.ws.symantec.com:80
# For subfolders, currently a full checkout is required.
# See: https://github.com/marketplace/actions/build-and-push-docker-images#path-context
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: Build backend
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ name: "CodeQL"

on:
push:
branches: ["master"]
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: ["master"]
branches: [master]
schedule:
- cron: "21 8 * * 3"

Expand All @@ -26,7 +26,7 @@ permissions: # added using https://github.com/step-security/secure-workflows
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
actions: read
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/combine_deploy_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions: # added using https://github.com/step-security/secure-workflows

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
# See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on
# configuring harden-runner and identifying allowed endpoints.
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions: # added using https://github.com/step-security/secure-workflows
jobs:
docker_build:
if: ${{ github.event.type }} == "PullRequest"
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
# See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on
# configuring harden-runner and identifying allowed endpoints.
Expand All @@ -26,7 +26,8 @@ jobs:
registry-1.docker.io:443
# For subfolders, currently a full checkout is required.
# See: https://github.com/marketplace/actions/build-and-push-docker-images#path-context
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: Build database image
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions:

jobs:
dependency-review:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy_qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
matrix:
component: [frontend, backend, maintenance, database]

runs-on: ubuntu-latest
runs-on: ubuntu-22.04
outputs:
image_tag: ${{ steps.build_combine.outputs.image_tag }}
steps:
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
build_component: ${{ matrix.component }}
clean_ecr_repo:
needs: build
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
# See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on
# configuring harden-runner and identifying allowed endpoints.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
component: [frontend, backend, maintenance, database]
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
outputs:
image_tag: ${{ steps.build_combine.outputs.image_tag }}
steps:
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions: # added using https://github.com/step-security/secure-workflows

jobs:
lint_build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [20]
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
- run: npm run build

test_coverage:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [20]
Expand All @@ -64,7 +64,8 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run test-frontend:coverage
- name: Run tests and generate coverage
run: npm run test-frontend:coverage
env:
CI: true
- name: Upload coverage artifact
Expand All @@ -77,7 +78,7 @@ jobs:

upload_coverage:
needs: test_coverage
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
# See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on
# configuring harden-runner and identifying allowed endpoints.
Expand Down Expand Up @@ -110,8 +111,8 @@ jobs:
name: Frontend

docker_build:
runs-on: ubuntu-latest
if: ${{ github.event.type }} == "PullRequest"
runs-on: ubuntu-22.04
steps:
# See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on
# configuring harden-runner and identifying allowed endpoints.
Expand All @@ -128,7 +129,8 @@ jobs:
pypi.org:443
registry-1.docker.io:443
registry.npmjs.org:443
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: Build frontend
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/maintenance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions: # added using https://github.com/step-security/secure-workflows
jobs:
docker_build:
if: ${{ github.event.type }} == "PullRequest"
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
# See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on
# configuring harden-runner and identifying allowed endpoints.
Expand All @@ -30,7 +30,8 @@ jobs:
security.ubuntu.com:80
# For subfolders, currently a full checkout is required.
# See: https://github.com/marketplace/actions/build-and-push-docker-images#path-context
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: Build maintenance image
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions: # added using https://github.com/step-security/secure-workflows

jobs:
deploy:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
# See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on
# configuring harden-runner and identifying allowed endpoints.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions: # added using https://github.com/step-security/secure-workflows

jobs:
tox:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.12"]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ permissions: read-all
jobs:
analysis:
name: Scorecards analysis
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
Expand Down
6 changes: 5 additions & 1 deletion deploy/helm/aws-login/templates/aws-ecr-login-cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ spec:
configMapKeyRef:
key: DOCKER_EMAIL
name: {{ .Values.awsEcr.configName }}
resources: {}
resources:
requests:
memory: 128Mi
limits:
memory: 128Mi
securityContext:
capabilities: {}
terminationMessagePath: /dev/termination-log
Expand Down
6 changes: 5 additions & 1 deletion deploy/helm/aws-login/templates/aws-ecr-login-oneshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ spec:
configMapKeyRef:
key: DOCKER_EMAIL
name: "{{ .Values.awsEcr.configName }}"
resources: {}
resources:
requests:
memory: 128Mi
limits:
memory: 128Mi
securityContext:
capabilities: {}
terminationMessagePath: /dev/termination-log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ spec:
configMapKeyRef:
key: VERBOSE
name: {{ .Values.envName | quote }}
resources: {}
resources:
requests:
memory: 128Mi
limits:
memory: 128Mi
securityContext:
capabilities: {}
terminationMessagePath: /dev/termination-log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ spec:
configMapKeyRef:
key: VERBOSE
name: {{ .Values.envName | quote }}
resources: {}
resources:
requests:
memory: 128Mi
limits:
memory: 128Mi
securityContext:
capabilities: {}
terminationMessagePath: /dev/termination-log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ spec:
resources:
requests:
cpu: 2m
memory: 100M
memory: 128Mi
limits:
memory: 150M
memory: 128Mi
restartPolicy: Always
{{- if ne .Values.global.pullSecretName "None" }}
imagePullSecrets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ spec:
resources:
requests:
cpu: 1m
memory: 10M
memory: 128Mi
limits:
memory: 50M
memory: 128Mi
volumeMounts:
- name: nginx-html
mountPath: /usr/share/nginx/html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ spec:
image: {{ include "create-admin-user.containerImage" . }}
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
name: create-admin-user
resources: {}
resources:
requests:
memory: 128Mi
limits:
memory: 128Mi
volumeMounts:
- mountPath: /home/app/.CombineFiles
name: backend-data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ spec:
resources:
requests:
cpu: 5m
memory: 960Mi
memory: 2Gi
{{- if .Values.global.includeResourceLimits }}
limits:
memory: 4Gi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ spec:
resources:
requests:
cpu: 25m
memory: 950Mi
memory: 1Gi
{{- if .Values.global.includeResourceLimits }}
limits:
memory: 2Gi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ spec:
resources:
requests:
cpu: 1m
memory: 15M
memory: 128Mi
{{- if .Values.global.includeResourceLimits }}
limits:
memory: 40M
memory: 128Mi
{{- end }}
volumeMounts:
- mountPath: /usr/share/nginx/fonts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ spec:
resources:
requests:
cpu: 200m
memory: 150M
memory: 128Mi
limits:
memory: 150M
memory: 128Mi
securityContext:
capabilities: {}
terminationMessagePath: /dev/termination-log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ spec:
- deployment/maintenance
- --
- get-fonts.sh
resources: {}
resources:
requests:
memory: 128Mi
limits:
memory: 128Mi
securityContext:
capabilities: {}
terminationMessagePath: /dev/termination-log
Expand Down
Loading

0 comments on commit e349e02

Please sign in to comment.