Skip to content
Snippets Groups Projects
Commit 8570949f authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

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
parent cdce7944
No related branches found
No related tags found
1 merge request!54Release 2.0.0
...@@ -15,22 +15,23 @@ ...@@ -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 # If not already set, set the URL of your local Docker registry where the images will be uploaded to.
# you do not want to use any Docker registry. # Leave it blank if you do not want to use any Docker registry.
export TFS_REGISTRY_IMAGE=${TFS_REGISTRY_IMAGE:-""} export TFS_REGISTRY_IMAGE=${TFS_REGISTRY_IMAGE:-""}
#export TFS_REGISTRY_IMAGE="http://my-container-registry.local/" #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. # 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. # If not already set, set the tag you want to use for your images.
export TFS_IMAGE_TAG=${TFS_IMAGE_TAG:-"dev"} export TFS_IMAGE_TAG=${TFS_IMAGE_TAG:-"dev"}
# If not already set, set the name of the Kubernetes namespace to deploy to. # 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 # If not already set, set additional manifest files to be applied after the deployment
export TFS_EXTRA_MANIFESTS=${TFS_EXTRA_MANIFESTS:-""} export TFS_EXTRA_MANIFESTS=${TFS_EXTRA_MANIFESTS:-""}
......
...@@ -13,6 +13,17 @@ ...@@ -13,6 +13,17 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # 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..." echo "Updating PIP, SetupTools and Wheel..."
pip install --upgrade pip # ensure next packages get the latest versions pip install --upgrade pip # ensure next packages get the latest versions
pip install --upgrade setuptools wheel # bring basic tooling for other requirements 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 ...@@ -20,18 +31,14 @@ pip install --upgrade pip-tools pylint # bring tooling for package compilation
printf "\n" printf "\n"
echo "Creating integrated requirements file..." echo "Creating integrated requirements file..."
tee requirements.in >/dev/null <<EOF touch requirements.in
grpcio-tools==1.43.0 diff requirements.in common_requirements.in | grep '^>' | sed 's/^>\ //' >> requirements.in
EOF
printf "\n" 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..." echo "Collecting requirements from components..."
for COMPONENT in $COMPONENTS for COMPONENT in $TFS_COMPONENTS
do do
if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then continue; fi
diff requirements.in src/$COMPONENT/requirements.in | grep '^>' | sed 's/^>\ //' >> requirements.in diff requirements.in src/$COMPONENT/requirements.in | grep '^>' | sed 's/^>\ //' >> requirements.in
done done
printf "\n" printf "\n"
......
# Set the URL of your local Docker registry where the images will be uploaded to.
export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/" 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" 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" export TFS_IMAGE_TAG="dev"
# Set the name of the Kubernetes namespace to deploy to.
export TFS_K8S_NAMESPACE="tfs" export TFS_K8S_NAMESPACE="tfs"
# Set additional manifest files to be applied after the deployment
export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml" export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml"
# Set the neew Grafana admin password
export TFS_GRAFANA_PASSWORD="admin123+" export TFS_GRAFANA_PASSWORD="admin123+"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment