Skip to content

Commit e161abb

Browse files
authored
feat: setup frontend on argus (#1666)
1 parent 8ed6f62 commit e161abb

18 files changed

+279
-7
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Update prod
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
prod_stack_upsert:
13+
runs-on: ARM64
14+
permissions:
15+
id-token: write
16+
issues: write
17+
pull-requests: write
18+
19+
steps:
20+
- name: Update Prod Stack
21+
uses: chanzuckerberg/argus-artifacts/ci/packages/create-stack@v0.54.1
22+
with:
23+
appName: cryoet-frontend
24+
envName: prod
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Create an RDev Stack
2+
3+
on:
4+
pull_request:
5+
types: [labeled, synchronize]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
create-stack:
13+
runs-on: ARM64
14+
if: contains(github.event.pull_request.labels.*.name, 'stack')
15+
permissions:
16+
id-token: write
17+
issues: write
18+
pull-requests: write
19+
20+
steps:
21+
- name: Create Stack
22+
id: upsert
23+
uses: chanzuckerberg/argus-artifacts/ci/packages/create-stack@v0.54.1
24+
with:
25+
appName: cryoet-frontend
26+
envName: rdev
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Delete an RDev Stack
2+
3+
on:
4+
pull_request:
5+
types: [ unlabeled, closed ]
6+
7+
jobs:
8+
delete-stack:
9+
runs-on: ARM64
10+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'stack') || github.event.pull_request.state == 'closed' }}
11+
permissions:
12+
id-token: write
13+
issues: write
14+
pull-requests: write
15+
16+
steps:
17+
- name: Delete Stack
18+
uses: chanzuckerberg/argus-artifacts/ci/packages/delete-stack@v0.54.1
19+
with:
20+
appName: cryoet-frontend
21+
envName: rdev
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Update staging
2+
3+
on:
4+
pull_request:
5+
types: [ opened, synchronize ]
6+
paths:
7+
- '.infra/common.yaml'
8+
- '.infra/staging/values.yaml'
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
run_if:
16+
if: github.head_ref == 'release-please--branches--main--components--frontend'
17+
runs-on: ARM64
18+
steps:
19+
- run: echo "The head branch of this PR is the release please branch"
20+
21+
staging_stack_upsert:
22+
needs: run_if
23+
runs-on: ARM64
24+
permissions:
25+
id-token: write
26+
issues: write
27+
pull-requests: write
28+
29+
steps:
30+
- name: Update Staging Stack
31+
uses: chanzuckerberg/argus-artifacts/ci/packages/create-stack@v0.54.1
32+
with:
33+
appName: cryoet-frontend
34+
envName: staging
35+
postStackDetails: false
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Docker Build Rdev
2+
3+
on:
4+
pull_request:
5+
types: [ labeled, synchronize ]
6+
paths:
7+
- 'frontend/**'
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
rdev_argus_builder:
15+
uses: ./.github/workflows/workflow-argus-docker-build.yaml
16+
secrets: inherit
17+
if: contains(github.event.pull_request.labels.*.name, 'stack') && github.event.sender.type != 'Bot'
18+
with:
19+
envs: rdev
20+
path_filters: 'frontend/**'
21+
branches_ignore: main,release-please--branches--main
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Docker Build Staging/Prod
2+
3+
on:
4+
push:
5+
paths:
6+
- 'frontend/**'
7+
branches:
8+
- release-please--branches--main--components--frontend
9+
10+
jobs:
11+
argus_builder:
12+
uses: ./.github/workflows/workflow-argus-docker-build.yaml
13+
secrets: inherit
14+
with:
15+
envs: staging,prod
16+
path_filters: '!.infra/**,frontend/**'
17+
branches_include: release-please--branches--main--components--frontend
18+
force_update_manifests: true
Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,19 @@ permissions:
1313
jobs:
1414
release-please:
1515
concurrency:
16-
group: release-prs-${{ github.ref }}
16+
group: ${{ github.workflow }}-${{ github.ref }}
1717
cancel-in-progress: true
1818

