From 915f4c08fc578ed7f0664336ffb7722e7aca11a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rok=20Ro=C5=A1kar?= Date: Wed, 21 Aug 2024 17:11:21 +0200 Subject: [PATCH 01/12] chore: update jupyterlab --- docker/py/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/py/requirements.txt b/docker/py/requirements.txt index 3499d9d2..a3f54a1e 100644 --- a/docker/py/requirements.txt +++ b/docker/py/requirements.txt @@ -2,6 +2,7 @@ bleach>5.0.0 # closes #300 certifi>=2022.12.7 # not directly required, pinned by Snyk to avoid a vulnerability Jinja2<3.1 # because of https://github.com/jupyter/nbconvert/issues/1742 jupyter-server-proxy==4.3.0 +jupyterlab>=4.0.0 jupyterlab-git==0.50.1 jupyterlab-system-monitor~=0.8.0 mistune>=2.0.1 # not directly required, pinned by Snyk to avoid a vulnerability From e5370c4b6638fc5e8aefd1a1ebee1570ac6ff423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rok=20Ro=C5=A1kar?= Date: Wed, 21 Aug 2024 17:14:52 +0200 Subject: [PATCH 02/12] Update requirements.txt --- docker/py/requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/docker/py/requirements.txt b/docker/py/requirements.txt index a3f54a1e..09301bc2 100644 --- a/docker/py/requirements.txt +++ b/docker/py/requirements.txt @@ -4,7 +4,6 @@ Jinja2<3.1 # because of https://github.com/jupyter/nbconvert/issues/1742 jupyter-server-proxy==4.3.0 jupyterlab>=4.0.0 jupyterlab-git==0.50.1 -jupyterlab-system-monitor~=0.8.0 mistune>=2.0.1 # not directly required, pinned by Snyk to avoid a vulnerability papermill~=2.6.0 requests>=2.20.0 From dc9d86b621c06bde034e2b8d0d235456e3515944 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rok=20Ro=C5=A1kar?= Date: Wed, 21 Aug 2024 17:30:57 +0200 Subject: [PATCH 03/12] Update requirements.txt --- docker/py/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/py/requirements.txt b/docker/py/requirements.txt index 09301bc2..129b2267 100644 --- a/docker/py/requirements.txt +++ b/docker/py/requirements.txt @@ -2,7 +2,7 @@ bleach>5.0.0 # closes #300 certifi>=2022.12.7 # not directly required, pinned by Snyk to avoid a vulnerability Jinja2<3.1 # because of https://github.com/jupyter/nbconvert/issues/1742 jupyter-server-proxy==4.3.0 -jupyterlab>=4.0.0 +jupyterlab~=4.1 jupyterlab-git==0.50.1 mistune>=2.0.1 # not directly required, pinned by Snyk to avoid a vulnerability papermill~=2.6.0 From d3241824ae68489941c9074cb03fc0b65103a473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rok=20Ro=C5=A1kar?= Date: Wed, 21 Aug 2024 17:45:20 +0200 Subject: [PATCH 04/12] Update requirements.txt --- docker/py/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/py/requirements.txt b/docker/py/requirements.txt index 129b2267..aa52c20a 100644 --- a/docker/py/requirements.txt +++ b/docker/py/requirements.txt @@ -2,7 +2,7 @@ bleach>5.0.0 # closes #300 certifi>=2022.12.7 # not directly required, pinned by Snyk to avoid a vulnerability Jinja2<3.1 # because of https://github.com/jupyter/nbconvert/issues/1742 jupyter-server-proxy==4.3.0 -jupyterlab~=4.1 +jupyterlab~=4.0 jupyterlab-git==0.50.1 mistune>=2.0.1 # not directly required, pinned by Snyk to avoid a vulnerability papermill~=2.6.0 From 1117afeebaab04d0acfcae7d093d1d2167d779cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rok=20Ro=C5=A1kar?= Date: Fri, 23 Aug 2024 14:45:27 +0200 Subject: [PATCH 05/12] test the test fix --- tests/cypress/e2e/jupyterlab.cy.ts | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/tests/cypress/e2e/jupyterlab.cy.ts b/tests/cypress/e2e/jupyterlab.cy.ts index 8f2fad51..a75a0996 100644 --- a/tests/cypress/e2e/jupyterlab.cy.ts +++ b/tests/cypress/e2e/jupyterlab.cy.ts @@ -10,6 +10,26 @@ const url_or_path = Cypress.env("URL"); const url = url_or_path.slice(-1) === "/" ? url_or_path.slice(0, -1) : url_or_path; +const makeFileWithTerminal_ = (fname: string) => () => { + cy.get(".xterm-helper-textarea").click().type(`touch ${fname}{enter}`); + cy.get("#filebrowser > .jp-Toolbar") + .find('[title="Refresh the file browser."]') + .click(); + cy.get("#filebrowser .jp-DirListing-content") + .should("be.visible") + .should("contain.text", "new-file.txt"); +}; + +const removeFileWithTerminal_ = (fname: string) => () => { + cy.get(".xterm-helper-textarea").click().type(`rm ${fname}{enter}`); + cy.get("#filebrowser > .jp-Toolbar") + .find('[title="Refresh the file browser."]') + .click(); + cy.get("#filebrowser .jp-DirListing-content") + .should("be.visible") + .should("not.contain.text", "new-file.txt"); +}; + describe("Test jupyter notebook", () => { before(() => { registerCustomCommands(); @@ -32,11 +52,11 @@ describe("Test jupyter notebook", () => { it("Can launch a terminal", jupyterlabTestFuncs.launchTerminal); it( "Can run terminal command to create a file", - jupyterlabTestFuncs.makeFileWithTerminal("new-file.txt") + makeFileWithTerminal_("new-file.txt") ); it( "Can remove the file", - jupyterlabTestFuncs.removeFileWithTerminal("new-file.txt") + removeFileWithTerminal_("new-file.txt") ); it("Can close the terminal", jupyterlabTestFuncs.closeTerminal); it( From d31f8381b8e53ff1673881869339cf965922340f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rok=20Ro=C5=A1kar?= Date: Fri, 23 Aug 2024 16:32:17 +0200 Subject: [PATCH 06/12] chore: switch base dependencies to conda --- .github/dependabot.yml | 2 +- docker/py/environment.yml | 18 ++++++++++++++++++ docker/py/requirements.txt | 13 ------------- 3 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 docker/py/environment.yml delete mode 100644 docker/py/requirements.txt diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6ccdb10f..ce773bec 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -40,7 +40,7 @@ updates: # python dependencies # -- package-ecosystem: "pip" +- package-ecosystem: "conda" directory: "/docker/py" schedule: interval: daily diff --git a/docker/py/environment.yml b/docker/py/environment.yml new file mode 100644 index 00000000..4b3a90f5 --- /dev/null +++ b/docker/py/environment.yml @@ -0,0 +1,18 @@ +name: base +channels: + - conda-forge +dependencies: + - jupyterlab~=4.0 + - bleach>5.0.0 # closes #300 + - certifi>=2022.12.7 # not directly required, pinned by Snyk to avoid a vulnerability + - Jinja2<3.1 # because of https://github.com/jupyter/nbconvert/issues/1742 + - jupyter-server-proxy==4.3.0 + - jupyterlab~=4.0 + - jupyterlab-git==0.50.1 + - mistune>=2.0.1 # not directly required, pinned by Snyk to avoid a vulnerability + - papermill~=2.6.0 + - requests>=2.20.0 + - setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability + - virtualenv>=20.7.2 + - ipython>=8.10.0 # not directly required, pinned by Snyk to avoid a vulnerability + - tornado>=6.3.3 # not directly required, pinned by Snyk to avoid a vulnerability diff --git a/docker/py/requirements.txt b/docker/py/requirements.txt deleted file mode 100644 index aa52c20a..00000000 --- a/docker/py/requirements.txt +++ /dev/null @@ -1,13 +0,0 @@ -bleach>5.0.0 # closes #300 -certifi>=2022.12.7 # not directly required, pinned by Snyk to avoid a vulnerability -Jinja2<3.1 # because of https://github.com/jupyter/nbconvert/issues/1742 -jupyter-server-proxy==4.3.0 -jupyterlab~=4.0 -jupyterlab-git==0.50.1 -mistune>=2.0.1 # not directly required, pinned by Snyk to avoid a vulnerability -papermill~=2.6.0 -requests>=2.20.0 -setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability -virtualenv>=20.7.2 -ipython>=8.10.0 # not directly required, pinned by Snyk to avoid a vulnerability -tornado>=6.3.3 # not directly required, pinned by Snyk to avoid a vulnerability From 2f54f069663e53bc3c795357acd85ec73ac831c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rok=20Ro=C5=A1kar?= Date: Fri, 23 Aug 2024 16:34:22 +0200 Subject: [PATCH 07/12] chore: update Dockerfile for conda deps --- docker/py/Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docker/py/Dockerfile b/docker/py/Dockerfile index cf785db4..8d2b26fa 100644 --- a/docker/py/Dockerfile +++ b/docker/py/Dockerfile @@ -14,9 +14,8 @@ RUN sed -i '/nodejs/d' /opt/conda/conda-meta/pinned # switch to the notebook user USER $NB_USER # install jupyterlab, papermill, git extension and renku-jupyterlab-ts -COPY requirements.txt /tmp/requirements.txt -RUN python3 -m pip install --no-cache-dir -U pip && \ - python3 -m pip install --no-cache-dir -r /tmp/requirements.txt && \ +COPY environment.yml /tmp/environment.yml +RUN mamba env update -q -f /tmp/environment.yml && \ jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \ rm -rf "/home/${NB_USER}/.cache" From 0c656b79841281d0ef46842b7481491a8bc542fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rok=20Ro=C5=A1kar?= Date: Fri, 23 Aug 2024 17:15:41 +0200 Subject: [PATCH 08/12] chore: avoid conda conflicts --- docker/py/Dockerfile | 7 ++++--- docker/py/environment.yml | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docker/py/Dockerfile b/docker/py/Dockerfile index 8d2b26fa..967d74fb 100644 --- a/docker/py/Dockerfile +++ b/docker/py/Dockerfile @@ -15,7 +15,7 @@ RUN sed -i '/nodejs/d' /opt/conda/conda-meta/pinned USER $NB_USER # install jupyterlab, papermill, git extension and renku-jupyterlab-ts COPY environment.yml /tmp/environment.yml -RUN mamba env update -q -f /tmp/environment.yml && \ +RUN mamba env update -f /tmp/environment.yml && \ jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \ rm -rf "/home/${NB_USER}/.cache" @@ -80,7 +80,7 @@ RUN mkdir -p "$HOME/.ssh" && \ # configure bash and shell prompt ENV PATH=$HOME/.local/bin:$PATH:$HOME/.renku/bin COPY --chown=1000:100 bashrc /renku/ -RUN cat "/renku/bashrc" >> "${HOME}/.bashrc" +RUN cat "/renku/bashrc" >> "${HOME}/.bashrc" COPY entrypoint.sh /entrypoint.sh @@ -96,7 +96,8 @@ COPY sshd_config /opt/ssh/sshd_config RUN chown -R 0:100 /opt/ssh/ && \ chmod -R u=rwX,g=rX,o= /opt/ssh && \ - chmod -R u=rwX,g=rwX,o= /opt/ssh/pid + chmod -R u=rwX,g=rwX,o= /opt/ssh/pid && \ + rm -rf /opt/conda ENTRYPOINT [ "tini", "--", "/entrypoint.sh" ] diff --git a/docker/py/environment.yml b/docker/py/environment.yml index 4b3a90f5..0e5daf43 100644 --- a/docker/py/environment.yml +++ b/docker/py/environment.yml @@ -2,12 +2,11 @@ name: base channels: - conda-forge dependencies: - - jupyterlab~=4.0 - bleach>5.0.0 # closes #300 - certifi>=2022.12.7 # not directly required, pinned by Snyk to avoid a vulnerability - Jinja2<3.1 # because of https://github.com/jupyter/nbconvert/issues/1742 - jupyter-server-proxy==4.3.0 - - jupyterlab~=4.0 + - jupyterlab>4.0,<5.0 - jupyterlab-git==0.50.1 - mistune>=2.0.1 # not directly required, pinned by Snyk to avoid a vulnerability - papermill~=2.6.0 From a524ed63c9d1cb711123163e168c22b16c9166aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rok=20Ro=C5=A1kar?= Date: Mon, 26 Aug 2024 09:38:13 +0200 Subject: [PATCH 09/12] chore: do not install server proxy twice --- docker/vnc/Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docker/vnc/Dockerfile b/docker/vnc/Dockerfile index 300a42bc..9e8b4776 100644 --- a/docker/vnc/Dockerfile +++ b/docker/vnc/Dockerfile @@ -68,9 +68,8 @@ RUN chmod +x /home/jovyan/Desktop/gitk.desktop && \ # Install the jupyter extensions USER ${NB_USER} -RUN mamba install -y jupyter-server-proxy numpy websockify -c conda-forge \ - && jupyter labextension install @jupyterlab/server-proxy \ - && mamba clean -y --all +RUN mamba install -y numpy websockify -c conda-forge && \ + mamba clean -y --all COPY jupyter_notebook_config.py /home/jovyan/.jupyter/jupyter_notebook_config.py From 27a32f0ae372be8d32496fb2dfb82a45d1ca8d11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rok=20Ro=C5=A1kar?= Date: Mon, 26 Aug 2024 14:51:10 +0200 Subject: [PATCH 10/12] chore: update tests version --- tests/package-lock.json | 13 +++++++------ tests/package.json | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/package-lock.json b/tests/package-lock.json index f6f1a681..53b1bca1 100644 --- a/tests/package-lock.json +++ b/tests/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.1", "license": "ISC", "devDependencies": { - "@renku/notebooks-cypress-tests": "^0.0.11", + "@renku/notebooks-cypress-tests": "^0.0.12", "@types/node": "^18.7.18", "axios": "^1.6.0", "axios-cookiejar-support": "^4.0.3", @@ -115,10 +115,10 @@ } }, "node_modules/@renku/notebooks-cypress-tests": { - "version": "0.0.11", - "resolved": "git+ssh://git@github.com/leafty/notebooks-cypress-tests.git#998453ad7965192f729971cc2846e1bab70ae905", + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/@renku/notebooks-cypress-tests/-/notebooks-cypress-tests-0.0.12.tgz", + "integrity": "sha512-kbFya4An4ZuDJmKh8gMUfOHxZBvCaTjKmjptw3TjU8yhYk2q8mWEoPqnSWdAu9vT4sZWZM+M33VkeGmX48TsMA==", "dev": true, - "license": "ISC", "dependencies": { "cypress": "^11.0.1" } @@ -3037,9 +3037,10 @@ } }, "@renku/notebooks-cypress-tests": { - "version": "git+ssh://git@github.com/leafty/notebooks-cypress-tests.git#998453ad7965192f729971cc2846e1bab70ae905", + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/@renku/notebooks-cypress-tests/-/notebooks-cypress-tests-0.0.12.tgz", + "integrity": "sha512-kbFya4An4ZuDJmKh8gMUfOHxZBvCaTjKmjptw3TjU8yhYk2q8mWEoPqnSWdAu9vT4sZWZM+M33VkeGmX48TsMA==", "dev": true, - "from": "@renku/notebooks-cypress-tests@^0.0.11", "requires": { "cypress": "^11.0.1" }, diff --git a/tests/package.json b/tests/package.json index 0e12b59f..911f7bc3 100644 --- a/tests/package.json +++ b/tests/package.json @@ -9,7 +9,7 @@ "author": "", "license": "ISC", "devDependencies": { - "@renku/notebooks-cypress-tests": "^0.0.11", + "@renku/notebooks-cypress-tests": "^0.0.12", "@types/node": "^18.7.18", "axios": "^1.6.0", "axios-cookiejar-support": "^4.0.3", From b8e1f89846544650272880f3f5529de9a8738948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rok=20Ro=C5=A1kar?= Date: Mon, 26 Aug 2024 14:51:36 +0200 Subject: [PATCH 11/12] Revert "test the test fix" This reverts commit 1117afeebaab04d0acfcae7d093d1d2167d779cf. --- tests/cypress/e2e/jupyterlab.cy.ts | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/tests/cypress/e2e/jupyterlab.cy.ts b/tests/cypress/e2e/jupyterlab.cy.ts index a75a0996..8f2fad51 100644 --- a/tests/cypress/e2e/jupyterlab.cy.ts +++ b/tests/cypress/e2e/jupyterlab.cy.ts @@ -10,26 +10,6 @@ const url_or_path = Cypress.env("URL"); const url = url_or_path.slice(-1) === "/" ? url_or_path.slice(0, -1) : url_or_path; -const makeFileWithTerminal_ = (fname: string) => () => { - cy.get(".xterm-helper-textarea").click().type(`touch ${fname}{enter}`); - cy.get("#filebrowser > .jp-Toolbar") - .find('[title="Refresh the file browser."]') - .click(); - cy.get("#filebrowser .jp-DirListing-content") - .should("be.visible") - .should("contain.text", "new-file.txt"); -}; - -const removeFileWithTerminal_ = (fname: string) => () => { - cy.get(".xterm-helper-textarea").click().type(`rm ${fname}{enter}`); - cy.get("#filebrowser > .jp-Toolbar") - .find('[title="Refresh the file browser."]') - .click(); - cy.get("#filebrowser .jp-DirListing-content") - .should("be.visible") - .should("not.contain.text", "new-file.txt"); -}; - describe("Test jupyter notebook", () => { before(() => { registerCustomCommands(); @@ -52,11 +32,11 @@ describe("Test jupyter notebook", () => { it("Can launch a terminal", jupyterlabTestFuncs.launchTerminal); it( "Can run terminal command to create a file", - makeFileWithTerminal_("new-file.txt") + jupyterlabTestFuncs.makeFileWithTerminal("new-file.txt") ); it( "Can remove the file", - removeFileWithTerminal_("new-file.txt") + jupyterlabTestFuncs.removeFileWithTerminal("new-file.txt") ); it("Can close the terminal", jupyterlabTestFuncs.closeTerminal); it( From dea123db137c096c624647f48079f4c9f4d5f929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rok=20Ro=C5=A1kar?= Date: Mon, 26 Aug 2024 15:41:25 +0200 Subject: [PATCH 12/12] chore: update tests library version --- tests/package-lock.json | 14 +++++++------- tests/package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/package-lock.json b/tests/package-lock.json index 53b1bca1..c274e835 100644 --- a/tests/package-lock.json +++ b/tests/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.1", "license": "ISC", "devDependencies": { - "@renku/notebooks-cypress-tests": "^0.0.12", + "@renku/notebooks-cypress-tests": "^0.0.13", "@types/node": "^18.7.18", "axios": "^1.6.0", "axios-cookiejar-support": "^4.0.3", @@ -115,9 +115,9 @@ } }, "node_modules/@renku/notebooks-cypress-tests": { - "version": "0.0.12", - "resolved": "https://registry.npmjs.org/@renku/notebooks-cypress-tests/-/notebooks-cypress-tests-0.0.12.tgz", - "integrity": "sha512-kbFya4An4ZuDJmKh8gMUfOHxZBvCaTjKmjptw3TjU8yhYk2q8mWEoPqnSWdAu9vT4sZWZM+M33VkeGmX48TsMA==", + "version": "0.0.13", + "resolved": "https://registry.npmjs.org/@renku/notebooks-cypress-tests/-/notebooks-cypress-tests-0.0.13.tgz", + "integrity": "sha512-0GU+iHG/vMg8cpYXhAuo4ztMA4ZxlEnJuQJThSpEMN9BjzUL5Bhj2Ia64a83ryW3mrYe5UDIrvWjKFoCDvd4tQ==", "dev": true, "dependencies": { "cypress": "^11.0.1" @@ -3037,9 +3037,9 @@ } }, "@renku/notebooks-cypress-tests": { - "version": "0.0.12", - "resolved": "https://registry.npmjs.org/@renku/notebooks-cypress-tests/-/notebooks-cypress-tests-0.0.12.tgz", - "integrity": "sha512-kbFya4An4ZuDJmKh8gMUfOHxZBvCaTjKmjptw3TjU8yhYk2q8mWEoPqnSWdAu9vT4sZWZM+M33VkeGmX48TsMA==", + "version": "0.0.13", + "resolved": "https://registry.npmjs.org/@renku/notebooks-cypress-tests/-/notebooks-cypress-tests-0.0.13.tgz", + "integrity": "sha512-0GU+iHG/vMg8cpYXhAuo4ztMA4ZxlEnJuQJThSpEMN9BjzUL5Bhj2Ia64a83ryW3mrYe5UDIrvWjKFoCDvd4tQ==", "dev": true, "requires": { "cypress": "^11.0.1" diff --git a/tests/package.json b/tests/package.json index 911f7bc3..4a77ed8c 100644 --- a/tests/package.json +++ b/tests/package.json @@ -9,7 +9,7 @@ "author": "", "license": "ISC", "devDependencies": { - "@renku/notebooks-cypress-tests": "^0.0.12", + "@renku/notebooks-cypress-tests": "^0.0.13", "@types/node": "^18.7.18", "axios": "^1.6.0", "axios-cookiejar-support": "^4.0.3",