diff --git a/cypress-tests/cypress/e2e/checkWorkflows.cy.ts b/cypress-tests/cypress/e2e/checkWorkflows.cy.ts index 5230e7477a..06e44d07e0 100644 --- a/cypress-tests/cypress/e2e/checkWorkflows.cy.ts +++ b/cypress-tests/cypress/e2e/checkWorkflows.cy.ts @@ -15,7 +15,7 @@ describe("Workflows pages", () => { cy.session( sessionId, () => { - cy.robustLogin(); + cy.robustLogin("v1"); }, validateLogin, ); diff --git a/cypress-tests/cypress/e2e/privateProject.cy.ts b/cypress-tests/cypress/e2e/privateProject.cy.ts index a3275ec173..7552403b91 100644 --- a/cypress-tests/cypress/e2e/privateProject.cy.ts +++ b/cypress-tests/cypress/e2e/privateProject.cy.ts @@ -34,7 +34,7 @@ describe("Basic public project functionality", () => { cy.session( sessionId, () => { - cy.robustLogin(); + cy.robustLogin("v1"); }, validateLogin, ); diff --git a/cypress-tests/cypress/e2e/publicProject.cy.ts b/cypress-tests/cypress/e2e/publicProject.cy.ts index 49b3596e0e..94ac717e93 100644 --- a/cypress-tests/cypress/e2e/publicProject.cy.ts +++ b/cypress-tests/cypress/e2e/publicProject.cy.ts @@ -35,7 +35,7 @@ describe("Basic public project functionality", () => { cy.session( sessionId, () => { - cy.robustLogin(); + cy.robustLogin("v1"); }, validateLogin, ); diff --git a/cypress-tests/cypress/e2e/rstudioSession.cy.ts b/cypress-tests/cypress/e2e/rstudioSession.cy.ts index 4fca930469..a5cf4d1534 100644 --- a/cypress-tests/cypress/e2e/rstudioSession.cy.ts +++ b/cypress-tests/cypress/e2e/rstudioSession.cy.ts @@ -36,7 +36,7 @@ describe("Basic rstudio functionality", () => { cy.session( sessionId, () => { - cy.robustLogin(); + cy.robustLogin("v1"); }, validateLogin, ); diff --git a/cypress-tests/cypress/e2e/testDatasets.cy.ts b/cypress-tests/cypress/e2e/testDatasets.cy.ts index ad94deb1c8..74a30dd396 100644 --- a/cypress-tests/cypress/e2e/testDatasets.cy.ts +++ b/cypress-tests/cypress/e2e/testDatasets.cy.ts @@ -30,7 +30,7 @@ describe("Basic datasets functionality", () => { cy.session( sessionId, () => { - cy.robustLogin(); + cy.robustLogin("v1"); }, validateLogin, ); diff --git a/cypress-tests/cypress/e2e/updateProjects.cy.ts b/cypress-tests/cypress/e2e/updateProjects.cy.ts index 5644bf0467..33ca82cd14 100644 --- a/cypress-tests/cypress/e2e/updateProjects.cy.ts +++ b/cypress-tests/cypress/e2e/updateProjects.cy.ts @@ -26,7 +26,7 @@ describe("Fork and update old projects", () => { cy.session( sessionId, () => { - cy.robustLogin(); + cy.robustLogin("v1"); }, validateLogin, ); diff --git a/cypress-tests/cypress/e2e/useSession.cy.ts b/cypress-tests/cypress/e2e/useSession.cy.ts index 8cd7a92323..0697cb8446 100644 --- a/cypress-tests/cypress/e2e/useSession.cy.ts +++ b/cypress-tests/cypress/e2e/useSession.cy.ts @@ -191,7 +191,7 @@ describe("Basic public project functionality", () => { // Stop the session -- mind that anonymous users cannot pause sessions cy.deleteSession({ fromSessionPage: true }); - cy.robustLogin(); + cy.robustLogin("v1"); }); it("Start a new session on a project without permissions.", () => { diff --git a/cypress-tests/cypress/e2e/v2/anonymousNavigation.cy.ts b/cypress-tests/cypress/e2e/v2/anonymousNavigation.cy.ts index dd80ba14e9..53ed34e460 100644 --- a/cypress-tests/cypress/e2e/v2/anonymousNavigation.cy.ts +++ b/cypress-tests/cypress/e2e/v2/anonymousNavigation.cy.ts @@ -21,7 +21,7 @@ const loggedSession = { id: ["anonymousNavigation-loggedUser", getRandomString()], setup: () => { cy.log("Logged in session"); - cy.robustLogin(); + cy.robustLogin("v2"); }, }; diff --git a/cypress-tests/cypress/e2e/v2/dashboardV2.cy.ts b/cypress-tests/cypress/e2e/v2/dashboardV2.cy.ts index 887f77b983..0f77b6c7d7 100644 --- a/cypress-tests/cypress/e2e/v2/dashboardV2.cy.ts +++ b/cypress-tests/cypress/e2e/v2/dashboardV2.cy.ts @@ -1,4 +1,4 @@ -import { getRandomString, validateLogin } from "../../support/commands/general"; +import { getRandomString, validateLoginV2 } from "../../support/commands/general"; import { generatorProjectName } from "../../support/commands/projects"; import { ProjectIdentifierV2 } from "../../support/types/project.types"; import { @@ -39,9 +39,9 @@ describe("Dashboard v2 - Authenticated user", () => { cy.session( sessionId, () => { - cy.robustLogin(); + cy.robustLogin("v2"); }, - validateLogin, + validateLoginV2, ); getUserNamespaceAPIV2().then((namespace) => { if (namespace) { diff --git a/cypress-tests/cypress/e2e/v2/groupBasics.cy.ts b/cypress-tests/cypress/e2e/v2/groupBasics.cy.ts index 79e5f6a148..75f4cd4737 100644 --- a/cypress-tests/cypress/e2e/v2/groupBasics.cy.ts +++ b/cypress-tests/cypress/e2e/v2/groupBasics.cy.ts @@ -27,7 +27,7 @@ describe("Group - create, edit and delete", () => { cy.session( sessionId, () => { - cy.robustLogin(); + cy.robustLogin("v2"); }, validateLoginV2, ); diff --git a/cypress-tests/cypress/e2e/v2/projectBasics.cy.ts b/cypress-tests/cypress/e2e/v2/projectBasics.cy.ts index c745a986a6..c5434a339e 100644 --- a/cypress-tests/cypress/e2e/v2/projectBasics.cy.ts +++ b/cypress-tests/cypress/e2e/v2/projectBasics.cy.ts @@ -36,7 +36,7 @@ describe("Project - create, edit and delete", () => { cy.session( sessionId, () => { - cy.robustLogin(); + cy.robustLogin("v2"); }, validateLoginV2, ); diff --git a/cypress-tests/cypress/e2e/v2/projectResources.cy.ts b/cypress-tests/cypress/e2e/v2/projectResources.cy.ts index 3eaee4a1c4..b4ba4e490c 100644 --- a/cypress-tests/cypress/e2e/v2/projectResources.cy.ts +++ b/cypress-tests/cypress/e2e/v2/projectResources.cy.ts @@ -31,7 +31,7 @@ describe("Project resources - work with code, data, environments", () => { cy.session( sessionId, () => { - cy.robustLogin(); + cy.robustLogin("v2"); }, validateLoginV2, ); @@ -54,7 +54,7 @@ describe("Project resources - work with code, data, environments", () => { cy.session( sessionId, () => { - cy.robustLogin(); + cy.robustLogin("v2"); }, validateLoginV2, ); diff --git a/cypress-tests/cypress/e2e/v2/searchEntities.cy.ts b/cypress-tests/cypress/e2e/v2/searchEntities.cy.ts index 04a51134be..3bbfb1839c 100644 --- a/cypress-tests/cypress/e2e/v2/searchEntities.cy.ts +++ b/cypress-tests/cypress/e2e/v2/searchEntities.cy.ts @@ -44,7 +44,7 @@ describe("Search for resources: groups, projects, users", () => { cy.session( sessionId, () => { - cy.robustLogin(); + cy.robustLogin("v2"); }, validateLoginV2, ); @@ -84,7 +84,7 @@ describe("Search for resources: groups, projects, users", () => { cy.session( sessionId, () => { - cy.robustLogin(); + cy.robustLogin("v2"); }, validateLoginV2, ); diff --git a/cypress-tests/cypress/e2e/v2/sessionBasics.cy.ts b/cypress-tests/cypress/e2e/v2/sessionBasics.cy.ts index 88370e1247..7dfe579211 100644 --- a/cypress-tests/cypress/e2e/v2/sessionBasics.cy.ts +++ b/cypress-tests/cypress/e2e/v2/sessionBasics.cy.ts @@ -39,7 +39,7 @@ describe("Start a session that consumes project resources", () => { cy.session( sessionId, () => { - cy.robustLogin(); + cy.robustLogin("v2"); }, validateLoginV2, ); diff --git a/cypress-tests/cypress/support/commands/login.ts b/cypress-tests/cypress/support/commands/login.ts index f540bfd9df..ea97c30d7c 100644 --- a/cypress-tests/cypress/support/commands/login.ts +++ b/cypress-tests/cypress/support/commands/login.ts @@ -76,7 +76,7 @@ type RegisterAndVerifyProps = { lastName?: string; }; -function registerAndVerify(props: RegisterAndVerifyProps) { +function registerAndVerify(renkuVersion : 'v1' | 'v2', props: RegisterAndVerifyProps) { // Register with the CI deployment const { email, password, firstName, lastName } = props; cy.register(email, password, firstName, lastName); @@ -107,13 +107,14 @@ function registerAndVerify(props: RegisterAndVerifyProps) { // allow Gitlab to "settle" after the login and properly recognize the token and respond with 200. // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(TIMEOUTS.short); - cy.request("ui-server/api/data/user").its("status").should("eq", 200); - cy.request("ui-server/api/user").then((response) => { + cy.request("/api/data/user").its("status").should("eq", 200); + if (renkuVersion === 'v1') { + cy.request("/api/user").then((response) => { expect(response.status).to.eq(200); expect(response.body).property("username").to.not.be.empty; expect(response.body).property("username").to.not.be.null; expect(response.body).property("state").to.equal("active"); - }); + });} } type RobustLoginProps = { @@ -121,11 +122,12 @@ type RobustLoginProps = { password: string; firstName?: string; lastName?: string; + }; -function robustLogin(props?: RobustLoginProps) { +function robustLogin(renkuVersion: 'v1' | 'v2',props?: RobustLoginProps) { // Check if we are already logged in - cy.request({ failOnStatusCode: false, url: "ui-server/api/data/user" }).then( + cy.request({ failOnStatusCode: false, url: "/api/data/user" }).then( (resp) => { // we are already logged in if (resp.status >= 200 && resp.status < 400) return; @@ -139,7 +141,7 @@ function robustLogin(props?: RobustLoginProps) { ...props, }; - return registerAndVerify(localProps); + return registerAndVerify(renkuVersion, localProps); }, ); } @@ -162,8 +164,8 @@ declare global { firstName?: string, lastName?: string, ); - registerAndVerify(props: RegisterAndVerifyProps); - robustLogin(props?: RobustLoginProps); + registerAndVerify(renkuVersion: 'v1' | 'v2', props: RegisterAndVerifyProps); + robustLogin(renkuVersion: 'v1' | 'v2', props?: RobustLoginProps); } } } diff --git a/cypress-tests/package-lock.json b/cypress-tests/package-lock.json index 22059ef5f6..d084ac8063 100644 --- a/cypress-tests/package-lock.json +++ b/cypress-tests/package-lock.json @@ -764,9 +764,10 @@ "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3746,9 +3747,9 @@ "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" }, "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" diff --git a/helm-chart/renku/requirements.yaml b/helm-chart/renku/requirements.yaml index d3d00c0055..161ede96a2 100644 --- a/helm-chart/renku/requirements.yaml +++ b/helm-chart/renku/requirements.yaml @@ -18,11 +18,11 @@ dependencies: condition: enableV1Services - name: amalthea repository: "https://swissdatasciencecenter.github.io/helm-charts/" - version: "0.19.2" + version: "0.20.0" condition: enableV1Services - name: amalthea-sessions repository: "https://swissdatasciencecenter.github.io/helm-charts/" - version: "0.19.2" + version: "0.20.0" - name: dlf-chart repository: "https://swissdatasciencecenter.github.io/datashim/" version: "0.3.9-renku-2" diff --git a/helm-chart/renku/templates/gateway/configmap.yaml b/helm-chart/renku/templates/gateway/configmap.yaml index a3d10052d1..02f03b0742 100644 --- a/helm-chart/renku/templates/gateway/configmap.yaml +++ b/helm-chart/renku/templates/gateway/configmap.yaml @@ -36,6 +36,7 @@ data: audience: renku authorizedParty: renku-cli revproxy: + enableV1Services: {{ .Values.enableV1Services | default false }} renkuBaseUrl: {{ include "renku.baseUrl" . | quote }} externalGitlabUrl: {{ .Values.global.gitlab.url | default "" | quote }} k8sNamespace: {{ .Release.Namespace }} @@ -54,6 +55,7 @@ data: uiserver: {{ printf "http://%s" (include "ui-server.fullname" .) | quote }} search: {{ printf "http://%s-search-api" .Release.Name | quote }} login: + enableV1Services: {{ .Values.enableV1Services | default false }} renkuBaseUrl: {{ include "renku.baseUrl" . | quote }} loginRoutesBasePath: "/api/auth" defaultAppRedirectURL: {{ include "renku.baseUrl" . | quote }} @@ -66,12 +68,14 @@ data: scopes: ["profile", "email", "openid", "microprofile-jwt"] callbackURI: {{ printf "%s/api/auth/callback" (include "renku.baseUrl" .) }} usePKCE: false + {{- if .Values.enableV1Services }} gitlab: issuer: {{ .Values.global.gitlab.url | quote }} 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 + {{- end }} oldGitLabLogout: {{ .Values.gateway.oldGitLabLogout | default false }} logoutGitLabUponRenkuLogout: {{ .Values.gateway.logoutGitLabUponRenkuLogout | default true }} redis: diff --git a/helm-chart/renku/templates/gateway/deployment-revproxy.yaml b/helm-chart/renku/templates/gateway/deployment-revproxy.yaml index 9428bb0af5..d9a5cae71a 100644 --- a/helm-chart/renku/templates/gateway/deployment-revproxy.yaml +++ b/helm-chart/renku/templates/gateway/deployment-revproxy.yaml @@ -71,11 +71,13 @@ spec: secretKeyRef: name: {{ cat (include "renku.fullname" .) "-gateway" | nospace }} key: oidcClientSecret + {{- if .Values.enableV1Services }} - name: GATEWAY_LOGIN_PROVIDERS_GITLAB_CLIENTSECRET valueFrom: secretKeyRef: name: {{ cat (include "renku.fullname" .) "-gateway" | nospace }} key: gitlabClientSecret + {{- end }} - name: GATEWAY_LOGIN_TOKENENCRYPTION_SECRETKEY valueFrom: secretKeyRef: @@ -91,6 +93,7 @@ spec: secretKeyRef: name: {{ cat (include "renku.fullname" .) "-gateway" | nospace }} key: cookieHashKey + {{- if .Values.enableV1Services }} - name: GATEWAY_LOGIN_PROVIDERS_GITLAB_COOKIEENCODINGKEY valueFrom: secretKeyRef: @@ -101,6 +104,7 @@ spec: secretKeyRef: name: {{ cat (include "renku.fullname" .) "-gateway" | nospace }} key: cookieHashKey + {{- end }} - name: GATEWAY_MONITORING_SENTRY_DSN value: {{ .Values.gateway.sentry.dsn }} - name: GATEWAY_POSTHOG_ENABLED diff --git a/helm-chart/renku/templates/swagger.yaml b/helm-chart/renku/templates/swagger.yaml index 17446ae4a8..0409a28642 100644 --- a/helm-chart/renku/templates/swagger.yaml +++ b/helm-chart/renku/templates/swagger.yaml @@ -19,17 +19,17 @@ spec: spec: containers: - name: swagger - image: swaggerapi/swagger-ui + image: "{{ .Values.swagger.image.repository }}:{{ .Values.swagger.image.tag }}" env: - name: BASE_URL value: /swagger - name: URLS value: > [ - {"url": "/api/renku/spec.json", "name": "core service"}, + {"url": "/api/data/spec.json", "name": "data service"}, {"url": "/api/kg/spec.json", "name": "knowledge graph"}, {"url": "/api/notebooks/spec.json", "name": "notebooks service"}, - {"url": "/api/data/spec.json", "name": "data service"}, + {"url": "/api/renku/spec.json", "name": "core service"}, {"url": "/api/search/spec.json", "name": "search service"} ] - name: OAUTH2_REDIRECT_URL diff --git a/helm-chart/renku/templates/ui/ui-client-deployment-template.yaml b/helm-chart/renku/templates/ui/ui-client-deployment-template.yaml index fae4655017..941257dcf1 100644 --- a/helm-chart/renku/templates/ui/ui-client-deployment-template.yaml +++ b/helm-chart/renku/templates/ui/ui-client-deployment-template.yaml @@ -88,7 +88,7 @@ spec: key: chart_version - name: HOMEPAGE value: {{ toJson .Values.ui.client.homepage | quote }} - - name: CORE_API_VERSION_CONFIG + - name: CORE_API_VERSION_CONFIG value: {{ toJson .Values.ui.client.coreApiVersionConfig | quote }} - name: KEYCLOAK_REALM value: {{ include "renku.keycloak.realm" . | quote }} @@ -98,6 +98,8 @@ spec: value: {{ toJson .Values.ui.client.sessionClassEmailUs | quote }} - name: IMAGE_BUILDERS_ENABLED value: {{ .Values.dataService.imageBuilders.enabled | quote }} + - name: LEGACY_SUPPORT + value: {{ printf "{\"enabled\": %t }" .Values.enableV1Services | quote }} livenessProbe: httpGet: path: / diff --git a/helm-chart/renku/values.yaml b/helm-chart/renku/values.yaml index 62a143e2a0..6d8155ee7d 100644 --- a/helm-chart/renku/values.yaml +++ b/helm-chart/renku/values.yaml @@ -1148,7 +1148,7 @@ gateway: secretKey: image: repository: renku/renku-gateway - tag: "1.5.1" + tag: "1.6.0" pullPolicy: IfNotPresent service: type: ClusterIP @@ -1449,6 +1449,9 @@ core: ## Configuration for the Swagger-UI available at /swagger swagger: enabled: true + image: + repository: swaggerapi/swagger-ui + tag: "latest" ## The image used in startup scripts to initialize different postgress databases initDb: image: @@ -1582,7 +1585,7 @@ secretsStorage: # This is used to indicate whether services needed exclusively for Renku V1 are deployed or not. # The support for this feature is experimental and it should not be set to false in production at all. -enableV1Services: true +enableV1Services: false podSecurityContext: {} securityContext: