Skip to content

Commit e251bf2

Browse files
committed
removing bug on java function executions
1 parent 4508ea6 commit e251bf2

File tree

4 files changed

+75
-5
lines changed

4 files changed

+75
-5
lines changed

ManagementService/python/deployWorkflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def create_k8s_deployment(email, workflow_info, runtime, gpu_usage, management=F
314314
# apply gpu_usage fraction to k8s deployment configuration
315315
use_gpus = gpu_usage
316316

317-
if not management and use_gpus >= 0:
317+
if not management and use_gpus >= 0 and runtime=="Python":
318318
# overwrite values from values.yaml for new workflows
319319
kservice['spec']['template']['spec']['containers'][0]['resources']['limits']['nvidia.com/gpu'] = str(use_gpus)
320320
kservice['spec']['template']['spec']['containers'][0]['resources']['requests']['nvidia.com/gpu'] = str(use_gpus)

Sandbox/Dockerfile_java_gpu

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Copyright 2020 The KNIX Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
#FROM ubuntu:18.04
16+
FROM nvidia/cuda:10.1-cudnn-devel-ubuntu18.04
17+
18+
# Install (as root)
19+
# Base
20+
RUN apt-get update --fix-missing
21+
RUN apt-get -y --no-install-recommends install build-essential
22+
RUN apt-get -y --no-install-recommends install netbase unzip file libmagic1
23+
24+
# Python
25+
RUN apt-get -y --no-install-recommends install python3 python3-dev
26+
RUN apt-get -y --no-install-recommends install python3-pip
27+
RUN apt-get -y --no-install-recommends install zlib1g libssl1.0 libsasl2-2 ca-certificates
28+
29+
RUN /usr/bin/python3 -m pip install --upgrade pip
30+
31+
RUN /usr/bin/python3 -m pip install setuptools
32+
RUN /usr/bin/python3 -m pip install thrift>=0.12.0
33+
RUN /usr/bin/python3 -m pip install anytree
34+
RUN /usr/bin/python3 -m pip install ujsonpath
35+
RUN /usr/bin/python3 -m pip install requests
36+
RUN /usr/bin/python3 -m pip install retry
37+
# remove warnings from anytree package
38+
RUN /usr/bin/python3 -m pip install fastcache
39+
# Needed for multi-language support (currently just Java)
40+
RUN /usr/bin/python3 -m pip install thriftpy2
41+
42+
# Java
43+
RUN apt-get -y --no-install-recommends install openjdk-8-jdk-headless
44+
45+
RUN apt-get -y --no-install-recommends install maven
46+
47+
# Add components (as mfn)
48+
RUN groupadd -o -g 1000 -r mfn && useradd -d /opt/mfn -u 1000 -m -r -g mfn mfn
49+
RUN mkdir /opt/mfn/logs
50+
51+
COPY build/queueservice.jar /opt/mfn/
52+
ADD frontend/frontend /opt/mfn/frontend
53+
ADD build/SandboxAgent.tar.gz /opt/mfn/
54+
ADD build/FunctionWorker.tar.gz /opt/mfn/
55+
ADD build/LoggingService.tar.gz /opt/mfn/
56+
57+
ADD build/JavaRequestHandler.tar.gz /opt/mfn/
58+
59+
RUN chmod +x /opt/mfn/JavaRequestHandler/setup_maven.sh
60+
RUN /opt/mfn/JavaRequestHandler/./setup_maven.sh True
61+
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
62+
63+
RUN chown mfn:mfn -R /opt/mfn
64+
USER mfn
65+
WORKDIR /opt/mfn
66+
CMD ["python3", "/opt/mfn/SandboxAgent/sandboxagent.py"]

deploy/helm/microfunctions/templates/management.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@ data:
125125
{{- /* Disable scale to zero with a minScale of 1. */ -}}
126126
"autoscaling.knative.dev/minScale": "1",
127127
{{- /* Limit scaling to 100 pods. */ -}}
128-
"autoscaling.knative.dev/maxScale": "5"
128+
"autoscaling.knative.dev/maxScale": "5",
129+
{{- /* KubeShare GPU-related configurations */ -}}
130+
"kubeshare/gpu_request": "0.4",
131+
"kubeshare/gpu_limit": "1.0",
132+
"kubeshare/gpu_mem": "3145728000"
129133
},
130134
"labels": {
131135
"app": "microfunctions-workflow",

mfn_sdk/mfn_sdk/workflow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ def modified(self):
102102

103103
@property
104104
def status(self):
105-
data = self.client.action('getWorkflows',{'workflow':{'id':self.id}})
106-
self._status = data['workflow']['status']
107-
#self._status == "undeployed"
105+
#data = self.client.action('getWorkflows',{'workflow':{'id':self.id}})
106+
#self._status = data['workflow']['status']
107+
self._status == "undeployed"
108108
if self._status == "deployed":
109109
self._endpoints = data['workflow']['endpoints']
110110
else:

0 commit comments

Comments
 (0)