forked from FMorsbach/DecFL
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeploy_training.sh
executable file
·57 lines (47 loc) · 1019 Bytes
/
deploy_training.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
52
53
54
55
56
57
#!/bin/bash
while getopts a:s: option
do
case "${option}"
in
a) APP=${OPTARG};;
s) SCENARIO=${OPTARG};;
esac
done
if [ -z "$APP" ];
then
echo "You need to specify an application to deploy with -a"
exit 1
fi
if [ -z "$SCENARIO" ];
then
echo "You need to specify a valid scenario with -s"
exit 1
fi
if [ "$SCENARIO" == "local" ];
then
STORAGE_TYPE=redis
STORAGE=$(cat scenarios/$SCENARIO/storage)
else
STORAGE_TYPE=ipfs
STORAGE=$(cat scenarios/$SCENARIO/deploy_storage)
fi
CHAIN=$(cat scenarios/$SCENARIO/chain)
KEY=$(cat scenarios/$SCENARIO/deploy_key)
TRAINERS=scenarios/$SCENARIO/trainers
echo "Packing scripts"
back=$PWD
cd $APP
tar -czvf scripts.tar.gz scripts > /dev/null
mv scripts.tar.gz $back/scripts.tar.gz
cd $back
echo "Deploying to $SCENARIO"
./app/deploy/deploy \
-chain $CHAIN \
-storage $STORAGE \
-storageType $STORAGE_TYPE \
-key $KEY \
-scripts scripts.tar.gz \
-config $APP/configuration.txt \
-weights $APP/weights.txt \
-trainer $TRAINERS
rm scripts.tar.gz