sudo sed -i "s|Proxy.*|Proxy \"${OSM_APT_PROXY}\"; }|" ${OSM_APT_PROXY_FILE}
fi
sudo apt-get update || FATAL "Configured apt proxy, but couldn't run 'apt-get update'. Check ${OSM_APT_PROXY_FILE}"
- track apt_proxy_configured
+ track prereq apt_proxy_configured_ok
[ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
}
function install_osm() {
[ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
- track checkingroot
+ track checks checkingroot_ok
[ "$USER" == "root" ] && FATAL "You are running the installer as root. The installer is prepared to be executed as a normal user with sudo privileges."
- track noroot
+ track checks noroot_ok
[ -z "$ASSUME_YES" ] && ! ask_user "The installation will do the following
1. Install and configure LXD
5. Install and initialize Kubernetes
as pre-requirements.
Do you want to proceed (Y/n)? " y && echo "Cancelled!" && exit 1
- track proceed
+ track checks proceed_ok
echo "Installing OSM"
install_lxd
fi
- track prereqok
+ track prereq prereqok_ok
if [ ! -n "$INSTALL_NODOCKER" ]; then
DOCKER_CE_OPTS="-D ${OSM_DEVOPS} ${DEBUG_INSTALL}"
[ -n "${DOCKER_PROXY_URL}" ] && DOCKER_CE_OPTS="${DOCKER_CE_OPTS} -p ${DOCKER_PROXY_URL}"
- $OSM_DEVOPS/installers/install_docker_ce.sh ${DOCKER_CE_OPTS}
+ $OSM_DEVOPS/installers/install_docker_ce.sh ${DOCKER_CE_OPTS} || FATAL_TRACK docker_ce "install_docker_ce.sh failed"
fi
- track docker_ce
+ track docker_ce docker_ce_ok
echo "Creating folders for installation"
[ ! -d "$OSM_DOCKER_WORK_DIR" ] && sudo mkdir -p $OSM_DOCKER_WORK_DIR
[ ! -d "$OSM_DOCKER_WORK_DIR/osm_pla" -a -n "$INSTALL_PLA" ] && sudo mkdir -p $OSM_DOCKER_WORK_DIR/osm_pla
sudo cp -b $OSM_DEVOPS/installers/docker/cluster-config.yaml $OSM_DOCKER_WORK_DIR/cluster-config.yaml
- $OSM_DEVOPS/installers/install_kubeadm_cluster.sh -i ${DEFAULT_IP} -d ${OSM_DOCKER_WORK_DIR} -D ${OSM_DEVOPS} ${DEBUG_INSTALL}
- track k8scluster
+ $OSM_DEVOPS/installers/install_kubeadm_cluster.sh -i ${DEFAULT_IP} -d ${OSM_DOCKER_WORK_DIR} -D ${OSM_DEVOPS} ${DEBUG_INSTALL} || \
+ FATAL_TRACK k8scluster "install_kubeadm_cluster.sh failed"
+ track k8scluster k8scluster_ok
JUJU_OPTS="-D ${OSM_DEVOPS} -s ${OSM_STACK_NAME} -i ${DEFAULT_IP} ${DEBUG_INSTALL} ${INSTALL_NOJUJU} ${INSTALL_CACHELXDIMAGES}"
[ -n "${OSM_VCA_HOST}" ] && JUJU_OPTS="$JUJU_OPTS -H ${OSM_VCA_HOST}"
[ -n "${LXD_CLOUD_FILE}" ] && JUJU_OPTS="$JUJU_OPTS -l ${LXD_CLOUD_FILE}"
[ -n "${LXD_CRED_FILE}" ] && JUJU_OPTS="$JUJU_OPTS -L ${LXD_CRED_FILE}"
[ -n "${CONTROLLER_NAME}" ] && JUJU_OPTS="$JUJU_OPTS -K ${CONTROLLER_NAME}"
- $OSM_DEVOPS/installers/install_juju.sh ${JUJU_OPTS}
+ $OSM_DEVOPS/installers/install_juju.sh ${JUJU_OPTS} || FATAL_TRACK juju "install_juju.sh failed"
set_vca_variables
- track juju
+ track juju juju_ok
if [ -z "$OSM_DATABASE_COMMONKEY" ]; then
OSM_DATABASE_COMMONKEY=$(generate_secret)
# Deploy OSM services
[ -z "$DOCKER_NOBUILD" ] && generate_docker_images
- track docker_build
+ track docker_images docker_images_ok
generate_k8s_manifest_files
- track manifest_files
+ track osm_files manifest_files_ok
generate_docker_env_files
- track env_files
+ track osm_files env_files_ok
deploy_charmed_services
+ track deploy_osm deploy_charmed_services_ok
kube_secrets
+ track deploy_osm kube_secrets_ok
update_manifest_files
+ track deploy_osm update_manifest_files_ok
namespace_vol
+ track deploy_osm namespace_vol_ok
deploy_osm_services
+ track deploy_osm deploy_osm_services_k8s_ok
if [ -n "$INSTALL_PLA"]; then
# optional PLA install
deploy_osm_pla_service
- track deploy_osm_pla
+ track deploy_osm deploy_osm_pla_ok
fi
- track deploy_osm_services_k8s
if [ -n "$INSTALL_K8S_MONITOR" ]; then
# install OSM MONITORING
install_k8s_monitoring
- track install_k8s_monitoring
+ track deploy_osm install_k8s_monitoring_ok
fi
[ -z "$INSTALL_NOHOSTCLIENT" ] && install_osmclient
- track osmclient
+ track osmclient osmclient_ok
echo -e "Checking OSM health state..."
$OSM_DEVOPS/installers/osm_health.sh -s ${OSM_STACK_NAME} -k || \
echo -e "OSM is not healthy, but will probably converge to a healthy state soon." && \
echo -e "Check OSM status with: kubectl -n ${OSM_STACK_NAME} get all" && \
- track osm_unhealthy
- track after_healthcheck
+ track healthchecks osm_unhealthy didnotconverge
+ track healthchecks after_healthcheck_ok
add_local_k8scluster
- track add_local_k8scluster
+ track final_ops add_local_k8scluster_ok
wget -q -O- https://osm-download.etsi.org/ftp/osm-11.0-eleven/README2.txt &> /dev/null
track end
[ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
# install OSM monitoring
sudo chmod +x $OSM_DEVOPS/installers/k8s/*.sh
- sudo $OSM_DEVOPS/installers/k8s/install_osm_k8s_monitoring.sh
+ sudo $OSM_DEVOPS/installers/k8s/install_osm_k8s_monitoring.sh || FATAL_TRACK install_k8s_monitoring "k8s/install_osm_k8s_monitoring.sh failed"
[ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
}
DOCKER_REGISTRY_URL=
DOCKER_PROXY_URL=
MODULE_DOCKER_TAG=
+OSM_INSTALLATION_TYPE="Default"
while getopts ":a:b:r:n:k:u:R:D:o:O:m:N:H:S:s:t:U:P:A:l:L:K:d:p:T:f:F:-: hy" o; do
case "${o}" in
[ "${OPTARG}" == "nohostclient" ] && INSTALL_NOHOSTCLIENT="y" && continue
[ "${OPTARG}" == "pullimages" ] && continue
[ "${OPTARG}" == "k8s_monitor" ] && INSTALL_K8S_MONITOR="y" && continue
- [ "${OPTARG}" == "charmed" ] && CHARMED="y" && continue
+ [ "${OPTARG}" == "charmed" ] && CHARMED="y" && OSM_INSTALLATION_TYPE="Charmed" && continue
[ "${OPTARG}" == "bundle" ] && continue
[ "${OPTARG}" == "k8s" ] && continue
[ "${OPTARG}" == "lxd" ] && continue
# Uninstall if "--uninstall"
if [ -n "$UNINSTALL" ]; then
if [ -n "$CHARMED" ]; then
- ${OSM_DEVOPS}/installers/charmed_uninstall.sh -R $RELEASE -r $REPOSITORY -u $REPOSITORY_BASE -D $OSM_DEVOPS -t $DOCKER_TAG "$@"
+ track start release $RELEASE none none docker_tag $OSM_DOCKER_TAG none none installation_type $OSM_INSTALLATION_TYPE none none
+ ${OSM_DEVOPS}/installers/charmed_uninstall.sh -R $RELEASE -r $REPOSITORY -u $REPOSITORY_BASE -D $OSM_DEVOPS -t $DOCKER_TAG "$@" || \
+ FATAL_TRACK charmed_uninstall "charmed_uninstall.sh failed"
else
- ${OSM_DEVOPS}/installers/uninstall_osm.sh "$@"
+ ${OSM_DEVOPS}/installers/uninstall_osm.sh "$@" || \
+ FATAL_TRACK community_uninstall "uninstall_osm.sh failed"
fi
echo -e "\nDONE"
exit 0
# Charmed installation
if [ -n "$CHARMED" ]; then
- ${OSM_DEVOPS}/installers/charmed_install.sh -R $RELEASE -r $REPOSITORY -u $REPOSITORY_BASE -D $OSM_DEVOPS -t $DOCKER_TAG "$@"
+ ${OSM_DEVOPS}/installers/charmed_install.sh -R $RELEASE -r $REPOSITORY -u $REPOSITORY_BASE -D $OSM_DEVOPS -t $DOCKER_TAG "$@" || \
+ FATAL_TRACK charmed_install "charmed_install.sh failed"
echo -e "\nDONE"
exit 0
fi
#Installation starts here
wget -q -O- https://osm-download.etsi.org/ftp/osm-11.0-eleven/README.txt &> /dev/null
-OSM_TRACK_INSTALLATION_ID="$(date +%s)-$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 16)"
+export OSM_TRACK_INSTALLATION_ID="$(date +%s)-$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 16)"
-track start release $RELEASE none none docker_tag $OSM_DOCKER_TAG none none
+track start release $RELEASE none none docker_tag $OSM_DOCKER_TAG none none installation_type $OSM_INSTALLATION_TYPE none none
install_osm
-echo -e "\nDONE" && exit 0
-echo -e "\nInstalling OSM from refspec: $COMMIT_ID"
-if [ -n "$INSTALL_FROM_SOURCE" ] && [ -z "$ASSUME_YES" ]; then
- ! ask_user "The installation will take about 75-90 minutes. Continue (Y/n)? " y && echo "Cancelled!" && exit 1
-fi
-
-echo -e "Checking required packages: lxd"
-lxd --version &>/dev/null || FATAL "lxd not present, exiting."
-[ -n "$INSTALL_LXD" ] && echo -e "\nInstalling and configuring lxd" && install_lxd
-
-wget -q -O- https://osm-download.etsi.org/ftp/osm-11.0-eleven/README2.txt &> /dev/null
-track end
echo -e "\nDONE"
+exit 0
#
source ../common/track
+source ../common/logging
-RELEASE="ReleaseTEN"
+RELEASE="test_track"
OSM_DOCKER_TAG=latest
OSM_TRACK_INSTALLATION_ID="$(date +%s)-$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 16)"
+echo "Next track call should fail"
+echo "track"
track
-track start
+echo
+echo "Next, several track calls are done with different args"
+echo "track test-event"
+track test-event
sleep 1
-track start release $RELEASE
+echo "track test-event release $RELEASE"
+track test-event release $RELEASE
sleep 1
-track start docker_tag $OSM_DOCKER_TAG none none
+echo "track test-event docker_tag $OSM_DOCKER_TAG none none"
+track test-event docker_tag $OSM_DOCKER_TAG none none
sleep 1
-track start release $RELEASE none none docker_tag $OSM_DOCKER_TAG none none
+echo "track test-event release $RELEASE none none docker_tag $OSM_DOCKER_TAG none none"
+track test-event release $RELEASE none none docker_tag $OSM_DOCKER_TAG none none
sleep 1
-track my-event my-op my-value "My comment" "tag1,tag2"
+echo 'track test-event my-op my-value "My comment" none'
+track test-event my-op my-value "My comment" none
sleep 1
-track my-second-event op1 value1 "My comment1 on second event" none op2 value2 "My comment2 on second event" none
+echo 'track test-event my-op my-value "My comment" "tag1,tag2"'
+track test-event my-op my-value "My comment" "tag1,tag2"
+sleep 1
+echo 'track test-event op1 value1 "My comment1 on test event" none op2 value2 "My comment2 on test event" none'
+track test-event op1 value1 "My comment1 on test event" none op2 value2 "My comment2 on test event" none
+sleep 1
+echo
+echo "Next track call will be done from function FATAL_TRACK"
+echo 'FATAL_TRACK test-event "Fatal error during execution"'
+FATAL_TRACK test-event "Fatal error during execution"