Skip to content

Commit

Permalink
Add Helm versions template (#246)
Browse files Browse the repository at this point in the history
Co-authored-by: GitHub Action <>
  • Loading branch information
goshander authored Nov 26, 2024
1 parent 8c04402 commit f6d7daa
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 65 deletions.
50 changes: 0 additions & 50 deletions .github/workflows/update-compose.yml

This file was deleted.

72 changes: 72 additions & 0 deletions .github/workflows/update-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
on:
pull_request:
paths:
- 'templates/**.j2'
- 'versions-config.json'
workflow_call:
inputs:
pr_head:
type: string

name: Update docker-compose and helm versions
permissions:
contents: write

jobs:
update_versions:
name: build files
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.head.ref }}${{ inputs.pr_head }}"
token: ${{ secrets.GH_TOKEN }}
- uses: azure/[email protected]
with:
version: v3.16.2
- name: build docker-compose.yml
uses: cuchi/[email protected]
with:
template: ./templates/docker-compose.j2
output_file: ./docker-compose.yml
data_file: versions-config.json
data_format: json
- name: build docker-compose-dev.yml
uses: cuchi/[email protected]
with:
template: ./templates/docker-compose.j2
output_file: ./docker-compose-dev.yml
data_file: versions-config.json
data_format: json
env:
DEV_MODE: 'true'
- name: build docker-compose.zitadel.yml
uses: cuchi/[email protected]
with:
template: ./templates/docker-compose.zitadel.j2
output_file: ./docker-compose.zitadel.yml
data_file: versions-config.json
data_format: json
- name: check docker-compose.yml config
run: docker compose -f ./docker-compose.yml config
- name: build deploy/helm/values.yaml
uses: cuchi/[email protected]
with:
template: ./templates/helm-values.j2
output_file: ./deploy/helm/values.yaml
data_file: versions-config.json
data_format: json
- name: check helm config
run: helm lint ./deploy/helm
- name: Initialize mandatory git config
run: |
git config user.email "" && git config user.name "GitHub Action"
- name: Commit compose files
id: make-commit
run: |
git add docker-compose.yml docker-compose-dev.yml docker-compose.zitadel.yml deploy/helm/values.yaml
if ! git diff-index --quiet HEAD; then
git commit --message "update docker-compose and helm versions"
git push
fi
8 changes: 4 additions & 4 deletions deploy/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ ingress:

application:
versions:
ui: 0.2312.0 # .uiVersion
control: 0.2176.0 # .controlApiVersion
data: 0.2176.0 # .dataApiVersion
us: 0.260.0 # .usVersion
ui: 0.2312.0
control: 0.2176.0
data: 0.2176.0
us: 0.260.0
replicas:
ui: 1
us: 1
Expand Down
14 changes: 7 additions & 7 deletions templates/docker-compose.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
RQE_SECRET_KEY: ""
US_HOST: "http://us:8083"
US_MASTER_TOKEN: "fake-us-master-token"
{%- if "DEV_MODE"|env(false) %}
{%- if env.get('DEV_MODE') %}
ports:
- 8081:8080
{%- endif %}
Expand All @@ -41,7 +41,7 @@ services:
BI_COMPENG_PG_URL: "postgresql://postgres:postgres@pg-compeng:5432/postgres"
US_HOST: "http://us:8083"
US_MASTER_TOKEN: "fake-us-master-token"
{%- if "DEV_MODE"|env(false) %}
{%- if env.get('DEV_MODE') %}
ports:
- 8082:8080
{%- endif %}
Expand All @@ -57,7 +57,7 @@ services:
POSTGRES_USER: demo
POSTGRES_PASSWORD: demo
volumes:
{%- if "DEV_MODE"|env(false) %}
{%- if env.get('DEV_MODE') %}
- db-demo:/var/lib/postgresql/data
- ./pg-demo-connection/init:/docker-entrypoint-initdb.d
{%- else %}
Expand All @@ -73,12 +73,12 @@ services:
POSTGRES_USER: us
POSTGRES_PASSWORD: us
volumes:
{%- if "DEV_MODE"|env(false) %}
{%- if env.get('DEV_MODE') %}
- db-us:/var/lib/postgresql/data
{%- else %}
- ./metadata:/var/lib/postgresql/data
{%- endif %}
{%- if "DEV_MODE"|env(false) %}
{%- if env.get('DEV_MODE') %}
ports:
- "8086:5432"
{%- endif %}
Expand All @@ -97,7 +97,7 @@ services:
USE_DEMO_DATA: ${USE_DEMO_DATA:-1}
HC: ${HC:-0}
NODE_EXTRA_CA_CERTS: /certs/root.crt
{%- if "DEV_MODE"|env(false) %}
{%- if env.get('DEV_MODE') %}
ports:
- "8083:8083"
{%- endif %}
Expand Down Expand Up @@ -130,7 +130,7 @@ services:
YANDEX_MAP_ENABLED: ${YANDEX_MAP_ENABLED:-0}
YANDEX_MAP_TOKEN: ${YANDEX_MAP_TOKEN}

{%- if "DEV_MODE"|env(false) %}
{%- if env.get('DEV_MODE') %}
volumes:
db-us:
db-demo:
Expand Down
8 changes: 4 additions & 4 deletions templates/docker-compose.zitadel.j2
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
AUTH_APP_CLIENT_ID: "${DL_CLIENT_ID}"
AUTH_APP_CLIENT_SECRET: "${DL_CLIENT_SECRET}"

{%- if "DEV_MODE"|env(false) %}
{%- if env.get('DEV_MODE') %}
ports:
- 8081:8080
{%- endif %}
Expand Down Expand Up @@ -60,7 +60,7 @@ services:
AUTH_APP_CLIENT_SECRET: "${DL_CLIENT_SECRET}"


{%- if "DEV_MODE"|env(false) %}
{%- if env.get('DEV_MODE') %}
ports:
- 8082:8080
{%- endif %}
Expand Down Expand Up @@ -88,7 +88,7 @@ services:
POSTGRES_PASSWORD: us
volumes:
- ./metadata:/var/lib/postgresql/data
{%- if "DEV_MODE"|env(false) %}
{%- if env.get('DEV_MODE') %}
ports:
- "8086:5432"
{%- endif %}
Expand All @@ -115,7 +115,7 @@ services:
SERVICE_CLIENT_ID: "us"
SERVICE_CLIENT_SECRET: "${US_SERVICE_CLIENT_SECRET}"

{%- if "DEV_MODE"|env(false) %}
{%- if env.get('DEV_MODE') %}
ports:
- "8083:8083"
{%- endif %}
Expand Down
49 changes: 49 additions & 0 deletions templates/helm-values.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
database:
enabled: true
demo: true

ingress:
enabled: true
domain: datalens.local
yc: false

application:
versions:
ui: {{ uiVersion }}
control: {{ controlApiVersion }}
data: {{ dataApiVersion }}
us: {{ usVersion }}
replicas:
ui: 1
us: 1
data: 1
control: 1
resources:
ui:
requests:
cpu: 250m
memory: 256Mi
limits:
cpu: 1000m
memory: 512Mi
control:
requests:
cpu: 500m
memory: 1024Mi
limits:
cpu: 1000m
memory: 2048Mi
data:
requests:
cpu: 1000m
memory: 1024Mi
limits:
cpu: 2000m
memory: 2048Mi
us:
requests:
cpu: 500m
memory: 512Mi
limits:
cpu: 1000m
memory: 1024Mi

0 comments on commit f6d7daa

Please sign in to comment.