diff --git a/Hackfest_Demos/OSM-15/setup_scripts/README.md b/Hackfest_Demos/OSM-15/setup_scripts/README.md new file mode 100644 index 0000000000000000000000000000000000000000..dcb51548a0a4214e0c0b7a69a7f276e87abd58a0 --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/README.md @@ -0,0 +1,56 @@ +## Setting up Participant VMs + +First, check the common-vars for the following: + +``` +APT_PROXY=http://172.21.1.1.3142 +FLAVOR=test_flavor_fix +KEY_NAME=hackfest +NETWORK=osm-ext +FOCAL=ubuntu20.04 +``` + +APT_PROXY: the address of a caching web proxy for installing packages +FLAVOR: the flavour of the new VM to launch. Must have at least 4 CPUs, 8 GB RAM and 60 GB Disk. +KEY_NAME: Key to connect VMs +NETWORK: IP addresses will be allocated from this network, this network is management network of OSM instance +FOCAL: Image to install VMs + +### Create VMs +This script creates the VMs in required project + +``` +./run-create-openstack-vms.sh +``` + + +### Initial Configuration +This script updates apt, upgrades the system to the latest 20.04 and installs remote desktop software + +``` +./run-vm-initial-setup.sh +``` + + +### Install OSM + +This script downloads the installer and runs it. It also sets the OSM admin password to `hackfest`. +``` +./run-install-osm.sh +``` + +### Add VIM and K8s Cluster +Add VIM and ks8cluster to OSM instance +``` +./run-osm-vim-k8scluster-add.sh +``` + +## Full Flow + +``` +./run-create-openstack-vms.sh +./run-vm-initial-setup.sh +./run-install-osm.sh +./run-osm-vim-k8scluster-add.sh +``` + diff --git a/Hackfest_Demos/OSM-15/setup_scripts/bundle.yaml b/Hackfest_Demos/OSM-15/setup_scripts/bundle.yaml new file mode 100644 index 0000000000000000000000000000000000000000..dd80284e91d6aa4f3d573757a73a41fbcb5c3cb8 --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/bundle.yaml @@ -0,0 +1,194 @@ +# Copyright 2020 Canonical Ltd. +# +# 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. +name: osm +bundle: kubernetes +docs: https://discourse.charmhub.io/t/osm-docs-index/8806 +description: | + **Single instance Charmed OSM** + + Charmed OSM is an OSM distribution, developed and maintained by Canonical, which uses + Juju charms to simplify its deployments and operations. This bundle distribution refers + to the development stack for OSM and allows you to deploy a single instance OSM bundle + that is fast, reliable, and a complete solution with MicroStack and MicroK8s. + + - Industry‐aligned and fully compliant with upstream + - Predictable release cadence and upgrade path + - Simplified deployments and operations + - Stable and secure + - Supported with Ubuntu Advantage + - Availability of managed services +applications: + zookeeper: + charm: zookeeper-k8s + channel: latest/stable + scale: 1 + storage: + data: 100M + kafka: + charm: kafka-k8s + channel: latest/stable + scale: 1 + trust: true + storage: + data: 100M + mariadb: + charm: charmed-osm-mariadb-k8s + scale: 1 + series: kubernetes + storage: + database: 50M + options: + password: manopw + root_password: osm4u + user: mano + mongodb: + charm: mongodb-k8s + channel: 5/edge + scale: 1 + series: kubernetes + storage: + db: 50M + nbi: + charm: osm-nbi + channel: latest/beta + trust: true + scale: 1 + options: + database-commonkey: osm + log-level: DEBUG + resources: + nbi-image: opensourcemano/nbi:testing-daily + ro: + charm: osm-ro + channel: latest/beta + trust: true + scale: 1 + options: + log-level: DEBUG + resources: + ro-image: opensourcemano/ro:testing-daily + ng-ui: + charm: osm-ng-ui + channel: latest/beta + trust: true + scale: 1 + resources: + ng-ui-image: opensourcemano/ng-ui:testing-daily + lcm: + charm: osm-lcm + channel: latest/beta + scale: 1 + options: + database-commonkey: osm + log-level: DEBUG + resources: + lcm-image: opensourcemano/lcm:testing-daily + mon: + charm: osm-mon + channel: latest/beta + trust: true + scale: 1 + options: + database-commonkey: osm + log-level: DEBUG + keystone-enabled: true + resources: + mon-image: opensourcemano/mon:testing-daily + pol: + charm: osm-pol + channel: latest/beta + scale: 1 + options: + log-level: DEBUG + resources: + pol-image: gatici/pol:testing-daily + vca: + charm: osm-vca-integrator + channel: latest/beta + scale: 1 + ingress: + charm: nginx-ingress-integrator + channel: latest/stable + scale: 1 + prometheus: + charm: osm-prometheus + channel: latest/stable + scale: 1 + series: kubernetes + storage: + data: 50M + options: + default-target: "mon:8000" + grafana: + charm: osm-grafana + channel: latest/stable + scale: 1 + series: kubernetes + keystone: + charm: osm-keystone + channel: latest/beta + scale: 1 + resources: + keystone-image: opensourcemano/keystone:testing-daily +relations: + - - grafana:prometheus + - prometheus:prometheus + - - kafka:zookeeper + - zookeeper:zookeeper + - - keystone:db + - mariadb:mysql + - - lcm:kafka + - kafka:kafka + - - lcm:mongodb + - mongodb:database + - - lcm:vca + - vca:vca + - - ro:ro + - lcm:ro + - - ro:kafka + - kafka:kafka + - - ro:mongodb + - mongodb:database + - - pol:kafka + - kafka:kafka + - - pol:mongodb + - mongodb:database + - - mon:mongodb + - mongodb:database + - - mon:kafka + - kafka:kafka + - - mon:vca + - vca:vca + - - nbi:mongodb + - mongodb:database + - - nbi:kafka + - kafka:kafka + - - nbi:ingress + - ingress:ingress + - - nbi:prometheus + - prometheus:prometheus + - - nbi:keystone + - keystone:keystone + - - mon:prometheus + - prometheus:prometheus + - - ng-ui:nbi + - nbi:nbi + - - ng-ui:ingress + - ingress:ingress + - - mon:keystone + - keystone:keystone + - - mariadb:mysql + - pol:mysql + - - grafana:db + - mariadb:mysql \ No newline at end of file diff --git a/Hackfest_Demos/OSM-15/setup_scripts/common-vars b/Hackfest_Demos/OSM-15/setup_scripts/common-vars new file mode 100644 index 0000000000000000000000000000000000000000..560aa9e78594ea9d92c84a925b8e75c6b12f8e0f --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/common-vars @@ -0,0 +1,35 @@ +cleanup() { + # kill all processes whose parent is this process + pkill -P $$ +} + +for sig in INT QUIT HUP TERM; do + trap " + cleanup + trap - $sig EXIT + kill -s $sig "'"$$"' "$sig" +done +trap cleanup EXIT + +if [ ! -z ${DEBUG} ]; then + set -x +fi + +START=6 +MAX=10 + +if [ ! -z $2 ] ; then + START=$1 + MAX=$2 +elif [ ! -z $1 ] ; then + START=$1 + MAX=$1 +fi + +# ETSI VIM ADMIN_DOMAIN=default +APT_PROXY=http://172.21.1.1.3142 +FLAVOR=osm.sanity +KEY_NAME=hackfest +NETWORK=osm-ext +FOCAL=ubuntu20.04 + diff --git a/Hackfest_Demos/OSM-15/setup_scripts/create-openstack-vm.sh b/Hackfest_Demos/OSM-15/setup_scripts/create-openstack-vm.sh new file mode 100755 index 0000000000000000000000000000000000000000..2c4fc656a082c314c8fbbde401b292718fe9da47 --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/create-openstack-vm.sh @@ -0,0 +1,31 @@ +#!/bin/bash +echo $0 started at $(date) + +PARTICIPANT=${1} +. ./common-vars +. ./main_credentials.rc + +VM_NAME=`expr charmedosm-${PARTICIPANT}` +echo "Creating public port" +# This port gets created as the admin +openstack port create --disable-port-security --enable --network $NETWORK $VM_NAME +wait + +echo "Creating Keypair" +openstack keypair create --public-key ./hackfest_rsa.pub ${KEY_NAME} & +wait + +echo "Launching OSM VM" +openstack server create --key-name ${KEY_NAME} --flavor ${FLAVOR} --image ${FOCAL} --nic port-id=$VM_NAME --user-data ./osm-cloud-init.yaml $VM_NAME & +wait + +echo "Waiting for OSM VM to be ready" +IP=`openstack server list --name $VM_NAME --column Networks -f yaml | head -3 | tail -1 | grep -o '[0-9]\+[.][0-9]\+[.][0-9]\+[.][0-9]\+'` +while [ 1 ] ; do + sleep 10 + ALIVE=$(ssh -T -o ConnectTimeout=5 -o StrictHostKeyChecking=no -i hackfest_rsa ubuntu@${IP} "cloud-init status --wait" | tail -1 2> /dev/null) + echo $ALIVE + if [ "${ALIVE}" == "status: done" ] ; then break ; fi +done + +echo $0 $@ complete at $(date) \ No newline at end of file diff --git a/Hackfest_Demos/OSM-15/setup_scripts/delete-openstack-vm.sh b/Hackfest_Demos/OSM-15/setup_scripts/delete-openstack-vm.sh new file mode 100755 index 0000000000000000000000000000000000000000..645472404ee3df1e213330ef40c2f0da7bad8c4e --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/delete-openstack-vm.sh @@ -0,0 +1,29 @@ +#!/bin/bash +echo $0 started at $(date) + +. ./common-vars +. ./main_credentials.rc + + +PROJECT_ID=`openstack project list | grep "${PROJECT} " | awk '{print $2}'` +if [ "${PROJECT_ID}" != "" ]; then + echo "Removing Router Ports" + for ROUTER in $(openstack router list -f value -c ID); do + openstack router unset --external-gateway ${ROUTER} + PORT=$(openstack router show ${ROUTER} -f json -c interfaces_info | jq .interfaces_info[0].port_id -r) + while [ "${PORT}" != "null" -a "${PORT}" != "" ] ; do + openstack router remove port ${ROUTER} ${PORT} + PORT=$(openstack router show ${ROUTER} -f json -c interfaces_info | jq .interfaces_info[0].port_id -r) + done + done + + echo "Removing VMs" + openstack server list -f value -c ID | xargs openstack server delete + echo "Removing Routers" + openstack router list -f value -c ID | xargs openstack router delete + echo "Removing Ports" + openstack port list -f value -c ID | xargs openstack port delete +fi + + +echo $0 $@ complete at $(date) \ No newline at end of file diff --git a/Hackfest_Demos/OSM-15/setup_scripts/hackfest-k8s.yaml b/Hackfest_Demos/OSM-15/setup_scripts/hackfest-k8s.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d31f636b25ad250aa409c3dc10b6d146d155fe86 --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/hackfest-k8s.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +clusters: +- cluster: + certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUREekNDQWZlZ0F3SUJBZ0lVS2RSZUhQQVdUMzNxZFZCd3pMdktGdGdXcUJNd0RRWUpLb1pJaHZjTkFRRUwKQlFBd0Z6RVZNQk1HQTFVRUF3d01NVEF1TVRVeUxqRTRNeTR4TUI0WERUSXpNRFl3TmpFM01qWXhNVm9YRFRNegpNRFl3TXpF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WttN0orUVJOTzVub2t1NkFZYTlKZXBWV2hLVjJqYWpyZ2JMVFRjTVRZNzJJZlN6ZnhTCmJDcms2ZXdhNDdiK09udE5mOFMvOW43MmxkVERGdjBJNG54M3FNVm9XREJFbWhGQnZCeUt0MWZRcTBwSEpsVzIKZmlndnRCRW9kb2M0U2gzaHUyYU4vQmZyK0E9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg== + server: https://172.21.249.42:16443 + name: microk8s-cluster +contexts: +- context: + cluster: microk8s-cluster + user: admin + name: microk8s +current-context: microk8s +kind: Config +preferences: {} +users: +- name: admin + user: + token: NldCZjFBTDRocVp6NTUyY3pOMDNzcFE2Z0R6dHBqaVVBeGtrQnd3MzFMMD0K \ No newline at end of file diff --git a/Hackfest_Demos/OSM-15/setup_scripts/hackfest15admin.pub b/Hackfest_Demos/OSM-15/setup_scripts/hackfest15admin.pub new file mode 100644 index 0000000000000000000000000000000000000000..d1cc177dcdc12b30302875cc081c1e23e95f8ed6 --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/hackfest15admin.pub @@ -0,0 +1,6 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCfVxIJI9N5VxOQ90PyDUYOVz/FzpR+tVg0FlFcvxo5njJKFwabHv7GgQ8rY3y0GSkahFn/okjjVtV3t0lgPJbkir4bHp9eDvRBbI4ryGjhruKepwQ+W4Dw55id1COHGJch84D5XpCCNHPZkxA26vsETf009nN42vfWImNeDLucUiUTf02aiwasUUTcIMcadHR0hsgAiK1wBqv0Q5A2Fiok0xd0AGDiPRvdxx11wQH3QMMC5cluXbMWjIkRRwSpoEBrfb9GF2tSEMvA258G+szWGM1pTxQ+qvmSnLlzUu118a29QKUa/0uwuHaOxTIIUzjZ/7471gfRn1ei5aB9GXHot8CFkkUYiKqeOT9hTZbadmoJ261uqth+y8nDrVX0sZHR5oNO6EhC4Dif+ZSivx1HmJuq0w8aPnatSqTaEn+eQF+P9R25jerC24gjpRzjGa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2Tq8/PiV84hl3A7bxFxO8oPKPG9LJURCFweDKiv9FELaH7RfG0VEg+O/cmeAcK/zjMZCU6O2JvsZ1v9i+vEMki8s8cmNNzWTgetDOwIU1SUf8dUST7Kzue0OhST3Asidyny6ymkQOGMeiP78qMhU5H6DDQlwsBeJ3DY4SIBcVrZ0bbMp0u9d7Ra4+1qOSOldYDnOfqLnWoQjXAuqEaOe+ivxQ27C8upw39tRAbbYXAy4CUqYDH1q5+D+3YotxHfwo2oAmSMj1cC0BOOCxP+oqxfWXVirOqB4LKkpVvKVHQMyLhBkxg94OiTy1JlRDNGwpZbjZQYgOHZ26g9OSmUKbbHmyiyqWdlKUVykehLBAoUfpA8WQ20= davide@davide-asus diff --git a/Hackfest_Demos/OSM-15/setup_scripts/hackfest15group10.rc b/Hackfest_Demos/OSM-15/setup_scripts/hackfest15group10.rc new file mode 100644 index 0000000000000000000000000000000000000000..9d6862520a98a8a51727c5e4ed91b0815eaef5b3 --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/hackfest15group10.rc @@ -0,0 +1,12 @@ +export OS_AUTH_TYPE=password +export OS_AUTH_URL=http://172.21.247.1:5000/v3 +export OS_DOMAIN_NAME= +export OS_IDENTITY_API_VERSION=3 +export OS_INTERFACE=public +export OS_PASSWORD=hackfest15group-10! +export OS_PROJECT_DOMAIN_NAME= +export OS_PROJECT_NAME=hackfest15group10 +export OS_REGION_NAME=RegionOne +export OS_TENANT_NAME=hackfest15group10 +export OS_USERNAME=hackfest15group10 +export OS_USER_DOMAIN_NAME= diff --git a/Hackfest_Demos/OSM-15/setup_scripts/hackfest15group6.rc b/Hackfest_Demos/OSM-15/setup_scripts/hackfest15group6.rc new file mode 100644 index 0000000000000000000000000000000000000000..1ae4a9ddbf6c03f475f124a4e34224088aeed2aa --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/hackfest15group6.rc @@ -0,0 +1,12 @@ +export OS_AUTH_TYPE=password +export OS_AUTH_URL=http://172.21.247.1:5000/v3 +export OS_DOMAIN_NAME= +export OS_IDENTITY_API_VERSION=3 +export OS_INTERFACE=public +export OS_PASSWORD=hackfest15group-6! +export OS_PROJECT_DOMAIN_NAME= +export OS_PROJECT_NAME=hackfest15group6 +export OS_REGION_NAME=RegionOne +export OS_TENANT_NAME=hackfest15group6 +export OS_USERNAME=hackfest15group6 +export OS_USER_DOMAIN_NAME= diff --git a/Hackfest_Demos/OSM-15/setup_scripts/hackfest15group7.rc b/Hackfest_Demos/OSM-15/setup_scripts/hackfest15group7.rc new file mode 100644 index 0000000000000000000000000000000000000000..0a9fb81e594d2e4d7e857e8b8c44c7029851ec4f --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/hackfest15group7.rc @@ -0,0 +1,12 @@ +export OS_AUTH_TYPE=password +export OS_AUTH_URL=http://172.21.247.1:5000/v3 +export OS_DOMAIN_NAME= +export OS_IDENTITY_API_VERSION=3 +export OS_INTERFACE=public +export OS_PASSWORD=hackfest15group-7! +export OS_PROJECT_DOMAIN_NAME= +export OS_PROJECT_NAME=hackfest15group7 +export OS_REGION_NAME=RegionOne +export OS_TENANT_NAME=hackfest15group7 +export OS_USERNAME=hackfest15group7 +export OS_USER_DOMAIN_NAME= diff --git a/Hackfest_Demos/OSM-15/setup_scripts/hackfest15group8.rc b/Hackfest_Demos/OSM-15/setup_scripts/hackfest15group8.rc new file mode 100644 index 0000000000000000000000000000000000000000..88fce050102d3ceb500d4480a34f55674558a111 --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/hackfest15group8.rc @@ -0,0 +1,12 @@ +export OS_AUTH_TYPE=password +export OS_AUTH_URL=http://172.21.247.1:5000/v3 +export OS_DOMAIN_NAME= +export OS_IDENTITY_API_VERSION=3 +export OS_INTERFACE=public +export OS_PASSWORD=hackfest15group-8! +export OS_PROJECT_DOMAIN_NAME= +export OS_PROJECT_NAME=hackfest15group8 +export OS_REGION_NAME=RegionOne +export OS_TENANT_NAME=hackfest15group8 +export OS_USERNAME=hackfest15group8 +export OS_USER_DOMAIN_NAME= diff --git a/Hackfest_Demos/OSM-15/setup_scripts/hackfest15group9.rc b/Hackfest_Demos/OSM-15/setup_scripts/hackfest15group9.rc new file mode 100644 index 0000000000000000000000000000000000000000..88e8fc8c370c7e617b49c96fcf81cdf013565a42 --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/hackfest15group9.rc @@ -0,0 +1,12 @@ +export OS_AUTH_TYPE=password +export OS_AUTH_URL=http://172.21.247.1:5000/v3 +export OS_DOMAIN_NAME= +export OS_IDENTITY_API_VERSION=3 +export OS_INTERFACE=public +export OS_PASSWORD=hackfest15group-9! +export OS_PROJECT_DOMAIN_NAME= +export OS_PROJECT_NAME=hackfest15group9 +export OS_REGION_NAME=RegionOne +export OS_TENANT_NAME=hackfest15group9 +export OS_USERNAME=hackfest15group9 +export OS_USER_DOMAIN_NAME= diff --git a/Hackfest_Demos/OSM-15/setup_scripts/hackfest_rsa b/Hackfest_Demos/OSM-15/setup_scripts/hackfest_rsa new file mode 100644 index 0000000000000000000000000000000000000000..2193387315fd1ff6752a4bf0420d538fdd6f5e93 --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/hackfest_rsa @@ -0,0 +1,38 @@ +-----BEGIN OPENSSH PRIVATE KEY----- +b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn +NhAAAAAwEAAQAAAYEAnJa7ao5DB7kCWoPYkdP0f/w5rW7t7YzsTYCHdKV8M/mktewb+N3E +bFxcxs7Caut5M9M+gpZpJyY0d/M7tzvhlAbWvdicwkjLgU6ujKZwwuxfPyc7UJrxw0dwNl +ubtaFbWa/tXygKlk+5/ICFFYY4d6dXkqfYjO/CUfpSXOw+hL7qS9ZkbnXFoLiLwnz0Zm5w +ATIUdyDtH9dzrWCRwFa0QKEmuakRxJoY5BLra9Hfork8VZqFmwBtA4rsRHBu820LYwRyVq +k4OXYKjSfWXSJWPoysOtOt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MDkwAQ== +-----END OPENSSH PRIVATE KEY----- diff --git a/Hackfest_Demos/OSM-15/setup_scripts/hackfest_rsa.pub b/Hackfest_Demos/OSM-15/setup_scripts/hackfest_rsa.pub new file mode 100644 index 0000000000000000000000000000000000000000..5efe445d0d1346b25fac553efe68db8b93eda62c --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/hackfest_rsa.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCclrtqjkMHuQJag9iR0/R//Dmtbu3tjOxNgId0pXwz+aS17Bv43cRsXFzGzsJq63kz0z6ClmknJjR38zu3O+GUBta92JzCSMuBTq6MpnDC7F8/JztQmvHDR3A2W5u1oVtZr+1fKAqWT7n8gIUVhjh3p1eSp9iM78JR+lJc7D6EvupL1mRudcWguIvCfPRmbnABMhR3IO0f13OtYJHAVrRAoSa5qRHEmhjkEutr0d+iuTxVmoWbAG0DiuxEcG7zbQtjBHJWqTg5dgqNJ9ZdIlY+jKw60632Ul5oD9L4OK0BDALBRNK4TqJcYsB+dBuLgblyeMyPX7cDrGOnSLAz//eSXcewkZfoZWUPmFbMBKPNCgaLjDIeYzdLc4XBCXTouO/htGM0idQUT/bebbNCDWHeJ5CU8yRvEsedJ0xb4kEUwf1rrPJqsuY1faGzHgO+LAPGoJID4GH2Bw1H+lYN/hstwGrCYKMEFDbzJJ3Cm/+GQ+f3OjJpEGsUit8mRvPswic= mark@mark-G5-5090 diff --git a/Hackfest_Demos/OSM-15/setup_scripts/logs/.gitkeep b/Hackfest_Demos/OSM-15/setup_scripts/logs/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/logs/.gitkeep @@ -0,0 +1 @@ + diff --git a/Hackfest_Demos/OSM-15/setup_scripts/main_credentials.rc b/Hackfest_Demos/OSM-15/setup_scripts/main_credentials.rc new file mode 100644 index 0000000000000000000000000000000000000000..da218d2d485aa856640db35c54292edee119e6be --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/main_credentials.rc @@ -0,0 +1,10 @@ +#OpenStack Credentials for OSM instances +export OS_AUTH_URL=http://172.21.247.1:5000/v3 +export OS_PROJECT_NAME=hackfest15main +export OS_USER_DOMAIN_NAME='Default' +export OS_PROJECT_DOMAIN_ID='default' +export OS_USERNAME=hackfest_admin +export OS_PASSWORD=h@ckf3st +export OS_REGION_NAME='RegionOne' +export OS_INTERFACE=public +export OS_IDENTITY_API_VERSION=3 diff --git a/Hackfest_Demos/OSM-15/setup_scripts/osm-cloud-init.yaml b/Hackfest_Demos/OSM-15/setup_scripts/osm-cloud-init.yaml new file mode 100644 index 0000000000000000000000000000000000000000..80b6b7b62965910f754448a67795ace031d08158 --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/osm-cloud-init.yaml @@ -0,0 +1,4 @@ +#cloud-config +password: hackfest +chpasswd: { expire: False } +ssh_pwauth: True diff --git a/Hackfest_Demos/OSM-15/setup_scripts/run-create-openstack-vms.sh b/Hackfest_Demos/OSM-15/setup_scripts/run-create-openstack-vms.sh new file mode 100755 index 0000000000000000000000000000000000000000..17838ea66a2e2c30c51976a36bbab4a1776b01ac --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/run-create-openstack-vms.sh @@ -0,0 +1,14 @@ +#!/bin/bash +echo $0 started at $(date) + +. ./common-vars + +mkdir -p logs/ + +for PARTICIPANT in `seq ${START} ${MAX}` ; do + ./create-openstack-vm.sh ${PARTICIPANT} 2>&1 | tee -a logs/create-openstack-user-and-project-${PARTICIPANT}.log & +sleep 60 +done +wait + +echo $0 $@ complete at $(date) diff --git a/Hackfest_Demos/OSM-15/setup_scripts/run-delete-openstack-vms.sh b/Hackfest_Demos/OSM-15/setup_scripts/run-delete-openstack-vms.sh new file mode 100755 index 0000000000000000000000000000000000000000..995343f9961dc282d2c0ab8686dda82c4aed2dea --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/run-delete-openstack-vms.sh @@ -0,0 +1,12 @@ +#!/bin/bash +echo $0 started at $(date) + +. ./common-vars + +mkdir -p logs/ + +./delete-openstack-vm.sh 2>&1 | tee -a logs/delete-openstack-osm-vms.log & + +wait + +echo $0 $@ complete at $(date) \ No newline at end of file diff --git a/Hackfest_Demos/OSM-15/setup_scripts/run-full-setup.sh b/Hackfest_Demos/OSM-15/setup_scripts/run-full-setup.sh new file mode 100755 index 0000000000000000000000000000000000000000..b3bebad79c565ea043a9656d0de392039d11a55e --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/run-full-setup.sh @@ -0,0 +1,13 @@ +#!/bin/bash +echo $0 started at $(date) + +. ./common-vars + +./run-create-openstack-vms.sh $@ +./run-vm-initial-setup.sh $@ +sleep 15 +./run-install-osm.sh $@ +wait +./run-osm-vim-k8scluster-add.sh $@ + +echo $0 $@ complete at $(date) \ No newline at end of file diff --git a/Hackfest_Demos/OSM-15/setup_scripts/run-install-osm.sh b/Hackfest_Demos/OSM-15/setup_scripts/run-install-osm.sh new file mode 100755 index 0000000000000000000000000000000000000000..31e781b56bdb81dc6125982ee30e883793f973bf --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/run-install-osm.sh @@ -0,0 +1,18 @@ +#!/bin/bash +echo $0 started at $(date) + +. ./common-vars +. ./main_credentials.rc + +for PARTICIPANT in `seq ${START} ${MAX}` ; do + VM_NAME=`expr charmedosm-${PARTICIPANT}` + IP=`openstack server list --name $VM_NAME --column Networks -f yaml | head -3 | tail -1 | grep -o '[0-9]\+[.][0-9]\+[.][0-9]\+[.][0-9]\+'` + echo $IP + scp -o StrictHostKeyChecking=no -i hackfest_rsa ./vm-install-osm.sh ubuntu@${IP}: & + scp -o StrictHostKeyChecking=no -i hackfest_rsa ./bundle.yaml ubuntu@${IP}: & + sleep 10 + ssh -o StrictHostKeyChecking=no -i hackfest_rsa ubuntu@${IP} ". ~/vm-install-osm.sh" 2>&1 | tee -a logs/vm-install-osm-${PARTICIPANT}.log& +done +wait + +echo $0 $@ complete at $(date) \ No newline at end of file diff --git a/Hackfest_Demos/OSM-15/setup_scripts/run-microk8s-setup.sh b/Hackfest_Demos/OSM-15/setup_scripts/run-microk8s-setup.sh new file mode 100755 index 0000000000000000000000000000000000000000..eef77bb476aad9f9c4b732c9c5a4f2dd77acd624 --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/run-microk8s-setup.sh @@ -0,0 +1,16 @@ +#!/bin/bash +echo $0 started at $(date) + +. ./common-vars +. ./main_credentials.rc + +for PARTICIPANT in `seq ${START} ${MAX}` ; do + VM_NAME=`expr hackfest-k8scluster` # There is only one VM which is created by Mark in admin project + IP=`expr openstack server list --name $VM_NAME --column Networks -f yaml | head -3 | tail -1 | grep -o '[0-9]\+[.][0-9]\+[.][0-9]\+[.][0-9]\+'` + scp -o StrictHostKeyChecking=no -i hackfest_rsa ./hackfest_rsa ./hackfest_rsa.pub ubuntu@${IP}:.ssh/ & + scp -o StrictHostKeyChecking=no -i hackfest_rsa vm-microk8s-setup.sh ubuntu@${IP}: & + ssh -o StrictHostKeyChecking=no -i hackfest_rsa ubuntu@${IP} "scp -o StrictHostKeyChecking=no -i .ssh/hackfest_rsa vm-microk8s-setup.sh 10.0.0.11:; ssh -o StrictHostKeyChecking=no -i .ssh/hackfest_rsa 10.0.0.11 ./vm-microk8s-setup.sh" 2>&1 | tee -a logs/vm-microk8s-setup-${PARTICIPANT}.log& +done +wait + +echo $0 $@ complete at $(date) \ No newline at end of file diff --git a/Hackfest_Demos/OSM-15/setup_scripts/run-osm-vim-k8scluster-add.sh b/Hackfest_Demos/OSM-15/setup_scripts/run-osm-vim-k8scluster-add.sh new file mode 100755 index 0000000000000000000000000000000000000000..80fbed22af68b4face2733011b726a77b6e1836f --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/run-osm-vim-k8scluster-add.sh @@ -0,0 +1,41 @@ +#!/bin/bash +echo $0 started at $(date) + +. ./common-vars +. ./main_credentials.rc + +for PARTICIPANT in `seq ${START} ${MAX}` ; do + VM_NAME=`expr charmedosm-${PARTICIPANT}` + IP=`openstack server list --name $VM_NAME --column Networks -f yaml | head -3 | tail -1 | grep -o '[0-9]\+[.][0-9]\+[.][0-9]\+[.][0-9]\+'` + OS_USERNAME=hackfest15group${PARTICIPANT} + OS_PASSWORD=hackfest15group-${PARTICIPANT}! + OS_PROJECT_NAME=hackfest15group${PARTICIPANT} + + cat << EOF > ${OS_USERNAME}.rc +export OS_AUTH_TYPE=password +export OS_AUTH_URL=${OS_AUTH_URL} +export OS_DOMAIN_NAME=${OS_DOMAIN_NAME} +export OS_IDENTITY_API_VERSION=3 +export OS_INTERFACE=public +export OS_PASSWORD=${OS_PASSWORD} +export OS_PROJECT_DOMAIN_NAME=${OS_DOMAIN_NAME} +export OS_PROJECT_NAME=${OS_PROJECT_NAME} +export OS_REGION_NAME=${OS_REGION_NAME} +export OS_TENANT_NAME=${OS_USERNAME} +export OS_USERNAME=${OS_USERNAME} +export OS_USER_DOMAIN_NAME=${OS_DOMAIN_NAME} +EOF + + ssh -o StrictHostKeyChecking=no -i hackfest_rsa ubuntu@${IP} ". .profile;osm version" + while [ $? -ne -0 ] ; do + ssh -o StrictHostKeyChecking=no -i hackfest_rsa ubuntu@${IP} ". .profile;osm version" + done + scp -o StrictHostKeyChecking=no -i hackfest_rsa ${OS_USERNAME}.rc ubuntu@${IP}: & + scp -o StrictHostKeyChecking=no -i hackfest_rsa hackfest-k8s.yaml ubuntu@${IP}:~/kubeconfig.yaml & + sleep 10 + ssh -o StrictHostKeyChecking=no -i hackfest_rsa ubuntu@${IP} ". .profile;osm vim-create --name openstack --user ${OS_USERNAME} --password ${OS_PASSWORD} --auth_url ${OS_AUTH_URL} --tenant ${OS_PROJECT_NAME} --account_type openstack --config=\"{ management_network_name: osm-ext, security_groups: default, insecure: true, project_domain_name: ${OS_PROJECT_DOMAIN_NAME}, user_domain_name: ${OS_USER_DOMAIN_NAME} }\"" 2>&1 | tee -a logs/osm-vim-k8scluster-add-${PARTICIPANT}.log + ssh -o StrictHostKeyChecking=no -i hackfest_rsa ubuntu@${IP} ". .profile;osm k8scluster-add --creds ~/kubeconfig.yaml --vim openstack --k8s-nets '{'net1': 'osm-ext'}' --version 1.26 --namespace hackfest --description 'Microk8s cluster' hackfest" 2>&1 | tee -a logs/osm-vim-k8scluster-add-${PARTICIPANT}.log + ssh -o StrictHostKeyChecking=no -i hackfest_rsa ubuntu@${IP} "echo . ~/${OS_USERNAME}.rc >> .bashrc" +done + +echo $0 $@ complete at $(date) \ No newline at end of file diff --git a/Hackfest_Demos/OSM-15/setup_scripts/run-vm-initial-setup.sh b/Hackfest_Demos/OSM-15/setup_scripts/run-vm-initial-setup.sh new file mode 100755 index 0000000000000000000000000000000000000000..5e4646e19fe1cee5f8cc8a045635b453043e25a5 --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/run-vm-initial-setup.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +echo $0 started at $(date) +. ./common-vars $@ +. ./main_credentials.rc + +for PARTICIPANT in `seq ${START} ${MAX}` ; do + VM_NAME=`expr charmedosm-${PARTICIPANT}` + IP=`openstack server list --name $VM_NAME --column Networks -f yaml | head -3 | tail -1 | grep -o '[0-9]\+[.][0-9]\+[.][0-9]\+[.][0-9]\+'` + echo $IP + scp -o StrictHostKeyChecking=no -i hackfest_rsa ./vm-initial-setup.sh ubuntu@${IP}: & + scp -o StrictHostKeyChecking=no -i hackfest_rsa ./hackfest15admin.pub ubuntu@${IP}: & + sleep 10 + ssh -o StrictHostKeyChecking=no -i hackfest_rsa ubuntu@${IP} ". ~/vm-initial-setup.sh" 2>&1 | tee -a logs/vm-initial-setup-${PARTICIPANT}.log & +done +wait + +echo $0 $@ complete at $(date) \ No newline at end of file diff --git a/Hackfest_Demos/OSM-15/setup_scripts/vm-initial-setup.sh b/Hackfest_Demos/OSM-15/setup_scripts/vm-initial-setup.sh new file mode 100755 index 0000000000000000000000000000000000000000..c58a643b5988b15e424956242fb8f771ae63306e --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/vm-initial-setup.sh @@ -0,0 +1,61 @@ +#!/bin/bash +echo $0 started at $(date) + +sudo sed -i "s/127.0.0.1 /127.0.0.1 $HOSTNAME /" /etc/hosts +echo 'ubuntu:hackfest'| sudo chpasswd +sudo sed -i "s/^PasswordAuthentication.*/PasswordAuthentication yes/" /etc/ssh/sshd_config +sudo service ssh restart +echo "Acquire::http::Proxy \"http://172.21.1.1:3142\";" | sudo tee /etc/apt/apt.conf.d/proxy.conf +echo "Acquire::https::Proxy \"http://172.21.1.1:3142\";" | sudo tee -a /etc/apt/apt.conf.d/proxy.conf + +sudo apt update +sudo apt full-upgrade -y + +sudo snap install code --classic +sudo snap install openstackclients yq jq + +echo net.ipv4.ip_forward=1 | sudo tee -a /etc/sysctl.conf +sudo sysctl net.ipv4.ip_forward=1 +sudo iptables -t nat -A POSTROUTING -o ens3 -j MASQUERADE +cat << EOF | sudo tee /etc/rc.local +#!/bin/sh -e +echo iptables -t nat -A POSTROUTING -o ens3 -j MASQUERADE +EOF +sudo chmod +x /etc/rc.local + +git clone --recurse-submodules -j8 https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages.git + +# Clone OSM code +mkdir $HOME/OSM/ +pushd $HOME/OSM +BRANCH=master +for MDG in common devops IM LCM MON N2VC NBI NG-SA NG-UI osmclient PLA POL RO tests; do + git clone https://osm.etsi.org/gerrit/osm/${MDG} + git -C ${MDG} checkout ${BRANCH} +done +popd + +# Create directory for kubeconfig +mkdir $HOME/.kube + +# Add hackfest15admin public keys +cat ~/hackfest15admin.pub >> ~/.ssh/authorized_keys + +# Export Module paths +cat << 'EOF' > $HOME/osm-vars.sh +export GIT_PATH=$HOME/OSM +export COMMON_LOCAL_PATH="$GIT_PATH/common" +export LCM_LOCAL_PATH="$GIT_PATH/LCM" +export MON_LOCAL_PATH="$GIT_PATH/MON" +export N2VC_LOCAL_PATH="$GIT_PATH/N2VC" +export NBI_LOCAL_PATH="$GIT_PATH/NBI" +export POL_LOCAL_PATH="$GIT_PATH/POL" +export RO_LOCAL_PATH="$GIT_PATH/RO" +EOF + +echo ". $HOME/osm-vars.sh" >> $HOME/.bashrc +. $HOME/osm-vars.sh + +echo $0 $@ complete at $(date) + +sudo reboot diff --git a/Hackfest_Demos/OSM-15/setup_scripts/vm-install-osm.sh b/Hackfest_Demos/OSM-15/setup_scripts/vm-install-osm.sh new file mode 100755 index 0000000000000000000000000000000000000000..512203ece2698b3d99da709de9f69c1c7629cb32 --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/vm-install-osm.sh @@ -0,0 +1,45 @@ +#!/bin/bash +echo $0 started at $(date) + +sudo snap install microk8s --classic --channel=1.26/stable +sudo snap install jq + +sudo mkdir -p /var/snap/microk8s/current/args/certs.d/docker.io +cat << EOF | sudo tee /var/snap/microk8s/current/args/certs.d/docker.io/hosts.toml +server = "http://172.21.1.1:5000" + +[host."http://172.21.1.1:5000"] +capabilities = ["pull", "resolve"] +skip_verify = true +plain-http = true +EOF + +sudo systemctl restart snap.microk8s.daemon-containerd.service +sudo microk8s.enable hostpath-storage + +sudo usermod -a -G microk8s ubuntu +sudo chown -f -R ubuntu ~/.kube +sudo snap alias microk8s.kubectl kubectl + +wget https://osm-download.etsi.org/ftp/osm-13.0-thirteen/install_osm.sh +chmod +x ./install_osm.sh +./install_osm.sh --charmed --bundle ~/bundle.yaml -R testing-daily -t testing-daily -r testing -y 2>&1 | tee charmed_install_log.txt + +# Set our environment to talk to the new OSM +grep '^export OSM' ~/charmed_install_log.txt >> ~/.bashrc +grep '^export OSM' ~/charmed_install_log.txt >> ~/.profile + +while [ 1 ] ; do + . .profile;osm version + if [ $? -eq 0 ]; then break ; fi +done + +. .profile; osm user-update admin --password admin +echo "export OSM_PASSWORD=admin" >> .bashrc +echo "export OSM_PASSWORD=admin" >> .profile + +# Set some sane defaults for LXD +lxc profile set default limits.memory 1GB +lxc profile set default limits.cpu 2 + +echo $0 $@ complete at $(date) \ No newline at end of file diff --git a/Hackfest_Demos/OSM-15/setup_scripts/vm-microk8s-setup.sh b/Hackfest_Demos/OSM-15/setup_scripts/vm-microk8s-setup.sh new file mode 100755 index 0000000000000000000000000000000000000000..8dfb22fcc12131be37fb2a1b3ac81cee1a71e49d --- /dev/null +++ b/Hackfest_Demos/OSM-15/setup_scripts/vm-microk8s-setup.sh @@ -0,0 +1,44 @@ +#!/bin/bash +echo $0 started at $(date) + +sudo sed -i "s/127.0.0.1 /127.0.0.1 $HOSTNAME /" /etc/hosts +echo 'ubuntu:hackfest'| sudo chpasswd +sudo sed -i "s/^PasswordAuthentication.*/PasswordAuthentication yes/" /etc/ssh/sshd_config +sudo service ssh restart +echo "Acquire::http::Proxy \"http://172.21.1.1:3142\";" | sudo tee /etc/apt/apt.conf.d/proxy.conf +echo "Acquire::https::Proxy \"http://172.21.1.1:3142\";" | sudo tee -a /etc/apt/apt.conf.d/proxy.conf + +sudo apt update +sudo apt full-upgrade -y + +sudo snap install microk8s --classic --channel=1.26/stable +sudo mkdir -p /var/snap/microk8s/current/args/certs.d/docker.io +cat << EOF | sudo tee /var/snap/microk8s/current/args/certs.d/docker.io/hosts.toml +server = "http://172.21.1.1:5000" + +[host."http://172.21.1.1:5000"] +capabilities = ["pull", "resolve"] +skip_verify = true +plain-http = true +EOF + +sudo systemctl restart snap.microk8s.daemon-containerd.service +sudo microk8s.enable hostpath-storage + +FLOATING_IP=172.21.249.42 +sudo sed -i "/^IP.2 = .*/a IP.3 = ${FLOATING_IP}" /var/snap/microk8s/current/certs/csr.conf.template + +METALLB_START=10.1.0.10 +METALLB_END=10.1.1.254 + +sudo microk8s.enable metallb:${METALLB_START}-${METALLB_END} +sudo microk8s.enable ingress storage dns +sudo microk8s status --wait-ready +KUBECONFIG=~/kubeconfig.yaml +sudo microk8s config | tee ${KUBECONFIG} + +sudo usermod -a -G microk8s ubuntu +sudo chown -f -R ubuntu ~/.kube +sudo snap alias microk8s.kubectl kubectl + +echo $0 $@ complete at $(date) \ No newline at end of file