Skip to content

Commit e5f34fc

Browse files
clean up readmes, move imports to requirements
1 parent 4997aae commit e5f34fc

File tree

4 files changed

+21
-120
lines changed

4 files changed

+21
-120
lines changed

README.md

Lines changed: 14 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -80,51 +80,35 @@ configure. To ease this complexity we provide a docker container for running the
8080
systems. To install docker on your system please see docker's [documentation](https://docs.docker.com/engine/installation/)
8181
for your operating system.
8282

83-
### Download prebuilt Docker image (recommended)
84-
The Docker image for these notebooks is hosted in the [planetlabs/notebooks](https://hub.docker.com/r/planetlabs/notebooks) repo on DockerHub. To download and prepare the image for use, run:
83+
### Build the Docker image
8584

85+
First you must build the docker image. Note, this only has to be done the first time you use it. After checking out the
86+
repository, you run:
8687
```bash
87-
cd notebooks
88-
docker pull planetlabs/notebooks
89-
docker tag planetlabs/notebooks planet-notebooks
90-
91-
# If you get errors running the above, you might have to add sudo to the beginning:
92-
#sudo docker pull planetlabs/notebooks
93-
#sudo docker tag planetlabs/notebooks planet-notebooks
88+
docker build -t planet-notebooks planet-notebook-docker/
9489
```
9590

96-
If you want to re-build the Docker image yourself, this is documented below in the "Appendix: Build the Docker image" section.
91+
This will build and install the Docker image on your system, making it available to run. This may take some
92+
time (from 10 minutes to an hour) depending on your network connection and how long Anaconda takes to configure
93+
its environment.
9794

9895
### Run the container
9996
To run the container (after building or downloading it), add your Planet API key below and issue the following command from the git repository root directory:
10097

10198
```bash
102-
docker run -it --rm -p 8888:8888 -v $PWD:/home/jovyan/work -e PL_API_KEY='[YOUR-API-KEY]' planet-notebooks
99+
docker run -it --rm -p 8888:8888 -v "$(pwd)/jupyter-notebooks:/home/jovyan/work" -e PL_API_KEY='your-key' planet-notebooks
103100

104101
# If you get a permissions error running the above, you should add sudo to the front:
105102
# sudo docker run -it --rm -p 8888:8888 -v $PWD:/home/jovyan/work -e PL_API_KEY='[YOUR-API-KEY]' planet-notebooks
106-
# Windows users run: winpty docker run -it --rm -p 8888:8888 -v "/$PWD":/home/joyvan/work -e PL_API_KEY='[YOUR-API-KEY]' planet-notebooks
107-
108103
```
109104

110105
This does several things:
111106

112-
1. Maps the docker container's ```8888``` port to your system's ```8888``` port. This makes the
113-
container available to your host systems web browser.
114-
115-
1. Maps a host system path ```$PWD``` to the docker container's working directory.
116-
This ensures that the notebooks you create, edit, and save are available on your host system under the
117-
`jupyter-notebooks` sub-directory and are not *destroyed* when you exit the container.
118-
This also allows for running tests in the `tests` sub-directory.
119-
120-
1. Ensures that the directory in the Docker container named `/home/jovyan/work` that has the notebooks
121-
in them is accessible to the Jupyter notebook server.
122-
123-
1. Starts an interactive terminal that is accessible through http://localhost:8888.
124-
125-
1. Sets an environment variable with your unique Planet API key for authenticating against the API.
126-
127-
1. Includes the ```--rm``` option to clean up the notebook after you exit the process.
107+
1. **Maps port 8888** - Makes the container accessible at http://localhost:8888
108+
2. **Mounts your notebooks** - Maps `jupyter-notebooks/` folder to `/home/jovyan/work` so your work persists and notebooks are accessible to Jupyter
109+
3. **Sets your API key** - Replace `your-key` with your actual Planet API key for API authentication
110+
4. **Starts interactive terminal** - Accessible through the web browser
111+
5. **Auto-cleanup** - Removes container when you exit (`--rm`)
128112

129113
### Open Jupyter notebooks
130114
Once the Docker container is running, the CLI output will display a URL that you will use to access Jupyter notebooks
@@ -133,82 +117,4 @@ with your browser.
133117
http://localhost:8888/?token=<UNIQUE-TOKEN>
134118
```
135119

136-
NOTE: This security token will change every time you start your Docker container.
137-
138-
## Repository Organization
139-
140-
### jupyter-notebooks
141-
142-
#### exploring_planet_data: Working with our various image products, how to use the udm mask or deliver imagery to our GEE integration
143-
144-
* [How to use the Data and Orders API to create analysis ready data](https://github.com/planetlabs/notebooks/tree/proserve_restructure/jupyter-notebooks/exploring_planet_data/analysis-ready-data)
145-
* [Converting Raster Results to Vector Features](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/analytics-snippets/README.md)
146-
* [Introduction to Cloud Native Geospatial Tools](https://github.com/planetlabs/notebooks/tree/master/jupyter-notebooks/cloud-native-geospatial)
147-
* [Comparing Planet Scope with Landsat 8]()
148-
* [Deliver data to GEE](https://github.com/planetlabs/notebooks/tree/master/jupyter-notebooks/cloud-native-geospatial)
149-
* [Start working with satellite imagery in Python](https://github.com/planetlabs/notebooks/tree/master/jupyter-notebooks/cloud-native-geospatial)
150-
* [Create labels using Planet imagery](https://github.com/planetlabs/notebooks/tree/master/jupyter-notebooks/cloud-native-geospatial)
151-
* [Pixel-by-pixel comparison of PlanetScope and Landsat Scenes](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/landsat-ps-comparison/landsat-ps-comparison.ipynb)
152-
* [Visualize and convert a UDM to a binary mask](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/udm/udm.ipynb)
153-
* [Work with the Usable Data Mask (UDM2)](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/udm2)
154-
155-
156-
157-
158-
#### Search, activate, download with the Data API
159-
* [Explore the Planet Data API with Python](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/data-api-tutorials/planet_data_api_introduction.ipynb)
160-
* [Search, activate, and download imagery with the Planet Python Client](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/data-api-tutorials/planet_python_client_introduction.ipynb)
161-
* [Search & Download Quickstart Guide](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/data-api-tutorials/search_and_download_quickstart.ipynb)
162-
* [Planet Data API reference](https://developers.planet.com/docs/apis/data/)
163-
164-
#### Ordering, delivery, and tools with the Orders API
165-
* [Ordering and Delivery](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/orders_api_tutorials/ordering_and_delivery.ipynb)
166-
* [Tools and Toolchains](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/orders_api_tutorials/tools_and_toolchains.ipynb)
167-
* [Planet Orders API reference](https://developers.planet.com/docs/orders/)
168-
169-
### Process Planet data
170-
* [Create a mosaic from multiple PlanetScope scenes](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/mosaicing/basic_compositing_demo.ipynb)
171-
* [Calculate a vegetation index from 4-band satellite imagery](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/ndvi/ndvi_planetscope.ipynb)
172-
* [Convert PlanetScope metadata from radiance to reflectance](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/toar/toar_planetscope.ipynb)
173-
174-
175-
### Analyze and visualize Planet data
176-
177-
* Analytics quickstart:
178-
1. [Summarizing Feeds and Subscriptions](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/analytics/quickstart/01_checking_available_feeds_and_subscriptions.ipynb)
179-
2. [Getting Analytic Feed Results](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/analytics/quickstart/02_fetching_feed_results.ipynb)
180-
3. [Visualizing Raster Results](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/analytics/quickstart/03_visualizing_raster_results.ipynb)
181-
* Analytics user guide:
182-
1. [Getting Started with Planet Analytics API](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/analytics/user-guide/01_getting_started_with_the_planet_analytics_api.ipynb)
183-
2. [Planet Analytic Feeds Results](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/analytics/user-guide/02_analytic_feeds_results.ipynb)
184-
3. [Change Detection](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/analytics/user-guide/03_change_detection.ipynb)
185-
4. [Summary Statistics - Buildings](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/analytics/user-guide/04_summary_statistics_buildings.ipynb)
186-
5. [Summary Statistics - Ships and Clouds](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/analytics/user-guide/05_summary_statistics_ships_and_clouds.ipynb)
187-
* Other analytics notebooks:
188-
* [Detect, count, and visualize ships in Planet imagery](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/ship-detector/01_ship_detector.ipynb)
189-
* [Pixel-by-pixel comparison of PlanetScope and Landsat Scenes](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/landsat-ps-comparison/landsat-ps-comparison.ipynb)
190-
* [Calculate Coverage for a Search Query](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/coverage/calculate_coverage.ipynb)
191-
* [Segment and Classify Crops](https://github.com/planetlabs/notebooks/tree/master/jupyter-notebooks/crop-segmentation-and-classification)
192-
* [Identify Forest Degradation](https://github.com/planetlabs/notebooks/tree/master/jupyter-notebooks/forest-monitoring)
193-
* [Identify the Temporal Signature of Crops](https://github.com/planetlabs/notebooks/tree/master/jupyter-notebooks/temporal-analysis)
194-
195-
* [Creating a Heatmap of Vector Results](https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/analytics/change_detection_heatmap.ipynb)
196-
197-
198-
Soon we hope to add notebooks from the researchers, technologists, geographers, and entrepreneurs who are already using Planet data to ask interesting and innovative questions about our changing Earth. If you're working with our imagery and have a notebook (or just an idea for a notebook) that you'd like to share, please [file an issue](https://github.com/planetlabs/notebooks/issues) and let us know.
199-
200-
### Appendix: Build the Docker image
201-
202-
This documents how to build the docker image yourself, rather than using the recommended step of downloading pre-built Docker images. This is useful if you are a developer adding dependencies or a new Jupyter notebook to this repo, for example.
203-
204-
First you must build the docker image. Note, this only has to be done the first time you use it. After checking out the
205-
repository, you run:
206-
```bash
207-
cd planet-notebook-docker
208-
docker build --rm -t planet-notebooks .
209-
cd ..
210-
```
211-
212-
This will build and install the Docker image on your system, making it available to run. This may take some
213-
time (from 10 minutes to an hour) depending on your network connection and how long Anaconda takes to configure
214-
its environment.
120+
NOTE: This security token will change every time you start your Docker container.

planet-notebook-docker/Dockerfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# https://github.com/jupyter/docker-stacks/wiki/minimal-notebook-414b5d749704
33
FROM quay.io/jupyter/minimal-notebook:8515ad39f045
44

5-
# install dependencies
5+
# Copy requirements file for package installation
66
COPY requirements.txt /tmp/requirements.txt
77

88
# libgl Required for opencv
@@ -18,14 +18,8 @@ USER $NB_UID
1818
RUN conda config --set channel_priority strict && \
1919
conda install -y -c conda-forge --file /tmp/requirements.txt
2020

21-
# install the following libraries w/ pip to support analytics/user-guide nb's
22-
# build fails due to long conda solves when these dependencies are added to requirements.txt
23-
# see https://github.com/planetlabs/notebooks/issues/135 for more details
24-
# python -m pip as per https://github.com/pypa/pip/issues/5599
25-
RUN python -m pip install descartes geoviews
26-
2721
# Attempts to avoid having to hardcode this failed.
2822
# ref: https://github.com/planetlabs/notebooks/issues/101
2923
ENV PROJ_LIB=/opt/conda/share/proj
3024

31-
WORKDIR work
25+
WORKDIR /home/jovyan/work

planet-notebook-docker/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Planet Notebook
1+
# Planet Notebooks Docker Instructions
22

3-
This image provides the dependencies for running jupyter notebooks in the [planetlabs/notebooks](https://github.com/planetlabs/notebooks) GitHub repository. A prebuilt version of this image can be downloaded from the [planetlabs/notebook](https://hub.docker.com/r/planetlabs/notebooks) dockerhub repo (recommended). Alternatively, this image can be built locally from the Dockerfile. The specifics of building and running this image are given in the planetlabs/notebooks GitHub [README.md](https://github.com/planetlabs/notebooks/blob/master/README.md) file.
3+
This image provides the dependencies for running jupyter notebooks in the [planetlabs/notebooks](https://github.com/planetlabs/notebooks) GitHub repository. This image must be built locally from the Dockerfile. The specifics of building and running this image are given in the planetlabs/notebooks GitHub [README.md](https://github.com/planetlabs/notebooks?tab=readme-ov-file#run-planet-notebooks-in-docker) file.
44

55
This image is based on the [jupyter/minimal-notebook](https://hub.docker.com/r/jupyter/minimal-notebook/) image and additional tips on running the jupyter notebook can be found in the documentation for that image.
66

planet-notebook-docker/requirements.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# changes here should be reflected in
21
# please keep this in alphabetical order
32
cartopy
3+
descartes
44
fiona
55
gdal
66
geojson
77
geojsonio
88
geopandas
9+
geoviews
910
ipyleaflet
1011
ipywidgets
1112
matplotlib
1213
mercantile
1314
numpy
14-
# for pip, use opencv-python
1515
opencv
1616
pandas
1717
planet
@@ -24,3 +24,4 @@ scikit-learn
2424
sentinelhub
2525
shapely
2626
tqdm
27+
tslearn

0 commit comments

Comments
 (0)