Skip to content

Commit 64a9547

Browse files
committed
adjustment according to asplos-ae suggestions
1 parent 0c86f84 commit 64a9547

File tree

51 files changed

+111
-129
lines changed

Some content is hidden

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

51 files changed

+111
-129
lines changed

README.md

+11-5
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@ FaaSFlow is a serverless workflow engine that enables efficient workflow executi
1010

1111
2. Please save the private IP address of the storage node as the **<master_ip>**, and save the private IP address of the other 7 worker nodes as the **<worker_ip>**.
1212

13+
## About Config Setting
14+
15+
There are 2 places for config setting. `src/container/container_config.py` specifies CouchDB and Redis's address, you need to fill in correct ip so that application code can directly connect to database inside container environment. All other configurations are in `config/config.py`.
16+
1317
## Installation and Software Dependencies
1418

1519
Clone our code `https://github.com/lzjzx1122/FaaSFlow.git` and:
1620

1721
1. Reset `worker_address` configuration with your <worker_ip>:8000 on `src/grouping/node_info.yaml`. It will specify your workers' addresses. The `scale_limit: 120` represents the maximum container numbers that can be deployed in each 32GB memory instance, and it does not need any change by default.
1822

19-
2. Reset `COUCHDB_URL` as `http://openwhisk:openwhisk@<master_ip>:5984/` in `src/container/config.py`, `src/workflow_manager/config.py`, `test/asplos/config.py`. It will specify the corresponding database storage you built previously.
23+
2. Reset `COUCHDB_URL` as `http://openwhisk:openwhisk@<master_ip>:5984/` in `config/config.py`, `src/container/container_config.py`. It will specify the corresponding database storage you built previously.
2024

2125
3. Then, clone the modified code into each node (8 nodes total).
2226

@@ -30,11 +34,13 @@ Clone our code `https://github.com/lzjzx1122/FaaSFlow.git` and:
3034

3135
## WorkerSP Start-up
3236

33-
The following operations help to run scripts under WorkerSP. Firstly, enter `src/workflow_manager`, change the configuration by `DATA_MODE = optimized` and `CONTROL_MODE = WorkerSP` in both 7 worker nodes and storage node. Then, start the engine proxy with the local <worker_ip> on each worker node by the following <span id="jump">command</span>:
37+
The following operations help to run scripts under WorkerSP.
38+
39+
Firstly, change the configuration by `DATA_MODE = optimized` and `CONTROL_MODE = WorkerSP` in both 7 worker nodes and storage node. Define the `GATEWAY_ADDR` as `<master_ip>:7000`. Then, enter `src/workflow_manager` and start the engine proxy with the local <worker_ip> on each worker node by the following <span id="jump">command</span>:
3440
```
3541
python3 proxy.py <worker_ip> 8000 (proxy start)
3642
```
37-
Enter `test/asplos/config.py` and define the `GATEWAY_ADDR` as `<master_ip>:7000`. Then start the gateway on the storage node by the following command:
43+
Then start the gateway on the storage node by the following command:
3844
```
3945
python3 gateway.py <master_ip> 7000 (gateway start)
4046
```
@@ -44,9 +50,9 @@ If you would like to run scripts under WorkerSP, you have finished all the opera
4450

4551
## MasterSP Start-up
4652

