Skip to content

Commit

Permalink
chore: update renku-notebooks to 1.19.0 and renku-ui to 3.13.0 (#3253)
Browse files Browse the repository at this point in the history
Co-authored-by: Laura <[email protected]>
Co-authored-by: Rok Roškar <[email protected]>
Co-authored-by: Mohammad Alisafaee <[email protected]>
Co-authored-by: Tasko Olevski <[email protected]>
Co-authored-by: Lorenzo Cavazzi <[email protected]>
  • Loading branch information
6 people authored Sep 28, 2023
1 parent 96dd760 commit d084571
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 66 deletions.
41 changes: 40 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,44 @@
.. _changelog:

0.37.0
------

Renku ``0.37.0`` introduces a new feature to pause sessions and later resume them exactly where you left off. All of your work in progress, including files, data, and environment changes not saved to git, are resumed right as you left them.

This feature replaces RenkuLab's branch-based auto-save mechanism. Most users do not have to do anything to transition from auto-saves to persistent sessions. However, if your last session went into an auto-save, you can still retrieve that work by using Start with Options and selecting your most recent auto-save branch. If your project contains auto-save branches that you do not need anymore, you can safely delete them.

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

**🌟 New Features**

- ⏸️ **Renku Notebooks** and **UI**: Support for pausing (i.e. hibernating) and resuming sessions
(`#1518 <https://github.com/SwissDataScienceCenter/renku-notebooks/pull/1518>`_)
(`#2686 <https://github.com/SwissDataScienceCenter/renku-ui/issues/2686>`_).

**🐞 Bug Fixes**

- **UI**: restore adding files by URL to datasets
(`#2800 <https://github.com/SwissDataScienceCenter/renku-ui/issues/2800>`_).

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

**New Features**

- **Renku Notebooks**: Use a new version of Amalthea which adds fields for culling
hibernating sessions in the CRD.
- **Renku Notebooks** - **Helm chart breaking change**: ``notebooks.culling.idleThresholdSeconds`` in the values file
was renamed to ``notebooks.culling.idleSecondsThreshold``.

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

- `amalthea 0.9.1 <https://github.com/SwissDataScienceCenter/amalthea/releases/tag/0.9.1>`_
- `renku-notebooks 1.19.0 <https://github.com/SwissDataScienceCenter/renku-notebooks/releases/tag/1.19.0>`_
- `renku-ui 3.13.0 <https://github.com/SwissDataScienceCenter/renku-ui/releases/tag/3.13.0>`_


0.36.3
------

Expand All @@ -25,7 +64,7 @@ User-Facing Changes
Individual components
~~~~~~~~~~~~~~~~~~~~~~

- `renku-ui 3.12.21 <https://github.com/SwissDataScienceCenter/renku-ui/releases/tag/3.12.2>`_
- `renku-ui 3.12.2 <https://github.com/SwissDataScienceCenter/renku-ui/releases/tag/3.12.2>`_


0.36.2
Expand Down
9 changes: 3 additions & 6 deletions cypress-tests/cypress/e2e/rstudioSession.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,14 @@ describe("Basic rstudio functionality", () => {
},
validateLogin
);
cy.visitAndLoadProject(projectIdentifier);
cy.stopAllSessionsForProject(projectIdentifier);
});

it(
"Creates a project and launches an RStudio session",
{ defaultCommandTimeout: TIMEOUTS.long },
() => {
// Waits for the image to build
cy.waitForImageToBuild(projectIdentifier);

// Launches a session
// Waits for the image to build and launches a session
cy.startSession(projectIdentifier);

// Opens the session in an iframe
Expand Down Expand Up @@ -97,7 +93,8 @@ describe("Basic rstudio functionality", () => {
});

// Stops the session
cy.stopSession();
cy.pauseSession();
cy.deleteSession();
}
);
});
48 changes: 22 additions & 26 deletions cypress-tests/cypress/e2e/useSession.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,16 @@ describe("Basic public project functionality", () => {
});

