Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit ae2d1e9

Browse files
authored
- Rewrite R base image due to gdal updates. (#66)
- Bug fixes.
1 parent 8902611 commit ae2d1e9

File tree

4 files changed

+43
-73
lines changed

4 files changed

+43
-73
lines changed

Containers/base-py/ai4e_api_tools/task_management/api_task.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def UpdateTaskStatus(self, taskId, status):
3434

3535
def AddPipelineTask(self, taskId, organization_moniker, version, api_name, body):
3636
next_url = organization_moniker + '/' + version + '/' + api_name
37-
UpdateTaskStatus(taskId, "Pipelining is not supported in a single node deployment, but the next service is: " + next_url)
37+
self.UpdateTaskStatus(taskId, "Pipelining is not supported in a single node deployment, but the next service is: " + next_url)
3838
return "Pipelining is not supported in a single node deployment, but the next service is: " + next_url
3939

4040
def CompleteTask(self, taskId, status):

Containers/base-r/Dockerfile

Lines changed: 29 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,46 @@
11
#mcr.microsoft.com/aiforearth/base-r:version
2-
FROM nvidia/cuda:9.2-runtime-ubuntu16.04
2+
FROM osgeo/gdal:ubuntu-full-3.0.3
33
ARG DEBIAN_FRONTEND=noninteractive
44

5-
RUN mkdir /var/uwsgi
6-
7-
RUN apt-get update \
8-
&& apt-get install -y python3-pip python3-dev \
9-
&& cd /usr/local/bin \
10-
&& ln -s /usr/bin/python3 python \
11-
&& pip3 install --upgrade pip
12-
135
RUN apt-get update --fix-missing && \
146
apt-get install -y wget supervisor bzip2 && \
157
apt-get clean && \
168
rm -rf /var/lib/apt/lists/*
179

18-
ENV GDAL_VERSION=2.2.1
19-
20-
RUN apt-get update && \
21-
apt-get -y install \
22-
libpq-dev \
23-
ogdi-bin \
24-
libogdi3.2-dev \
25-
libjasper-runtime \
26-
libjasper-dev \
27-
libjasper1 \
28-
libgeos-dev \
29-
libproj-dev \
30-
libpoppler-dev \
31-
libsqlite3-dev \
32-
libspatialite-dev \
33-
python3 \
34-
python3-dev \
35-
python3-numpy
36-
37-
RUN wget http://download.osgeo.org/gdal/$GDAL_VERSION/gdal-${GDAL_VERSION}.tar.gz -O /tmp/gdal-${GDAL_VERSION}.tar.gz && \
38-
tar -x -f /tmp/gdal-${GDAL_VERSION}.tar.gz -C /tmp
39-
40-
RUN tar -xvf /tmp/gdal-${GDAL_VERSION}.tar.gz && cd /tmp/gdal-${GDAL_VERSION} \
41-
&& ./configure \
42-
&& make && make install && ldconfig \
43-
&& apt-get update -y \
44-
&& apt-get remove -y --purge build-essential wget \
45-
&& rm -Rf $ROOTDIR/src/*
46-
47-
RUN rm /tmp/gdal-${GDAL_VERSION} -rf
48-
49-
CMD gdalinfo --version && gdalinfo --formats && ogrinfo --formats
10+
RUN apt-get update \
11+
&& apt-get install -y --no-install-recommends \
12+
r-base \
13+
r-base-dev \
14+
r-recommended
5015

5116
RUN apt-get update \
52-
&& apt-get install -y \
53-
apt-transport-https \
54-
build-essential \
55-
ed \
56-
gtk2.0 \
57-
libcurl4-openssl-dev \
58-
libgtk2.0-dev \
59-
libiodbc2-dev \
60-
libnlopt-dev \
61-
libssh2-1-dev \
62-
libssl-dev \
63-
libxml2-dev \
64-
software-properties-common \
65-
wget \
66-
xvfb \
67-
&& rm -rf /var/lib/apt/lists/*
17+
&& apt-get install -y \
18+
apt-transport-https \
19+
build-essential \
20+
ed \
21+
gtk2.0 \
22+
libcurl4-openssl-dev \
23+
libgtk2.0-dev \
24+
libiodbc2-dev \
25+
libnlopt-dev \
26+
libssh2-1-dev \
27+
libssl-dev \
28+
libxml2-dev \
29+
software-properties-common \
30+
wget \
31+
xvfb \
32+
&& rm -rf /var/lib/apt/lists/*
6833

6934
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
70-
RUN add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/'
35+
RUN add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu bionic-cran35/'
7136

7237
RUN apt-get update \
7338
&& apt-get install -y --no-install-recommends \
7439
r-base \
7540
r-base-dev \
7641
r-recommended
7742

78-
RUN apt-get update -qq && apt-get install -y \
79-
git-core \
80-
libssl-dev \
81-
libcurl4-gnutls-dev
82-
83-
# Install data_processing packages
84-
RUN apt-get update && \
85-
apt-get install -y \
86-
libgdal-dev \
87-
libproj-dev
88-
8943
RUN echo "r <- getOption('repos'); r['CRAN'] <- 'http://cran.r-project.org'; options(repos = r);" > ~/.Rprofile
90-
#RUN Rscript -e 'remove.packages(c("curl","httr"));'
9144
RUN Rscript -e 'install.packages(c("curl", "httr"));'
9245
RUN Rscript -e 'Sys.setenv(CURL_CA_BUNDLE="/utils/microsoft-r-open-3.4.3/lib64/R/lib/microsoft-r-cacert.pem");'
9346
RUN Rscript -e 'install.packages("sp");'
@@ -100,6 +53,12 @@ RUN Rscript -e 'install.packages("RCurl");'
10053
RUN Rscript -e 'install.packages("sjmisc");'
10154
RUN Rscript -e 'install.packages("reticulate");'
10255

56+
RUN apt-get update \
57+
&& apt-get install -y python3-pip python3-dev \
58+
&& cd /usr/local/bin \
59+
&& ln -s /usr/bin/python3 python \
60+
&& pip3 install --upgrade pip
61+
10362
# Install Azure Blob SDK and application insights
10463
RUN pip install azure
10564
RUN pip install azure-storage-common

Containers/blob-py/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
FROM mcr.microsoft.com/aiforearth/base-py:1.4
1+
FROM mcr.microsoft.com/aiforearth/base-py:1.9
22
#############################################################################################
33
# Add support for mounting an Azure blob
44
# Add the Microsoft package repository and install blobfuse
5+
RUN apt-get update && apt-get install wget
56
RUN wget https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb && \
67
dpkg -i packages-microsoft-prod.deb && \
78
apt-get update && \

Containers/common/aad_blob.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ def write_blob_from_text(self, container, blob, text):
5050
service.create_blob_from_text(container, blob, text, 'utf-8', max_connections=100, timeout=600, progress_callback=self.callback)
5151
return service.make_blob_url(container, blob)
5252

53+
def create_blob_from_path(self, container, blob, path):
54+
service = self._get_service()
55+
print("{} for {}/{}".format('create_blob_from_path', container, blob))
56+
service.create_blob_from_path(container, blob, path, max_connections=100, timeout=600, progress_callback=self.callback)
57+
return service.make_blob_url(container, blob)
58+
5359
def get_blob(self, container, blob):
5460
service = self._get_service()
5561
with io.BytesIO() as output_stream:
@@ -79,4 +85,8 @@ def save_local_blob(self, container, blob, local_file):
7985
def get_blob_uri(self, container, blob):
8086
service = self._get_service()
8187
url = service.make_blob_url(container, blob)
82-
return url
88+
return url
89+
90+
def does_blob_exist(self, container, blob):
91+
service = self._get_service()
92+
return service.exists(container, blob)

0 commit comments

Comments
 (0)