47-
The following operations help to run scripts under MasterSP. Firstly, enter `src/workflow_manager`, change the configuration by `DATA_MODE = raw` and `CONTROL_MODE = MasterSP` in both 7 worker nodes and storage node. Then, restart the engine proxy on each worker node by the [proxy start](#jump) command, and restart the gateway on the storage node by the [gateway start](#jump) command.
53+
The following operations help to run scripts under MasterSP. Firstly, change the configuration by `DATA_MODE = raw` and `CONTROL_MODE = MasterSP` in both 7 worker nodes and storage node. Then, restart the engine proxy on each worker node by the [proxy start](#jump) command, and restart the gateway on the storage node by the [gateway start](#jump) command.
4854

49-
Enter `src/workflow_manager/config.py`, and define the `MASTER_HOST` as `<master_ip>:8000`. Then,
55+
Define the `MASTER_HOST` as `<master_ip>:8000`. Then,
5056
start another proxy on the storage node as the virtual master node by the following command:
5157
```
5258
python3 proxy.py <master_ip> 8000
+3-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import nltk
22
from nltk.sentiment import SentimentIntensityAnalyzer
3-
import time
4-
# nltk.download('vader_lexicon')
3+
nltk.download('vader_lexicon')
54

65
def main():
76
content = store.fetch(['file'])['file']
87
sia = SentimentIntensityAnalyzer()
9-
score = sia.polarity_scores(content) # can't handle large dataset
10-
# time.sleep(7)
8+
score = sia.polarity_scores(content)
9+
# time.sleep(7) # if can't handle large dataset, please uncomment this to simulate sentiment processing
1110
store.put({'score': 0}, {})

benchmark/generator/translator.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import json
2-
import yaml
3-
import sys
42
import os
5-
import random
63

74
def translator(workflow_name: str):
85
## parse json build flat_workflow.yaml

benchmark/illgal_recognizer/extract/Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
FROM workflow_base
22

3-
RUN sed -i 's/deb.debian.org/mirrors.cloud.aliyuncs.com/g' /etc/apt/sources.list
43
RUN apt-get clean
54
RUN apt-get update
65
RUN apt-get install -y tesseract-ocr libgl1-mesa-glx

benchmark/illgal_recognizer/mosaic/Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
FROM workflow_base
22

3-
RUN sed -i 's/deb.debian.org/mirrors.cloud.aliyuncs.com/g' /etc/apt/sources.list
43
RUN apt-get clean
54
RUN apt-get update
65
RUN apt-get install -y tesseract-ocr libgl1-mesa-glx

benchmark/video/merge/Dockerfile

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
FROM workflow_base
22

3-
RUN sed -i 's/deb.debian.org/mirrors.cloud.aliyuncs.com/g' /etc/apt/sources.list
4-
RUN sed -i 's/security.debian.org/mirrors.cloud.aliyuncs.com/g' /etc/apt/sources.list
53
RUN apt-get clean
6-
74
RUN apt-get update
85
RUN apt-get -y --force-yes --fix-missing install yasm ffmpeg
96

benchmark/video/simple_process/Dockerfile

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
FROM workflow_base
22

3-
RUN sed -i 's/deb.debian.org/mirrors.cloud.aliyuncs.com/g' /etc/apt/sources.list
4-
RUN sed -i 's/security.debian.org/mirrors.cloud.aliyuncs.com/g' /etc/apt/sources.list
53
RUN apt-get clean
6-
74
RUN apt-get update
85
RUN apt-get -y --force-yes install yasm ffmpeg
96

benchmark/video/split/Dockerfile

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
FROM workflow_base
22

3-
RUN sed -i 's/deb.debian.org/mirrors.cloud.aliyuncs.com/g' /etc/apt/sources.list
4-
RUN sed -i 's/security.debian.org/mirrors.cloud.aliyuncs.com/g' /etc/apt/sources.list
53
RUN apt-get clean
6-
74
RUN apt-get update
85
RUN apt-get -y --force-yes install yasm ffmpeg
96

benchmark/video/transcode/Dockerfile

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
FROM workflow_base
22

3-
RUN sed -i 's/deb.debian.org/mirrors.cloud.aliyuncs.com/g' /etc/apt/sources.list
4-
RUN sed -i 's/security.debian.org/mirrors.cloud.aliyuncs.com/g' /etc/apt/sources.list
53
RUN apt-get clean
6-
74
RUN apt-get update
85
RUN apt-get -y --force-yes install yasm ffmpeg
96

benchmark/video/upload/Dockerfile

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
FROM workflow_base
22

3-
RUN sed -i 's/deb.debian.org/mirrors.cloud.aliyuncs.com/g' /etc/apt/sources.list
4-
RUN sed -i 's/security.debian.org/mirrors.cloud.aliyuncs.com/g' /etc/apt/sources.list
53
RUN apt-get clean
6-
74
RUN apt-get update
85
RUN apt-get -y --force-yes install yasm ffmpeg
96

config/config.py

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
COUCHDB_URL = 'http://openwhisk:[email protected]:5984/'
2+
REDIS_HOST = '10.2.64.8'
3+
REDIS_PORT = 6380
4+
REDIS_DB = 0
5+
GATEWAY_ADDR = '10.2.64.8:7000'
6+
MASTER_HOST = '10.2.64.8:8000'
7+
WORKFLOW_YAML_ADDR = {'fileprocessing': '/home/openwhisk/Workflow/benchmark/fileprocessing/flat_workflow.yaml',
8+
'illgal_recognizer': '/home/openwhisk/Workflow/benchmark/illgal_recognizer/flat_workflow.yaml',
9+
'video': '/home/openwhisk/Workflow/benchmark/video/flat_workflow.yaml',
10+
'wordcount': '/home/openwhisk/Workflow/benchmark/wordcount/flat_workflow.yaml',
11+
'cycles': '/home/openwhisk/Workflow/benchmark/generator/cycles/flat_workflow.yaml',
12+
'epigenomics': '/home/openwhisk/Workflow/benchmark/generator/epigenomics/flat_workflow.yaml',
13+
'genome': '/home/openwhisk/Workflow/benchmark/generator/genome/flat_workflow.yaml',
14+
'soykb': '/home/openwhisk/Workflow/benchmark/generator/soykb/flat_workflow.yaml'}
15+
NETWORK_BANDWIDTH = 25 * 1024 * 1024 / 4 # 25MB/s / 4
16+
NET_MEM_BANDWIDTH_RATIO = 15 # mem_time = net_time / 15
17+
CONTAINER_MEM = 256 * 1024 * 1024 # 256MB
18+
NODE_MEM = 256 * 1024 * 1024 * 1024 # 256G
19+
RESERVED_MEM_PERCENTAGE = 0.2
20+
GROUP_LIMIT = 100
21+
RPMs = {'genome-25': [2, 4, 6, 8], 'genome-50': [2, 4, 6, 8, 10], 'genome-75': [2, 4, 6, 8, 10], 'genome-100': [2, 4, 6, 8, 10],
22+
'video-25': [4, 8, 16, 24], 'video-50': [8, 16, 24, 32, 40], 'video-75': [8, 16, 24, 32, 40], 'video-100': [8, 16, 24, 32, 40]}
23+
FUNCTION_INFO_ADDRS = {'genome': '../../benchmark/generator/genome', 'epigenomics': '../../benchmark/generator/epigenomics',
24+
'soykb': '../../benchmark/generator/soykb', 'cycles': '../../benchmark/generator/cycles',
25+
'fileprocessing': '../../benchmark/fileprocessing', 'wordcount': '../../benchmark/wordcount',
26+
'illgal_recognizer': '../../benchmark/illgal_recognizer', 'video': '../../benchmark/video'}
27+
DATA_MODE = 'raw' # raw, optimized
28+
CONTROL_MODE = 'WorkerSP' # WorkerSP, MasterSP
29+
CLEAR_DB_AND_MEM = True

scripts/requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ couchdb
44
docker
55
flask
66
psutil
7-
pandas
7+
pandas
8+
PyYAML

src/container/Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RUN mkdir /proxy
1212
COPY proxy.py /proxy/proxy.py
1313
COPY main.py /proxy/main.py
1414
COPY Store.py /proxy/Store.py
15-
COPY config.py /proxy/config.py
15+
COPY container_config.py /proxy/container_config.py
1616

1717
WORKDIR /proxy
1818

@@ -25,7 +25,6 @@ EXPOSE 5000
2525
# pip install --no-cache-dir gevent flask && \
2626
# apk del .build-deps
2727

28-
RUN sed -i 's/deb.debian.org/mirrors.cloud.aliyuncs.com/g' /etc/apt/sources.list
2928
RUN apt-get clean
3029
RUN apt-get update
3130
RUN pip3 install --no-cache-dir gevent flask couchdb redis

src/container/config.py

-4
This file was deleted.

src/container/container_config.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
COUCHDB_URL = 'http://openwhisk:[email protected]:5984/'
2+
REDIS_HOST = '172.17.0.1'
3+
REDIS_PORT = 6380
4+
REDIS_DB = 0

src/container/proxy.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
from flask import Flask, request
55
from gevent.pywsgi import WSGIServer
66
from Store import Store
7-
import config
7+
import container_config
88
import redis
99

1010
default_file = 'main.py'
1111
work_dir = '/proxy'
12-
couchdb_url = config.COUCHDB_URL
12+
couchdb_url = container_config.COUCHDB_URL
1313
db_server = couchdb.Server(couchdb_url)
14-
redis_server = redis.StrictRedis(host=config.REDIS_HOST, port=config.REDIS_PORT, db=config.REDIS_DB)
14+
redis_server = redis.StrictRedis(host=container_config.REDIS_HOST, port=container_config.REDIS_PORT, db=container_config.REDIS_DB)
1515
latency_db = db_server['workflow_latency']
1616

1717
class Runner:

src/grouping/config.py

-18
This file was deleted.

src/grouping/grouping.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import sys
2-
from typing import Dict, List
32
import parse_yaml
43
import queue
5-
import json
64
import component
75
import repository
8-
import config
9-
import time
106
import yaml
11-
import uuid
7+
8+
sys.path.append('../../config')
9+
import config
1210

1311
mem_usage = 0
1412
max_mem_usage = 0

src/grouping/node_info.yaml

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
nodes:
2-
- worker_address: 172.20.185.151:8000
3-
scale_limit: 120
4-
- worker_address: 172.20.185.152:8000
5-
scale_limit: 120
6-
- worker_address: 172.20.185.153:8000
7-
scale_limit: 120
8-
- worker_address: 172.20.185.154:8000
9-
scale_limit: 120
10-
- worker_address: 172.20.185.155:8000
11-
scale_limit: 120
12-
- worker_address: 172.20.185.156:8000
13-
scale_limit: 120
14-
- worker_address: 172.20.185.157:8000
15-
scale_limit: 120
2+
- worker_address: 10.2.64.8:8000
3+
scale_limit: 120
4+
# - worker_address: 172.20.185.152:8000
5+
# scale_limit: 120
6+
# - worker_address: 172.20.185.153:8000
7+
# scale_limit: 120
8+
# - worker_address: 172.20.185.154:8000
9+
# scale_limit: 120
10+
# - worker_address: 172.20.185.155:8000
11+
# scale_limit: 120
12+
# - worker_address: 172.20.185.156:8000
13+
# scale_limit: 120
14+
# - worker_address: 172.20.185.157:8000
15+
# scale_limit: 120

src/grouping/parse_yaml.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import yaml
22
import component
3+
import sys
4+
5+
sys.path.append('../../config')
36
import config
47

58
yaml_file_addr = config.WORKFLOW_YAML_ADDR

src/grouping/repository.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
from os import remove
21
import couchdb
32
import redis
43
from typing import Dict, List
4+
import sys
5+
6+
sys.path.append('../../config')
57
import config
68

79
couchdb_url = config.COUCHDB_URL

src/workflow_manager/config.py

-12
This file was deleted.

src/workflow_manager/gateway.py

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
from repository import Repository
88
import requests
99
import time
10+
11+
sys.path.append('../../config')
1012
import config
1113

1214
app = Flask(__name__)

src/workflow_manager/proxy.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@
44
import gevent
55
import json
66
from typing import Dict
7-
from threading import Thread
7+
import sys
8+
sys.path.append('../../config')
89
import config
910
from workersp import WorkerSPManager
1011
from mastersp import MasterSPManager
1112
import docker
12-
import subprocess
13-
14-
import sys
1513
from flask import Flask, request
1614
app = Flask(__name__)
1715
docker_client = docker.from_env()

src/workflow_manager/repository.py

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
import couchdb
33
import redis
44
import json
5+
import sys
6+
7+
sys.path.append('../../config')
58
import config
69

710
couchdb_url = config.COUCHDB_URL

test/asplos/all_tail_latency/run.py

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import getopt
66
import sys
77
sys.path.append('..')
8+
sys.path.append('../../../config')
89
from repository import Repository
910
import config
1011
import pandas as pd

test/asplos/config.py

-13
This file was deleted.

test/asplos/data_overhead/run.py

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import getopt
66
import sys
77
sys.path.append('..')
8+
sys.path.append('../../../config')
89
from repository import Repository
910
import config
1011
import pandas as pd

test/asplos/e2e_latency_and_colocation/run.py

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import getopt
66
import sys
77
sys.path.append('..')
8+
sys.path.append('../../../config')
89
from repository import Repository
910
import config
1011
import pandas as pd

0 commit comments

Comments
 (0)