Skip to content

Commit e4b2d09

Browse files
committed
Merge branch 'master' of https://github.com/DSC-SPIDAL/twister2
2 parents 3fa7c50 + 081ae35 commit e4b2d09

File tree

21 files changed

+563
-244
lines changed

21 files changed

+563
-244
lines changed

docker/standalone/Dockerfile

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ FROM ubuntu:18.04
33

44
# install dependencies
55
RUN apt-get update && apt-get install -y --no-install-recommends openjdk-8-jdk sudo \
6-
python-dev python-pip g++ git build-essential \
7-
automake cmake libtool-bin zip libunwind-setjmp0-dev \
8-
zlib1g-dev unzip pkg-config python-setuptools \
9-
maven wget ssh && \
10-
rm -rf /var/lib/apt/lists/* && apt autoclean && apt-get clean && apt autoremove
6+
python3-dev python3-pip g++ git build-essential \
7+
automake cmake libtool-bin zip libunwind-setjmp0-dev \
8+
zlib1g-dev unzip pkg-config python3-setuptools \
9+
maven wget ssh \
10+
&& cd /usr/local/bin \
11+
&& ln -s /usr/bin/python3 python \
12+
&& pip3 install --upgrade pip \
13+
&& sudo pip3 install wheel \
14+
&& rm -rf /var/lib/apt/lists/* && apt autoclean && apt-get clean && apt autoremove
1115

1216

1317
# add user
@@ -20,32 +24,35 @@ WORKDIR /home/twister2
2024

2125
#install openmpi
2226
RUN cd && \
23-
wget https://www.open-mpi.org/software/ompi/v3.1/downloads/openmpi-3.1.2.tar.gz && \
24-
tar -zxvf openmpi-3.1.2.tar.gz && \
25-
OMPI_BUILD=~/openmpi && \
26-
OMPI_312=~/openmpi-3.1.2 && \
27-
PATH=${OMPI_BUILD}/bin:${PATH} && \
28-
LD_LIBRARY_PATH=${OMPI_BUILD}/lib:${LD_LIBRARY_PATH} && \
29-
cd $OMPI_312 && \
30-
./configure --prefix=$OMPI_BUILD --enable-mpi-java --enable-mpirun-prefix-by-default --enable-orterun-prefix-by-default && make;make install && \
31-
echo "export OMPI_BUILD=$OMPI_BUILD" >> ~/.bashrc && \
32-
echo "export PATH=\${OMPI_BUILD}/bin:\${PATH}" >> ~/.bashrc && \
33-
echo "export LD_LIBRARY_PATH=\${OMPI_BUILD}/lib:\${LD_LIBRARY_PATH}" >> ~/.bashrc && \
34-
rm -rf ~/openmpi-3.1.2.tar.gz $OMPI_312
27+
wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.1.tar.gz && \
28+
tar -zxvf openmpi-4.0.1.tar.gz && \
29+
OMPI_BUILD=~/openmpi && \
30+
OMPI_401=~/openmpi-4.0.1 && \
31+
PATH=${OMPI_BUILD}/bin:${PATH} && \
32+
LD_LIBRARY_PATH=${OMPI_BUILD}/lib:${LD_LIBRARY_PATH} && \
33+
cd $OMPI_401 && \
34+
./configure --prefix=$OMPI_BUILD --enable-mpi-java --enable-mpirun-prefix-by-default --enable-orterun-prefix-by-default && make;make install && \
35+
echo "export OMPI_BUILD=$OMPI_BUILD" >> ~/.bashrc && \
36+
echo "export PATH=\${OMPI_BUILD}/bin:\${PATH}" >> ~/.bashrc && \
37+
echo "export LD_LIBRARY_PATH=\${OMPI_BUILD}/lib:\${LD_LIBRARY_PATH}" >> ~/.bashrc && \
38+
rm -rf ~/openmpi-4.0.1.tar.gz $OMPI_401
3539

3640

3741
#install bazel
38-
RUN wget https://github.com/bazelbuild/bazel/releases/download/0.18.1/bazel-0.18.1-installer-linux-x86_64.sh && \
39-
chmod +x bazel-0.18.1-installer-linux-x86_64.sh && \
40-
./bazel-0.18.1-installer-linux-x86_64.sh --user && \
41-
echo "export PATH=~/.bazel/bin:\$PATH" >> ~/.bashrc && \
42-
rm bazel-0.18.1-installer-linux-x86_64.sh
42+
RUN wget https://github.com/bazelbuild/bazel/releases/download/0.28.1/bazel-0.28.1-installer-linux-x86_64.sh && \
43+
chmod +x bazel-0.28.1-installer-linux-x86_64.sh && \
44+
./bazel-0.28.1-installer-linux-x86_64.sh --user && \
45+
echo "export PATH=~/.bazel/bin:\$PATH" >> ~/.bashrc && \
46+
rm bazel-0.28.1-installer-linux-x86_64.sh
47+
4348

4449

4550
# clone & build twister2
4651
RUN git clone https://github.com/DSC-SPIDAL/twister2.git && \
47-
cd twister2 && ~/.bazel/bin/bazel build --config=ubuntu scripts/package:tarpkgs && cd && \
48-
tar -xzvf twister2/bazel-bin/scripts/package/twister2-0.3.0.tar.gz && \
49-
echo "export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64" >> ~/.bashrc && \
50-
sed -i '/twister2.resource.scheduler.mpi.mpirun.file/c\twister2.resource.scheduler.mpi.mpirun.file: "mpirun"' /home/twister2/twister2-0.3.0/conf/standalone/resource.yaml && \
51-
rm -rf bin ~/.cache/bazel
52+
cd twister2 && ~/.bazel/bin/bazel build --config=ubuntu scripts/package:tarpkgs && cd && \
53+
tar -xzvf twister2/bazel-bin/scripts/package/twister2-0.3.0.tar.gz && \
54+
echo "export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64" >> ~/.bashrc && \
55+
sed -i '/twister2.resource.scheduler.mpi.mpirun.file/c\twister2.resource.scheduler.mpi.mpirun.file: "mpirun"' /home/twister2/twister2-0.3.0/conf/standalone/resource.yaml && \
56+
rm -rf bin ~/.cache/bazel
57+
58+

docs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# We have moved the documentation to [https://dsc-spidal.github.io/twister2](https://dsc-spidal.github.io/twister2)
1+
# We have moved the documentation to [https://twister2.org](https://twister2.org)
22

33
This documentation is written using mark down files. These markdown files are converted into HTML and deployed on to github pages.
44

@@ -79,4 +79,4 @@ id: img_proc
7979
title: Image Processing
8080
```
8181

82-
Inside website folder there is a file called, sidebars.json. You can modify that file to include the documentation in the sidebar.
82+
Inside website folder there is a file called, sidebars.json. You can modify that file to include the documentation in the sidebar.

docs/docs/concepts/operator-api.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,14 @@ to a single value at the target. How to reduce multiple values to a single value
3636
a user defined function.
3737

3838
```java
39+
LogicalPlanBuilder logicalPlanBuilder = LogicalPlanBuilder.plan(
40+
3, // 3 sources
41+
3, // 3 targets
42+
workerEnv
43+
).withFairDistribution();
44+
3945
// setup the batch operation
40-
BReduce reduce = new BReduce(communicator, logicalPlan, sources, target,
46+
BReduce reduce = new BReduce(communicator, logicalPlanBuilder,
4147
reduceFunction, reduceReceiver, datatype);
4248
// send the data
4349
reduce.reduce(task, data, flag);

docs/docs/concepts/task-system/task-scheduler/batch.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,21 @@ Finally, the algorithm pack the task instance plan and the container plan into t
103103
and return the same.
104104

105105
[Data Locality Batch Task Scheduler Source Code](https://github.com/DSC-SPIDAL/twister2/blob/master/twister2/taskscheduler/src/java/edu/iu/dsc/tws/tsched/batch/datalocalityaware/DataLocalityBatchTaskScheduler.java)
106+
107+
108+
## Batch Task Scheduler
109+
110+
Batch Task Scheduler is capable of scheduling of single task graph as well as multiple graphs which
111+
depends on the input from other task graphs. If the batch task scheduler receives only single task
112+
graph, first it will check whether it has any receptor and collector tasks in the graph. If the receptor
113+
and collector task doesn't match the parallelism it throws the runtime exception to the user to provide
114+
the same parallelism for the dependent tasks in the graph. If the batch task scheduler receives multiple
115+
task graph, first it will store the collectible name set and receivable name set in the appropriate
116+
set values. If the collectible name set (input key) matches with the receivable name set (input key)
117+
it validate the parallelism of the dependent tasks in the task graph, if it doesn't match it will
118+
guide the user to specify the same parallelism. If it matches, it proceeds with the scheduling of the
119+
task graphs to the same workers. For example, if the map task, 0th task has the data in worker 0, it
120+
will schedule the reduce task 0th task to the worker 1. Batch Task Scheduler considers both the locality
121+
of the data and scheduling the tasks in a round robin fashion.
122+
123+
[Batch Task Scheduler Source Code](https://github.com/DSC-SPIDAL/twister2/blob/master/twister2/taskscheduler/src/java/edu/iu/dsc/tws/tsched/batch/batchscheduler/BatchTaskScheduler.java)

docs/docs/concepts/task-system/task-scheduler/task-scheduler.md

Lines changed: 105 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ that consists of two main methods namely initialize and schedule methods to init
2626
configuration and schedule the taskgraph based on the workers information available in the resource plan.
2727

2828
```text
29-
edu.iu.dsc.tws.tsched.spi.taskschedule.ITaskScheduler
29+
edu.iu.dsc.tws.api.compute.schedule.ITaskScheduler
3030
```
3131

3232
has the following methods namely
@@ -71,9 +71,13 @@ container id, task instance plan, required and scheduled resource of the contain
7171
plan holds the jobid or the taskgraph id and the container plan. The task schedule plan list is mainly
7272
responsible for holding the taskschedule of the batch tasks.
7373

74-
\`\`bash message Resource { double availableCPU = 1; double availableMemory = 2; double availableDisk = 3; }
75-
7674
```text
75+
message Resource {
76+
double availableCPU = 1;
77+
double availableMemory = 2;
78+
double availableDisk = 3;
79+
}
80+
7781
message TaskInstancePlan {
7882
int32 taskid = 1;
7983
string taskname = 2;
@@ -99,8 +103,6 @@ message TaskSchedulePlanList {
99103
}
100104
```
101105

102-
\`\`
103-
104106
## YAML file
105107

106108
The task scheduler has task.yaml in the config directory. The task scheduler mode represents either
@@ -109,49 +111,84 @@ memory, disk, and cpu values assigned to the task instances. The default contain
109111
represents the percentage of values to be added to each container. The default container instance
110112
values represents the default size of memory, disk, and cpu of the container. The task parallelism
111113
represents the default parallelism value assigned to each task instance. The task type represents
112-
the streaming or batch task.The task scheduler dynamically loads the respective streaming and batch
114+
the streaming or batch task. The task scheduler dynamically loads the respective streaming and batch
113115
task schedulers based on the configuration values specified in the task.yaml.
114116

115-
\`\`yaml
116-
117117
```text
118-
#Streaming Task Scheduler Mode "roundrobin" or "firstfit" or "datalocalityaware"
119-
twister2.streaming.taskscheduler: "roundrobin"
118+
# Task scheduling mode for the streaming jobs "roundrobin" or "firstfit" or "datalocalityaware" or "userdefined"
119+
twister2.taskscheduler.streaming: "roundrobin"
120120
121-
#Streaming Task Scheduler Class
122-
twister2.streaming.taskscheduler.class: "edu.iu.dsc.tws.tsched.streaming.roundrobin.RoundRobinTaskScheduler"
121+
# Task Scheduler class for the round robin streaming task scheduler
122+
twister2.taskscheduler.streaming.class: "edu.iu.dsc.tws.tsched.streaming.roundrobin.RoundRobinTaskScheduler"
123123
124-
#Batch Task Scheduler Mode "roundrobin" or "datalocalityaware"
125-
twister2.batch.taskscheduler: "roundrobin"
124+
# Task scheduling mode for the batch jobs "roundrobin" or "datalocalityaware" or "userdefined" or "batchscheduler"
125+
twister2.taskscheduler.batch: "roundrobin"
126126
127-
#Batch Task Scheduler Class
128-
twister2.batch.taskscheduler.class: "edu.iu.dsc.tws.tsched.batch.roundrobin.RoundRobinBatchTaskScheduler"
127+
# Task Scheduler class for the round robin batch task scheduler
128+
twister2.taskscheduler.batch.class: "edu.iu.dsc.tws.tsched.batch.roundrobin.RoundRobinBatchTaskScheduler"
129129
130-
#Default Task Instance Values
131-
twister2.task.instances: 2
132-
twister2.task.instance.ram: 512.0
133-
twister2.task.instance.disk: 500.0
134-
twister2.task.instance.cpu: 2.0
130+
# Number of task instances to be allocated to each worker/container
131+
twister2.taskscheduler.task.instances: 2
135132
136-
#Default Container Padding Values
137-
twister2.ram.padding.container: 2.0
138-
twister2.disk.padding.container: 12.0
139-
twister2.cpu.padding.container: 1.0
140-
twister2.container.padding.percentage: 2
133+
# Ram value to be allocated to each task instance
134+
twister2.taskscheduler.task.instance.ram: 512.0
141135
142-
#Default Container Instance Values
143-
twister2.container.instance.ram: 2048.0
144-
twister2.container.instance.disk: 2000.0
145-
twister2.container.instance.cpu: 4.0
136+
# Disk value to be allocated to each task instance
137+
twister2.taskscheduler.task.instance.disk: 500.0
146138
147-
#Default Task Parallelism Value
148-
twister2.task.parallelism: 2
139+
# CPU value to be allocated to each task instancetwister2.task.parallelism
140+
twister2.taskscheduler.instance.cpu: 2.0
149141
150-
#Default Task Type "streaming" or "batch"
151-
twister2.task.type: "streaming"
152-
```
142+
# Default Container Instance Values
143+
# Ram value to be allocated to each container
144+
twister2.taskscheduler.container.instance.ram: 4096.0
153145
154-
\`\`
146+
# Disk value to be allocated to each container
147+
twister2.taskscheduler.container.instance.disk: 8000.0
148+
149+
twister2.taskscheduler.container.instance.cpu: 16.0
150+
151+
# Default Container Padding Values
152+
# Default padding value of the ram to be allocated to each container
153+
twister2.taskscheduler.ram.padding.container: 2.0
154+
155+
# Default padding value of the disk to be allocated to each container
156+
twister2.taskscheduler.disk.padding.container: 12.0
157+
158+
# CPU padding value to be allocated to each container
159+
twister2.taskscheduler.cpu.padding.container: 1.0
160+
161+
# Percentage value to be allocated to each container
162+
twister2.taskscheduler.container.padding.percentage: 2
163+
164+
# Static Default Network parameters
165+
# Bandwidth value to be allocated to each container instance for datalocality scheduling
166+
twister2.taskscheduler.container.instance.bandwidth: 100 #Mbps
167+
168+
# Latency value to be allocated to each container instance for datalocality scheduling
169+
twister2.taskscheduler.container.instance.latency: 0.002 #Milliseconds
170+
171+
# Bandwidth to be allocated to each datanode instance for datalocality scheduling
172+
twister2.taskscheduler.datanode.instance.bandwidth: 200 #Mbps
173+
174+
# Latency value to be allocated to each datanode instance for datalocality scheduling
175+
twister2.taskscheduler.datanode.instance.latency: 0.01 #Milliseconds
176+
177+
# Prallelism value to each task instance
178+
twister2.taskscheduler.task.parallelism: 2
179+
180+
# Task type to each submitted job by default it is "streaming" job.
181+
twister2.taskscheduler.task.type: "streaming"
182+
183+
# number of threads per worker
184+
twister2.exector.worker.threads: 1
185+
186+
# name of the batch executor
187+
twister2.executor.batch.name: "edu.iu.dsc.tws.executor.threading.BatchSharingExecutor2"
188+
189+
# number of tuples executed at a single pass
190+
twister2.exector.instance.queue.low.watermark: 10000
191+
```
155192

156193
## User-Defined Task Scheduler
157194

@@ -165,8 +202,31 @@ as "user-defined" with the corresponding "user-defined" task scheduler class nam
165202
#User-defined Streaming Task Scheduler
166203
twister2.streaming.taskscheduler: "user-defined"
167204
168-
#User-defined Streaming Task Scheduler Class
169-
twister2.streaming.taskscheduler.class: "edu.iu.dsc.tws.tsched.userdefined.UserDefinedTaskScheduler"
205+
# Task Scheduler for the userDefined Streaming Task Scheduler
206+
#twister2.taskscheduler.streaming.class: "edu.iu.dsc.tws.tsched.userdefined.UserDefinedTaskScheduler"
207+
208+
# Task Scheduler for the userDefined Batch Task Scheduler
209+
#twister2.taskscheduler.batch.class: "edu.iu.dsc.tws.tsched.userdefined.UserDefinedTaskScheduler"
210+
```
211+
212+
\`\`
213+
214+
## Batch Task Scheduler
215+
216+
Batch Task Scheduler is able to handle and schedule both single task graph as well as multiple
217+
dependent task graphs. The main constraint considered in the batch task scheduler is specify the same
218+
parallelism value for the dependent tasks in the task graphs. It schedule the tasks in a round
219+
robin fashion but, while scheduling the child or the dependent tasks it considers the data locality
220+
of the input data from the parent tasks and schedule the tasks in a round robin fashion to the workers.
221+
222+
\`\`yaml
223+
224+
```text
225+
#Batch Task Scheduler
226+
twister2.taskscheduler.batch: "batchscheduler"
227+
228+
#Task Scheduler class for the batch task scheduler
229+
twister2.taskscheduler.batch.class: "edu.iu.dsc.tws.tsched.batch.batchscheduler.BatchTaskScheduler"
170230
```
171231

172232
\`\`
@@ -176,25 +236,18 @@ twister2.streaming.taskscheduler.class: "edu.iu.dsc.tws.tsched.userdefined.UserD
176236
The other task schedulers and their respective class names are given below. The user have to specify
177237
the respective scheduler mode and their corresponding class names.
178238

239+
179240
\`\`yaml
180241

181242
```text
182-
#Streaming Task Scheduler Mode "roundrobin" or "firstfit" or "datalocalityaware"
183-
twister2.streaming.taskscheduler: "roundrobin"
184-
185-
#Streaming Task Scheduler Class
186-
twister2.streaming.taskscheduler.class: "edu.iu.dsc.tws.tsched.streaming.roundrobin.RoundRobinTaskScheduler"
187-
188-
#twister2.streaming.taskscheduler.class: "edu.iu.dsc.tws.tsched.streaming.datalocalityaware.DataLocalityStreamingTaskScheduler"
189-
#twister2.streaming.taskscheduler.class: "edu.iu.dsc.tws.tsched.streaming.firstfit.FirstFitStreamingTaskScheduler"
243+
# Task Scheduler for the Data Locality Aware Streaming Task Scheduler
244+
#twister2.taskscheduler.streaming.class: "edu.iu.dsc.tws.tsched.streaming.datalocalityaware.DataLocalityStreamingTaskScheduler"
190245
191-
#Batch Task Scheduler Mode "roundrobin" or "datalocalityaware"
192-
#twister2.batch.taskscheduler: "roundrobin"
193-
twister2.batch.taskscheduler: "datalocalityaware"
246+
# Task Scheduler for the FirstFit Streaming Task Scheduler
247+
#twister2.taskscheduler.streaming.class: "edu.iu.dsc.tws.tsched.streaming.firstfit.FirstFitStreamingTaskScheduler"
194248
195-
#Batch Task Scheduler Class
196-
twister2.batch.taskscheduler.class: "edu.iu.dsc.tws.tsched.batch.datalocalityaware.DataLocalityBatchTaskScheduler"
197-
#twister2.batch.taskscheduler.class: "edu.iu.dsc.tws.tsched.batch.roundrobin.RoundRobinBatchTaskScheduler"
249+
# Task Scheduler for the Data Locality Aware Batch Task Scheduler
250+
#twister2.taskscheduler.batch.class: "edu.iu.dsc.tws.tsched.batch.datalocalityaware.DataLocalityBatchTaskScheduler"
198251
```
199252

200253
\`\`

0 commit comments

Comments
 (0)