forked from valory-xyz/academy-learning-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_service.sh
executable file
·42 lines (30 loc) · 1.14 KB
/
run_service.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
#!/usr/bin/env bash
REPO_PATH=$PWD
# Remove previous service build
if test -d learning_service; then
echo "Removing previous service build (requires sudo permission)"
sudo rm -r learning_service
fi
# Remove empty directories to avoid wrong hashes
find . -empty -type d -delete
# Ensure that third party packages are correctly synced
make clean
AUTONOMY_VERSION=v$(autonomy --version | grep -oP '(?<=version\s)\S+')
AEA_VERSION=v$(aea --version | grep -oP '(?<=version\s)\S+')
autonomy packages sync --source valory-xyz/open-aea:$AEA_VERSION --source valory-xyz/open-autonomy:$AUTONOMY_VERSION --update-packages
# Ensure hashes are updated
autonomy packages lock
# Push packages to IPFS
autonomy push-all
# Fetch the service
autonomy fetch --local --service valory/learning_service && cd learning_service
# Build the image
autonomy init --reset --author author --remote --ipfs --ipfs-node "/dns/registry.autonolas.tech/tcp/443/https"
autonomy build-image
# Copy .env file
cp $REPO_PATH/.env .
# Copy the keys and build the deployment
cp $REPO_PATH/keys.json .
autonomy deploy build -ltm
# Run the deployment
autonomy deploy run --build-dir abci_build/