Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2a3e39a
virtual desktop first pass: nasa-veda, minus qgis, plus geolab-defaul…
sarahw-earthscope Oct 22, 2025
d35293a
gitlab-ci, build the right image please
sarahw-earthscope Oct 22, 2025
f7429da
file rename
sarahw-earthscope Oct 23, 2025
8b622b4
sudo permissions on setup script
sarahw-earthscope Oct 24, 2025
5b09a12
try moving everything froms setup-linux-desktop to dockerfile
sarahw-earthscope Oct 24, 2025
132ed50
consolidate all conda installs to environment.yml
sarahw-earthscope Oct 24, 2025
9c60a2e
switch docker base to pangeo
sarahw-earthscope Oct 24, 2025
d0e7629
remove extraneous pipefail
sarahw-earthscope Oct 24, 2025
b541879
Revert "file rename"
sarahw-earthscope Oct 27, 2025
8c6c764
revert to bash script version, add chmod on file permissions
sarahw-earthscope Oct 27, 2025
6e19f46
filename confusion
sarahw-earthscope Oct 27, 2025
5c21770
add fix-permissions
sarahw-earthscope Oct 28, 2025
a2496df
increase fix-permissions permissions and filepath specificity
sarahw-earthscope Oct 28, 2025
9139b8a
add chmod -r
sarahw-earthscope Oct 28, 2025
c6b4a6a
shift to multistage build with geolab-default base
sarahw-earthscope Nov 1, 2025
95cc502
add gmt, gedit, man-db
sarahw-earthscope Dec 4, 2025
412d1f7
Merge branch 'main' into virtual_desktop
sarahw-earthscope Dec 4, 2025
b192b79
fix docs issues
sarahw-earthscope Dec 4, 2025
27201d7
pin JB version
sarahw-earthscope Dec 4, 2025
2b523b5
update base image
sarahw-earthscope Dec 5, 2025
b709bc3
add TauP
sarahw-earthscope Dec 9, 2025
3cb6b63
Trigger checks
sarahw-earthscope Dec 9, 2025
8eacd7d
change working directory for taup install
sarahw-earthscope Feb 3, 2026
8d735ef
specify taup download location
sarahw-earthscope Feb 3, 2026
c44fecf
added experimental desktop
sparafina-earthscope Feb 11, 2026
0a66da0
revamped jupyter virtual desktop image
sparafina-earthscope Feb 17, 2026
bb574f4
remove experimental virtual desktop
sparafina-earthscope Feb 17, 2026
7209f05
added annotated-dockerfile
sparafina-earthscope Feb 17, 2026
125e83b
updated annotated-dockerfile
sparafina-earthscope Feb 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ include:
- DOCKERFILE_RELPATH: "geolab-gpu"
# - DOCKERFILE_RELPATH: "mspass_shortcourse"
# - DOCKERFILE_RELPATH: "mt_shortcourse"
- DOCKERFILE_RELPATH: "virtual_desktop"

variables:
CONTAINER_REGISTRY_PLATFORM: "AWS-PUB"
Expand Down
1 change: 1 addition & 0 deletions docs/.readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ build:
os: ubuntu-22.04
tools:
python: "3.12"
nodejs: "20"
jobs:
pre_build:
# Generate the Sphinx configuration for this Jupyter Book so it builds.
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
jupyter-book
jupyter-book<2.0.0
matplotlib
numpy
sphinx == 6.2.1
2 changes: 1 addition & 1 deletion geolab-default/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dependencies:
# Packages required by ES
- tiledb
- pip
- setuptools
- pip:
- awswrangler
- dascore
Expand All @@ -21,7 +22,6 @@ dependencies:
- jupyter-resource-usage
- obspy==1.4.1
- polars
- pygmt==0.14.2
- pynlloc
- pyocto
- pyrocko
6 changes: 6 additions & 0 deletions scratch
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
docker pull aws_account_id.dkr.ecr.us-west-2.amazonaws.com/amazonlinux:latest


docker pull 599637926940.dkr.ecr.us-east-2.amazonaws.com/earthscope/geolab/geolab-default:2025-12-15-202605

docker pull public.ecr.aws/earthscope/geolab/geolab-default:2025-12-15-202605
146 changes: 146 additions & 0 deletions virtual_desktop/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
FROM public.ecr.aws/earthscope-dev/geolab/geolab-default:agu_wkshp-dc9cd124

ENV NB_GID=100
USER root

# temporary fix
RUN pip uninstall --yes pygmt

#install packages
RUN apt-get update -qq --yes > /dev/null \
&& apt-get install gmt-dcw gmt-gshhg --yes \
&& apt-get install gedit --yes \
&& apt-get install man-db --yes \
&& apt-get install openjdk-11-jre-headless --yes \
&& apt-get install xdg-utils --yes \
&& apt-get clean

# unminimize to install man-db
RUN yes | unminimize

#install gmt and pygmt from conda-forge
RUN conda install -c conda-forge --yes gmt pygmt

# install taup
WORKDIR /opt
RUN wget -P /opt/ https://zenodo.org/records/16884103/files/TauP-3.1.0.zip \
&& unzip /opt/TauP-3.1.0.zip \
&& echo 'export PATH=$PATH:/opt/TauP-3.1.0/bin' >> ~/.bashrc \
&& rm /opt/TauP-3.1.0.zip