it("Start a new session on the project and interact with the terminal.", () => {
cy.visitAndLoadProject(projectIdentifier);
cy.stopAllSessionsForProject(projectIdentifier);

// Start a session with options
let serversInvoked = false;
cy.intercept("/ui-server/api/notebooks/servers*", (req) => {
serversInvoked = true;
}).as("getServers");
if (projectTestConfig.shouldCreateProject) {
cy.getDataCy("project-overview-content")
.contains("your new Renku project", { timeout: TIMEOUTS.long })
.should("exist");
}
cy.getProjectSection("Sessions").click();
if (serversInvoked) cy.wait("@getServers");
cy.getDataCy("more-menu").should("be.visible").click();
cy.getProjectPageLink(projectIdentifier, "sessions/new")
.should("be.visible")
.first()
Expand All @@ -89,15 +84,14 @@ describe("Basic public project functionality", () => {
cy.get(".renku-container .badge.bg-success", { timeout: TIMEOUTS.vlong })
.contains("available")
.should("exist");
cy.get(".renku-container button.btn-rk-green", { timeout: TIMEOUTS.long })
.contains("Start session")
cy.get(".renku-container button.btn-secondary", { timeout: TIMEOUTS.long })
.contains("Start Session")
.should("exist")
.click();
cy.get(".progress-box .progress-title").should("exist"); //.contains("Step 2 of 2");
cy.get(".fullscreen-header")
.should("exist")
cy.get("button")
.contains(projectTestConfig.projectName)
.should("exist");
.should("be.visible");
cy.get(".progress-box .progress-title")
.contains("Starting Session")
.should("exist");
Expand All @@ -106,16 +100,14 @@ describe("Basic public project functionality", () => {
);

// Verify the "Connect" button works as well
cy.get(".fullscreen-header")
.should("exist")
.get(".fullscreen-back-button")
cy.get(".fullscreen-back-button")
.contains("Back")
.should("exist")
.should("be.visible")
.click();
cy.getDataCy("open-session").should("exist").click();
cy.getDataCy("open-session").first().should("be.visible").click();
cy.get(".progress-box .progress-title")
.contains("Starting Session")
.should("exist");
.should("be.visible");

// Run a simple workflow in the iframe
cy.getIframe("iframe#session-iframe").within(() => {
Expand All @@ -142,7 +134,7 @@ describe("Basic public project functionality", () => {

// Save the changes
cy.getDataCy("save-session-button").should("be.visible").click();
cy.get(".modal-session")
cy.get(".modal")
.contains("1 commit will be pushed")
.should("be.visible");
cy.getDataCy("save-session-modal-button").should("be.visible").click();
Expand All @@ -154,9 +146,11 @@ describe("Basic public project functionality", () => {
.should("be.visible");
cy.get(".modal .btn-close").should("be.visible").click();

// Pause the session
cy.pauseSession();

// Stop the session and check the project has been indexed
cy.stopSession();
cy.getDataCy("go-back-button").click();
cy.deleteSession();
cy.waitMetadataIndexing();

// Go the workflows page and check the new workflow appears
Expand Down Expand Up @@ -191,6 +185,7 @@ describe("Basic public project functionality", () => {

// Check we show the appropriate message
cy.getProjectSection("Sessions").click();
cy.getDataCy("more-menu").first().should("be.visible").click();
cy.getProjectPageLink(projectIdentifier, "sessions/new")
.should("be.visible")
.first()
Expand All @@ -201,16 +196,16 @@ describe("Basic public project functionality", () => {
cy.getDataCy("go-back-button").click();
cy.quickstartSession();

// Stop the session
cy.stopSession();
// Stop the session -- mind that anonymous users cannot pause sessions
cy.deleteSession(true);
});

it("Start a new session on a project without permissions.", () => {
// Log out and go to the project again
cy.visitAndLoadProject(projectWithoutPermissions);
cy.stopAllSessionsForProject(projectWithoutPermissions);

// Check we show the appropriate message
cy.getProjectSection("Sessions").click();
cy.getDataCy("more-menu").first().should("be.visible").click();
cy.getProjectPageLink(projectWithoutPermissions, "sessions/new")
.should("be.visible")
.first()
Expand All @@ -223,7 +218,8 @@ describe("Basic public project functionality", () => {
cy.getDataCy("go-back-button").click();
cy.quickstartSession();

// Stop the session
cy.stopSession();
// Pause, then delete the session
cy.pauseSession();
cy.deleteSession();
});
});
84 changes: 55 additions & 29 deletions cypress-tests/cypress/support/commands/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import type { ProjectIdentifier } from "./projects";
function startSession(identifier: ProjectIdentifier) {
const id = fullProjectIdentifier(identifier);
cy.visit(`/projects/${id.namespace}/${id.name}/sessions/new`);
cy.get(".btn-rk-green", { timeout: TIMEOUTS.long })
.contains("Start session")
cy.get(".renku-container button.btn-secondary", { timeout: TIMEOUTS.vlong })
.contains("Start Session")
.should("be.visible")
.should("be.enabled")
.click();
Expand All @@ -22,44 +22,68 @@ function startSession(identifier: ProjectIdentifier) {
function waitForImageToBuild(identifier: ProjectIdentifier) {
const id = fullProjectIdentifier(identifier);
cy.visit(`/projects/${id.namespace}/${id.name}/sessions/new`);
cy.get(".btn-rk-green", { timeout: TIMEOUTS.vlong })
cy.get(".renku-container button.btn-secondary", { timeout: TIMEOUTS.vlong })
.contains("Start Session")
.should("be.visible")
.should("be.enabled");
}

const stopAllSessionsForProject = (identifier: ProjectIdentifier) => {
function stopAllSessionsForProject(
identifier: ProjectIdentifier,
loadPage = true
) {
const id = fullProjectIdentifier(identifier);
cy.intercept("/ui-server/api/notebooks/servers*").as("getSessions");
cy.visit(`/projects/${id.namespace}/${id.name}/sessions`);
if (loadPage) cy.visitAndLoadProject(identifier);
cy.getProjectSection("Sessions").click();
cy.wait("@getSessions").then(({ response }) => {
const servers = response?.body?.servers ?? {};
for (const key of Object.keys(servers)) {
const name = servers[key].name;
// eslint-disable-next-line cypress/no-assigning-return-values
const connectButton = cy
.get(`[data-cy=open-session][href$=${name}]`)
.should("exist");
connectButton.siblings("[data-cy=more-menu]").click();
connectButton
.siblings(".dropdown-menu")
.find("button")
.contains("Stop")
// Skip any unrelated sessions
if (
servers[key].annotations["renku.io/namespace"] !== id.namespace ||
servers[key].annotations["renku.io/projectName"] !== id.name
)
continue;

// Stop any existing session
cy.getDataCy("session-container")
.find("[data-cy=more-menu]")
.first()
.should("be.visible")
.click();
cy.getDataCy("session-container")
.find(`[data-cy=delete-session-button]`)
.first()
.should("be.visible")
.click();
cy.getDataCy("delete-session-modal-button").should("be.visible").click();
}
});
cy.contains("No currently running sessions.", { timeout: TIMEOUTS.long });
cy.getDataCy("go-back-button").click();
};
}

function deleteSession(fromSessionPage = false) {
if (!fromSessionPage)
cy.getDataCy("more-menu").first().should("be.visible").click();
cy.getDataCy("delete-session-button").first().should("be.visible").click();
cy.getDataCy("delete-session-modal-button").should("be.visible").click();
cy.getDataCy("stopping-btn").should("be.visible");
cy.get(".renku-container", { timeout: TIMEOUTS.long })
.contains("No currently running sessions")
.should("be.visible");
}

function pauseSession(fromSessionPage = true) {
if (!fromSessionPage)
cy.getDataCy("more-menu").first().should("be.visible").click();
cy.getDataCy("pause-session-button").should("be.visible").click();
cy.getDataCy("pause-session-modal-button").should("be.visible").click();
cy.get(`[data-cy="session-container"]`, { timeout: TIMEOUTS.long })
.should("be.visible")
.contains("Paused");
}

export const stopSession = () => {
// Stop the session
cy.getDataCy("stop-session-button").should("exist").click();
cy.getDataCy("stop-session-modal-button").should("exist").click();
cy.get(".renku-container", { timeout: TIMEOUTS.long }).contains(
"No currently running sessions.",
{ timeout: TIMEOUTS.long }
);
};

function quickstartSession() {
cy.get(".start-session-button").should("not.be.disabled").click();
Expand All @@ -85,7 +109,8 @@ export default function registerSessionCommands() {
Cypress.Commands.add("quickstartSession", quickstartSession);
Cypress.Commands.add("startSession", startSession);
Cypress.Commands.add("waitForImageToBuild", waitForImageToBuild);
Cypress.Commands.add("stopSession", stopSession);
Cypress.Commands.add("deleteSession", deleteSession);
Cypress.Commands.add("pauseSession", pauseSession);
Cypress.Commands.add("stopAllSessionsForProject", stopAllSessionsForProject);
}

Expand All @@ -95,9 +120,10 @@ declare global {
interface Chainable {
startSession(identifier: ProjectIdentifier);
waitForImageToBuild(identifier: ProjectIdentifier);
stopSession();
deleteSession(fromSessionPage?: boolean);
pauseSession(fromSessionPage?: boolean);
quickstartSession();
stopAllSessionsForProject: typeof stopAllSessionsForProject;
stopAllSessionsForProject(identifier: ProjectIdentifier, loadPage?: boolean);
}
}
}
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.12.2
version: 3.13.0
- name: renku-notebooks
alias: notebooks
repository: "https://swissdatasciencecenter.github.io/helm-charts/"
version: 1.18.1
version: 1.19.0
- name: renku-gateway
alias: gateway
repository: "https://swissdatasciencecenter.github.io/helm-charts/"
Expand Down
6 changes: 6 additions & 0 deletions helm-chart/values.yaml.changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ For changes that require manual steps other than changing values, please check o
Please follow this convention when adding a new row
* `<type: NEW|EDIT|DELETE> - *<resource name>*: <details>`

----
## Upgrading to Renku 0.37.0
* EDIT - `notebooks.culling.idleThresholdSeconds` in the notebooks' values file was renamed to
`notebooks.culling.idleSecondsThreshold`. This needs to be acted upon once the corresponding
[PR](https://github.com/SwissDataScienceCenter/renku/pull/3253) in Renku repository is merged.

----
## Upgrading to Renku 0.34.0
* NEW - *ingress.className* is now available to select a specific IngressClass to
Expand Down
4 changes: 2 additions & 2 deletions load-tests/scenarioLecture.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { renkuLogin } from "./utils/oauth.js";
import { getRandomInt } from "./utils/general.js";
import { getCommitShasFromProjectName, deleteProjectByName } from "./utils/git.js";
import { createProject } from "./utils/core.js";
import { startServer, waitForServerState, getServer, stopServer, waitForImageToBuild } from "./utils/servers.js";
import { startServer, waitForServerState, getServer, deleteServer, waitForImageToBuild } from "./utils/servers.js";
import { credentials, baseUrl, gitUrl, registryDomain, concurentUsers } from "./config.js";

export const options = {
Expand Down Expand Up @@ -75,7 +75,7 @@ export default function test() {
}
});
describe("should stop the server", () => {
const res = stopServer(baseUrl, server.name);
const res = deleteServer(baseUrl, server.name);
expect(res.status, 'response status').to.equal(204);
});
describe("should delete the project", () => {
Expand Down

0 comments on commit d084571

Please sign in to comment.