Skip to content

Commit 8294206

Browse files
option to run workshop locally (#238)
* option to run workshop locally * Update index.md * Update README.md * Update index.md --------- Co-authored-by: Tom Kralidis <tomkralidis@gmail.com>
1 parent f28657b commit 8294206

3 files changed

Lines changed: 60 additions & 7 deletions

File tree

README.md

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,15 @@ See Workshop entry doc https://geopython.github.io/geopython-workshop.
88

99
### Requirements
1010

11-
The workshop requires [Docker](https://docker.com)
12-
and [Docker Compose](https://docs.docker.com/compose/) on your system
11+
The workshop uses Jupyter Notebooks. [Jupyter](https://jupyter.org/) is an interactive development environment suitable for documenting and reproducing workflows using live code.
12+
13+
As the installation of all dependencies on all platforms (Windows, Mac, Linux) can be quite involved and complex this workshop provides all components within a Docker Image.
14+
15+
In addition, geospatial web services like pygeoapi and pycsw in this workshop are provided by Docker images.
16+
17+
The core requirement is to have Docker and Docker Compose installed on the system. Once you have Docker and Docker Compose installed you will be able to install and run the workshop without any other dependencies.
18+
19+
Alternatively, if you're confident with Python development, you can run the notebook in a local Anaconda or Python environment. [Read more about running locally](#running-locally)
1320

1421
### Docker Images
1522

@@ -55,8 +62,6 @@ bash ./geopython-workshop-ctl.sh url
5562
bash ./geopython-workshop-ctl.sh stop
5663
```
5764

58-
59-
6065
NB [Jupyter notebook](https://en.wikipedia.org/wiki/Project_Jupyter) needs a **token**. The token is displayed in the jupyter container logs on startup:
6166

6267
`http://127.0.0.1:8888/?token=<longtokenhexstring>`.
@@ -81,6 +86,26 @@ cd geopython-workshop.git/workshop/jupyter
8186
- by default the web services pygeoapi and pycsw are not required for the regular workshop like FOSS4G
8287
- if you use pygeoapi: there is an issue with MacOS Monterey where the port 5000 is already used and therefore conflicting with that one used by pygeoapi. If you are facing this error `OSError: [Errno 48] Address already in use` then your machine is affected. To overcome the issue you can disable the *Airplay Receiver* from `System Preferences->Sharing` of your MacOS (detailed description in this blog [post](https://progressstory.com/tech/port-5000-already-in-use-macos-monterey-issue/)).
8388

89+
### Running locally
90+
91+
If you're confident with Python development, consider to run the Jupyter notebook locally. The operations below require a [anaconda](https://www.anaconda.com/) or [(micro)mamba](https://mamba.readthedocs.io/en/latest/user_guide/mamba.html) environment.
92+
93+
```bash
94+
# clone the workshop repository
95+
git clone https://github.com/geopython/geopython-workshop.git
96+
cd geopython-workshop/
97+
# create virtual environment
98+
micromamba create -n pyworkshop python=3.12 jupyterlab -y
99+
micromamba activate pyworkshop
100+
# install conda workshop requirements
101+
micromamba install -n pyworkshop -c conda-forge gdal notebook
102+
cd workshop/jupyter
103+
# install python workshop requirements
104+
pip3 install -r requirements.txt
105+
# Run the notebook, copy url (with token) to browser if browser does not open automatically
106+
jupyter notebook
107+
```
108+
84109
### Bugs and Issues
85110

86111
All bugs, enhancements and issues are managed

web/docs/index.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ able to install and run the workshop without any other dependencies.
2525

2626
More information on installing Docker can also be found [here](./docker.md).
2727

28+
Alternatively, if you're confident with Python development, you can run the notebook
29+
in a local Anaconda or Python environment. [Read more about running locally](#running-locally).
30+
Or run the notebook in the cloud, using `Jupyter Binder`. [Read more about
31+
running in binder](#run-notebook-in-the-cloud).
32+
2833
### Optional requirements
2934

3035
Users may optionally install [QGIS](https://qgis.org) as a GIS data viewer.
@@ -183,12 +188,33 @@ In that case you could also try `http://0.0.0.0:8888?token=<token>`.
183188

184189
There is an issue with MacOS Monterey where the port 5000 is already used and therefore conflicting with that one used by pygeoapi. If you are facing this error `OSError: [Errno 48] Address already in use` then your machine is affected. To overcome the issue you can disable the *Airplay Receiver* from `System Preferences->Sharing` of your MacOS (detailed description in this blog [post](https://progressstory.com/tech/port-5000-already-in-use-macos-monterey-issue/)).
185190

186-
## No Docker Installed?
191+
## Running locally
192+
193+
If you're confident with python development, consider to run the Jupyter notebook locally. The operations below require a [anaconda](https://www.anaconda.com/) or [(micro)mamba](https://mamba.readthedocs.io/en/latest/user_guide/mamba.html) environment.
194+
195+
```bash
196+
# clone the workshop repository
197+
git clone https://github.com/geopython/geopython-workshop.git
198+
cd geopython-workshop/
199+
# create virtual environment
200+
micromamba create -n pyworkshop python=3.12 jupyterlab -y
201+
micromamba activate pyworkshop
202+
# install conda workshop requirements
203+
micromamba install -n pyworkshop -c conda-forge gdal notebook
204+
cd workshop/jupyter
205+
# install python workshop requirements
206+
pip3 install -r requirements.txt
207+
# Run the notebook, copy URL (with token) to browser if browser does not open automatically
208+
jupyter notebook
209+
```
210+
211+
## Run notebook in the cloud
187212

188213
If you somehow were not able to install Docker:
189-
there is a Cloud version of the Jupyter-Notebook-part of the workshop via "Jupyter Binder".
214+
there is a Cloud version of the Jupyter-Notebook-part of the workshop,
215+
available via [Jupyter Binder](https://jupyter.org/binder).
190216

191-
With some limits (e.g. no local geo-services, no data publication), you can follow most of the workshop using a remote Docker instance within your browser via "Jupyter Binder". Click on the button below
217+
With some limits (e.g. no local geo-services, no data publication), you can follow most of the workshop using a remote Docker instance within your browser via `Jupyter Binder`. Click on the button below
192218
to launch the Workshop Binder Instance. Startup takes a while, be patient...
193219

194220
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/geopython/geopython-workshop/master?filepath=workshop%2Fjupyter%2Fcontent%2Fnotebooks%2F01-introduction.ipynb)

workshop/jupyter/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ ipyleaflet
1111
pydeck
1212
pygeometa # >0.7 removed by Just
1313
matplotlib
14+
fiona
15+
rasterio

0 commit comments

Comments
 (0)