-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #211 from geo-engine/ge_test
test geo engine against actual instance in unit tests
- Loading branch information
Showing
28 changed files
with
913 additions
and
2,064 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Setup a Debian 12 based image with a Python virtualenv | ||
FROM debian:12-slim AS build | ||
RUN apt-get update && \ | ||
apt-get install --no-install-suggests --no-install-recommends --yes python3-venv gcc libpython3-dev && \ | ||
python3 -m venv /venv && \ | ||
/venv/bin/pip install --upgrade pip setuptools wheel | ||
|
||
# Install Geo Engine library and its dependencies | ||
FROM build AS build-venv | ||
COPY pyproject.toml setup.cfg setup.py /library/ | ||
COPY geoengine /library/geoengine | ||
WORKDIR /library | ||
RUN /venv/bin/pip install --disable-pip-version-check .[dev,test,examples] | ||
|
||
# Copy the virtualenv into a distroless image | ||
# Hint: Use the `:debug` tag to get a shell in the image | ||
FROM gcr.io/distroless/python3-debian12 | ||
COPY --from=build-venv /venv /venv | ||
|
||
# Copy the example notebook to run | ||
COPY examples/interactive_ml /app | ||
|
||
WORKDIR /app | ||
|
||
ENV GEOENGINE_INSTANCE_URL=https://zentrale.app.geoengine.io/api | ||
ENV GEOENGINE_SESSION_TOKEN=<SESSION_TOKEN> | ||
|
||
EXPOSE 8866 | ||
|
||
ENTRYPOINT [ \ | ||
"/venv/bin/python3", \ | ||
"-m", \ | ||
"voila", \ | ||
"--no-browser", \ | ||
"--Voila.ip='0.0.0.0'", \ | ||
"app/Simple Random Forest Two-Class Classifier on Sentinel-2 Images.ipynb" \ | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Interactive ML App | ||
|
||
This app demonstrates a complete workflow for binary classification using Sentinel-2 satellite imagery and a Random Forest classifier. The workflow includes data acquisition, preprocessing, model training, and result visualization. Initially, the environment is set up and necessary libraries are imported. The spatial and temporal bounds for the data query are then defined through a query rectangle. A workflow is created to fetch and preprocess Sentinel-2 data, which is followed by the use of a labeling tool to create training data for water and non-water classes. | ||
|
||
## Local setup | ||
|
||
To run the app locally, you need to install the dependencies and start the app. You can install the dependencies with: | ||
|
||
```bash | ||
pip install --disable-pip-version-check -e .[dev,test,examples] | ||
|
||
GEOENGINE_INSTANCE_URL=https://zentrale.app.geoengine.io/api \ | ||
GEOENGINE_SESSION_TOKEN=<SESSION_TOKEN> \ | ||
./examples/interactive_ml/app/app.sh | ||
``` | ||
|
||
The app will be available at [http://localhost:8866](http://localhost:8866). | ||
|
||
## Container setup | ||
|
||
To run the app in a container, you need to build the container image and start the container. | ||
You can build the container image with: | ||
|
||
```bash | ||
./examples/interactive_ml/app/build.sh | ||
|
||
podman run --rm \ | ||
-p 8866:8866 \ | ||
-e GEOENGINE_INSTANCE_URL=https://zentrale.app.geoengine.io/api \ | ||
-e GEOENGINE_SESSION_TOKEN=<SESSION_TOKEN> \ | ||
geoengine-interactive-ml:latest | ||
``` | ||
|
||
### Upload to quay.io | ||
|
||
To upload the container image to quay.io, you need to log in and push the image. | ||
You can do this with: | ||
|
||
```bash | ||
podman login quay.io | ||
podman push geoengine-interactive-ml:latest quay.io/geoengine/geoengine-interactive-ml:latest | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
|
||
podman build -f $SCRIPT_DIR/Dockerfile --tag geoengine-interactive-ml:latest . |
Oops, something went wrong.