Skip to content

Commit

Permalink
Merge branch 'master' into ceos_master
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrattz committed Aug 30, 2021
2 parents 998002b + b09df0a commit 54c6a90
Show file tree
Hide file tree
Showing 37 changed files with 1,590 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.git
**/*.tif
.git
odc_gee/config
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ __pycache__
*.pkl
**/tmp
**/output
**/.env
**/.env
odc_gee/config
4 changes: 2 additions & 2 deletions README.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"Follow the instructions in the \n",
"[Open Data Cube Database Installation Guide](https://github.com/ceos-seo/data_cube_ui/blob/master/docs/odc_db_setup.md) to setup the Open Data Cube (ODC) database.\n",
"\n",
"Follow the instructions in the [Notebooks Installation Guide](docs/notebook_install.md) to set up the Jupyter Notebook environment.\n",
"Follow the instructions in the [Operation Manual](docs/notebooks_operation_manual.md) to set up and operate the Jupyter Notebook environment.\n",
"\n",
"## Obtaining Help\n",
"-------\n",
Expand Down Expand Up @@ -55,4 +55,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ First follow the instructions in the [Docker Installation Guide](https://github.
Follow the instructions in the
[Open Data Cube Database Installation Guide](https://github.com/ceos-seo/data_cube_ui/blob/master/docs/odc_db_setup.md) to setup the Open Data Cube (ODC) database.

Follow the instructions in the [Notebooks Installation Guide](docs/notebook_install.md) to set up the Jupyter Notebook environment.
Follow the instructions in the [Operation Manual](docs/notebooks_operation_manual.md) to set up and operate the Jupyter Notebook environment.

## Obtaining Help
-------
Expand Down
8 changes: 8 additions & 0 deletions build/docker/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,15 @@ RUN pip3 install -r reqs/13_reqs_misc.txt
# ln -s /etc/ssl/certs/ca-certificates.crt /etc/pki/tls/certs/ca-bundle.crt
RUN pip3 install --no-binary=rasterio rasterio==1.1.8 GDAL==$(gdal-config --version)

# Set config directory for Matplotlib to avoid warnings.
ENV MPLCONFIGDIR=/var/jovyan/.config/matplotlib

# Install the ODC-GEE package.
COPY odc_gee odc_gee
USER root
RUN cd odc_gee; python3 setup.py build && python3 setup.py install
# Set the recently changed or added packages' ownership to jovyan.
RUN find /env/lib/python3.6/site-packages -group root -mtime -1 -exec chown -R jovyan:users {} +

# Setup the ODC configuration.
ENV ODC_DB_HOSTNAME \
Expand Down
1 change: 1 addition & 0 deletions build/docker/dev/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ services:
- ${HOST_PORT}:8888
volumes:
- ${DKR_CMP_CONTEXT}:${ROOT_DIR}
- ${DKR_CMP_CONTEXT}/odc_gee/config:/home/jovyan/.config/odc-gee
networks:
- odc
restart: "no"
Expand Down
15 changes: 9 additions & 6 deletions docs/notebook_install.md → docs/notebooks_operation_manual.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# CEOS Open Data Cube Notebooks Installation Guide
# Operation Manual

This document will guide users through the process of installing and configuring
our Open Data Cube (ODC) Jupyter Notebook server.
This document will guide users through the process of operating the Jupyter Notebook server.

## Contents

Expand Down Expand Up @@ -44,7 +43,9 @@ You can set the port that the notebooks will be available on with the `HOST_PORT

The `ODC_DB_*` variables in the `build/docker/dev/.env` file are the connection credentials for the ODC database. The `ODC_DB_*` variables are set to match the default settings for the ODC database container, but if these settings were changed in the command for the `create-odc-db` target in the `Makefile` file, they will need to be changed here.

If you want to access data on S3, you will need to set the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` variables. By default, they are set to use the values of identically named environment variables. You should set these environment variables before running the UI. Do not write these AWS credentials to the `build/docker/dev/.env` file directly.
If you want to access data on S3, you will need to set the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` variables. By default, they are set to use the values of identically named environment variables. You should set these environment variables before starting the environment. Do not write these AWS credentials to the `build/docker/dev/.env` file directly.

The pre-start configuration for the production environment in `build/docker/prod` is very similar to the pre-start configuration for the development environment. A notable difference is that the default port for the production environment is `8081`.

When you have finished configuring these values, run `make create-odc-network create-odc-db`.

Expand All @@ -69,6 +70,8 @@ When starting or restarting in the future, you can use the `-no-build` versions
* dev-up-no-build
* dev-restart-no-build

The commands for the production environment in `build/docker/prod` are very similar to the commands for the development environment.

>### <a name="install_ssh"></a> SSH to the notebook server
To connect to the development environment through a bash shell over SSH, run this command:
Expand All @@ -82,11 +85,11 @@ source /env/bin/activate
```
This must be run for every connection with `make dev-ssh`.

In the development environment, you also can launch terminals by clicking the `New` dropdown button and then the `Terminal` option. This will provide a terminal through a webpage in your browser.
In the development environment, you can also launch terminals through the interface in your web browser by clicking the `New` dropdown button and then the `Terminal` option. This will provide a terminal through a webpage in your browser.

## <a name="connect"></a> Access the notebooks

In the development environment, you can connect to the notebooks on the host machine at `localhost:<HOST_PORT>`, where `<HOST_PORT>` is the value of the `HOST_PORT` environment variable specified in `build/docker/dev/.env`.
In the development environment, you can connect to the notebooks on the host machine at `localhost:<HOST_PORT>`, where `<HOST_PORT>` is the value of the `HOST_PORT` environment variable specified in the `.env` file of the environment (i.e. `build/docker/dev/.env` or `build/docker/prod/.env`).

## <a name="faqs"></a> Common problems/FAQs

Expand Down
2 changes: 1 addition & 1 deletion docs/notebooks_overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CEOS Open Data Cube Notebooks Overview
# Notebooks Overview

This document provides an overview of the available notebooks in the `notebooks` directory.

Expand Down
51 changes: 51 additions & 0 deletions odc_gee/docs/credentials_guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Getting service account credentials
This document is to help guide users through obtaining a service account
credentials file for use with GEE.

The first step is to setup the API to use the
[Google Earth Engine REST
API](https://developers.google.com/earth-engine/reference). To do
this you need to create a project [here](https://console.cloud.google.com/). Go
to the [API & Services
Dashboard](https://console.cloud.google.com/apis/dashboard)
from the developer console.

![](/docs/images/image1.png)

Select the button in the red box according to Figure 1. This will pull up the
API library. Search for Earth Engine, select it, and then enable it for the
project.

The next step to setup the API is to create a Service Account. To do this
navigate to the
[API
& Services
Credentials](https://console.cloud.google.com/apis/api/earthengine.googleapis.com/credentials)
page for the API.

![](/docs/images/image2.png)

Click the button in the red box for Figure 2 and select Service Account. Fill
out the form
and click next. You will likely need to add Owner roles in the next section.
Click the Role selection box, type Owner in the filter field, and then select
the Owner choice to add it as the Role. Click next. In this section click add
key and select the JSON option. This will download a JSON file with your key’s
credentials for the Service Account. **Keep this file secure and don’t
lose it.** This file will act as the API key for accessing GEE data. Once
you’ve got the file, click done.

>**Note:** It may take some time for your credentials to propagate before they
can be used.

If you encounter any issues with using your service account credentials then
you may have to get the proper permission to use GEE with your account from
Google. This process will involve contacting Google where you may have to
supply a Google employee your Service Account email as
indicated by the red box from the
[API
& Services
Credentials](https://console.cloud.google.com/apis/api/earthengine.googleapis.com/credentials)
page in Figure 3.

![](/docs/images/image3.png)
Binary file added odc_gee/docs/images/image1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added odc_gee/docs/images/image2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added odc_gee/docs/images/image3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added odc_gee/docs/images/real-time-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added odc_gee/odc_gee/__init__.py
Empty file.
Loading

0 comments on commit 54c6a90

Please sign in to comment.