Skip to content

Commit

Permalink
Merge pull request #84 from nmfs-opensci/eeholmes-dev-1
Browse files Browse the repository at this point in the history
Eeholmes dev 1
  • Loading branch information
eeholmes authored Oct 23, 2024
2 parents 371b089 + c3f823c commit 5825dac
Show file tree
Hide file tree
Showing 14 changed files with 125 additions and 66 deletions.
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,8 @@ venv.bak/
dmypy.json
# Pyre type checker
.pyre/
.Rproj.user
py-rocket-base.Rproj

# Rproj stuff
.Rproj.user/
*.Rproj
.Rhistory
11 changes: 9 additions & 2 deletions appendix
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,16 @@ RUN yes | unminimize
ENV MANPATH="${NB_PYTHON_PREFIX}/share/man:${MANPATH}"
RUN mandb

# Clean up extra files in ${REPO_DIR}
RUN rm -rf ${REPO_DIR}/book ${REPO_DIR}/docs

# Copy Desktop files into ${REPO_DIR}/Desktop if they exist
ONBUILD RUN mkdir -p ${REPO_DIR}/Desktop && \
if [ -d Desktop ]; then cp Desktop/* ${REPO_DIR}/Desktop/; fi
ONBUILD COPY . /pyrocket-child/
ONBUILD RUN if [ -d /pyrocket-child/Desktop ]; then \
mkdir -p ${REPO_DIR}/Desktop && \
cp -r /pyrocket-child/Desktop/* ${REPO_DIR}/Desktop/; \
fi && \
rm -rf /pyrocket-child

# Revert to default user
USER ${NB_USER}
Binary file added book/assets/texlive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 13 additions & 7 deletions book/index.qmd
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# Guide to py-rocket-base

The py-rocket-base image is a base image for JupyterHubs with Jupyter Lab and RStudio UIs. The py-rocket-base image is designed to install with repo2docker. The `/lab` UI is Jupyter Lab and the `/rstudio` is a R and RStudio environment installed with Rocker installation scripts.

There are many ways to install R and RStudio into an image designed for JupyterHubs. The objective of py-rocker-base is not to install R and RStudio, per se. The objective of py-rocket-base is to create an JupyterHub image such when you click the RStudio button in the JupyterLab UI to enter the RStudio UI, you enter an environment that is the same as if you had used a Rocker image but if you are in the JupyterLab UI, the environment is the same as it you had used repo2docker to create the environment. The py-rocker-base image includes the Rocker scripts so that the user can use the image as a base and extend the R environment to match other Rocker environments, e.g. verse, geospatial or ml.
The py-rocket-base image is a base image for JupyterHubs with Jupyter Lab, RStudio, Desktop, and VSCode UIs. What makes py-rocket-base unique, is that the RStudio UI (via `/rstudio`) is a R and RStudio environment installed with Rocker installation scripts. Thus all the Rocker design choices and R/RStudio environment choices are in that UI. Properly setting up environments to work properly with spatial libraries and HPC libraries is tricky. py-rocket-base solves this problem (and the associated maintenance of installation scripts) by using Rocker installation scripts.

The base image has the following support:

* Python + JupyterLab with mamba handling package installation
* R + RStudio with the Rocker scripts and other functions available
* Desktop VNC ready for installing applications, including Java-based applications
* VSCode
* Python + JupyterLab with mamba handling package installation and repo2docker (Pangeo) environment design
* R + RStudio with the Rocker environment design and Rocker scripts and other functions included
* Desktop UI for serving applications, including Java-based applications
* VSCode UI
* Quarto, Myst and Texlive installed with tlmgr for tex package management

**Design**: py-rocket-base is inspired by repo2docker and the Pangeo Docker stack design. py-rocker-base is built using repo2docker (via `repo2docker-action`) and thus lets repo2docker make the choices regarding the environment design---things like how the conda environment is set-up and the base directory structure and permissions. The Pangeo Docker stack does not use repo2docker, but mimics repo2docker's environment design. The Pangeo base-image is designed like repo2docker in that using the base-image in the `FROM` line of a Dockerfile causes the build to look for files with particular names (like `environment.yml`) and then do the proper action with those files. This means that routine users do not need to know how to write Dockerfile code in order to extend the image with new packages or applications. py-rocker-base Docker image uses this Pangeo base-image design. It is based on `ONBUILD` commands in the Dockerfile that trigger actions only when the image is used in the `FROM` line of another Dockerfile.

*There are many ways to install R and RStudio into an image designed for JupyterHubs* The objective of py-rocker-base is not to install R and RStudio, per se, and there are other leaner and faster ways to install R/RStudio if that is your goal[^1]. The objective of py-rocket-base is to create an JupyterHub image such when you click the RStudio button in the JupyterLab UI to enter the RStudio UI, you enter an environment that is the same as if you had used a Rocker image. If you are in the JupyterLab UI, the environment is the same as it you had used repo2docker (or Pangeo base-image) to create the environment.

[^1]: See the Developer section for links to some other approaches.

14 changes: 10 additions & 4 deletions book/tex.qmd
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
---
Title: TeX and TeXLive
---
# Creating PDFs

<div>
<div style="float: right; position: relative; top: 0px; padding: 2px;">
![](assets/texlive.png)
</div>

py-rocket-base has Quarto and Myst installed along with pandoc and TeXLive for output to PDF. TeX Live is installed and the tlmgr is used to manage packages.

</div>

TeXLive is installed and the tlmgr is used to manage packages. This allows packages to be installed 'on the fly' if they are missing.

## tlmgr

Expand Down
Binary file added docs/assets/texlive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/configuration_files.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./tex.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">5</span>&nbsp; <span class="chapter-title">tlmgr</span></span></a>
<span class="menu-text"><span class="chapter-number">5</span>&nbsp; <span class="chapter-title">Creating PDFs</span></span></a>
</div>
</li>
<li class="sidebar-item">
Expand Down
2 changes: 1 addition & 1 deletion docs/customizing.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./tex.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">5</span>&nbsp; <span class="chapter-title">tlmgr</span></span></a>
<span class="menu-text"><span class="chapter-number">5</span>&nbsp; <span class="chapter-title">Creating PDFs</span></span></a>
</div>
</li>
<li class="sidebar-item">
Expand Down
6 changes: 3 additions & 3 deletions docs/desktop.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./tex.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">5</span>&nbsp; <span class="chapter-title">tlmgr</span></span></a>
<span class="menu-text"><span class="chapter-number">5</span>&nbsp; <span class="chapter-title">Creating PDFs</span></span></a>
</div>
</li>
<li class="sidebar-item">
Expand Down Expand Up @@ -776,8 +776,8 @@ <h2 data-number="4.3" class="anchored" data-anchor-id="png"><span class="header-
</a>
</div>
<div class="nav-page nav-page-next">
<a href="./tex.html" class="pagination-link" aria-label="tlmgr">
<span class="nav-page-text"><span class="chapter-number">5</span>&nbsp; <span class="chapter-title">tlmgr</span></span> <i class="bi bi-arrow-right-short"></i>
<a href="./tex.html" class="pagination-link" aria-label="Creating PDFs">
<span class="nav-page-text"><span class="chapter-number">5</span>&nbsp; <span class="chapter-title">Creating PDFs</span></span> <i class="bi bi-arrow-right-short"></i>
</a>
</div>
</nav>
Expand Down
22 changes: 15 additions & 7 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./tex.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">5</span>&nbsp; <span class="chapter-title">tlmgr</span></span></a>
<span class="menu-text"><span class="chapter-number">5</span>&nbsp; <span class="chapter-title">Creating PDFs</span></span></a>
</div>
</li>
<li class="sidebar-item">
Expand Down Expand Up @@ -203,17 +203,25 @@ <h1 class="title">py-rocket-base documentation</h1>

<section id="guide-to-py-rocket-base" class="level1" data-number="1">
<h1 data-number="1"><span class="header-section-number">1</span> Guide to py-rocket-base</h1>
<p>The py-rocket-base image is a base image for JupyterHubs with Jupyter Lab and RStudio UIs. The py-rocket-base image is designed to install with repo2docker. The <code>/lab</code> UI is Jupyter Lab and the <code>/rstudio</code> is a R and RStudio environment installed with Rocker installation scripts.</p>
<p>There are many ways to install R and RStudio into an image designed for JupyterHubs. The objective of py-rocker-base is not to install R and RStudio, per se. The objective of py-rocket-base is to create an JupyterHub image such when you click the RStudio button in the JupyterLab UI to enter the RStudio UI, you enter an environment that is the same as if you had used a Rocker image but if you are in the JupyterLab UI, the environment is the same as it you had used repo2docker to create the environment. The py-rocker-base image includes the Rocker scripts so that the user can use the image as a base and extend the R environment to match other Rocker environments, e.g.&nbsp;verse, geospatial or ml.</p>
<p>The py-rocket-base image is a base image for JupyterHubs with Jupyter Lab, RStudio, Desktop, and VSCode UIs. What makes py-rocket-base unique, is that the RStudio UI (via <code>/rstudio</code>) is a R and RStudio environment installed with Rocker installation scripts. Thus all the Rocker design choices and R/RStudio environment choices are in that UI. Properly setting up environments to work properly with spatial libraries and HPC libraries is tricky. py-rocket-base solves this problem (and the associated maintenance of installation scripts) by using Rocker installation scripts.</p>
<p>The base image has the following support:</p>
<ul>
<li>Python + JupyterLab with mamba handling package installation</li>
<li>R + RStudio with the Rocker scripts and other functions available</li>
<li>Desktop VNC ready for installing applications, including Java-based applications</li>
<li>VSCode</li>
<li>Python + JupyterLab with mamba handling package installation and repo2docker (Pangeo) environment design</li>
<li>R + RStudio with the Rocker environment design and Rocker scripts and other functions included</li>
<li>Desktop UI for serving applications, including Java-based applications</li>
<li>VSCode UI</li>
<li>Quarto, Myst and Texlive installed with tlmgr for tex package management</li>
</ul>
<p><strong>Design</strong>: py-rocket-base is inspired by repo2docker and the Pangeo Docker stack design. py-rocker-base is built using repo2docker (via <code>repo2docker-action</code>) and thus lets repo2docker make the choices regarding the environment design—things like how the conda environment is set-up and the base directory structure and permissions. The Pangeo Docker stack does not use repo2docker, but mimics repo2docker’s environment design. The Pangeo base-image is designed like repo2docker in that using the base-image in the <code>FROM</code> line of a Dockerfile causes the build to look for files with particular names (like <code>environment.yml</code>) and then do the proper action with those files. This means that routine users do not need to know how to write Dockerfile code in order to extend the image with new packages or applications. py-rocker-base Docker image uses this Pangeo base-image design. It is based on <code>ONBUILD</code> commands in the Dockerfile that trigger actions only when the image is used in the <code>FROM</code> line of another Dockerfile.</p>
<p><em>There are many ways to install R and RStudio into an image designed for JupyterHubs</em> The objective of py-rocker-base is not to install R and RStudio, per se, and there are other leaner and faster ways to install R/RStudio if that is your goal<a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"><sup>1</sup></a>. The objective of py-rocket-base is to create an JupyterHub image such when you click the RStudio button in the JupyterLab UI to enter the RStudio UI, you enter an environment that is the same as if you had used a Rocker image. If you are in the JupyterLab UI, the environment is the same as it you had used repo2docker (or Pangeo base-image) to create the environment.</p>


</section>
<section id="footnotes" class="footnotes footnotes-end-of-document" role="doc-endnotes">
<hr>
<ol>
<li id="fn1"><p>See the Developer section for links to some other approaches.<a href="#fnref1" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
</ol>
</section>

</main> <!-- /main -->
Expand Down
6 changes: 3 additions & 3 deletions docs/py-rocket-base.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./tex.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">5</span>&nbsp; <span class="chapter-title">tlmgr</span></span></a>
<span class="menu-text"><span class="chapter-number">5</span>&nbsp; <span class="chapter-title">Creating PDFs</span></span></a>
</div>
</li>
<li class="sidebar-item">
Expand Down Expand Up @@ -769,8 +769,8 @@ <h2 data-number="6.2" class="anchored" data-anchor-id="documentation"><span clas
</script>
<nav class="page-navigation">
<div class="nav-page nav-page-previous">
<a href="./tex.html" class="pagination-link" aria-label="tlmgr">
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">5</span>&nbsp; <span class="chapter-title">tlmgr</span></span>
<a href="./tex.html" class="pagination-link" aria-label="Creating PDFs">
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">5</span>&nbsp; <span class="chapter-title">Creating PDFs</span></span>
</a>
</div>
<div class="nav-page nav-page-next">
Expand Down
Loading

0 comments on commit 5825dac

Please sign in to comment.