From 18880e7e4fe80dbb75094c088f3d00c71c147c13 Mon Sep 17 00:00:00 2001 From: Simon Li Date: Sun, 22 Oct 2023 22:16:17 +0100 Subject: [PATCH 1/5] Fix Dockerfile (currently broken as there is no `jovyan` group) --- .github/workflows/build.yaml | 34 ++++++++++++++++++++++++++++++++++ Dockerfile | 11 +++++------ 2 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 00000000..980c3fbd --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,34 @@ +# This is a GitHub workflow defining a set of jobs with a set of steps. +# ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions +# +name: Build + +on: + pull_request: + push: + branches-ignore: + - "dependabot/**" + - "pre-commit-ci-update-config" + tags: ["**"] + workflow_dispatch: + +jobs: + container: + runs-on: ubuntu-22.04 + timeout-minutes: 10 + + steps: + - uses: actions/checkout@v4 + + - name: Build image + run: | + docker build -t jupyter-remote-desktop-proxy . + + - name: Smoke test image + run: | + docker run -d -p 8888:8888 -e JUPYTER_TOKEN=secret jupyter-remote-desktop-proxy + sleep 10 + curl 'http://localhost:8888/desktop/?token=secret' | grep 'Modified from novnc_lite.html example in noVNC' + + # TODO: Check VNC desktop works, e.g. by comparing Playwright screenshots + # https://playwright.dev/docs/test-snapshots diff --git a/Dockerfile b/Dockerfile index 4966b0ac..e6cd6f75 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,10 +20,9 @@ RUN apt-get -y -q update \ USER $NB_USER -RUN mamba install --yes websockify +COPY --chown=$NB_UID:$NB_GID jupyter_remote_desktop_proxy /opt/install/jupyter_remote_desktop_proxy +COPY --chown=$NB_UID:$NB_GID environment.yml setup.py MANIFEST.in README.md LICENSE /opt/install/ -COPY --chown=$NB_USER:$NB_USER jupyter_remote_desktop_proxy /opt/install/jupyter_remote_desktop_proxy -COPY --chown=$NB_USER:$NB_USER setup.py MANIFEST.in README.md LICENSE /opt/install/ - -RUN cd /opt/install \ - && pip install -e . +RUN cd /opt/install && \ + . /opt/conda/bin/activate && \ + mamba env update --quiet --file environment.yml From ecbb99ffd6b8da29973231fa2c7f9295fbaee4fe Mon Sep 17 00:00:00 2001 From: Simon Li Date: Sun, 22 Oct 2023 22:18:39 +0100 Subject: [PATCH 2/5] Use -qq for apt. Use quay.io base image --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e6cd6f75..f950cedc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ -FROM jupyter/base-notebook +FROM quay.io/jupyter/base-notebook:latest USER root -RUN apt-get -y -q update \ - && apt-get -y -q install \ +RUN apt-get -y -qq update \ + && apt-get -y -qq install \ dbus-x11 \ xfce4 \ xfce4-panel \ From 0274d14d2a1a231f9437cb5ed5ad93a9cec85543 Mon Sep 17 00:00:00 2001 From: Simon Li Date: Sun, 22 Oct 2023 22:21:02 +0100 Subject: [PATCH 3/5] Add Build badge to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c417baf1..020e5dc4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Jupyter Remote Desktop Proxy [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jupyterhub/jupyter-remote-desktop-proxy/HEAD?urlpath=desktop) +[![Build](https://github.com/jupyterhub/jupyter-remote-desktop-proxy/actions/workflows/build.yaml/badge.svg)](https://github.com/jupyterhub/jupyter-remote-desktop-proxy/actions/workflows/build.yaml) [![Latest PyPI version](https://img.shields.io/pypi/v/jupyter-remote-desktop-proxy?logo=pypi)](https://pypi.python.org/pypi/jupyter-remote-desktop-proxy) [![Issue tracking - GitHub](https://img.shields.io/badge/issue_tracking-github-blue?logo=github)](https://github.com/jupyterhub/jupyter-remote-desktop-proxy/issues) [![Help forum - Discourse](https://img.shields.io/badge/help_forum-discourse-blue?logo=discourse)](https://discourse.jupyter.org/c/jupyterhub) From eb2dcf4b38f7a6455e0f0a89616dd6d8a16fd923 Mon Sep 17 00:00:00 2001 From: Simon Li Date: Sun, 22 Oct 2023 22:43:24 +0100 Subject: [PATCH 4/5] Create /opt/install to ensure it's writable by pip --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f950cedc..88b8e7c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,9 @@ RUN apt-get -y -qq update \ tigervnc-xorg-extension \ # chown $HOME to workaround that the xorg installation creates a # /home/jovyan/.cache directory owned by root - && chown -R $NB_UID:$NB_GID $HOME \ + # Create /opt/install to ensure it's writable by pip + && mkdir -p /opt/install \ + && chown -R $NB_UID:$NB_GID $HOME /opt/install \ && rm -rf /var/lib/apt/lists/* USER $NB_USER From 8e6a1a2a71104204ca5959685700af952601c7b5 Mon Sep 17 00:00:00 2001 From: Simon Li Date: Sun, 22 Oct 2023 23:30:50 +0100 Subject: [PATCH 5/5] Rename build workflow to test --- .github/workflows/{build.yaml => test.yaml} | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{build.yaml => test.yaml} (98%) diff --git a/.github/workflows/build.yaml b/.github/workflows/test.yaml similarity index 98% rename from .github/workflows/build.yaml rename to .github/workflows/test.yaml index 980c3fbd..da75eda2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/test.yaml @@ -1,7 +1,7 @@ # This is a GitHub workflow defining a set of jobs with a set of steps. # ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions # -name: Build +name: Test on: pull_request: diff --git a/README.md b/README.md index 020e5dc4..2b641de7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Jupyter Remote Desktop Proxy [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jupyterhub/jupyter-remote-desktop-proxy/HEAD?urlpath=desktop) -[![Build](https://github.com/jupyterhub/jupyter-remote-desktop-proxy/actions/workflows/build.yaml/badge.svg)](https://github.com/jupyterhub/jupyter-remote-desktop-proxy/actions/workflows/build.yaml) +[![Test](https://github.com/jupyterhub/jupyter-remote-desktop-proxy/actions/workflows/test.yaml/badge.svg)](https://github.com/jupyterhub/jupyter-remote-desktop-proxy/actions/workflows/test.yaml) [![Latest PyPI version](https://img.shields.io/pypi/v/jupyter-remote-desktop-proxy?logo=pypi)](https://pypi.python.org/pypi/jupyter-remote-desktop-proxy) [![Issue tracking - GitHub](https://img.shields.io/badge/issue_tracking-github-blue?logo=github)](https://github.com/jupyterhub/jupyter-remote-desktop-proxy/issues) [![Help forum - Discourse](https://img.shields.io/badge/help_forum-discourse-blue?logo=discourse)](https://discourse.jupyter.org/c/jupyterhub)