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

Commit 6b9d512

Browse files
authored
Add CUDA 9.0 image and fix anaconda script issues. (#55)
1 parent 2afd4df commit 6b9d512

File tree

4 files changed

+63
-29
lines changed

4 files changed

+63
-29
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM nvidia/cuda:9.0-cudnn7-runtime-ubuntu16.04
2+
3+
COPY ./base-py/requirements /ai4e_api_tools/requirements
4+
5+
ENV PATH /usr/local/envs/ai4e_py_api/bin:$PATH
6+
ENV PYTHONPATH="${PYTHONPATH}:/ai4e_api_tools"
7+
8+
# Install Miniconda, Flask, Supervisor, uwsgi
9+
RUN ./ai4e_api_tools/requirements/install-api-hosting-reqs.sh
10+
11+
# Install Azure Blob SDK
12+
RUN ./ai4e_api_tools/requirements/install-azure-blob.sh
13+
14+
# Install Application Insights and OpenCensus
15+
RUN ./ai4e_api_tools/requirements/install-appinsights.sh
16+
17+
COPY ./base-py/ai4e_api_tools /ai4e_api_tools/
18+
COPY ./common/sas_blob.py /ai4e_api_tools/
19+
COPY ./common/aad_blob.py /ai4e_api_tools/
Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,47 @@
11
export LANG=C.UTF-8
22
export LC_ALL=C.UTF-8
3-
export PATH=/opt/conda/bin:$PATH
3+
44
mkdir /var/uwsgi
55

66
apt-get update --fix-missing
7-
apt-get install -y supervisor bzip2
7+
apt-get install -y apt-utils
8+
apt-get install -y supervisor
9+
10+
apt-get install -y curl bzip2 ca-certificates libglib2.0-0 libxext6 libsm6 libxrender1 git mercurial subversion
11+
apt-get clean
812

9-
apt-get -qq update && apt-get -qq -y install curl
13+
echo 'export PATH=/usr/local/miniconda/bin:$PATH' > /etc/profile.d/conda.sh
1014
curl -sSL https://repo.continuum.io/miniconda/Miniconda3-4.5.4-Linux-x86_64.sh -o /tmp/miniconda.sh
11-
bash /tmp/miniconda.sh -bfp /usr/local
15+
bash /tmp/miniconda.sh -bfp /usr/local
1216
rm -rf /tmp/miniconda.sh
13-
conda install -y python=3
14-
conda update conda
15-
apt-get -qq -y remove curl bzip2
16-
apt-get -qq -y autoremove
17-
apt-get autoclean
18-
rm -rf /var/lib/apt/lists/* /var/log/dpkg.log
19-
conda clean --all --yes
20-
21-
conda create -n ai4e_py_api python=3.6.6
17+
18+
export PATH=/usr/local/miniconda/bin:$PATH
19+
export CONDA_AUTO_UPDATE_CONDA=false
20+
export CONDA_DEFAULT_ENV=ai4e_py_api
21+
export CONDA_PREFIX=/usr/local/miniconda/envs/$CONDA_DEFAULT_ENV
22+
export PATH=$CONDA_PREFIX/bin:$PATH
23+
24+
# Create a Python 3.6 environment
25+
conda install conda-build
26+
conda create -y --name ai4e_py_api python=3.6.6
27+
conda clean -ya
28+
29+
30+
31+
32+
#/opt/conda/bin/conda clean -tipsy
33+
#ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh
34+
#echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc
35+
#echo "conda activate base" >> ~/.bashrc
36+
#find /opt/conda/ -follow -type f -name '*.a' -delete
37+
#find /opt/conda/ -follow -type f -name '*.js.map' -delete
38+
#/opt/conda/bin/conda clean -afy
39+
40+
41+
#conda install -y python=3
42+
43+
#conda create -n ai4e_py_api python=3.6.6
44+
#mkdir -p /usr/local/envs/ai4e_py_api/bin
45+
#ln /opt/conda/envs/ai4e_py_api/bin/pip /usr/local/envs/ai4e_py_api/bin/pip
2246
echo "source activate ai4e_py_api" >> ~/.bashrc
2347
conda install -c conda-forge -n ai4e_py_api uwsgi flask flask-restful
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
pip install azure
2-
pip install azure-storage-blob
1+
export PATH=/opt/conda/bin:$PATH
2+
3+
conda info --envs
4+
5+
/usr/local/envs/ai4e_py_api/bin/pip install azure
6+
/usr/local/envs/ai4e_py_api/bin/pip install azure-storage-blob

Examples/animal-detection-api/Dockerfile

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
11
# Pull in the AI for Earth Base Image, so we can extract necessary libraries.
2-
FROM mcr.microsoft.com/aiforearth/base-py:latest as ai4e_base
3-
4-
# Use any compatible Ubuntu-based image as your selected base image.
5-
FROM nvidia/cuda:9.0-cudnn7-runtime-ubuntu16.04
6-
# Copy the AI4E tools and libraries to our container.
7-
COPY --from=ai4e_base /ai4e_api_tools /ai4e_api_tools
8-
ENV PATH /usr/local/envs/ai4e_py_api/bin:$PATH
9-
ENV PYTHONPATH="${PYTHONPATH}:/ai4e_api_tools"
10-
11-
# Install Miniconda, Flask, Supervisor, uwsgi
12-
RUN ./ai4e_api_tools/requirements/install-api-hosting-reqs.sh
13-
14-
# Install Application Insights
15-
RUN ./ai4e_api_tools/requirements/install-appinsights.sh
2+
FROM ai4epublic.azurecr.io/public/aiforearth/cuda-9.0-base-py:1.8
163

174
RUN echo "source activate ai4e_py_api" >> ~/.bashrc \
185
&& conda install -c conda-forge -n ai4e_py_api numpy pandas

0 commit comments

Comments
 (0)