Spaces:
Running
Running
Add Dockerfile
Browse files- .pre-commit-config.yaml +32 -0
- Dockerfile +19 -0
- README.md +18 -0
- notebooks/intro.ipynb +45 -0
- requirements.txt +3 -0
- run.sh +1 -0
.pre-commit-config.yaml
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
repos:
|
2 |
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
3 |
+
rev: v5.0.0
|
4 |
+
hooks:
|
5 |
+
- id: check-toml
|
6 |
+
- id: check-yaml
|
7 |
+
- id: end-of-file-fixer
|
8 |
+
types: [python]
|
9 |
+
- id: trailing-whitespace
|
10 |
+
- id: requirements-txt-fixer
|
11 |
+
- id: check-added-large-files
|
12 |
+
args: ["--maxkb=500"]
|
13 |
+
|
14 |
+
- repo: https://github.com/psf/black
|
15 |
+
rev: 25.1.0
|
16 |
+
hooks:
|
17 |
+
- id: black-jupyter
|
18 |
+
|
19 |
+
- repo: https://github.com/codespell-project/codespell
|
20 |
+
rev: v2.4.1
|
21 |
+
hooks:
|
22 |
+
- id: codespell
|
23 |
+
args:
|
24 |
+
[
|
25 |
+
"--ignore-words-list=aci,acount,acounts,fallow,ges,hart,hist,nd,ned,ois,wqs,watermask,tre,mape",
|
26 |
+
"--skip=*.csv,*.geojson,*.json,*.yml*.js,*.html,*cff,*.pdf",
|
27 |
+
]
|
28 |
+
|
29 |
+
- repo: https://github.com/kynan/nbstripout
|
30 |
+
rev: 0.8.1
|
31 |
+
hooks:
|
32 |
+
- id: nbstripout
|
Dockerfile
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM quay.io/jupyter/base-notebook:latest
|
2 |
+
|
3 |
+
RUN mamba install -c conda-forge leafmap maplibre voila -y && \
|
4 |
+
pip install -U leafmap && \
|
5 |
+
fix-permissions "${CONDA_DIR}" && \
|
6 |
+
fix-permissions "/home/${NB_USER}"
|
7 |
+
|
8 |
+
WORKDIR /home/jovyan
|
9 |
+
USER jovyan
|
10 |
+
|
11 |
+
RUN mkdir ./notebooks
|
12 |
+
|
13 |
+
COPY run.sh .
|
14 |
+
|
15 |
+
EXPOSE 8866
|
16 |
+
|
17 |
+
HEALTHCHECK CMD curl --fail http://localhost:8866/_stcore/health
|
18 |
+
|
19 |
+
CMD ["/bin/bash", "run.sh"]
|
README.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1 |
# leafmap-voila
|
2 |
|
3 |
Build a docker image for using leafmap with Voila
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# leafmap-voila
|
2 |
|
3 |
Build a docker image for using leafmap with Voila
|
4 |
+
|
5 |
+
To build the image:
|
6 |
+
|
7 |
+
```bash
|
8 |
+
docker buildx build --platform linux/amd64,linux/arm64 -t giswqs/leafmap:voila --push .
|
9 |
+
```
|
10 |
+
|
11 |
+
To run the image:
|
12 |
+
|
13 |
+
```bash
|
14 |
+
docker run -it -p 8866:8866 -v $(pwd):/home/jovyan/notebooks giswqs/leafmap:voila
|
15 |
+
```
|
16 |
+
|
17 |
+
To push the image to the registry:
|
18 |
+
|
19 |
+
```bash
|
20 |
+
docker push giswqs/leafmap:voila
|
21 |
+
```
|
notebooks/intro.ipynb
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": 1,
|
6 |
+
"metadata": {},
|
7 |
+
"outputs": [],
|
8 |
+
"source": [
|
9 |
+
"import leafmap.maplibregl as leafmap"
|
10 |
+
]
|
11 |
+
},
|
12 |
+
{
|
13 |
+
"cell_type": "code",
|
14 |
+
"execution_count": null,
|
15 |
+
"metadata": {},
|
16 |
+
"outputs": [],
|
17 |
+
"source": [
|
18 |
+
"m = leafmap.Map(style=\"liberty\")\n",
|
19 |
+
"m.add_basemap(\"Satellite\")\n",
|
20 |
+
"m"
|
21 |
+
]
|
22 |
+
}
|
23 |
+
],
|
24 |
+
"metadata": {
|
25 |
+
"kernelspec": {
|
26 |
+
"display_name": "geo",
|
27 |
+
"language": "python",
|
28 |
+
"name": "python3"
|
29 |
+
},
|
30 |
+
"language_info": {
|
31 |
+
"codemirror_mode": {
|
32 |
+
"name": "ipython",
|
33 |
+
"version": 3
|
34 |
+
},
|
35 |
+
"file_extension": ".py",
|
36 |
+
"mimetype": "text/x-python",
|
37 |
+
"name": "python",
|
38 |
+
"nbconvert_exporter": "python",
|
39 |
+
"pygments_lexer": "ipython3",
|
40 |
+
"version": "3.12.2"
|
41 |
+
}
|
42 |
+
},
|
43 |
+
"nbformat": 4,
|
44 |
+
"nbformat_minor": 2
|
45 |
+
}
|
requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
voila
|
2 |
+
leafmap
|
3 |
+
maplibre
|
run.sh
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
voila --Voila.ip=0.0.0.0 --no-browser --strip_sources=True --enable_nbextensions=True --MappingKernelManager.cull_interval=60 --MappingKernelManager.cull_idle_timeout=120 --NotebookClient.iopub_timeout=30 notebooks/
|