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

feat!: gateway refactor helm changes #3431

Draft
wants to merge 12 commits into
base: release-0.57.0
Choose a base branch
from
2 changes: 1 addition & 1 deletion .github/workflows/cron-jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: renku teardown
uses: SwissDataScienceCenter/renku-actions/cleanup-renku-ci-deployments@v1.9.1
uses: SwissDataScienceCenter/renku-actions/cleanup-renku-ci-deployments@v1.10.0
env:
GITLAB_TOKEN: ${{ secrets.DEV_GITLAB_TOKEN }}
RENKUBOT_KUBECONFIG: ${{ secrets.RENKUBOT_DEV_KUBECONFIG }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-helm-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set version
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- uses: SwissDataScienceCenter/renku-actions/publish-chart@v1.9.1
- uses: SwissDataScienceCenter/renku-actions/publish-chart@v1.10.0
env:
CHART_DIR: helm-chart/
CHART_NAME: renku
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
with:
fetch-depth: 0
- name: Rollout renku version
uses: SwissDataScienceCenter/renku-actions/rollout-renku-version@v1.9.1
uses: SwissDataScienceCenter/renku-actions/rollout-renku-version@v1.10.0
env:
CHART_VERSION: ${{ needs.publish-chart.outputs.chart-version }}
GITHUB_TOKEN: ${{ secrets.RENKUBOT_GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/publish-master-merges.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- id: set-version
run: |
echo "publish_version=${{ steps.bump-semver.outputs.new_version }}.$(echo ${{ github.sha }} | cut -c 1-7)" >> $GITHUB_ENV
- uses: SwissDataScienceCenter/renku-actions/publish-chart@v1.9.1
- uses: SwissDataScienceCenter/renku-actions/publish-chart@v1.10.0
env:
CHART_DIR: helm-chart/
CHART_TAG: "--tag ${{env.publish_version}}"
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pull-request-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- id: deploy-comment
uses: SwissDataScienceCenter/renku-actions/check-pr-description@v1.9.1
uses: SwissDataScienceCenter/renku-actions/check-pr-description@v1.10.0
with:
string: /deploy
pr_ref: ${{ github.event.number }}
Expand All @@ -78,7 +78,7 @@ jobs:
- uses: actions/checkout@v4
- name: renku build and deploy
if: needs.check-deploy.outputs.pr-contains-string == 'true'
uses: SwissDataScienceCenter/renku-actions/deploy-renku@v1.9.1
uses: SwissDataScienceCenter/renku-actions/deploy-renku@v1.10.0
env:
DOCKER_PASSWORD: ${{ secrets.RENKU_DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.RENKU_DOCKER_USERNAME }}
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
needs: [check-deploy, deploy-pr]
runs-on: ubuntu-22.04
steps:
- uses: SwissDataScienceCenter/renku-actions/test-renku@v1.9.1
- uses: SwissDataScienceCenter/renku-actions/test-renku@v1.10.0
with:
kubeconfig: ${{ secrets.RENKUBOT_DEV_KUBECONFIG }}
renku-release: ci-renku-${{ github.event.number }}
Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:
]

steps:
- uses: SwissDataScienceCenter/renku-actions/test-renku-cypress@v1.9.1
- uses: SwissDataScienceCenter/renku-actions/test-renku-cypress@v1.10.0
if: github.event.action != 'closed' && needs.check-deploy.outputs.pr-contains-string == 'true' && needs.check-deploy.outputs.test-enabled == 'true'
with:
e2e-target: ${{ matrix.tests }}
Expand All @@ -162,7 +162,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: renku teardown
uses: SwissDataScienceCenter/renku-actions/cleanup-renku-ci-deployments@v1.9.1
uses: SwissDataScienceCenter/renku-actions/cleanup-renku-ci-deployments@v1.10.0
env:
HELM_RELEASE_REGEX: "^ci-renku-${{ github.event.number }}$"
GITLAB_TOKEN: ${{ secrets.DEV_GITLAB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/renku-dev-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
github.event.client_payload.message == 'Helm test succeeded' }}
runs-on: ubuntu-20.04
steps:
- uses: SwissDataScienceCenter/renku-actions/test-renku@v1.9.1
- uses: SwissDataScienceCenter/renku-actions/test-renku@v1.10.0
with:
kubeconfig: ${{ secrets.RENKUBOT_DEV_KUBECONFIG }}
renku-release: renku
Expand Down
8 changes: 4 additions & 4 deletions helm-chart/renku/requirements.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
dependencies:
- name: gitlab
repository: "https://swissdatasciencecenter.github.io/helm-charts/"
version: 0.8.0
condition: gitlab.enabled
# - name: gitlab
# repository: "https://swissdatasciencecenter.github.io/helm-charts/"
# version: 0.8.0
# condition: gitlab.enabled
- name: postgresql
version: 9.1.1
repository: "https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami"
Expand Down
8 changes: 4 additions & 4 deletions helm-chart/renku/templates/gateway/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{{/*
Template core service paths as a comma separated list
*/}}
{{- define "gateway.core.paths" -}}
{{- define "gateway.core.pathsYaml" -}}
{{- $paths := list -}}
{{- range $i, $k := (keys .Values.global.core.versions | sortAlpha) -}}
{{- $paths = mustAppend $paths (printf "/api/renku/%s" (get $.Values.global.core.versions $k).prefix) -}}
{{- if eq $k "latest" -}}
{{- $paths = mustAppend $paths "/api/renku" -}}
{{- end -}}
{{- end -}}
{{- join "," $paths | quote -}}
{{- $paths | toYaml -}}
{{- end -}}

{{/*
Template core service names as a comma separated list
*/}}
{{- define "gateway.core.serviceNames" -}}
{{- define "gateway.core.serviceNamesYaml" -}}
{{- $serviceNames := list -}}
{{- $coreBaseName := printf "%s-core" .Release.Name -}}
{{- range $i, $k := (keys .Values.global.core.versions | sortAlpha) -}}
Expand All @@ -25,7 +25,7 @@ Template core service names as a comma separated list
{{- $serviceNames = mustAppend $serviceNames $serviceName -}}
{{- end -}}
{{- end -}}
{{- join "," $serviceNames | quote -}}
{{- $serviceNames | toYaml -}}
{{- end -}}

{{/*
Expand Down
83 changes: 83 additions & 0 deletions helm-chart/renku/templates/gateway/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "gateway.name" . }}
labels:
app: {{ template "gateway.name" . }}
chart: {{ template "renku.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
config.yaml: |
server:
port: 8080
host: 0.0.0.0
rateLimits:
enabled: {{ .Values.gateway.rateLimits.general.enabled }}
rate: {{ .Values.gateway.rateLimits.general.average }}
burst: {{ .Values.gateway.rateLimits.general.burst }}
revproxy:
renkuBaseUrl: {{ include "renku.baseUrl" . | quote }}
{{- if .Values.gitlab.enabled }}
externalGitlabUrl: ""
{{- else }}
externalGitlabUrl: {{ .Values.global.gitlab.url | default "" | quote }}
{{- end }}
k8sNamespace: {{ .Release.Namespace }}
renkuServices:
notebooks: {{ printf "http://%s-notebooks" .Release.Name | quote }}
kg: {{ printf "http://%s-knowledge-graph" .Release.Name | quote }}
webhook: {{ printf "http://%s-webhook-service" .Release.Name | quote }}
core:
serviceNames:
{{- include "gateway.core.serviceNamesYaml" . | nindent 12 }}
servicePaths:
{{- include "gateway.core.pathsYaml" . | nindent 12 }}
sticky: true
dataService: {{ printf "http://%s-data-service" .Release.Name | quote }}
keycloak: {{ include "renku.keycloakUrl" . | quote }}
uiserver: {{ printf "http://%s" (include "ui-server.fullname" .) | quote }}
login:
renkuBaseUrl: {{ include "renku.baseUrl" . | quote }}
endpointsBasePath: "/api/auth"
defaultAppRedirectURL: {{ include "renku.baseUrl" . | quote }}
tokenEncryption:
enabled: true
providers:
renku:
default: true
issuer: {{ printf "%s/realms/%s" (include "renku.keycloakUrl" . | trimSuffix "/") (include "renku.keycloak.realm" .) }}
clientID: renku
scopes: ["profile", "email", "openid", "offline_access"]
callbackURI: {{ printf "%s/api/auth/callback" (include "renku.baseUrl" .) }}
usePKCE: false
renkuCli:
default: false
issuer: {{ printf "%s/realms/%s" (include "renku.keycloakUrl" . | trimSuffix "/") (include "renku.keycloak.realm" .) }}
clientID: renku-cli
scopes: ["profile", "email", "openid", "offline_access"]
callbackURI: {{ printf "%s/api/auth/callback" (include "renku.baseUrl" .) }}
usePKCE: false
gitlab:
default: true
issuer: {{ template "renku.gitlabUrl" . }}
clientID: {{ .Values.gateway.gitlabClientId | default .Values.global.gateway.gitlabClientId | quote }}
scopes: ["openid", "api", "read_user", "read_repository"]
callbackURI: {{ printf "%s/api/auth/callback" (include "renku.baseUrl" .) }}
usePKCE: false
redis:
type: redis
addresses:
- {{ printf "%s:%d" .Values.global.redis.host (.Values.global.redis.port | int) | quote }}
isSentinel: {{ .Values.global.redis.sentinel.enabled }}
masterName: {{ .Values.global.redis.sentinel.masterSet | quote }}
dbIndex: {{ .Values.global.redis.dbIndex.gateway }}
monitoring:
sentry:
enabled: {{ .Values.gateway.sentry.enabled }}
environment: {{ .Values.gateway.sentry.environment }}
sampleRate: {{ .Values.gateway.sentry.sampleRate }}
prometheus:
enabled: {{ .Values.gateway.metrics.enabled }}
port: {{ .Values.gateway.metrics.port }}
---
Loading
Loading