Skip to content

Commit 88ec678

Browse files
authored
Merge pull request #85 from emiliom/ohwe-pyrgeo2
Add py-rocket image for OceanHackWeek-en-espanol based on py-rocket-geospatial-2
2 parents 9d1d1f5 + 868f8b2 commit 88ec678

File tree

12 files changed

+544
-1
lines changed

12 files changed

+544
-1
lines changed

.github/workflows/build-and-push.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
- 'images/asar/**'
1515
- 'images/echopype/**'
1616
- 'images/coastwatch/**'
17+
- 'images/py-rocket-oceanhw-esp/**'
1718
- 'draft_images/coastwatch-qgis/**'
1819
- 'draft_images/test/**'
1920

@@ -25,6 +26,7 @@ env:
2526
images/asar
2627
images/echopype
2728
images/coastwatch
29+
images/py-rocket-oceanhw-esp
2830
draft_images/coastwatch-qgis
2931
draft_images/test
3032

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
.Rhistory
33
.RData
44
.Ruserdata
5-
*.Rproj
5+
*.Rproj
6+
7+
build_logs/
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Desktop Entry]
2+
Type=Application
3+
Name=Panoply
4+
GenericName=Panoply netCDF, HDF and GRIB Data Viewer
5+
Icon=panoply
6+
Exec=/tmp/PanoplyJ/panoply.sh %F
7+
Terminal=false
8+
StartupNotify=false
9+
Categories=Qt;Education;Science;Geography;
10+
Keywords=map;
53.5 KB
Loading
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# From: https://github.com/qgis/QGIS/blob/ltr-3_28/linux/org.qgis.qgis.desktop.in
2+
[Desktop Entry]
3+
Type=Application
4+
Name=QGIS Desktop
5+
GenericName=Geographic Information System
6+
Icon=/srv/conda/envs/notebook/share/qgis/images/icons/qgis-icon-512x512.png
7+
TryExec=qgis
8+
Exec=qgis %F
9+
Terminal=false
10+
StartupNotify=false
11+
Categories=Qt;Education;Science;Geography;
12+
MimeType=application/x-qgis-project;application/x-qgis-project-container;application/x-qgis-layer-settings;application/x-qgis-layer-definition;application/x-qgis-composer-template;image/tiff;image/jpeg;image/jp2;application/x-raster-aig;application/x-raster-ecw;application/x-raster-mrsid;application/x-mapinfo-mif;application/x-esri-shape;application/vnd.google-earth.kml+xml;application/vnd.google-earth.kmz;application/geopackage+sqlite3;
13+
Keywords=map;globe;postgis;wms;wfs;ogc;osgeo;
14+
StartupWMClass=QGIS3
Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
<?xml version="1.0"?>
2+
<!-- From: https://raw.githubusercontent.com/qgis/QGIS/ltr-3_28/debian/qgis.xml -->
3+
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
4+
5+
<mime-type type="application/x-qgis-project">
6+
<comment>QGIS Project</comment>
7+
<comment xml:lang="de">QGIS-Projekt</comment>
8+
<sub-class-of type="application/xml"/>
9+
<alias type="application/x-qgis"/>
10+
<icon name="qgis-qgs"/>
11+
<magic priority="50">
12+
<match type="string" offset="0" value="&lt;!DOCTYPE qgis"/>
13+
</magic>
14+
<glob pattern="*.qgs"/>
15+
</mime-type>
16+
17+
<mime-type type="application/x-qgis-project-container">
18+
<comment>QGIS Project</comment>
19+
<comment xml:lang="de">QGIS-Projekt</comment>
20+
<sub-class-of type="application/zip"/>
21+
<alias type="application/x-qgis"/>
22+
<icon name="qgis-qgs"/>
23+
<glob pattern="*.qgz"/>
24+
</mime-type>
25+
26+
<mime-type type="application/x-qgis-layer-settings">
27+
<comment>QGIS layer settings</comment>
28+
<comment xml:lang="de">QGIS-Layereinstellungen</comment>
29+
<sub-class-of type="application/xml"/>
30+
<icon name="qgis-qml"/>
31+
<magic priority="80">
32+
<match type="string" offset="0" value="&lt;!DOCTYPE qgis"/>
33+
</magic>
34+
<glob pattern="*.qml"/>
35+
</mime-type>
36+
37+
<mime-type type="application/x-qgis-layer-definition">
38+
<comment>QGIS layer definition</comment>
39+
<comment xml:lang="de">QGIS-Layerdefinition</comment>
40+
<sub-class-of type="application/xml"/>
41+
<icon name="qgis-qlr"/>
42+
<magic priority="50">
43+
<match type="string" offset="0" value="&lt;!DOCTYPE qgis-layer-definition"/>
44+
</magic>
45+
<glob pattern="*.qlr"/>
46+
</mime-type>
47+
48+
<mime-type type="application/x-qgis-composer-template">
49+
<comment>QGIS composer template</comment>
50+
<comment xml:lang="de">QGIS-Druckzusammenstellungsvorlage</comment>
51+
<sub-class-of type="application/xml"/>
52+
<icon name="qgis-qpt"/>
53+
<magic priority="50">
54+
<match type="string" offset="0" value="&lt;!DOCTYPE qgis"/>
55+
</magic>
56+
<glob pattern="*.qpt"/>
57+
</mime-type>
58+
59+
<mime-type type="application/x-esri-shape">
60+
<comment>ESRI shape file</comment>
61+
<comment xml:lang="de">ESRI-Shapedatei</comment>
62+
<icon name="qgis-mime"/>
63+
<magic priority="100">
64+
<match type="big32" offset="0" value="9994">
65+
<match type="big32" offset="4" value="0">
66+
<match type="big32" offset="8" value="0">
67+
<match type="big32" offset="12" value="0">
68+
<match type="big32" offset="16" value="0">
69+
<match type="big32" offset="20" value="0">
70+
<match type="big32" offset="28" value="1000"/>
71+
</match>
72+
</match>
73+
</match>
74+
</match>
75+
</match>
76+
</match>
77+
</magic>
78+
<glob pattern="*.shp"/>
79+
<glob pattern="*.shx"/>
80+
</mime-type>
81+
82+
<mime-type type="application/x-esri-crs">
83+
<comment>ESRI coordinate reference system</comment>
84+
<comment xml:lang="de">ESRI-Koordinatenreferenzsystem</comment>
85+
<icon name="qgis-mime"/>
86+
<magic>
87+
<match type="string" offset="0" value="GEOGCS["/>
88+
<match type="string" offset="0" value="PROJCS["/>
89+
<match type="string" offset="0" value="LOCAL_CS["/>
90+
</magic>
91+
<glob pattern="*.prj"/>
92+
</mime-type>
93+
94+
<mime-type type="image/tiff">
95+
<comment>TIFF raster data</comment>
96+
<comment xml:lang="de">TIFF-Rasterdaten</comment>
97+
<icon name="qgis-mime"/>
98+
<magic priority="50">
99+
<match type="string" offset="0" value="MM">
100+
<match type="little16" offset="2" value="42"/>
101+
</match>
102+
<match type="string" offset="0" value="MM">
103+
<match type="big16" offset="2" value="42"/>
104+
</match>
105+
</magic>
106+
<glob pattern="*.tiff"/>
107+
<glob pattern="*.tif"/>
108+
</mime-type>
109+
110+
<mime-type type="image/jpeg">
111+
<comment>JPEG raster data</comment>
112+
<comment xml:lang="de">JPEG-Rasterdaten</comment>
113+
<icon name="qgis-mime"/>
114+
<magic priority="50">
115+
<match type="big16" offset="0" value="65496"/>
116+
</magic>
117+
<glob pattern="*.jpeg"/>
118+
<glob pattern="*.jpg"/>
119+
</mime-type>
120+
121+
<mime-type type="image/jp2">
122+
<comment>JPEG2000 raster data</comment>
123+
<comment xml:lang="de">JPEG2000-Rasterdaten</comment>
124+
<icon name="qgis-mime"/>
125+
<magic priority="50">
126+
<match type="little32" offset="0" value="12">
127+
<match type="string" offset="8" value="jP">
128+
<match type="byte" offset="10" value="32">
129+
<match type="byte" offset="11" value="32">
130+
<match type="byte" offset="12" value="13">
131+
<match type="byte" offset="13" value="10">
132+
<match type="byte" offset="14" value="135">
133+
<match type="byte" offset="13" value="10"/>
134+
</match>
135+
</match>
136+
</match>
137+
</match>
138+
</match>
139+
</match>
140+
</match>
141+
</magic>
142+
<glob pattern="*.jp2"/>
143+
<glob pattern="*.j2k"/>
144+
</mime-type>
145+
146+
<mime-type type="application/x-raster-aig">
147+
<comment>AIG raster data</comment>
148+
<comment xml:lang="de">AIG-Rasterdaten</comment>
149+
<icon name="qgis-mime"/>
150+
<glob pattern="*.aig"/>
151+
</mime-type>
152+
153+
<mime-type type="application/x-raster-ecw">
154+
<comment>ECW raster data</comment>
155+
<comment xml:lang="de">ECW-Rasterdaten</comment>
156+
<icon name="qgis-mime"/>
157+
<glob pattern="*.ecw"/>
158+
</mime-type>
159+
160+
<mime-type type="application/x-raster-mrsid">
161+
<comment>MrSID raster data</comment>
162+
<comment xml:lang="de">MrSID-Rasterdaten</comment>
163+
<icon name="qgis-mime"/>
164+
<glob pattern="*.sid"/>
165+
</mime-type>
166+
167+
<mime-type type="application/x-mapinfo-mif">
168+
<comment>MapInfo file</comment>
169+
<comment xml:lang="de">MapInfo-Datei</comment>
170+
<icon name="qgis-mime"/>
171+
<magic priority="51">
172+
<match type="string" offset="0" value="VERSION">
173+
<match type="string" offset="0:512" value="COLUMNS"/>
174+
<match type="string" offset="0:512" value="DATA">
175+
</match>
176+
</match>
177+
</magic>
178+
<glob weight="60" pattern="*.mif"/>
179+
</mime-type>
180+
181+
<!-- .mif is just not good enough -->
182+
<mime-type type="application/x-adobe-mif">
183+
<alias type="application/x-mif"/>
184+
<comment>Adobe FrameMaker MIF file</comment>
185+
<magic priority="100">
186+
<match type="string" offset="0" value="&lt;MIFFile"/>
187+
</magic>
188+
<glob weight="51" pattern="*.mif"/>
189+
</mime-type>
190+
191+
<mime-type type="application/vnd.google-earth.kml+xml">
192+
<comment>Keyhole Markup Language data</comment>
193+
<sub-class-of type="application/xml"/>
194+
<icon name="qgis-mime"/>
195+
<glob pattern="*.kml"/>
196+
</mime-type>
197+
198+
<mime-type type="application/vnd.google-earth.kmz">
199+
<comment>Zipped Keyhole Markup Language data</comment>
200+
<sub-class-of type="application/zip"/>
201+
<icon name="qgis-mime"/>
202+
<glob pattern="*.kmz"/>
203+
</mime-type>
204+
205+
<mime-type type="application/geopackage+sqlite3">
206+
<comment>GeoPackage data</comment>
207+
<sub-class-of type="application/vnd.sqlite3"/>
208+
<icon name="qgis-mime"/>
209+
<glob pattern="*.gpkg"/>
210+
</mime-type>
211+
212+
</mime-info>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
FROM ghcr.io/nmfs-opensci/py-rocket-base:2025.04.26
2+
3+
LABEL org.opencontainers.image.maintainers="[email protected]"
4+
LABEL org.opencontainers.image.author="[email protected], [email protected]"
5+
LABEL org.opencontainers.image.source=https://github.com/nmfs-opensci/container-images/py-rocket-2
6+
LABEL org.opencontainers.image.description="OceanHackWeek-en-Espan-ol Geospatial Python (3.12) and R (4.4.3) image with Desktop (QGIS, Panoply)"
7+
LABEL org.opencontainers.image.licenses=Apache2.0
8+
LABEL org.opencontainers.image.version=2025.11.09
9+
10+
ENV PROJ_LIB=/srv/conda/envs/notebook/share/proj
11+
12+
USER root
13+
14+
COPY . /tmp2/
15+
RUN /pyrocket_scripts/install-apt-packages.sh /tmp2/apt.txt || echo "install-apt-packages.sh failed" || true
16+
RUN /pyrocket_scripts/install-conda-packages.sh /tmp2/environment.yml || echo "install-conda-packages.sh failed" || true
17+
RUN /pyrocket_scripts/install-r-packages.sh /tmp2/install.R || echo "install-r-package.sh failed" || true
18+
RUN /pyrocket_scripts/install-desktop.sh /tmp2/Desktop|| echo "setup-desktop.sh failed" || true
19+
RUN rm -rf /tmp2
20+
21+
USER root
22+
# install the geospatial libraries and R spatial; the rocket script are part of py-rocket-base
23+
# need to ensure that it installs to the site-library (that user can control) and with a clean PATH
24+
# Ensure packages go to site-library whether installed via R, Rscript, or littler (r)
25+
RUN echo '.libPaths("/usr/local/lib/R/site-library")' > /etc/littler.r && \
26+
echo '.libPaths("/usr/local/lib/R/site-library")' > /tmp/rprofile.site && \
27+
R_PROFILE=/tmp/rprofile.site \
28+
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
29+
/rocker_scripts/install_geospatial.sh && \
30+
rm /etc/littler.r /tmp/rprofile.site
31+
32+
33+
# --- 11/10/25: Commented out the two steps below while refining the R environment,
34+
# to slim down the image build time
35+
36+
# Install panoply
37+
# 11/6/2025 16:00 PST
38+
# 0.336 Connecting to www.giss.nasa.gov (www.giss.nasa.gov)|129.164.141.233|:443... failed: Connection refused.
39+
# 0.428 Connecting to www.giss.nasa.gov (www.giss.nasa.gov)|2001:4d0:2310:151::233|:443... failed: Network is unreachable.
40+
# 11/8/2025: Uploaded latest Panoply tgz to Emilio's UW website, temporarily, as a stopgap
41+
ENV PANOPLY_VERSION=5.7.1
42+
RUN cd /tmp && \
43+
# wget --user-agent="Mozilla/5.0" https://www.giss.nasa.gov/tools/panoply/download/PanoplyJ-${PANOPLY_VERSION}.tgz && \
44+
wget --user-agent="Mozilla/5.0" http://staff.washington.edu/emiliom/out/PanoplyJ-${PANOPLY_VERSION}.tgz && \
45+
tar -zxf PanoplyJ-${PANOPLY_VERSION}.tgz && \
46+
rm -rf PanoplyJ-${PANOPLY_VERSION}.tgz
47+
ENV PATH=${PATH}:/tmp/PanoplyJ
48+
49+
# Install tools for working with Google Cloud Buckets
50+
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg && apt-get update -y && apt-get install google-cloud-cli -y
51+
52+
USER ${NB_USER}
53+
WORKDIR ${HOME}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# README
2+
3+
## py-rocket-oceanhw-esp
4+
5+
Python-R image for OceanHackWeek-en-Español, https://intercoonecta.github.io. Based on customizations of the `py-rocket-geospatial-2` image.
6+
7+
### Emilio's notes on new Docker image
8+
9+
**I'll clean this up soon**
10+
11+
```bash
12+
13+
docker compose build py-rocket > build_no_custom_R.log 2>&1
14+
15+
docker compose build py-rocket > build_logs/build_custom-R-pckgs.log 2>&1
16+
17+
docker compose up py-rocket
18+
19+
# logs from docker compose up py-rocket are available via
20+
docker compose logs py-rocket
21+
22+
23+
# view and rm containers
24+
docker ps -a
25+
docker rm a68304072b28
26+
27+
# rename and remove images
28+
docker rmi 0b148c9c27c9
29+
docker tag a65b2f13b739 py-rocket-oceanhw-esp:r-custom-3
30+
docker rmi py-rocket-oceanhw-esp:latest
31+
```
32+
33+
### From py-rocket-geospatial v2.0 README
34+
35+
This creates a base Python-R image with geospatial packages for Python and R. The Python environment is the Pangeo notebook environment + extra geospatial libraries (similar to CryoCloud). The R environment is Rocker geospatial plus a few other packages. The image also includes a linux Desktop with QGIS, CoastWatch Utilities, and Panoply.
36+
37+
TeXLive and Quarto are installed along with MyST and JupyterBook.
38+
39+
Python 3.12 is installed with a conda environment called notebook that is activated on opening the container. R 4.4.X is installed.
40+
41+
See the documentation on [py-rocket-base](https://nmfs-opensci.github.io/py-rocket-base/) for information on the image structure and design.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# for qgis
2+
libgl1-mesa-glx
3+
4+
# for install-r-packages.sh errors
5+
libudunits2-dev
6+
libgdal-dev
7+
libgeos-dev
8+
libproj-dev
9+
libtbb-dev
10+
libnetcdf-dev
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
services:
2+
py-rocket:
3+
build: .
4+
image: py-rocket-oceanhw-esp
5+
# container_name: py-rocket-oceanhw-esp
6+
command: jupyter lab --port=8080 --ip=0.0.0.0
7+
ports:
8+
- "8080:8080"

0 commit comments

Comments
 (0)