mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-12-25 03:01:26 +01:00
- Adds a dockerfile to build ONOS image with profiler agent enabled - Prevents the overriding of the JAVA_OPTS when using the profiler - Deploy profiler also in the atomix nodes when using stc Change-Id: I00d5091428083f44360989c701350b7fead66038
69 lines
2.0 KiB
Bash
Executable File
69 lines
2.0 KiB
Bash
Executable File
#!/bin/bash
|
|
# -----------------------------------------------------------------------------
|
|
# Remotely pushes bits to a remote node and installs ONOS on it.
|
|
# -----------------------------------------------------------------------------
|
|
|
|
function _usage () {
|
|
cat << _EOF_
|
|
usage:
|
|
$(basename $0) [-fn] [-m] <settings> [node]
|
|
|
|
options:
|
|
- [node] : remote node to install ONOS on.
|
|
|
|
summary:
|
|
Downloads Atomix bits to a remote node and installs Atomix on it.
|
|
|
|
The -u should be used on upstart-based systems.
|
|
|
|
If [node] is not specified the default target is \$OCI.
|
|
|
|
_EOF_
|
|
}
|
|
|
|
[ "$1" = "-h" ] && _usage && exit 0
|
|
|
|
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
|
|
. $ONOS_ROOT/tools/build/envDefaults
|
|
|
|
while getopts fnvm: o; do
|
|
case "$o" in
|
|
f) uninstall=true;;
|
|
n) nostart=true;;
|
|
esac
|
|
done
|
|
let OPC=$OPTIND-1
|
|
shift $OPC
|
|
|
|
# If the -f was given, attempt uninstall first.
|
|
[ -n "$uninstall" ] && atomix-uninstall ${1:-$OCI}
|
|
|
|
node=${1:-$OCI}
|
|
remote=$ONOS_USER@$node
|
|
|
|
$(dirname $0)/atomix-push-bits $node
|
|
|
|
ssh -tt $remote "
|
|
[ -f $ATOMIX_INSTALL_DIR/bin/atomix-agent ] && echo \"Atomix is already installed\" && exit 1
|
|
|
|
sudo mkdir -p $ATOMIX_INSTALL_DIR && sudo chown ${ONOS_USER}:${ONOS_GROUP} $ATOMIX_INSTALL_DIR
|
|
tar -xvf /tmp/atomix.tar.gz -C $ATOMIX_INSTALL_DIR
|
|
|
|
if [ ! -z "$ONOS_YOURKIT" ]; then
|
|
sudo apt-get install unzip
|
|
cd /tmp
|
|
wget -N https://www.yourkit.com/download/YourKit-JavaProfiler-${ONOS_YOURKIT}.zip
|
|
unzip -o YourKit-JavaProfiler-${ONOS_YOURKIT}.zip
|
|
rm YourKit-JavaProfiler-${ONOS_YOURKIT}.zip
|
|
mv /tmp/YourKit-JavaProfiler-$(echo $ONOS_YOURKIT | sed 's/\(.*\)-.*/\1/')/bin/linux-x86-64/libyjpagent.so $ATOMIX_INSTALL_DIR/libyjpagent.so
|
|
fi
|
|
"
|
|
|
|
# Configure the ONOS installation
|
|
atomix-config $node
|
|
|
|
# Upload the shared cluster key if present
|
|
[ -f "$ONOS_CLUSTER_KEY_FILE" ] && onos-push-cluster-key $1
|
|
|
|
# Unless -n option was given, attempt to ignite the ONOS service.
|
|
[ -z "$nostart" ] && atomix-service $node start || true |