From 90df4054ddc1fbcd2715e1620dfb6d4a5888a93b Mon Sep 17 00:00:00 2001 From: ashishj1729 Date: Thu, 17 Nov 2022 15:09:25 +0530 Subject: [PATCH] Installation scripts for aiml Issue-Id: AIMLFW-4 Signed-off-by: ashishj1729 Change-Id: Ibcc71e5db220f9645b9a391ae55ed68af876ba6a --- bin/install.sh | 82 +++++++++++++++++++++++++++++++++ bin/install_common_templates_to_helm.sh | 53 +++++++++++++++++++++ bin/install_databases.sh | 25 ++++++++++ bin/install_rolebindings.sh | 23 +++++++++ bin/install_traininghost.sh | 24 ++++++++++ 5 files changed, 207 insertions(+) create mode 100755 bin/install.sh create mode 100755 bin/install_common_templates_to_helm.sh create mode 100755 bin/install_databases.sh create mode 100755 bin/install_rolebindings.sh create mode 100755 bin/install_traininghost.sh diff --git a/bin/install.sh b/bin/install.sh new file mode 100755 index 0000000..c305466 --- /dev/null +++ b/bin/install.sh @@ -0,0 +1,82 @@ +# ================================================================================== +# +# Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ================================================================================== + +#!/bin/bash + +IS_HELM3=$(helm version --short|grep -e "^v3") + +while [ -n "$1" ]; do # while loop starts + + case "$1" in + + -f) OVERRIDEYAML=$2 + shift + ;; + -c) LIST_OF_COMPONENTS=$2 + shift + ;; + -o) KERNEL_OPTIMIZATION=true + ;; + *) echo "Option $1 not recognized" ;; # In case you typed a different option other than a,b,c + + esac + + shift + +done + +if [ -z "$OVERRIDEYAML" ];then + echo "****************************************************************************************************************" + echo " ERROR " + echo "****************************************************************************************************************" + echo "AIMLFW deployment without deployment recipe is currently disabled. Please specify an recipe with the -f option." + echo "****************************************************************************************************************" + exit 1 +fi + +if [ -z $IS_HELM3 ] +then + echo "****************************************************************************************************************" + echo " ERROR " + echo "****************************************************************************************************************" + echo "AIMLFW deployment expects helm 3 installed" + echo "****************************************************************************************************************" + exit 1 +else + HAS_COMMON_PACKAGE=$(helm search repo local/aimlfw-common | grep aimlfw-common) +fi + + +if [ -z "$HAS_COMMON_PACKAGE" ];then + echo "****************************************************************************************************************" + echo " ERROR " + echo "****************************************************************************************************************" + echo "Can't locate the aimlfw-common helm package in the local repo. Please make sure that it is properly installed." + echo "****************************************************************************************************************" + exit 1 +fi + +COMPONENTS="tm data-extraction kfadapter aiml-dashboard aiml-notebook" + + + +for component in $COMPONENTS; do + sudo helm dep up helm/$component + echo "Installing $component" + helm install $component helm/$component -f $OVERRIDEYAML +done diff --git a/bin/install_common_templates_to_helm.sh b/bin/install_common_templates_to_helm.sh new file mode 100755 index 0000000..c18dbc6 --- /dev/null +++ b/bin/install_common_templates_to_helm.sh @@ -0,0 +1,53 @@ +# ================================================================================== +# +# Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ================================================================================== + +#!/bin/bash + +echo "Installing servecm (Chart Manager) and common templates to helm3" + +helm plugin install https://github.com/jdolitsky/helm-servecm +eval $(helm env |grep HELM_REPOSITORY_CACHE) +echo ${HELM_REPOSITORY_CACHE} + +helm servecm --port=8879 --context-path=/charts --storage local --storage-local-rootdir $HELM_REPOSITORY_CACHE/local/ <