Skip to content

Commit 7cc0087

Browse files
feat: otel collector, runtime and studio install (#17372)
1 parent 3d1a348 commit 7cc0087

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1544
-34
lines changed
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Runtime - deploy observability
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- infra/observability/base/**
9+
- infra/observability/runtime/**
10+
- .github/workflows/deploy-runtime-observability.yaml
11+
workflow_dispatch:
12+
inputs:
13+
rings:
14+
description: 'Rings to tag the artifact with. Format of the input object is [{"ring": "at_ring1", "environment": "runtime_at_ring1"}].'
15+
required: false
16+
default: '[{"ring": "at_ring1", "environment": "runtime_at_ring1"}]'
17+
18+
permissions:
19+
id-token: write
20+
contents: read
21+
22+
jobs:
23+
get-short-sha:
24+
uses: ./.github/workflows/template-short-sha.yaml
25+
26+
construct-rings-array:
27+
runs-on: ubuntu-latest
28+
env:
29+
default-rings: >-
30+
[{"ring": "at_ring1", "environment": "runtime_at_ring1"},{"ring": "at_ring2", "environment": "runtime_at_ring2"},{"ring": "tt_ring1", "environment": "runtime_tt_ring1"},{"ring": "tt_ring2", "environment": "runtime_tt_ring2"},{"ring": "prod_ring1", "environment": "runtime_prod_ring1"},{"ring": "prod_ring2", "environment": "runtime_prod_ring2"}]
31+
outputs:
32+
ringsjson: ${{ steps.construct-rings.outputs.ringsjson }}
33+
steps:
34+
- name: Construct rings array
35+
id: construct-rings
36+
run: |
37+
rings='${{ github.event.inputs.rings }}'
38+
if [ -z "$rings" ]; then
39+
rings='${{ env.default-rings }}'
40+
fi
41+
echo "Raw rings input: $rings"
42+
echo "ringsjson=${rings}" >> $GITHUB_OUTPUT
43+
44+
push-observability-artifact:
45+
name: Push observability as OCI artifact
46+
needs: get-short-sha
47+
runs-on: ubuntu-latest
48+
environment: dev
49+
env:
50+
REGISTRY_NAME: altinncr
51+
CONFIG_REPO: altinncr.azurecr.io/studio-apps/runtime-observability:${{ needs.get-short-sha.outputs.short-sha }}
52+
outputs:
53+
config-repo: altinncr.azurecr.io/studio-apps/runtime-observability:${{ needs.get-short-sha.outputs.short-sha }}
54+
defaults:
55+
run:
56+
working-directory: infra/observability
57+
steps:
58+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
59+
60+
- name: az login
61+
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2
62+
with:
63+
client-id: ${{ secrets.AZURE_CLIENT_ID_FC }}
64+
tenant-id: ${{ secrets.AZURE_TENANT_ID_FC }}
65+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_FC }}
66+
67+
- name: az acr login
68+
run: az acr login --name ${{ env.REGISTRY_NAME }}
69+
70+
- name: flux install
71+
uses: fluxcd/flux2/action@8454b02a32e48d775b9f563cb51fdcb1787b5b93 # v2.7.5
72+
73+
- name: build manifests
74+
run: ./build.sh runtime
75+
76+
- name: push artifact
77+
run: |
78+
flux push artifact oci://${{ env.CONFIG_REPO }} \
79+
--provider=azure \
80+
--reproducible \
81+
--path="./dist/runtime" \
82+
--source="$(git config --get remote.origin.url)" \
83+
--revision="$(git branch --show-current)/$(git rev-parse HEAD)"
84+
85+
tag-observability:
86+
name: Tag observability
87+
needs: [push-observability-artifact, construct-rings-array]
88+
runs-on: ubuntu-latest
89+
environment: ${{ matrix.environment }}
90+
strategy:
91+
matrix:
92+
include: ${{ fromJson(needs.construct-rings-array.outputs.ringsjson) }}
93+
steps:
94+
- name: az login
95+
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2
96+
with:
97+
client-id: ${{ secrets.AZURE_CLIENT_ID_FC }}
98+
tenant-id: ${{ secrets.AZURE_TENANT_ID_FC }}
99+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_FC }}
100+
101+
- name: az acr login
102+
run: az acr login --name altinncr
103+
104+
- name: flux install
105+
uses: fluxcd/flux2/action@8454b02a32e48d775b9f563cb51fdcb1787b5b93 # v2.7.5
106+
107+
- name: tag artifact
108+
run: |
109+
flux tag artifact oci://${{ needs.push-observability-artifact.outputs.config-repo }} \
110+
--tag ${{ matrix.ring }}
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Deploy Studio Observability
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- infra/observability/base/**
8+
- infra/observability/studio/**
9+
- infra/observability/build.sh
10+
- .github/workflows/deploy-studio-observability.yaml
11+
workflow_dispatch:
12+
inputs:
13+
environments:
14+
description: 'Environments to deploy to. Multiple environments can be specified by separating them with a comma.'
15+
required: false
16+
default: 'dev'
17+
18+
permissions:
19+
id-token: write
20+
contents: read
21+
22+
jobs:
23+
get-short-sha:
24+
uses: ./.github/workflows/template-short-sha.yaml
25+
26+
construct-environments-array:
27+
uses: ./.github/workflows/template-construct-environments.yaml
28+
with:
29+
environments: ${{ github.event.inputs.environments || 'dev,staging,prod' }}
30+
31+
push-artifact:
32+
name: Push observability as OCI artifact
33+
needs: get-short-sha
34+
runs-on: ubuntu-latest
35+
environment: dev
36+
env:
37+
REGISTRY_NAME: altinntjenestercontainerregistry
38+
CONFIG_REPO: altinntjenestercontainerregistry.azurecr.io/altinn-studio/configs/observability-repo:${{ needs.get-short-sha.outputs.short-sha }}
39+
outputs:
40+
CONFIG_REPO: altinntjenestercontainerregistry.azurecr.io/altinn-studio/configs/observability-repo:${{ needs.get-short-sha.outputs.short-sha }}
41+
defaults:
42+
run:
43+
working-directory: infra/observability
44+
steps:
45+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
46+
47+
- name: az login
48+
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2
49+
with:
50+
client-id: ${{ secrets.AZURE_CLIENT_ID_FC }}
51+
tenant-id: ${{ secrets.AZURE_TENANT_ID_FC }}
52+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_FC }}
53+
54+
- name: az acr login
55+
run: az acr login --name ${{ env.REGISTRY_NAME }}
56+
57+
- name: flux install
58+
uses: fluxcd/flux2/action@8454b02a32e48d775b9f563cb51fdcb1787b5b93 # v2.7.5
59+
60+
- name: build manifests
61+
run: ./build.sh studio
62+
63+
- name: push artifact
64+
run: |
65+
flux push artifact oci://${{ env.CONFIG_REPO }} \
66+
--provider=azure \
67+
--reproducible \
68+
--path="./dist/studio" \
69+
--source="$(git config --get remote.origin.url)" \
70+
--revision="$(git branch --show-current)/$(git rev-parse HEAD)"
71+
72+
tag:
73+
name: Tag artifact
74+
needs: [push-artifact, construct-environments-array]
75+
runs-on: ubuntu-latest
76+
environment: ${{ matrix.environment }}
77+
env:
78+
REGISTRY_NAME: altinntjenestercontainerregistry
79+
strategy:
80+
matrix:
81+
environment: ${{ fromJSON(needs.construct-environments-array.outputs.environmentsjson) }}
82+
steps:
83+
- name: az login
84+
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2
85+
with:
86+
client-id: ${{ secrets.AZURE_CLIENT_ID_FC }}
87+
tenant-id: ${{ secrets.AZURE_TENANT_ID_FC }}
88+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_FC }}
89+
90+
- name: az acr login
91+
run: az acr login --name ${{ env.REGISTRY_NAME }}
92+
93+
- name: flux install
94+
uses: fluxcd/flux2/action@8454b02a32e48d775b9f563cb51fdcb1787b5b93 # v2.7.5
95+
96+
- name: tag artifact
97+
run: |
98+
flux tag artifact oci://${{ needs.push-artifact.outputs.CONFIG_REPO }} \
99+
--tag ${{ matrix.environment }}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Deploy Studio OTel Operator
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- infra/studio/otel-operator/**
8+
- .github/workflows/deploy-studio-otel-operator.yaml
9+
workflow_dispatch:
10+
inputs:
11+
environments:
12+
description: 'Environments to deploy to. Multiple environments can be specified by separating them with a comma.'
13+
required: false
14+
default: 'dev'
15+
16+
permissions:
17+
id-token: write
18+
contents: read
19+
20+
jobs:
21+
get-short-sha:
22+
uses: ./.github/workflows/template-short-sha.yaml
23+
24+
construct-environments-array:
25+
uses: ./.github/workflows/template-construct-environments.yaml
26+
with:
27+
environments: ${{ github.event.inputs.environments || 'dev,staging,prod' }}
28+
29+
push-artifact:
30+
name: Push otel-operator as OCI artifact
31+
needs: get-short-sha
32+
runs-on: ubuntu-latest
33+
environment: dev
34+
env:
35+
REGISTRY_NAME: altinntjenestercontainerregistry
36+
CONFIG_REPO: altinntjenestercontainerregistry.azurecr.io/altinn-studio/configs/otel-operator-repo:${{ needs.get-short-sha.outputs.short-sha }}
37+
outputs:
38+
CONFIG_REPO: altinntjenestercontainerregistry.azurecr.io/altinn-studio/configs/otel-operator-repo:${{ needs.get-short-sha.outputs.short-sha }}
39+
defaults:
40+
run:
41+
working-directory: infra/studio/otel-operator
42+
steps:
43+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
44+
45+
- name: az login
46+
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2
47+
with:
48+
client-id: ${{ secrets.AZURE_CLIENT_ID_FC }}
49+
tenant-id: ${{ secrets.AZURE_TENANT_ID_FC }}
50+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_FC }}
51+
52+
- name: az acr login
53+
run: az acr login --name ${{ env.REGISTRY_NAME }}
54+
55+
- name: flux install
56+
uses: fluxcd/flux2/action@8454b02a32e48d775b9f563cb51fdcb1787b5b93 # v2.7.5
57+
58+
- name: push artifact
59+
run: |
60+
flux push artifact oci://${{ env.CONFIG_REPO }} \
61+
--provider=azure \
62+
--reproducible \
63+
--path="." \
64+
--source="$(git config --get remote.origin.url)" \
65+
--revision="$(git branch --show-current)/$(git rev-parse HEAD)"
66+
67+
tag:
68+
name: Tag artifact
69+
needs: [push-artifact, construct-environments-array]
70+
runs-on: ubuntu-latest
71+
environment: ${{ matrix.environment }}
72+
env:
73+
REGISTRY_NAME: altinntjenestercontainerregistry
74+
strategy:
75+
matrix:
76+
environment: ${{ fromJSON(needs.construct-environments-array.outputs.environmentsjson) }}
77+
steps:
78+
- name: az login
79+
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2
80+
with:
81+
client-id: ${{ secrets.AZURE_CLIENT_ID_FC }}
82+
tenant-id: ${{ secrets.AZURE_TENANT_ID_FC }}
83+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_FC }}
84+
85+
- name: az acr login
86+
run: az acr login --name ${{ env.REGISTRY_NAME }}
87+
88+
- name: flux install
89+
uses: fluxcd/flux2/action@8454b02a32e48d775b9f563cb51fdcb1787b5b93 # v2.7.5
90+
91+
- name: tag artifact
92+
run: |
93+
flux tag artifact oci://${{ needs.push-artifact.outputs.CONFIG_REPO }} \
94+
--tag ${{ matrix.environment }}

0 commit comments

Comments
 (0)