From 0bd6429be7447c70dffd9dc96909aace88da8d1d Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Fri, 29 Mar 2024 22:33:28 +0100 Subject: [PATCH] install websocat in image --- .github/workflows/test.yaml | 30 ++++++++++++++++++++---------- Dockerfile | 4 ---- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 874e6b5a..e1f325ca 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -33,13 +33,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install test requirement (websocat) - run: | - wget -q https://github.com/vi/websocat/releases/download/v1.12.0/websocat.x86_64-unknown-linux-musl \ - -O /usr/local/bin/websocat - chmod +x /usr/local/bin/websocat - websocat --help=long - - name: Build image run: | docker build --progress=plain --build-arg vncserver=${{ matrix.vncserver }} -t test . @@ -80,6 +73,14 @@ jobs: container_id=$(docker run -d -it -p 5901:5901 test websockify --verbose --log-file=/tmp/websockify.log --heartbeat=30 5901 -- vncserver -xstartup /opt/install/jupyter_remote_desktop_proxy/share/xstartup -verbose -fg -geometry 1680x1050 -SecurityTypes None -rfbport 5901) sleep 1 + echo "::group::Install websocat, a test dependency" + docker exec --user root $container_id bash -c ' + wget -q https://github.com/vi/websocat/releases/download/v1.12.0/websocat.x86_64-unknown-linux-musl \ + -O /usr/local/bin/websocat + chmod +x /usr/local/bin/websocat + ' + echo "::endgroup::" + docker exec -it $container_id websocat --binary --one-message --exit-on-eof "ws://localhost:5901/" 2>&1 | tee -a /dev/stderr | \ grep --quiet RFB && echo "Passed test" || { echo "Failed test" && TEST_OK=false; } @@ -106,9 +107,18 @@ jobs: curl --silent --fail 'http://localhost:8888/desktop/?token=secret' | grep --quiet 'Jupyter Remote Desktop Proxy' && echo "Passed get index.html test" || { echo "Failed get index.html test" && TEST_OK=false; } curl --silent --fail 'http://localhost:8888/desktop/static/dist/viewer.js?token=secret' > /dev/null && echo "Passed get viewer.js test" || { echo "Failed get viewer.js test" && TEST_OK=false; } - websocat --binary --one-message --exit-on-eof 'ws://localhost:8888/desktop-websockify/?token=secret' | \ - grep --quiet RFB && echo "Passed initial websocket test" || { \ - echo "Failed initial websocket test" && sleep 1 && websocat --binary --one-message --exit-on-eof 'ws://localhost:8888/desktop-websockify/?token=secret' | grep --quiet RFB && echo "Passed second websocket test" || { echo "Failed second websocket test" && TEST_OK=false; } \ + websocat --binary --one-message --exit-on-eof 'ws://localhost:8888/desktop-websockify/?token=secret' 2>&1 \ + | tee -a /dev/stderr \ + | grep --quiet RFB \ + && echo "Passed initial websocket test" \ + || { \ + echo "Failed initial websocket test" \ + && sleep 1 \ + && websocat --binary --one-message --exit-on-eof 'ws://localhost:8888/desktop-websockify/?token=secret' 2>&1 \ + | tee -a /dev/stderr \ + | grep --quiet RFB \ + && echo "Passed second websocket test" \ + || { echo "Failed second websocket test" && TEST_OK=false; } \ } echo "::group::jupyter_server logs" diff --git a/Dockerfile b/Dockerfile index 7327f387..80ffb137 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,10 +23,6 @@ RUN apt-get -y -qq update \ && chown -R $NB_UID:$NB_GID $HOME /opt/install \ && rm -rf /var/lib/apt/lists/* -RUN wget -q https://github.com/vi/websocat/releases/download/v1.12.0/websocat.x86_64-unknown-linux-musl \ - -O /usr/local/bin/websocat \ - && chmod +x /usr/local/bin/websocat - # Install a VNC server, either TigerVNC (default) or TurboVNC ARG vncserver=tigervnc RUN if [ "${vncserver}" = "tigervnc" ]; then \