Skip to content

Commit 9fa2eee

Browse files
author
Tom Augspurger
authored
[esa-cci-lc] Staging fixups (#115)
- Added container image - Remove Microsoft as processor for netcdf collection - set production values for ingest
1 parent d015cab commit 9fa2eee

File tree

4 files changed

+86
-7
lines changed

4 files changed

+86
-7
lines changed

datasets/esa-cci-lc/Dockerfile

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
FROM ubuntu:20.04
2+
3+
# Setup timezone info
4+
ENV TZ=UTC
5+
6+
ENV LC_ALL=C.UTF-8
7+
ENV LANG=C.UTF-8
8+
9+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
10+
11+
RUN apt-get update && apt-get install -y software-properties-common
12+
13+
RUN add-apt-repository ppa:ubuntugis/ppa && \
14+
apt-get update && \
15+
apt-get install -y build-essential python3-dev python3-pip \
16+
jq unzip ca-certificates wget curl git && \
17+
apt-get autoremove && apt-get autoclean && apt-get clean
18+
19+
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10
20+
21+
# See https://github.com/mapbox/rasterio/issues/1289
22+
ENV CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
23+
24+
# Install Python 3.8
25+
RUN curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh" \
26+
&& bash "Mambaforge-$(uname)-$(uname -m).sh" -b -p /opt/conda \
27+
&& rm -rf "Mambaforge-$(uname)-$(uname -m).sh"
28+
29+
ENV PATH /opt/conda/bin:$PATH
30+
ENV LD_LIBRARY_PATH /opt/conda/lib/:$LD_LIBRARY_PATH
31+
32+
RUN mamba install -y -c conda-forge python=3.8 gdal=3.3.3 pip setuptools cython numpy==1.21.5
33+
34+
RUN python -m pip install --upgrade pip
35+
36+
# Install common packages
37+
COPY requirements-task-base.txt /tmp/requirements.txt
38+
RUN python -m pip install --no-build-isolation -r /tmp/requirements.txt
39+
40+
#
41+
# Copy and install packages
42+
#
43+
44+
COPY pctasks/core /opt/src/pctasks/core
45+
RUN cd /opt/src/pctasks/core && \
46+
pip install .
47+
48+
COPY pctasks/cli /opt/src/pctasks/cli
49+
RUN cd /opt/src/pctasks/cli && \
50+
pip install .
51+
52+
COPY pctasks/task /opt/src/pctasks/task
53+
RUN cd /opt/src/pctasks/task && \
54+
pip install .
55+
56+
COPY pctasks/client /opt/src/pctasks/client
57+
RUN cd /opt/src/pctasks/client && \
58+
pip install .
59+
60+
COPY pctasks/ingest /opt/src/pctasks/ingest
61+
RUN cd /opt/src/pctasks/ingest && \
62+
pip install .
63+
64+
COPY pctasks/dataset /opt/src/pctasks/dataset
65+
RUN cd /opt/src/pctasks/dataset && \
66+
pip install .
67+
68+
COPY ./datasets/esa-cci-lc/requirements.txt /opt/src/datasets/esa-cci-lc/requirements.txt
69+
RUN python3 -m pip install -r /opt/src/datasets/esa-cci-lc/requirements.txt
70+
71+
# Setup Python Path to allow import of test modules
72+
ENV PYTHONPATH=/opt/src:$PYTHONPATH
73+
74+
WORKDIR /opt/src

datasets/esa-cci-lc/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# ESA CCI
2+
3+
## Docker container
4+
5+
```shell
6+
az acr build -r {the registry} --subscription {the subscription} -t pctasks-esa-cci-lc:latest -f datasets/esa-cci-lc/Dockerfile .
7+
```

datasets/esa-cci-lc/collection/esa-cci-lc-netcdf/template.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@
105105
{
106106
"name": "Microsoft",
107107
"roles": [
108-
"processor",
109108
"host"
110109
],
111110
"url": "https://planetarycomputer.microsoft.com"

datasets/esa-cci-lc/dataset.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
id: esa_cci_lc
2-
image: ${{ args.registry }}/pctasks-task-base:latest
2+
image: ${{ args.registry }}/pctasks-esa-cci-lc:latest
33

44
args:
55
- registry
66

77
code:
88
src: ${{ local.path(./esa_cci_lc.py) }}
9-
requirements: ${{ local.path(./requirements.txt) }}
9+
# included in the container image
10+
# requirements: ${{ local.path(./requirements.txt) }}
1011

1112
environment:
1213
AZURE_TENANT_ID: ${{ secrets.task-tenant-id }}
@@ -23,8 +24,7 @@ collections:
2324
options:
2425
name_starts_with: netcdf/
2526
extension: [.nc]
26-
chunk_length: 2 # for testing; set to 10 for production
27-
limit: 2 # for testing; remove for production
27+
chunk_length: 10
2828
chunk_storage:
2929
uri: blob://landcoverdata/esa-cci-lc-etl-data/esa-cci-lc-netcdf/
3030

@@ -37,7 +37,6 @@ collections:
3737
options:
3838
name_starts_with: netcdf/
3939
extension: [.nc]
40-
chunk_length: 1 # for testing; set to 10 for production
41-
limit: 2 # for testing; remove for production
40+
chunk_length: 10
4241
chunk_storage:
4342
uri: blob://landcoverdata/esa-cci-lc-etl-data/esa-cci-lc/

0 commit comments

Comments
 (0)