Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2024.4 base upgrade (nb7/py311), *packages upgraded #5

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
e59e7d5
Update DockerFile & Created new branch
man3ng Nov 5, 2024
613a680
manual workflow configuration
man3ng Nov 5, 2024
23e0ce1
Check why pip install fail with echo commands
man3ng Nov 5, 2024
838660e
spacing error fix, try again
man3ng Nov 5, 2024
a9d65e2
Added packages to requirement.txt to avoid warning
man3ng Nov 5, 2024
dfdf970
minor change to packages
man3ng Nov 5, 2024
6d8494e
minor changes
man3ng Nov 5, 2024
dde4cf7
trying pip install of mamba install
man3ng Nov 5, 2024
8fb5dda
Change to specific version
man3ng Nov 5, 2024
5e1ec2a
remove the -c
man3ng Nov 5, 2024
5f56c64
Change directory of image and removed a couple installation lines
man3ng Nov 13, 2024
7f93054
re-add accidental removed line
man3ng Nov 13, 2024
d8cb042
minor changes
man3ng Nov 13, 2024
51232ea
force add specific version
man3ng Nov 13, 2024
896e0b8
change update order
man3ng Nov 13, 2024
7ad8f19
bump to 2024.4, remove version locks on all packages, replace pygeos …
dafeliton Nov 13, 2024
47461fe
move dependencies to requirements.txt to avoid conda conflicts, susbe…
dafeliton Nov 13, 2024
59c18ad
add arcgis-mapping
dafeliton Nov 13, 2024
a612519
move widgets to req.txt
dafeliton Nov 13, 2024
c6fee4b
prep for numpy downgrade
dafeliton Nov 19, 2024
c7600dd
CS2276124 new pkgs
dafeliton Nov 27, 2024
aed3cbc
move arcgis to pypi
dafeliton Nov 27, 2024
1bbab51
add mapping
dafeliton Nov 27, 2024
1712274
revert arcgis changes
dafeliton Nov 27, 2024
612782c
Update requirements.txt
dafeliton Dec 2, 2024
96e0dfe
bokeh typo
dafeliton Dec 2, 2024
743b328
Remove ipywidgets from requirements.txt, add note
dafeliton Dec 2, 2024
bf58026
notes 12-1-24
dafeliton Dec 2, 2024
7447b38
notes
dafeliton Dec 2, 2024
304213c
force ipywidgets match
dafeliton Dec 2, 2024
6cf9caa
undo ipywidgets, latest changes
dafeliton Dec 2, 2024
d5cc63f
open-url
dafeliton Dec 2, 2024
577307c
Remove deprecated instructs
dafeliton Dec 2, 2024
4b03a3e
try installing notebookparams
dafeliton Dec 5, 2024
fbd39b2
add my custom ext
dafeliton Dec 6, 2024
2a5df19
add disclaimer
dafeliton Dec 6, 2024
bc46b07
fix jupy build
dafeliton Dec 6, 2024
858e921
Trigger
dafeliton Dec 6, 2024
e569002
rebuild
dafeliton Dec 9, 2024
a226bc2
Update requirements.txt added numpy==1.26.4
izaslavsky Dec 24, 2024
97544d2
Update requirements.txt - add pygris and shap
izaslavsky Dec 24, 2024
d3ed881
Update Dockerfile add RUN pip install numpy==1.26.4
izaslavsky Dec 24, 2024
2e0fa71
Update Dockerfile
izaslavsky Dec 25, 2024
0d57534
Update Dockerfile
izaslavsky Dec 25, 2024
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 .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
schedule:
- cron: '0 2 * * *'
push:
workflow_dispatch:

env:
REGISTRY: ghcr.io
Expand Down
39 changes: 24 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,44 @@
ARG BASE_CONTAINER=ucsdets/datahub-base-notebook:2023.2-stable
ARG BASE_CONTAINER=ghcr.io/ucsd-ets/datascience-notebook:2024.4-stable
FROM $BASE_CONTAINER

LABEL maintainer="UC San Diego ITS/ETS <[email protected]>"

USER root

######################### ##
# Requested for DSC170 WI23
########################
# Requested for DSC170 WI25
COPY requirements.txt /home/jovyan

RUN apt update -y && \
apt-get install software-properties-common -y && \
add-apt-repository universe && \
apt update -y && \
apt install graphviz -y
RUN mamba install -c esri arcgis=2.2.0 numpy=1.26.2 -y

