You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LABEL org.opencontainers.image.description="Python (3.12), R (4.4.3), Desktop and Publishing tools"
7
7
LABEL org.opencontainers.image.licenses=Apache2.0
8
-
LABEL org.opencontainers.image.version=2025.04.17
8
+
LABEL org.opencontainers.image.version=2025.04.26
9
9
10
10
USER root
11
11
@@ -60,7 +60,7 @@ RUN wget -qO- https://raw.githubusercontent.com/retorquere/zotero-deb/master/ins
60
60
RUN /pyrocket_scripts/install-apt-packages.sh ${REPO_DIR}/apt.txt
61
61
62
62
# Install some basic VS Code extensions
63
-
RUN /pyrocket_scripts/install-vscode-extensions.sh ${REPO_DIR}/vscode-extensions.txt
63
+
RUN /pyrocket_scripts/install-vscode-extensions.sh ${REPO_DIR}/vscode-extensions.txt || (echo "install-vscode-extensions.sh failed for some extensions" >&2 && exit 1)
64
64
65
65
# Re-enable man pages disabled in Ubuntu 18 minimal image
Copy file name to clipboardExpand all lines: README.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# py-rocket-base: JupyterHub base image
2
2
3
-
[](https://github.com/nmfs-opensci/py-rocket-base/actions/workflows/build.yaml)[](https://doi.org/10.5281/zenodo.13942617)[](https://github.com/nmfs-opensci/py-rocket-base/releases)
3
+
[](https://github.com/nmfs-opensci/py-rocket-base/actions/workflows/build.yaml)[](https://doi.org/10.5281/zenodo.13942617)[](https://github.com/nmfs-opensci/py-rocket-base/releases)
4
4
5
5
The py-rocket-base image is a base image for the JupyterHubs with Python and RStudio. The py-rocket-base image uses the [Pangeo base-image](https://github.com/pangeo-data/pangeo-docker-images/tree/master/base-image) (minus the `ONBUILD` commands) as the base image (stored in `py-rocket-base/base-image`) and the [pangeo-notebook metapackage](https://github.com/conda-forge/pangeo-notebook-feedstock/blob/main/recipe/meta.yaml) to setup the core JupyterHub environment (following [Pangeo base-notebook](https://github.com/pangeo-data/pangeo-docker-images/blob/master/base-notebook/environment.yml). [Additional Python packages](https://github.com/nmfs-opensci/py-rocket-base/blob/main/environment.yml) are installed to provide a fuller JupyterLab, RStudio, Desktop, and VSCode environment. The R environment is installed with [Rocker](https://rocker-project.org/) installation scripts. You can scroll through the Rocker [installation scripts](https://github.com/rocker-org/rocker-versioned2/blob/master/scripts/install_rstudio.sh) to see how that environment is set up.
6
6
@@ -14,9 +14,12 @@ The base image has the following support:
14
14
* Python + JupyterLab with mamba handling package installation
15
15
* R + RStudio with the rocker scripts and other functions available
16
16
* Desktop ready for installing applications, including Java-based applications
*There are many ways to install R and RStudio into an image designed for JupyterHubs.* The objective of py-rocket-base is to create a JupyterHub (or binder) image such when you click the RStudio button in the JupyterLab UI to enter the RStudio UI (`/rstudio`), you **enter an environment that is the same as if you had used a Rocker image** but if you are in the JupyterLab UI (`/lab`), the **environment is the same as if you had used repo2docker** to create the environment. There are many other ways to install R and RStudio in a JupyterHub image. See History below for other approaches we have used.
20
+
py-rocket-base is the base image for the NMFS OpenSci specialized images, specifically [py-rocket-geospatial](https://nmfs-opensci.github.io/container-images/).
21
+
22
+
*There are many ways to install R and RStudio into an image designed for JupyterHubs.* The objective of py-rocket-base is to create a JupyterHub (or binder) image such when you click the RStudio button in the JupyterLab UI to enter the RStudio UI (`/rstudio`), you **enter an environment that is the same as if you had used a Rocker image** but if you are in the JupyterLab UI (`/lab`), the **environment is the same as if you had used the Pangeo base image** to create the environment. See History below for other approaches we have used to create py-rocket over the years (and why this current approach is used).
20
23
21
24
## Using this in a JupyterHub
22
25
@@ -34,9 +37,9 @@ py-rocket-base has pyrocket and rocket scripts that you can use to help customiz
34
37
35
38
## History and motivation
36
39
37
-
The original [py-rocket 1.0](https://github.com/NASA-Openscapes/py-rocket) was developed by Luis Lopez and was built off a Rocker base image. Carl Boettiger and Eli Holmes later altered the image (py-rocket 2.0) so that the Python environment matched the Pangeo image structure but the image was still built off a Rocker image. Subsequently, Carl Boettiger developed [repo2docker-r](https://github.com/boettiger-lab/repo2docker-r) that creates a JupyterHub-compatible image that uses a [Jupyter docker stack image](https://jupyter-docker-stacks.readthedocs.io/en/latest/) as base. For py-rocker 3.0, Eli Holmes used Carl's ideas but used [repo2docker](https://repo2docker.readthedocs.io/en/latest/) and [repo2docker-action](https://github.com/jupyterhub/repo2docker-action) to build the base image. To do this, the [CryoCloud hub image](https://github.com/CryoInTheCloud/hub-image) repo was used for the basic structure and approach. Eli added the `rocker.sh` script and `appendix` modifications to install R and RStudio via the Rocker scripts (rather than using a Rocker image as base). Yuvi Panda (repo2docker) gave input throughout the process as snags were hit.
40
+
The original [py-rocket 1.0](https://github.com/NASA-Openscapes/py-rocket) was developed by Luis Lopez and was built off a Rocker base image. Carl Boettiger and Eli Holmes later altered the image (py-rocket 2.0) so that the Python environment matched the Pangeo image structure but the image was still built off a Rocker image. Subsequently, Carl Boettiger developed [repo2docker-r](https://github.com/boettiger-lab/repo2docker-r) that creates a JupyterHub-compatible image that uses a [Jupyter docker stack image](https://jupyter-docker-stacks.readthedocs.io/en/latest/) as base. For py-rocker 3.0, Eli Holmes used Carl's ideas but used [repo2docker](https://repo2docker.readthedocs.io/en/latest/) and [repo2docker-action](https://github.com/jupyterhub/repo2docker-action) to build the base image. To do this, the [CryoCloud hub image](https://github.com/CryoInTheCloud/hub-image) repo was used for the basic structure and approach. Eli added the `rocker.sh` script and `appendix` modifications to install R and RStudio via the Rocker scripts (rather than using a Rocker image as base). Yuvi Panda (repo2docker) gave input throughout the process as snags were hit. For py-rocker 4.0, current approach, repo2docker was abandoned and the base image was created by using the Pangeo base image with the `ONBUILD` parts removed. This approach was taken after discussions with Docker image mainainers at NASA who had quickly run into the need for more tailored control of the build process when customizing images. And in fact, the need for customizing the build process became an issue quickly and I was resorting to many "hacks" to circumvent repo2docker default behavior. Given the close relationship between Pangeo base image and repo2docker developers, using the Pangeo base image Docker file still results in a base image that is very similar to that created with repo2docker.
38
41
39
-
**Why Rocker for the R/RStudio environment?** The Rocker images are the standard for R/RStudio contanier images. They are heavily tested and regularly updated. There is a large developer community that fixes problems and bugs. The stack has gone through major revisions to improve modularity and they constantly innovating (integration for machine-learning, CUDA, BLAS, spatial, etc., etc.). py-rocket is building off that work without using the images directly. Instead it uses the Docker file code and the installation scripts. There are many other approaches to adding R and RStudio to images that work in JupyterHubs. See [repo2docker-r](https://github.com/boettiger-lab/repo2docker-r) that Carl developed and [r-conda](https://github.com/binder-examples/r-conda) for a conda native approach using repo2docker. py-rocket is not intended to create small images; it is intended to create images that emulate Rocker in the `/rstudio` environment on a JupyterHub.
42
+
**Why Rocker for the R/RStudio environment?** The Rocker images are the standard for R/RStudio contanier images. They are heavily tested and regularly updated. There is a large developer community that fixes problems and bugs. The stack has gone through major revisions to improve modularity and they constantly innovating (integration for machine-learning, CUDA, BLAS, spatial, etc., etc.). py-rocket is building off that work without using the images directly. Instead it uses the Docker file code and the installation scripts. There are many other approaches to adding R and RStudio to images that work in JupyterHubs. See [repo2docker-r](https://github.com/boettiger-lab/repo2docker-r) that Carl developed and [r-conda](https://github.com/binder-examples/r-conda) for a conda native approach using repo2docker. py-rocket is not intended to create small images; it is intended to create images that emulate Rocker (verse and geospatial) in the R environments (whether in Jupyter Lab, RStudio or VSCode) on a JupyterHub.
Copy file name to clipboardExpand all lines: book/customizing.qmd
+14-2Lines changed: 14 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ How to use the helper scripts is shown in [configuration files](configuration_fi
11
11
*`install-conda-packages.sh`
12
12
*`install-pip-packages.sh`
13
13
*`install-r-packages.sh`
14
+
*`install-geospatial-r.sh`
14
15
*`install-apt-packages.sh`
15
16
*`install-vscode-extensions.sh`
16
17
*`install-desktop.sh`
@@ -33,12 +34,23 @@ RUN /pyrocket_scripts/install-conda-packages.sh environment.yml && \
33
34
rm environment.yml
34
35
```
35
36
36
-
Rocker scripts do not take arguments. Note that PATH must be given since rocker installation scripts will fail with conda on the path. The path specification will apply only within the specific RUN context and must be in the same RUN that the rocker script is run. The scripts should be run as root.
37
+
If you have multiple files in the repo:
38
+
```markdown
39
+
COPY . /tmp2/
40
+
RUN /pyrocket_scripts/install-conda-packages.sh /tmp2/environment.yml || echo "install-conda-packages.sh failed" || true
41
+
RUN /pyrocket_scripts/install-r-packages.sh /tmp2/install.R || echo "install-r-package.sh failed" || true
42
+
RUN /pyrocket_scripts/install-apt-packages.sh /tmp2/apt.txt || echo "install-apt-packages.sh failed" || true
43
+
RUN /pyrocket_scripts/install-desktop.sh /tmp2/Desktop|| echo "setup-desktop.sh failed" || true
44
+
RUN /pyrocket_scripts/install-geospatial-r.sh || echo "setup-desktop.sh failed" || true
45
+
RUN rm -rf /tmp2
46
+
```
47
+
48
+
Rocker scripts do not take arguments. Note that PATH must be given since rocker installation scripts will fail with conda on the path. The path specification will apply only within the specific RUN context and must be in the same RUN that the rocker script is run. The scripts should be run as root. Getting R packages to install to the system library, as opposed to /home which will be removed in a Jupyter Hub, can be tricky. See the `/pyrocket_scripts/install-geospatial-r.sh` script for an example.
37
49
38
50
```markdown
39
51
USER root
40
52
RUN PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin && \
0 commit comments