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

chore: 0.31.0 release with crc service #3067

Merged
merged 34 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a7c8aad
feat: add crac service helm chart
olevski May 10, 2023
2ea6288
squashme: minor fixes
olevski May 11, 2023
007a60d
Merge branch 'master' into crac-service-helm-chart
leafty May 26, 2023
ba78f94
chore: add rbac for crac service
olevski Jun 5, 2023
d362182
Merge branch 'master' into crac-service-helm-chart
olevski Jun 5, 2023
90dbcf3
squashme: set the crac service name
olevski Jun 6, 2023
b88a8af
Merge branch 'master' into crac-service-helm-chart
olevski Jun 6, 2023
45b03c0
chore: rename crac to crc
olevski Jun 6, 2023
3b940c3
chore: renam crac to crc
olevski Jun 6, 2023
620c1cc
Merge branch 'master' into crac-service-helm-chart
olevski Jun 13, 2023
b1a46b5
Merge branch 'master' into crac-service-helm-chart
olevski Jun 16, 2023
b7aca52
Merge branch 'master' into crac-service-helm-chart
leafty Jun 21, 2023
24d6cf4
Merge branch 'master' into crac-service-helm-chart
olevski Jun 27, 2023
b8b9d7f
Fix cypress-tests/cypress/e2e/publicProject.cy.ts
leafty Jun 30, 2023
7b203e3
Merge branch 'master' into crac-service-helm-chart
rokroskar Jun 30, 2023
7fe483d
Merge branch 'master' into crac-service-helm-chart
olevski Jul 3, 2023
2b248c3
Merge branch 'master' into crac-service-helm-chart
olevski Jul 4, 2023
ad096bd
chore: use crc 0.0.1
olevski Jul 4, 2023
4abb63a
Merge branch 'master' into crac-service-helm-chart
lorenzo-cavazzi Jul 5, 2023
a190aad
Merge branch 'master' into crac-service-helm-chart
leafty Jul 5, 2023
716a3be
chore: update keycloak python client
olevski Jul 5, 2023
f15006c
squashme: correctly create postgres db
olevski Jul 5, 2023
99b632e
chore: update renku notebooks to 1.16.0
olevski Jul 5, 2023
1800b08
Merge branch 'master' into crac-service-helm-chart
olevski Jul 6, 2023
0531367
chore: update changelog
olevski Jul 6, 2023
ac1ef6a
Merge branch 'master' into crac-service-helm-chart
olevski Jul 6, 2023
6611309
Merge branch 'master' into crac-service-helm-chart
olevski Jul 7, 2023
3912363
Merge branch 'master' into crac-service-helm-chart
olevski Jul 7, 2023
439dd1f
chore: update renku-ui
olevski Jul 7, 2023
b6fa7fd
Update CHANGELOG.rst
bethcg Jul 7, 2023
9a7106d
Update CHANGELOG.rst
bethcg Jul 7, 2023
b0160c3
Update CHANGELOG.rst
bethcg Jul 8, 2023
af464e5
Merge branch 'master' into crac-service-helm-chart
lorenzo-cavazzi Jul 10, 2023
e6c045a
chorre: expand changelog
olevski Jul 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
.. _changelog:

0.31.0
------

Renku ``0.31.0`` introduces the compute resource control (CRC) service and supporting or related changes in
olevski marked this conversation as resolved.
Show resolved Hide resolved
other components.

User-Facing Changes
~~~~~~~~~~~~~~~~~~~

**🌟 New Features**

- **UI**: Update session start options and project settings to use compute resource pools
(`#2484 <https://github.com/SwissDataScienceCenter/renku-ui/issues/2484>`_).

**🐞 Bug Fixes**

- **UI**: Support common R file extensions
(`#2638 <https://github.com/SwissDataScienceCenter/renku-ui/issues/2638>`_).

Internal Changes
~~~~~~~~~~~~~~~~

**🌟 New Features**

- **Infrastructure**: add the compute resource control service
- **Renku Notebooks**: use the compute resource control (CRC) service

Individual components
~~~~~~~~~~~~~~~~~~~~~~