19-
runs-on: ubuntu-latest
19+
runs-on: ARM64
2020
steps:
21+
# See https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow
22+
# For why we need to generate a token and not use the default
23+
- name: Generate token
24+
id: generate_token
25+
uses: tibdex/github-app-token@v2
26+
with:
27+
app_id: ${{ secrets.CZI_RELEASE_PLEASE_APP_ID }}
28+
private_key: ${{ secrets.CZI_RELEASE_PLEASE_PK }}
2129
- name: release please
2230
uses: googleapis/release-please-action@v4
2331
id: release
@@ -26,7 +34,7 @@ jobs:
2634
manifest-file: "release-please.manifest.json"
2735
config-file: "release-please.config.json"
2836
target-branch: "main"
29-
token: ${{ secrets.GITHUB_TOKEN }}
37+
token: ${{ steps.generate_token.outputs.token }}
3038

3139
outputs:
3240
paths_released: ${{ steps.release.outputs.paths_released }}
@@ -50,7 +58,7 @@ jobs:
5058

5159
- uses: actions/setup-python@v4
5260
with:
53-
pyton-version: "3.10"
61+
python-version: "3.12"
5462

5563
- name: build
5664
run: |
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Docker Image Build
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
envs:
7+
description: "Env names, comma delimited"
8+
required: true
9+
type: string
10+
path_filters:
11+
description: "Glob patterns to match against changed files in the repository, comma delimited"
12+
required: true
13+
type: string
14+
branches_include:
15+
description: "Branches to build on, comma delimited"
16+
required: false
17+
type: string
18+
default: "*"
19+
branches_ignore:
20+
description: "Branches to skip build on, comma delimited"
21+
required: false
22+
type: string
23+
default: ""
24+
force_update_manifests:
25+
description: "Whether to always update ArgoCD manifests after building the Docker images"
26+
required: false
27+
type: boolean
28+
default: false
29+
30+
jobs:
31+
argus_builder:
32+
uses: chanzuckerberg/github-actions/.github/workflows/argus-docker-build.yaml@v4.2.0
33+
secrets: inherit
34+
with:
35+
branches_include: ${{ inputs.branches_include }}
36+
branches_ignore: ${{ inputs.branches_ignore }}
37+
force_update_manifests: ${{ inputs.force_update_manifests }}
38+
path_filters: ${{ inputs.path_filters }}
39+
envs: ${{ inputs.envs }}
40+
images: |
41+
{
42+
"frontend": {
43+
"context": "frontend",
44+
"dockerfile": "frontend/packages/data-portal/Dockerfile"
45+
}
46+
}

.infra/common.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
stack:
2+
global:
3+
replicaCount: 2
4+
autoscaling:
5+
enabled: false
6+
service:
7+
port: 8080
8+
env:
9+
- name: AWS_REGION
10+
value: us-west-2
11+
- name: AWS_ACCESS_KEY_ID
12+
value: test
13+
- name: AWS_SECRET_ACCESS_KEY
14+
value: test
15+
- name: JWK_PUBLIC_KEY_FILE
16+
value: /var/keys/public_key.pem
17+
- name: JWK_PRIVATE_KEY_FILE
18+
value: /var/keys/private_key.pem
19+
services:
20+
frontend:
21+
image:
22+
repository: 533267185808.dkr.ecr.us-west-2.amazonaws.com/core-platform/cryoet-data-portal/frontend/frontend
23+
paths:
24+
- /
25+
pathType: Prefix

.infra/prod/Chart.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: v2
2+
name: stack
3+
type: application
4+
version: 1.0.0
5+
dependencies:
6+
- name: stack
7+
version: 2.5.3
8+
repository: https://chanzuckerberg.github.io/argo-helm-charts

0 commit comments

Comments
 (0)