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

Commit fc0753a

Browse files
manju956rranjan3
authored andcommitted
Move graphene python worker to trusted module
- the core of graphene python worker module, docker files from existing $TCF_HOME/example/graphene_apps/python_worker to trusted module i.e, $TCF_HOME/tc/graphene/python_worker - renamed $TCF_HOME/example/graphene_apps/python_worker to $TCF_HOME/example/graphene_apps/python_workloads - modified docker files to build restrustured python worker modules - moved ov_workload python module to $TCFHOME/example/graphene_apps/cppopenvino Signed-off-by: manju956 <[email protected]>
1 parent fe9faea commit fc0753a

File tree

67 files changed

+538
-73
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+538
-73
lines changed

config/graphene_config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ sleep_interval = "2"
4141
# Port for socket interaction with listener
4242
zmq_port = '5555'
4343
# Graphene worker url. Graphene worker uses ZMQ for communication
44-
graphene_zmq_url = "tcp://graphene-python-worker:7777"
44+
graphene_zmq_url = "tcp://graphene-python-workload:7777"
4545

4646
# -------------------------------------------------------
4747
# EnclaveModule -- configuration of the Intel SGX Enclave

docker/compose/avalon-graphene.yaml renamed to docker/compose/avalon-fib-graphene.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ services:
2525
# ZMQ socket port to communicate with graphene python worker
2626
- 7777
2727
depends_on:
28-
- graphene-python-worker
28+
- graphene-python-workload
2929

30-
graphene-python-worker:
31-
container_name: graphene-python-worker
32-
image: avalon-python-worker-dev
30+
graphene-python-workload:
31+
container_name: graphene-python-workload
32+
image: avalon-fibonacci-workload-dev
3333
environment:
3434
- http_proxy
3535
- https_proxy
@@ -40,6 +40,5 @@ services:
4040
# Need to pass full path of file to python interpreter.
4141
# Pass ZMQ URL to listen for requests. Bind to all available interfaces.
4242
# Pass JSON file which has the workload module details.
43-
command: /usr/local/bin/wo-processor --bind "tcp://*:7777" --workload "workloads.json"
43+
command: /usr/local/bin/wo-processor --bind "tcp://*:7777" --workload "fib_workload.json"
4444
stop_signal: SIGKILL
45-

examples/graphene_apps/python_worker/compose/ov-sgx.yaml renamed to docker/compose/avalon-fib-gsgx.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
version: '3.5'
1616

1717
services:
18-
ov-work-order:
19-
image: gsc-openvinowl
18+
graphene-python-workload:
19+
image: gsc-avalon-fibonacci-workload-dev
2020
devices:
2121
- "/dev/gsgx:/dev/gsgx"
2222
- "/dev/isgx:/dev/isgx"

examples/graphene_apps/python_worker/compose/ov.yaml renamed to docker/compose/avalon-ov-graphene.yaml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@
1515
version: '3.5'
1616

1717
services:
18-
test-send-work-order:
19-
command: |
20-
bash -c "
21-
python ./tests/test_send_work_order.py ./tests/test_ov_work_orders.json
22-
"
18+
avalon-enclave-manager:
19+
image: avalon-enclave-manager-graphene-dev
20+
build:
21+
dockerfile: ./enclave_manager/Dockerfile-graphene
22+
args:
23+
- ENCLAVE_TYPE=graphene
24+
expose:
25+
# ZMQ socket port to communicate with graphene python worker
26+
- 7777
2327
depends_on:
24-
- ov-work-order
28+
- graphene-python-workload
2529

2630
ov-work-order:
2731
container_name: ov-work-order
@@ -38,3 +42,18 @@ services:
3842
command: openvinowl
3943
stop_signal: SIGKILL
4044

45+
graphene-python-workload:
46+
container_name: graphene-python-workload
47+
image: avalon-ov-python-worker-dev
48+
environment:
49+
- http_proxy
50+
- https_proxy
51+
- no_proxy
52+
expose:
53+
# ZMQ socket port used to communicate with graphene python worker.
54+
- 7777
55+
# Need to pass full path of file to python interpreter.
56+
# Pass ZMQ URL to listen for requests. Bind to all available interfaces.
57+
# Pass JSON file which has the workload module details.
58+
command: /usr/local/bin/wo-processor --bind "tcp://*:7777" --workload "ov_workload.json"
59+
stop_signal: SIGKILL