- `renku-data-services 0.0.1 <https://github.com/SwissDataScienceCenter/renku-data-services/releases/tag/v0.0.1>`_
- `renku-notebooks 1.16.0 <https://github.com/SwissDataScienceCenter/renku-notebooks/releases/tag/1.16.0>`_
- `renku-ui 3.9.0 <https://github.com/SwissDataScienceCenter/renku-ui/releases/tag/3.9.0>`_


0.30.1
------

Expand All @@ -18,6 +53,7 @@ Individual components

- `renku-gateway 0.21.1 <https://github.com/SwissDataScienceCenter/renku-gateway/releases/tag/0.21.1>`_


0.30.0
------

Expand Down
40 changes: 27 additions & 13 deletions cypress-tests/cypress/e2e/publicProject.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,18 +194,21 @@ describe("Basic public project functionality", () => {
it("Can view and modify sessions settings", () => {
cy.dataCy("project-navbar").contains("Settings").should("exist").click();
cy.intercept("/ui-server/api/renku/*/config.set").as("configSet");
// ? The settings page refreshes when stale. We should wait for that only when it's invoked.
let configInvocations = 0;
cy.intercept("/ui-server/api/renku/*/config.show?git_url=*", req => { configInvocations++; }).as("getConfig");
cy.intercept("/ui-server/api/renku/*/config.show?git_url=*").as(
"getConfig"
);

const navigateToSettingsSessions = () => {
const invoked = configInvocations;
const navigateToSettingsSessions = ({
waitForApis,
}: { waitForApis?: boolean } = {}) => {
robustNavigateToProjectPage("/settings");
cy.get(".form-rk-green form").contains("Project Tags").should("exist");
robustNavigateToProjectPage("/settings/sessions");
cy.get("h3").contains("Session settings").should("exist");
if (invoked > configInvocations)
cy.wait("@configShow", { timeout: TIMEOUTS.long });
cy.intercept("/ui-server/api/data/resource_pools").as("getResourcePools");
if (waitForApis) {
cy.wait("@getConfig", { timeout: TIMEOUTS.long });
}
};

// Make sure the renku.ini is in a pristine state
Expand All @@ -215,20 +218,31 @@ describe("Basic public project functionality", () => {
cy.get("pre.hljs").should("be.visible");
cy.get("pre.hljs").contains("cpu_request").should("not.exist");

navigateToSettingsSessions();
cy.get("div.form-rk-green div.row").contains("button", "0.5").should("exist").click();
// Add a compute requirement for sessions
navigateToSettingsSessions({ waitForApis: true });
cy.contains("label", "Number of CPUs")
.parent()
.find("input.form-control")
.should("exist")
.click()
.type("1.5")
.blur();
cy.contains(".badge", "Saving");
cy.wait("@configSet");
cy.get("div.form-rk-green div.success-feedback").contains("Updated.").should("be.visible");
cy.contains(".badge", "Saved");

robustNavigateToProjectPage("/files");
cy.get("div#tree-content").contains("renku.ini").should("exist").click();
cy.get(".hljs.language-ini").contains("[interactive]").should("be.visible");
cy.get("pre.hljs").contains("cpu_request = 0.5").should("exist");
cy.get("pre.hljs").contains("cpu_request = 1.5").should("exist");

navigateToSettingsSessions();
cy.get("#cpu_request_reset").should("be.visible").click();
cy.get("#project-settings-sessions-interactive-cpu-request-reset")
.should("be.visible")
.click();
cy.contains(".badge", "Saving");
cy.wait("@configSet");
cy.get("div.form-rk-green div.success-feedback").contains("Updated.").should("exist");
cy.contains(".badge", "Saved");

robustNavigateToProjectPage("/files");
cy.get("div#tree-content").contains("renku.ini").should("exist").click();
Expand Down
4 changes: 2 additions & 2 deletions helm-chart/renku/requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ dependencies:
- name: renku-ui
alias: ui
repository: "https://swissdatasciencecenter.github.io/helm-charts/"
version: 3.8.1
version: 3.9.0
- name: renku-notebooks
alias: notebooks
repository: "https://swissdatasciencecenter.github.io/helm-charts/"
version: 1.15.3
version: 1.16.0
- name: renku-gateway
alias: gateway
repository: "https://swissdatasciencecenter.github.io/helm-charts/"
Expand Down
35 changes: 28 additions & 7 deletions helm-chart/renku/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ metadata:
heritage: {{ .Release.Service }}
data:
{{- if and .Values.gitlab.enabled }}
# DO NOT USE set -x you will leak the password in the logs
init-gitlab.sh: |-
#!/usr/bin/env bash
set -ex
set -e
env

GITLAB_SERVICE_URL="http://{{ template "gitlab.fullname" . }}{{ .Values.global.gitlab.urlPrefix }}"
Expand All @@ -35,9 +36,10 @@ data:
# Init scripts that populate /docker-entrypoint-initdb.d

# Unashamedly copied from: https://github.com/docker-library/postgres/blob/master/9.6/docker-entrypoint.sh
# DO NOT USE set -x you will leak the password in the logs
init-postgres.sh: |-
#!/bin/bash
set -ex
set -e
env

until sleep 1; pg_isready; do
Expand Down Expand Up @@ -67,9 +69,9 @@ data:
done

{{- if .Values.keycloakx.enabled }}
# DO NOT USE set -x you will leak the password in the logs
init-keycloak-db.sh: |-
#!/bin/bash
set -x

KEYCLOAK_POSTGRES_PASSWORD=$(cat /keycloak-postgres/KC_DB_PASSWORD)

Expand All @@ -86,9 +88,9 @@ data:
{{- end }}

{{- if .Values.gitlab.enabled }}
# DO NOT USE set -x you will leak the password in the logs
init-gitlab-db.sh: |-
#!/bin/bash
set -x

GITLAB_POSTGRES_PASSWORD=$(cat /gitlab-postgres/gitlab-postgres-password)

Expand All @@ -108,9 +110,9 @@ data:

{{- if .Values.graph.enabled }}

# DO NOT USE set -x you will leak the password in the logs
init-dbEventLog-db.sh: |-
#!/bin/bash
set -x

DB_EVENT_LOG_POSTGRES_PASSWORD=$(cat /graph-db-postgres/graph-dbEventLog-postgresPassword)
DB_EVENT_LOG_DB_NAME=event_log
Expand All @@ -127,9 +129,9 @@ data:
grant all privileges on schema "public" to "{{ .Values.global.graph.dbEventLog.postgresUser }}";
EOSQL

# DO NOT USE set -x you will leak the password in the logs
init-triplesGenerator-db.sh: |-
#!/bin/bash
set -x

DB_TG_LOG_POSTGRES_PASSWORD=$(cat /graph-tg-postgres/graph-triplesGenerator-postgresPassword)
DB_TG_LOG_DB_NAME=triples_generator
Expand All @@ -149,7 +151,6 @@ data:

init-tokenRepository-db.sh: |-
#!/bin/bash
set -x

TOKEN_REPOSITORY_POSTGRES_PASSWORD=$(cat /graph-token-postgres/graph-tokenRepository-postgresPassword)
TOKEN_REPOSITORY_DB_NAME=projects_tokens
Expand All @@ -166,3 +167,23 @@ data:
grant all privileges on schema "public" to "{{ .Values.global.graph.tokenRepository.postgresUser }}";
EOSQL
{{- end }}

# DO NOT USE set -x you will leak the password in the logs
init-renku-db.sh: |-
#!/bin/bash

PASSWORD=$(cat /db-common-password/password)
DB_NAME=renku

psql -v ON_ERROR_STOP=1 <<-EOSQL
create user "{{ .Values.global.db.common.username }}" password '$PASSWORD';
create database "$DB_NAME" WITH OWNER "{{ .Values.global.db.common.username }}";
EOSQL

psql postgres -v ON_ERROR_STOP=1 --dbname "$DB_NAME" <<-EOSQL
create extension if not exists "pg_trgm";
revoke all on schema "public" from "public";
grant all privileges on database "$DB_NAME" to "{{ .Values.global.db.common.username }}";
grant all privileges on database "$DB_NAME" to "postgres";
grant all privileges on schema "public" to "{{ .Values.global.db.common.username }}";
EOSQL
16 changes: 16 additions & 0 deletions helm-chart/renku/templates/crc/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if and .Values.notebooks.serverOptions .Values.notebooks.serverDefaults -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "renku.fullname" . }}-server-options
labels:
app: {{ template "renku.name" . }}
chart: {{ template "renku.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
server_options.json: |
{{ .Values.notebooks.serverOptions | default dict | toJson }}
server_defaults.json: |
{{ toJson .Values.notebooks.serverDefaults }}
{{- end -}}
108 changes: 108 additions & 0 deletions helm-chart/renku/templates/crc/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "renku.fullname" . }}-crc
labels:
app: renku-crc
chart: {{ template "renku.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
{{- if not .Values.crc.autoscaling.enabled }}
replicas: {{ .Values.crc.replicaCount }}
{{- end }}
strategy:
{{- toYaml .Values.crc.updateStrategy | nindent 4 }}
selector:
matchLabels:
app: renku-crc
release: {{ .Release.Name }}
template:
metadata:
labels:
app: renku-crc
release: {{ .Release.Name }}
{{- with .Values.crc.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
automountServiceAccountToken: {{ .Values.global.debug }}
initContainers:
{{- include "certificates.initContainer" . | nindent 8 }}
containers:
- name: crc
image: "{{ .Values.crc.image.repository }}:{{ .Values.crc.image.tag }}"
imagePullPolicy: {{ .Values.crc.image.pullPolicy }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
ports:
- name: http
containerPort: 8000
protocol: TCP
env:
- name: DB_HOST
value: {{ template "postgresql.fullname" . }}
- name: DB_USER
value: {{ .Values.global.db.common.username }}
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.global.db.common.passwordSecretName }}
key: password
- name: KEYCLOAK_URL
value: {{ (printf "%s://%s/auth/" (include "gateway.protocol" .) .Values.global.renku.domain) | quote}}
- name: KEYCLOAK_TOKEN_SIGNATURE_ALGS
value: "RS256"
- name: SERVER_DEFAULTS
value: /etc/renku-crc/server_options/server_defaults.json
- name: SERVER_OPTIONS
value: /etc/renku-crc/server_options/server_options.json
- name: K8S_NAMESPACE
value: {{ .Release.Namespace | quote }}
volumeMounts:
- name: server-options
mountPath: /etc/renku-crc/server_options
{{- include "certificates.volumeMounts.system" . | nindent 12 }}
livenessProbe:
httpGet:
path: /api/data/version
port: http
initialDelaySeconds: 10
periodSeconds: 10
failureThreshold: 6
readinessProbe:
httpGet:
path: /api/data/version
port: http
initialDelaySeconds: 10
periodSeconds: 2
failureThreshold: 2
startupProbe:
httpGet:
path: /api/data/version
port: http
periodSeconds: 5
failureThreshold: 60
resources:
{{ toYaml .Values.crc.resources | nindent 12 }}
{{- with .Values.crc.nodeSelector }}
nodeSelector:
{{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.crc.affinity }}
affinity:
{{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.crc.tolerations }}
tolerations:
{{ toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: server-options
configMap:
name: {{ template "renku.fullname" . }}-server-options
{{- include "certificates.volumes" . | nindent 8 }}
serviceAccountName: {{ template "renku.fullname" . }}-crc
39 changes: 39 additions & 0 deletions helm-chart/renku/templates/crc/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{{- if .Values.crc.autoscaling.enabled }}
{{- if semverCompare ">=1.23.0-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: autoscaling/v2
{{- else -}}
apiVersion: autoscaling/v2beta2
{{- end }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "renku.fullname" . }}-crc
labels:
app: renku-crc
chart: {{ template "renku.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "renku.fullname" . }}-crc
minReplicas: {{ .Values.crc.autoscaling.minReplicas }}
maxReplicas: {{ .Values.crc.autoscaling.maxReplicas }}
metrics:
{{- if .Values.crc.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.crc.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.crc.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.crc.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
Loading