Skip to content

Commit

Permalink
Install & Deploy support for utils, more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ljkeller committed Apr 7, 2024
1 parent 53ac7a6 commit e91d9b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ TARGET=$1
set -ex

scp -r ./app/exe/ "root@${TARGET}:/home/root/dev/"
scp -r ./utils/ "root@${TARGET}:/home/root/dev/"
ssh "root@${TARGET}" "mkdir -p /opt/spark/iot"
scp ./app/iot/*.json "${TARGET}:/opt/spark/iot/"
scp ./app/iot/iotc-spark-server.service "${TARGET}:/etc/systemd/system/"
Expand Down
9 changes: 8 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,27 @@
INSTALL_DIR=/opt/spark
mkdir -p "${INSTALL_DIR}"

echo "Installing SPARK executables, utils, and libs into RZBoard... The executables will be copied to ${INSTALL_DIR} directory."
cp -r ./app/exe/* "${INSTALL_DIR}" || { echo "Failed to copy SPARK to RZBoard"; exit 1;}
cp -r ./utils/* "${INSTALL_DIR}" || { echo "Failed to copy SPARK utils to RZBoard";}
cp ./runtime_deps/libtvm_runtime.so /usr/lib64/ || { echo "Failed to copy TVM runtime to RZboard"; exit 1;}
cat ./app/weston_conf/weston.ini.append >> /etc/xdg/weston/weston.ini || { echo "Failed to append weston.ini"; exit 1;}
cat ./app/weston_conf/weston.ini.append >> /etc/xdg/weston/weston.ini || { echo "Failed to append weston.ini. You will have to run spark from ${INSTALL_DIR}";}
echo "Done installing SPARK executables, utils, and libs into RZBoard..."

# IoT Config
echo "Installing IoT Connect configurations into RZBoard..."
mkdir -p ${INSTALL_DIR}/iot || { echo "Failed to create iot directory"; exit 1;}
cp ./app/iot/*.json ${INSTALL_DIR}/iot/ || { echo "Failed to copy iot json files"; exit 1;}
echo "Don't forget to update /opt/spark/iot/ config files with your own device keys/server orientation"
echo "Done installing IoT Connect configurations into RZBoard..."

# Service management
echo "Installing IoT Connect / SPARK Service into RZBoard... The service will be enabled (auto launches on internet connection) and started after installation."
cp ./app/iot/iotc-spark-server.service /etc/systemd/system/ || { echo "Failed to copy iotc-spark-server.service"; exit 1;}
systemctl daemon-reload
systemctl enable iotc-spark-server.service || { echo "Failed to enable iotc-spark-server.service"; exit 1;}
systemctl start iotc-spark-server.service || { echo "Failed to start iotc-spark-server.service"; exit 1;}
echo "Done installing IoT Connect / SPARK Service into RZBoard... The service is enabled and started after installation."

echo "SPARK installed successfully. Restarting Weston for changes to take effect."

Expand Down

0 comments on commit e91d9b6

Please sign in to comment.