-
Notifications
You must be signed in to change notification settings - Fork 1
/
launcher.sh
executable file
·51 lines (47 loc) · 1.98 KB
/
launcher.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# Edgebench Framework
# Core Launcher
#
# Everything begins here
# Get & Set the execution platform
# We set this in order to pull the correct docker tag
# and pass it through to the docker container
# (it misbehaves when checked from inside)
case "$(uname -m)" in
"x86_64") platform="amd64" ;;
"aarch64") platform="arm64v8" ;;
"armv7l") platform="arm32v7" ;;
"armv6l") platform="arm32v6" ;;
*) echo 'Platform not found'; exit 1 ;;
esac
# Launch the docker image & pass any arguments through
#
# Possible invocations:
# no arguments -> interactive menu
# or explore -> launch shell
# or call directly:
# oneoff <app> <app id>
# loop <app> <app id>
# listen <app> <app id>
# custodian <app combination>
# spawner <number of tasks> or <algorithm> <timeline>
# device <algorithm> <device id>
# gateway <algorithm> <gateway id>
# profile <app> <arch> <combo> <index> <length>
#
# Parameters:
# -it: make the shell interactive
# -v: mount a volume
# -t: set the image tag
# --entrypoint: change image entrypoint
#
# The "$@" here passes the arguments on to the docker image
#
#if [ "$#" -eq 0 ]; then docker run -it -v $PWD:/app -t uphilld/edgebench:"$platform" "$platform" "$@" ;
#elif [ "$1" = "explore" ]; then docker run -it -v $PWD:/app --entrypoint /bin/sh -t uphilld/edgebench:"$platform" ;
#elif [ "$1" = "spawn" ] || [ "$1" = "prepare" ]; then docker run -it -v $PWD:/app -t uphilld/edgebench:"$platform" "$platform" "$@" ;
#else docker run -v $PWD:/app -t uphilld/edgebench:"$platform" "$platform" "$@" ; fi
# Trying something new
if [ "$1" = "explore" ]; then arg="--entrypoint /bin/bash" ;
else arg="" ; fi
docker run -it -v $PWD:/app $arg -t uphilld/edgebench:"$platform" $platform "$@"