# Dockerfile for JupyterLab with Embedded VNC Desktop
# ====================================================
# This creates a JupyterLab environment with:
# - JupyterLab interface
# - VNC desktop accessible through JupyterLab
# - X server (Xvfb for virtual display)
# - Desktop applications (xterm, firefox, etc.)
# - jupyter-server-proxy for desktop integration
# - jupyter-remote-desktop-proxy for launcher button

FROM stage
# FROM jupyter/base-notebook:latest

# Switch to root for system installations
USER root

# Prevent interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive \
DISPLAY=:1 \
VNC_PORT=5901 \
RESOLUTION=1920x1080

# Install system packages
RUN apt-get update && apt-get install -y \
# X server and utilities
xvfb \
x11-apps \
x11-utils \
# Window manager
xfce4 \
xfce4-goodies \
xfce4-terminal \
# VNC server
tigervnc-standalone-server \
tigervnc-common \
# noVNC and dependencies
novnc \
websockify \
python3 \
# Applications
xterm \
firefox \
gedit \
# Utilities
wget \
curl \
net-tools \
# Fonts
fonts-liberation \
fonts-dejavu \
# System utilities
dbus-x11 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Create VNC directory for the notebook user
RUN mkdir -p /home/$NB_USER/.vnc && \
chown -R $NB_USER:$NB_GID /home/$NB_USER

# Switch to notebook user for Python package installation
USER $NB_USER

# Install JupyterLab extensions and VNC support
RUN pip install --no-cache-dir \
jupyter-server-proxy==4.4.0 \
jupyter-remote-desktop-proxy

# Switch back to root for VNC configuration
USER root

# Set VNC password (password: password)
RUN echo "password" | vncpasswd -f > /home/$NB_USER/.vnc/passwd && \
chmod 600 /home/$NB_USER/.vnc/passwd && \
chown $NB_USER:$NB_GID /home/$NB_USER/.vnc/passwd

# Create VNC xstartup script for XFCE
COPY xstartup /home/$NB_USER/.vnc/xstartup

RUN chmod +x /home/$NB_USER/.vnc/xstartup && \
chown $NB_USER:$NB_GID /home/$NB_USER/.vnc/xstartup

# Copy desktop startup script
COPY startup-desktop.sh /usr/local/bin/start-desktop.sh

# Create a wrapper script that jupyter-remote-desktop-proxy can call
COPY vnc-startup /usr/local/bin/vnc-startup

RUN chmod +x /usr/local/bin/vnc-startup

# Copy manual launcher script for terminal use
COPY launch-desktop /usr/local/bin/launch-desktop

RUN chmod +x /usr/local/bin/launch-desktop

# Fix all permissions
RUN chown -R $NB_USER:$NB_GID /home/$NB_USER

# Switch back to notebook user
USER $NB_USER

# Expose JupyterLab and VNC ports
EXPOSE 8888 5901 6080

# Set working directory
WORKDIR /home/$NB_USER

# Copy README
COPY README.md /home/$NB_USER/README.md

# Copy demo notebook
COPY desktop-demo.ipynb /home/$NB_USER/desktop-demo.ipynb

# Start JupyterLab
# The jupyter-remote-desktop-proxy will automatically detect VNC and add the Desktop launcher
# CMD ["start-notebook.sh", "--ServerApp.token=''", "--ServerApp.password=''"]
CMD ["jupyter", "lab", "--ip=0.0.0.0", "--no-browser", "--allow-root"]
83 changes: 83 additions & 0 deletions virtual_desktop/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# JupyterLab with VNC Desktop

## Quick Start

### Access Desktop in JupyterLab

**Method 1: Launcher Icon (Easiest)**
1. Open JupyterLab at http://localhost:8888
2. Click the **"Desktop"** icon in the Launcher
3. Desktop opens in a new tab within JupyterLab!

**Method 2: Direct URL**
Navigate to: http://localhost:8888/desktop/

**Method 3: Terminal Command**
```bash
launch-desktop
```

## Using the Desktop

The desktop provides a full XFCE environment with:
- Applications menu (top-left)
- Firefox web browser
- Gedit text editor
- File manager
- Terminal emulator
- Multiple workspaces

## Running Applications from Jupyter

### From Terminal:
```bash
export DISPLAY=:1
firefox &
gedit myfile.txt &
xterm &
```

### From Notebook:
```python
import os
import subprocess

os.environ['DISPLAY'] = ':1'
subprocess.Popen(['firefox'])
```

## Troubleshooting

### Desktop won't load?
```bash
# Check if VNC is running
ps aux | grep Xvnc

# Restart VNC
vncserver -kill :1
sleep 2
vncserver :1 -geometry 1920x1080 -depth 24

# Check logs
cat ~/.vnc/*.log
```

### Applications won't start?
```bash
export DISPLAY=:1
export USER=jovyan
export HOME=/home/jovyan
```

## Installed Applications

- Firefox - Web browser
- Gedit - Text editor
- XFCE Terminal - Terminal emulator
- Xterm - Simple terminal
- File Manager - Browse files
- X11 apps - xeyes, xclock, xcalc

## Password

If prompted for VNC password: **password**
Loading