From 8570949f35d7f0b7a2418feb823e73abf3faeacc Mon Sep 17 00:00:00 2001 From: Lluis Gifre <lluis.gifre@cttc.es> Date: Wed, 27 Jul 2022 15:24:08 +0000 Subject: [PATCH] Common scripts: - deploy.sh: clarified some descriptions of environment variables - install_requirements.sh: integrated common requirements and selection of components based on the deploy - my_deploy.sh: added description of environment variables --- deploy.sh | 11 ++++++----- install_requirements.sh | 23 +++++++++++++++-------- my_deploy.sh | 16 ++++++++++++++++ 3 files changed, 37 insertions(+), 13 deletions(-) diff --git a/deploy.sh b/deploy.sh index f60e4bc11..1eeebb805 100755 --- a/deploy.sh +++ b/deploy.sh @@ -15,22 +15,23 @@ ######################################################################################################################## -# Define your deployment settings here +# Read deployment settings ######################################################################################################################## -# If not already set, set the URL of your local Docker registry where the images will be uploaded to. Leave it blank if -# you do not want to use any Docker registry. +# If not already set, set the URL of your local Docker registry where the images will be uploaded to. +# Leave it blank if you do not want to use any Docker registry. export TFS_REGISTRY_IMAGE=${TFS_REGISTRY_IMAGE:-""} #export TFS_REGISTRY_IMAGE="http://my-container-registry.local/" # If not already set, set the list of components you want to build images for, and deploy. -export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device automation policy service compute monitoring dbscanserving opticalattackmitigator opticalcentralizedattackdetector webui"} +# By default, only basic components are deployed +export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device monitoring service compute webui"} # If not already set, set the tag you want to use for your images. export TFS_IMAGE_TAG=${TFS_IMAGE_TAG:-"dev"} # If not already set, set the name of the Kubernetes namespace to deploy to. -export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs-dev"} +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} # If not already set, set additional manifest files to be applied after the deployment export TFS_EXTRA_MANIFESTS=${TFS_EXTRA_MANIFESTS:-""} diff --git a/install_requirements.sh b/install_requirements.sh index 089d1e771..ea9385729 100755 --- a/install_requirements.sh +++ b/install_requirements.sh @@ -13,6 +13,17 @@ # See the License for the specific language governing permissions and # limitations under the License. +# If not already set, set the list of components you want to install dependencies for. +# By default, dependencies for all components are installed. +# Components still not supported by this script: +# automation & policy : implemented in Java +# dlt : under design +# pathcomp : under design +ALL_COMPONENTS="context device service compute monitoring webui interdomain slice" +ALL_COMPONENTS="${ALL_COMPONENTS} dbscanserving opticalattackmitigator opticalcentralizedattackdetector" +ALL_COMPONENTS="${ALL_COMPONENTS} l3_attackmitigator l3_centralizedattackdetector l3_distributedattackdetector" +TFS_COMPONENTS=${TFS_COMPONENTS:-$ALL_COMPONENTS} + echo "Updating PIP, SetupTools and Wheel..." pip install --upgrade pip # ensure next packages get the latest versions pip install --upgrade setuptools wheel # bring basic tooling for other requirements @@ -20,18 +31,14 @@ pip install --upgrade pip-tools pylint # bring tooling for package compilation printf "\n" echo "Creating integrated requirements file..." -tee requirements.in >/dev/null <<EOF -grpcio-tools==1.43.0 -EOF +touch requirements.in +diff requirements.in common_requirements.in | grep '^>' | sed 's/^>\ //' >> requirements.in printf "\n" -# List of all the components, not only deployed ones -# TODO: include here your components -COMPONENTS="compute context device service monitoring opticalcentralizedattackdetector opticalattackmitigator dbscanserving webui" - echo "Collecting requirements from components..." -for COMPONENT in $COMPONENTS +for COMPONENT in $TFS_COMPONENTS do + if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then continue; fi diff requirements.in src/$COMPONENT/requirements.in | grep '^>' | sed 's/^>\ //' >> requirements.in done printf "\n" diff --git a/my_deploy.sh b/my_deploy.sh index 28148123d..67a2e0558 100644 --- a/my_deploy.sh +++ b/my_deploy.sh @@ -1,6 +1,22 @@ +# Set the URL of your local Docker registry where the images will be uploaded to. export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/" + +# Set the list of components, separated by comas, you want to build images for, and deploy. +# Supported components are: +# context device automation policy service compute monitoring webui +# interdomain slice pathcomp dlt +# dbscanserving opticalattackmitigator opticalcentralizedattackdetector +# l3_attackmitigator l3_centralizedattackdetector l3_distributedattackdetector export TFS_COMPONENTS="context device automation service compute monitoring webui" + +# Set the tag you want to use for your images. export TFS_IMAGE_TAG="dev" + +# Set the name of the Kubernetes namespace to deploy to. export TFS_K8S_NAMESPACE="tfs" + +# Set additional manifest files to be applied after the deployment export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml" + +# Set the neew Grafana admin password export TFS_GRAFANA_PASSWORD="admin123+" -- GitLab