RUN pip install --upgrade pip setuptools wheel
RUN pip install --upgrade nbconvert

RUN mamba install -c conda-forge geopandas cartopy pygeos pysal contextily osmnx jupyterlab_widgets -y
RUN jupyter labextension install @dafeliton/jupyterlab-notebookparams

# Install geospatial packages first
RUN pip uninstall pillow fiona -y && \
pip install -r ~/requirements.txt && \
pip install --upgrade fiona
pip install -r ~/requirements.txt && \
pip install --upgrade fiona

# pygeos is deprecated and has been merged with shapely. (pygeos works around python GIL)
# https://github.com/shapely/shapely

# geopandas/cartopy/etc. error when importing sqlite3 from python:
# ImportError: /opt/conda/lib/python3.11/lib-dynload/_sqlite3.cpython-311-x86_64-linux-gnu.so: undefined symbol: sqlite3_deserialize
# Moved to requirements.txt

RUN mamba install -c esri arcgis arcgis-mapping -y && \
fix-permissions $CONDA_DIR && \
fix-permissions /home/$NB_USER && \
mamba clean --all

RUN pip install --upgrade pip setuptools wheel
RUN pip install --upgrade nbconvert

RUN jupyter nbextension enable --py widgetsnbextension --sys-prefix && \
jupyter labextension install @jupyter-widgets/jupyterlab-manager && \
jupyter labextension install [email protected]

RUN jupyter nbextension enable --py --sys-prefix arcgis && \
jupyter nbextension enable --py --sys-prefix arcgis
# RUN pip install "numpy<2"

USER $NB_UID

Expand All @@ -39,3 +47,4 @@ RUN rm -rf /home/jovyan/requirements.txt

ENV USE_PYGEOS=0

RUN pip install numpy==1.26.4
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,3 @@
DataHub notebook for GPEC 447 - Data Science/Spatial Analysis

Sample notebook arcgis_test.ipynb is copied into container at /opt

# Usage

## Map Widget

Enable the map widget by running these 2 commands in a New -> Terminal:

```
jupyter nbextension enable --py --user widgetsnbextension
jupyter nbextension enable --py --user arcgis
```
38 changes: 38 additions & 0 deletions notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
### 12/1/24 Notes:

1. Installing certain python packages breaks our python installation (failed to import sqlite3, prevents JLab startup and breaks the image)

Solution: Install them using pip. A more permanent solution can be found but at this time only a certain number of python packages seem to trigger this issue.

2. IPython.notebook.* no longer exists in JupyterLab/NB7+.

Solution: There is no 1:1 drop-in alternative to this as far as I'm aware. However, here are a few potential replacements:

- https://gist.github.com/gnestor/f1893e0226ced227e910f11b769adc06

- The ```pylab``` extension: https://stackoverflow.com/questions/68585590/run-all-below-action-in-jupyterlab-programatically/71944193#71944193

- Using the following snippet is a decent start:

```
%%javascript
console.log('hello')
```

This logs "hello" to the developer console.

```
from IPython.display import Javascript, display
from ipywidgets import HTML

html_widget = HTML()
display(html_widget)

# Use Javascript to set the innerHTML of the widget
display(Javascript("""
var test_variable = 'Hello from Javascript!';
element.innerHTML = test_variable;
"""))
```

This displays an HTML widget to get similar behavior to the original ```IPython.notebook.kernel.execute()``` method.
41 changes: 32 additions & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,41 @@
pillow==9.1
pyproj==3.3
pillow
pyproj
openpyxl
cenpy
python-Levenshtein
geopy
ipyleaflet
ipywidgets
keplergl
ipyleaflet
keplergl
mesa-geo
mesa
matplotlib
jupyterlab==2.3.1
shapely==2.0.0
pyshp==2.3.1
pandas==1.5.2
shapely
pyshp
pandas
censusdata
graphviz
geopandas
cartopy
pysal
contextily
jupyterlab_widgets
osmnx
numpy==1.26.4

# TODO: keplergl/bokeh conflict with their dependency on ipywidgets as of 12/5/24. keplergl wants ipyiwdgets<8 >=7.8.1, but bokeh wants ==8.*.
# May have to pick one or the other

# New packages
ipywidgets
panel
statsmodels
pyvis
networkx
holoviews
hvplot
geopandas
bokeh
jupyter_bokeh
jupyterlab-open-url-parameter
pygris
shap
Loading