-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/gpu support extended #87
base: develop
Are you sure you want to change the base?
Changes from 24 commits
5b9a16a
5628d51
2d8a7ff
9fab0e3
01c5c3d
977ee01
87fd792
32dd904
cdd0faf
9fba583
0124123
cf047f0
89e8d24
dfc7cd7
4508ea6
e251bf2
5508abc
a9ad920
ea3b5f6
ef7ed75
f7571f2
a250fb3
f86c970
e334db1
297a8e0
677cacd
6941e7e
6c3efd5
eaae6be
f707010
46577ad
dd3a1c3
4d734fa
95d81ca
232b3c0
d494c86
a6f84a8
9055a30
ecc1b8f
3fbcfb1
99e04b0
1012b31
5db4cfb
50dc35f
ff25274
d8c01e9
5163ede
47bd2cd
defacaf
730e0f7
cd779af
09f58e8
7311aec
8520d5f
338fcd3
5697446
051b327
70ce3ec
e0e4a86
d92a604
1de8f8b
48f7546
463cbab
7a1b157
191e0da
4528bc6
ea5e1bd
6913fbb
3647851
3187c49
700e298
c46055b
f30f610
529be65
05e6b25
a198f2b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Copyright 2020 The KNIX Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
#FROM ubuntu:18.04 | ||
FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04 | ||
|
||
# Install (as root) | ||
# Base | ||
RUN apt-get update --fix-missing | ||
RUN apt-get -y --no-install-recommends install build-essential | ||
RUN apt-get -y --no-install-recommends install netbase unzip file libmagic1 | ||
|
||
# CUDA 10.1 dependencies and tools to build dlib | ||
RUN apt-get -y --no-install-recommends install libsm6 libxrender1 libxrender-dev libxext6 libglib2.0-0 git cmake | ||
RUN apt-get install -y --no-install-recommends libnvinfer6=6.0.1-1+cuda10.1 libnvinfer-dev=6.0.1-1+cuda10.1 libnvinfer-plugin6=6.0.1-1+cuda10.1 | ||
|
||
# Python | ||
RUN apt-get -y --no-install-recommends install python3 python3-dev | ||
RUN apt-get -y --no-install-recommends install python3-pip | ||
RUN apt-get -y --no-install-recommends install zlib1g libssl1.0 libsasl2-2 ca-certificates | ||
|
||
RUN /usr/bin/python3 -m pip install --upgrade pip | ||
|
||
RUN /usr/bin/python3 -m pip install setuptools | ||
RUN /usr/bin/python3 -m pip install thrift>=0.12.0 | ||
RUN /usr/bin/python3 -m pip install anytree | ||
RUN /usr/bin/python3 -m pip install ujsonpath | ||
RUN /usr/bin/python3 -m pip install requests | ||
RUN /usr/bin/python3 -m pip install retry | ||
# remove warnings from anytree package | ||
RUN /usr/bin/python3 -m pip install fastcache | ||
# Needed for multi-language support (currently just Java) | ||
RUN /usr/bin/python3 -m pip install thriftpy2 | ||
|
||
# Install dlib for CUDA | ||
RUN git clone https://github.com/davisking/dlib.git | ||
RUN mkdir -p /dlib/build | ||
|
||
RUN cmake -H/dlib -B/dlib/build -DDLIB_USE_CUDA=1 -DUSE_AVX_INSTRUCTIONS=1 | ||
RUN cmake --build /dlib/build | ||
|
||
RUN cd /dlib; python3 /dlib/setup.py install | ||
|
||
# Install the face recognition package and tensorflow | ||
RUN pip3 install face_recognition | ||
RUN pip3 install tensorflow==2.1.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure why we need to install all these custom libraries for the GPU usage. If these are needed by the workflows, then they should specify it in the function requirements. |
||
|
||
# Java (for queue service) | ||
RUN apt-get -y --no-install-recommends install openjdk-8-jdk-headless | ||
|
||
# Add components (as mfn) | ||
RUN groupadd -o -g 1000 -r mfn && useradd -d /opt/mfn -u 1000 -m -r -g mfn mfn | ||
RUN mkdir /opt/mfn/logs | ||
|
||
COPY build/queueservice.jar /opt/mfn/ | ||
ADD frontend/frontend /opt/mfn/frontend | ||
ADD build/SandboxAgent.tar.gz /opt/mfn/ | ||
ADD build/FunctionWorker.tar.gz /opt/mfn/ | ||
ADD build/LoggingService.tar.gz /opt/mfn/ | ||
|
||
RUN chown mfn:mfn -R /opt/mfn | ||
USER mfn | ||
WORKDIR /opt/mfn | ||
CMD ["python3", "/opt/mfn/SandboxAgent/sandboxagent.py"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Copyright 2020 The KNIX Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
#FROM ubuntu:18.04 | ||
FROM nvidia/cuda:10.1-cudnn-devel-ubuntu18.04 | ||
|
||
# Install (as root) | ||
# Base | ||
RUN apt-get update --fix-missing | ||
RUN apt-get -y --no-install-recommends install build-essential | ||
RUN apt-get -y --no-install-recommends install netbase unzip file libmagic1 | ||
|
||
# Python | ||
RUN apt-get -y --no-install-recommends install python3 python3-dev | ||
RUN apt-get -y --no-install-recommends install python3-pip | ||
RUN apt-get -y --no-install-recommends install zlib1g libssl1.0 libsasl2-2 ca-certificates | ||
|
||
RUN /usr/bin/python3 -m pip install --upgrade pip | ||
|
||
RUN /usr/bin/python3 -m pip install setuptools | ||
RUN /usr/bin/python3 -m pip install thrift>=0.12.0 | ||
RUN /usr/bin/python3 -m pip install anytree | ||
RUN /usr/bin/python3 -m pip install ujsonpath | ||
RUN /usr/bin/python3 -m pip install requests | ||
RUN /usr/bin/python3 -m pip install retry | ||
# remove warnings from anytree package | ||
RUN /usr/bin/python3 -m pip install fastcache | ||
# Needed for multi-language support (currently just Java) | ||
RUN /usr/bin/python3 -m pip install thriftpy2 | ||
|
||
# Java | ||
RUN apt-get -y --no-install-recommends install openjdk-8-jdk-headless | ||
|
||
RUN apt-get -y --no-install-recommends install maven | ||
|
||
# Add components (as mfn) | ||
RUN groupadd -o -g 1000 -r mfn && useradd -d /opt/mfn -u 1000 -m -r -g mfn mfn | ||
RUN mkdir /opt/mfn/logs | ||
|
||
COPY build/queueservice.jar /opt/mfn/ | ||
ADD frontend/frontend /opt/mfn/frontend | ||
ADD build/SandboxAgent.tar.gz /opt/mfn/ | ||
ADD build/FunctionWorker.tar.gz /opt/mfn/ | ||
ADD build/LoggingService.tar.gz /opt/mfn/ | ||
|
||
ADD build/JavaRequestHandler.tar.gz /opt/mfn/ | ||
|
||
RUN chmod +x /opt/mfn/JavaRequestHandler/setup_maven.sh | ||
RUN /opt/mfn/JavaRequestHandler/./setup_maven.sh True | ||
RUN mvn -Duser.home=/tmp -DskipTests -gs /opt/mfn/JavaRequestHandler/maven/sandbox-mvn-settings.xml -f /opt/mfn/JavaRequestHandler/maven/init-mvn.pom.xml dependency:resolve-plugins | ||
|
||
RUN chown mfn:mfn -R /opt/mfn | ||
USER mfn | ||
WORKDIR /opt/mfn | ||
CMD ["python3", "/opt/mfn/SandboxAgent/sandboxagent.py"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ include ../build_env.mk | |
|
||
default: build_thrift \ | ||
image \ | ||
image_gpu \ | ||
image_java | ||
|
||
clean: | ||
|
@@ -95,6 +96,16 @@ image: \ | |
build/SandboxAgent.tar.gz | ||
$(call build_image,Dockerfile,microfn/sandbox) | ||
|
||
image_gpu: \ | ||
Dockerfile_gpu \ | ||
build/queueservice.jar \ | ||
frontend/frontend \ | ||
build/LoggingService.tar.gz \ | ||
build/FunctionWorker.tar.gz \ | ||
build/SandboxAgent.tar.gz | ||
$(call build_image,Dockerfile_gpu,microfn/sandbox_gpu) | ||
|
||
|
||
image_java: \ | ||
Dockerfile_java \ | ||
build/queueservice.jar \ | ||
|
@@ -107,6 +118,7 @@ image_java: \ | |
|
||
push: image image_java | ||
$(call push_image,microfn/sandbox) | ||
$(call push_image,microfn/sandbox_gpu) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. microfn/sandbox_java_gpu? Need to also update the dependencies for the Makefile target. |
||
$(call push_image,microfn/sandbox_java) | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we had the "microfn/sandbox_java_gpu" image?