From: beierlm Date: Fri, 23 Oct 2020 18:54:56 +0000 (-0400) Subject: Merge branch 'v8.0' X-Git-Tag: release-v9.0-start~50 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=b1a1c46a60aa4981c7b01e9d6ff95958db7749a5;hp=358a7c3091330ec57479be685c2a0e5689fe3037;p=osm%2Fdevops.git Merge branch 'v8.0' Change-Id: I96d3bae3abca7b2a5f66bca591b4358d6c921f3d Signed-off-by: beierlm --- diff --git a/installers/charm/lcm-k8s/reactive/lcm.py b/installers/charm/lcm-k8s/reactive/lcm.py index 313ed63a..1cb46610 100644 --- a/installers/charm/lcm-k8s/reactive/lcm.py +++ b/installers/charm/lcm-k8s/reactive/lcm.py @@ -11,18 +11,20 @@ # 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. -from charms.layer.caas_base import pod_spec_set -from charms.reactive import endpoint_from_flag -from charms.reactive import when, when_not, hook -from charms.reactive.flags import set_flag, clear_flag +import logging +import yaml + from charmhelpers.core.hookenv import ( log, metadata, config, ) from charms import layer -import yaml -import logging +from charms.layer.caas_base import pod_spec_set +from charms.reactive import endpoint_from_flag +from charms.reactive import when, when_not, hook +from charms.reactive.flags import set_flag, clear_flag + logger = logging.getLogger(__name__) diff --git a/installers/charm/ng-ui/hooks/start b/installers/charm/ng-ui/hooks/start new file mode 120000 index 00000000..25b1f68f --- /dev/null +++ b/installers/charm/ng-ui/hooks/start @@ -0,0 +1 @@ +../src/charm.py \ No newline at end of file diff --git a/installers/charm/ng-ui/lib/ops b/installers/charm/ng-ui/lib/ops new file mode 120000 index 00000000..d9341932 --- /dev/null +++ b/installers/charm/ng-ui/lib/ops @@ -0,0 +1 @@ +../mod/operator/ops \ No newline at end of file diff --git a/installers/charm/ng-ui/src/charm.py b/installers/charm/ng-ui/src/charm.py index 8e21bcd2..d9ad8f2a 100755 --- a/installers/charm/ng-ui/src/charm.py +++ b/installers/charm/ng-ui/src/charm.py @@ -13,11 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys -import logging import base64 - -sys.path.append("lib") +from glob import glob +import logging +from pathlib import Path +from string import Template +import sys from ops.charm import CharmBase from ops.framework import StoredState, Object @@ -30,9 +31,9 @@ from ops.model import ( WaitingStatus, ) -from glob import glob -from pathlib import Path -from string import Template + +sys.path.append("lib") + logger = logging.getLogger(__name__) @@ -158,6 +159,8 @@ class NGUICharm(CharmBase): } ) + logger.debug(files) + spec = { "version": 2, "containers": [ diff --git a/installers/charm/pla/hooks/install b/installers/charm/pla/hooks/install new file mode 120000 index 00000000..25b1f68f --- /dev/null +++ b/installers/charm/pla/hooks/install @@ -0,0 +1 @@ +../src/charm.py \ No newline at end of file diff --git a/installers/charm/pla/hooks/start b/installers/charm/pla/hooks/start new file mode 120000 index 00000000..25b1f68f --- /dev/null +++ b/installers/charm/pla/hooks/start @@ -0,0 +1 @@ +../src/charm.py \ No newline at end of file diff --git a/installers/charm/pla/hooks/upgrade-charm b/installers/charm/pla/hooks/upgrade-charm new file mode 120000 index 00000000..25b1f68f --- /dev/null +++ b/installers/charm/pla/hooks/upgrade-charm @@ -0,0 +1 @@ +../src/charm.py \ No newline at end of file diff --git a/installers/charm/pla/lib/ops b/installers/charm/pla/lib/ops new file mode 120000 index 00000000..d9341932 --- /dev/null +++ b/installers/charm/pla/lib/ops @@ -0,0 +1 @@ +../mod/operator/ops \ No newline at end of file diff --git a/installers/charm/pla/src/charm.py b/installers/charm/pla/src/charm.py index e137394e..785766de 100755 --- a/installers/charm/pla/src/charm.py +++ b/installers/charm/pla/src/charm.py @@ -13,10 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys +from glob import glob import logging - -sys.path.append("lib") +from pathlib import Path +from string import Template +import sys from ops.charm import CharmBase from ops.framework import StoredState, Object @@ -27,9 +28,9 @@ from ops.model import ( WaitingStatus, ) -from glob import glob -from pathlib import Path -from string import Template + +sys.path.append("lib") + logger = logging.getLogger(__name__) @@ -84,7 +85,7 @@ class PLACharm(CharmBase): config = self.framework.model.config ports = [ - {"name": "port", "containerPort": config["port"], "protocol": "TCP",}, + {"name": "port", "containerPort": config["port"], "protocol": "TCP", }, ] config_spec = { diff --git a/installers/charmed_install.sh b/installers/charmed_install.sh index d0418a88..f0f729e6 100755 --- a/installers/charmed_install.sh +++ b/installers/charmed_install.sh @@ -261,7 +261,8 @@ function deploy_charmed_osm(){ function check_osm_deployed() { TIME_TO_WAIT=600 start_time="$(date -u +%s)" - total_service_count=14 + total_service_count=15 + previous_count=0 while true do service_count=$(juju status | grep kubernetes | grep active | wc -l) @@ -269,6 +270,10 @@ function check_osm_deployed() { if [ $service_count -eq $total_service_count ]; then break fi + if [ $service_count -ne $previous_count ]; then + previous_count=$service_count + start_time="$(date -u +%s)" + fi now="$(date -u +%s)" if [[ $(( now - start_time )) -gt $TIME_TO_WAIT ]];then echo "Timed out waiting for OSM services to become ready" @@ -403,14 +408,16 @@ if [ -v MICROSTACK ]; then install_microstack fi +OSM_HOSTNAME=$(juju config nbi-k8s juju-external-hostname):443 + echo "Your installation is now complete, follow these steps for configuring the osmclient:" echo echo "1. Create the OSM_HOSTNAME environment variable with the NBI IP" echo -echo "export OSM_HOSTNAME=nbi.$API_SERVER.xip.io:443" +echo "export OSM_HOSTNAME=$OSM_HOSTNAME" echo echo "2. Add the previous command to your .bashrc for other Shell sessions" echo -echo "echo \"export OSM_HOSTNAME=nbi.$API_SERVER.xip.io:443\" >> ~/.bashrc" +echo "echo \"export OSM_HOSTNAME=$OSM_HOSTNAME\" >> ~/.bashrc" echo echo "DONE"