docker/compose/avalon-graphene-ov.yaml renamed to docker/compose/avalon-ov-gsgx.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ version: '3.5'
1616

1717
services:
1818
ov-work-order:
19-
container_name: ov-work-order
20-
image: openvinowl
21-
environment:
22-
- http_proxy
23-
- https_proxy
24-
- no_proxy
25-
expose:
26-
- 8888
19+
image: gsc-openvinowl
20+
devices:
21+
- "/dev/gsgx:/dev/gsgx"
22+
- "/dev/isgx:/dev/isgx"
2723
volumes:
28-
# Output images directory for openvino object detection.
29-
- ./output:/home/openvino/output
30-
command: openvinowl
31-
stop_signal: SIGKILL
24+
- /var/run/aesmd/aesm.socket:/var/run/aesmd/aesm.socket
3225

26+
graphene-python-workload:
27+
image: gsc-avalon-ov-python-worker-dev
28+
devices:
29+
- "/dev/gsgx:/dev/gsgx"
30+
- "/dev/isgx:/dev/isgx"
31+
volumes:
32+
- /var/run/aesmd/aesm.socket:/var/run/aesmd/aesm.socket

docker/compose/avalon-ov-subnet.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ services:
4040
networks:
4141
- awov
4242

43-
graphene-python-worker:
43+
graphene-python-workload:
4444
networks:
4545
- awov
4646

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright 2020 Intel Corporation
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 avalon-python-worker-dev
16+
17+
COPY ./ov_workload /home/openvino/ov_workload
18+
COPY ./test/python_worker/test_ov_work_orders.json /home/openvino/ov_workload
19+
COPY ./test/python_worker/ov_workload.json /home/openvino/ov_workload
20+
21+
WORKDIR /home/openvino/ov_workload
22+
23+
RUN python3 setup.py build_ext \
24+
&& python3 setup.py bdist_wheel \
25+
&& pip3 install dist/*
26+
27+
# Pass python file as docker command line argument
28+
# This is required for Graphene.
29+
CMD ["python"]
30+

examples/graphene_apps/python_worker/compose/ov-subnet.yaml renamed to examples/graphene_apps/cppopenvino/compose/ov-subnet.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ services:
2828
networks:
2929
- awip
3030

31-
test-send-work-order:
31+
test-ov-send-work-order:
3232
networks:
3333
- awip
3434

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Copyright 2020 Intel Corporation
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+
version: '3.5'
16+
17+
services:
18+
process-work-order:
19+
container_name: process-work-order
20+
image: avalon-ov-python-worker-dev
21+
build:
22+
context: ../
23+
dockerfile: ./Dockerfile-py-workloads
24+
environment:
25+
- http_proxy
26+
- https_proxy
27+
- no_proxy
28+
expose:
29+
- 7777
30+
# Need to pass full path of file to python interpreter
31+
# Pass ZMQ URL to listen for requests. Bind to all available interfaces.
32+
# Pass JSON file which has the workload module details.
33+
command: /usr/local/bin/wo-processor --bind "tcp://*:7777" --workload "ov_workload.json"
34+
stop_signal: SIGKILL
35+
36+
37+
test-ov-send-work-order:
38+
container_name: test-ov-send-work-order
39+
image: avalon-ov-python-worker-dev
40+
environment:
41+
- http_proxy
42+
- https_proxy
43+
- no_proxy
44+
expose:
45+
- 7777
46+
command: |
47+
bash -c "
48+
python /home/python_worker/tests/test_send_work_order.py test_ov_work_orders.json"
49+
stop_signal: SIGKILL
50+
depends_on:
51+
- process-work-order
52+
53+

docker/compose/avalon-graphene-ov-sgx.yaml renamed to examples/graphene_apps/cppopenvino/compose/python-worker-gsgx.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
version: '3.5'
1616

1717
services:
18-
ov-work-order:
19-
image: gsc-openvinowl
18+
process-work-order:
19+
image: gsc-avalon-ov-python-worker-dev
2020
devices:
2121
- "/dev/gsgx:/dev/gsgx"
2222
- "/dev/isgx:/dev/isgx"

0 commit comments

Comments
 (0)