From: David Garcia Date: Tue, 1 Feb 2022 15:39:44 +0000 (+0100) Subject: Charmed OSM: migration to CharmHub X-Git-Tag: v12.0.0rc1~39 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=53a09d8a21b6b4c2a3e17ce302c3aec4b220b040;p=osm%2Fdevops.git Charmed OSM: migration to CharmHub Change-Id: I7dd740b0ed007360767998372f97c53b5269fdf4 Signed-off-by: David Garcia --- diff --git a/installers/charm/bundles/osm-ha/bundle.yaml b/installers/charm/bundles/osm-ha/bundle.yaml index 752cf567..202ee2b7 100644 --- a/installers/charm/bundles/osm-ha/bundle.yaml +++ b/installers/charm/bundles/osm-ha/bundle.yaml @@ -11,6 +11,8 @@ # 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-ha +bundle: kubernetes description: | **A high-available Charmed OSM cluster** @@ -26,11 +28,10 @@ description: | - Highly Available and resilient against failures - Supported with Ubuntu Advantage - Availability of managed services -bundle: kubernetes applications: zookeeper: - charm: "cs:~charmed-osm/zookeeper-1" - channel: "stable" + charm: osm-zookeeper + channel: latest/edge scale: 3 series: kubernetes storage: @@ -40,9 +41,8 @@ applications: annotations: gui-x: 0 gui-y: 500 - mariadb-k8s: - charm: "cs:~charmed-osm/mariadb-k8s" - channel: "stable" + mariadb: + charm: charmed-osm-mariadb-k8s scale: 3 series: kubernetes storage: @@ -56,8 +56,8 @@ applications: gui-x: -300 gui-y: -250 kafka: - charm: "cs:~charmed-osm/kafka-1" - channel: "stable" + charm: osm-kafka + channel: latest/edge scale: 3 series: kubernetes storage: @@ -69,7 +69,8 @@ applications: gui-x: 0 gui-y: 250 mongodb: - charm: ch:mongodb-k8s + charm: mongodb-k8s + channel: latest/stable scale: 3 series: kubernetes storage: @@ -78,7 +79,8 @@ applications: gui-x: 0 gui-y: 0 nbi: - charm: "cs:~charmed-osm/nbi-18" + charm: osm-nbi + channel: latest/edge scale: 3 series: kubernetes options: @@ -89,7 +91,8 @@ applications: gui-x: 0 gui-y: -250 ro: - charm: "cs:~charmed-osm/ro-10" + charm: osm-ro + channel: latest/edge scale: 3 series: kubernetes options: @@ -98,14 +101,16 @@ applications: gui-x: -300 gui-y: 250 ng-ui: - charm: "cs:~charmed-osm/ng-ui-25" + charm: osm-ng-ui + channel: latest/edge scale: 3 series: kubernetes annotations: gui-x: 600 gui-y: 0 lcm: - charm: "cs:~charmed-osm/lcm-15" + charm: osm-lcm + channel: latest/edge scale: 3 series: kubernetes options: @@ -115,7 +120,8 @@ applications: gui-x: -300 gui-y: 0 mon: - charm: "cs:~charmed-osm/mon-12" + charm: osm-mon + channel: latest/edge scale: 1 series: kubernetes options: @@ -126,7 +132,8 @@ applications: gui-x: 300 gui-y: 0 pol: - charm: "cs:~charmed-osm/pol-10" + charm: osm-pol + channel: latest/edge scale: 3 series: kubernetes options: @@ -135,7 +142,8 @@ applications: gui-x: -300 gui-y: 500 pla: - charm: "cs:~charmed-osm/pla-13" + charm: osm-pla + channel: latest/edge scale: 3 series: kubernetes options: @@ -144,7 +152,8 @@ applications: gui-x: 600 gui-y: -250 prometheus: - charm: "cs:~charmed-osm/prometheus-9" + charm: osm-prometheus + channel: latest/edge scale: 1 series: kubernetes storage: @@ -155,16 +164,17 @@ applications: gui-x: 300 gui-y: 250 grafana: - charm: "cs:~charmed-osm/grafana-10" + charm: osm-grafana + channel: latest/edge scale: 3 series: kubernetes annotations: gui-x: 300 gui-y: 500 keystone: - charm: "cs:~charmed-osm/keystone-16" + charm: osm-keystone + channel: latest/edge scale: 1 - series: kubernetes annotations: gui-x: 300 gui-y: -250 @@ -174,7 +184,7 @@ relations: - - kafka:zookeeper - zookeeper:zookeeper - - keystone:db - - mariadb-k8s:mysql + - mariadb:mysql - - lcm:kafka - kafka:kafka - - lcm:mongodb @@ -211,7 +221,7 @@ relations: - nbi:nbi - - mon:keystone - keystone:keystone - - - mariadb-k8s:mysql + - - mariadb:mysql - pol:mysql - - grafana:db - - mariadb-k8s:mysql + - mariadb:mysql diff --git a/installers/charm/bundles/osm-ha/charmcraft.yaml b/installers/charm/bundles/osm-ha/charmcraft.yaml new file mode 100644 index 00000000..111b05c9 --- /dev/null +++ b/installers/charm/bundles/osm-ha/charmcraft.yaml @@ -0,0 +1,14 @@ +# Copyright 2022 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. +type: bundle diff --git a/installers/charm/bundles/osm/bundle.yaml b/installers/charm/bundles/osm/bundle.yaml index 9031388a..fa367dc5 100644 --- a/installers/charm/bundles/osm/bundle.yaml +++ b/installers/charm/bundles/osm/bundle.yaml @@ -11,6 +11,8 @@ # 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 description: | **Single instance Charmed OSM** @@ -25,10 +27,10 @@ description: | - Stable and secure - Supported with Ubuntu Advantage - Availability of managed services -bundle: kubernetes applications: zookeeper: - charm: "cs:~charmed-osm/zookeeper-1" + charm: osm-zookeeper + channel: latest/edge scale: 1 series: kubernetes storage: @@ -36,9 +38,8 @@ applications: annotations: gui-x: 0 gui-y: 500 - mariadb-k8s: - charm: "cs:~charmed-osm/mariadb-k8s" - channel: "stable" + mariadb: + charm: charmed-osm-mariadb-k8s scale: 1 series: kubernetes storage: @@ -51,7 +52,8 @@ applications: gui-x: -300 gui-y: -250 kafka: - charm: "cs:~charmed-osm/kafka-1" + charm: osm-kafka + channel: latest/edge scale: 1 series: kubernetes storage: @@ -60,7 +62,8 @@ applications: gui-x: 0 gui-y: 250 mongodb: - charm: ch:mongodb-k8s + charm: mongodb-k8s + channel: latest/stable scale: 1 series: kubernetes storage: @@ -69,7 +72,8 @@ applications: gui-x: 0 gui-y: 0 nbi: - charm: "cs:~charmed-osm/nbi-18" + charm: osm-nbi + channel: latest/edge scale: 1 series: kubernetes options: @@ -80,7 +84,8 @@ applications: gui-x: 0 gui-y: -250 ro: - charm: "cs:~charmed-osm/ro-10" + charm: osm-ro + channel: latest/edge scale: 1 series: kubernetes options: @@ -89,14 +94,16 @@ applications: gui-x: -300 gui-y: 250 ng-ui: - charm: "cs:~charmed-osm/ng-ui-25" + charm: osm-ng-ui + channel: latest/edge scale: 1 series: kubernetes annotations: gui-x: 600 gui-y: 0 lcm: - charm: "cs:~charmed-osm/lcm-15" + charm: osm-lcm + channel: latest/edge scale: 1 series: kubernetes options: @@ -106,7 +113,8 @@ applications: gui-x: -300 gui-y: 0 mon: - charm: "cs:~charmed-osm/mon-12" + charm: osm-mon + channel: latest/edge scale: 1 series: kubernetes options: @@ -117,7 +125,8 @@ applications: gui-x: 300 gui-y: 0 pol: - charm: "cs:~charmed-osm/pol-10" + charm: osm-pol + channel: latest/edge scale: 1 series: kubernetes options: @@ -126,7 +135,8 @@ applications: gui-x: -300 gui-y: 500 pla: - charm: "cs:~charmed-osm/pla-13" + charm: osm-pla + channel: latest/edge scale: 1 series: kubernetes options: @@ -135,7 +145,8 @@ applications: gui-x: 600 gui-y: -250 prometheus: - charm: "cs:~charmed-osm/prometheus-9" + charm: osm-prometheus + channel: latest/edge scale: 1 series: kubernetes storage: @@ -146,16 +157,17 @@ applications: gui-x: 300 gui-y: 250 grafana: - charm: "cs:~charmed-osm/grafana-10" + charm: osm-grafana + channel: latest/edge scale: 1 series: kubernetes annotations: gui-x: 300 gui-y: 500 keystone: - charm: "cs:~charmed-osm/keystone-16" + charm: osm-keystone + channel: latest/edge scale: 1 - series: kubernetes annotations: gui-x: 300 gui-y: -250 @@ -165,7 +177,7 @@ relations: - - kafka:zookeeper - zookeeper:zookeeper - - keystone:db - - mariadb-k8s:mysql + - mariadb:mysql - - lcm:kafka - kafka:kafka - - lcm:mongodb @@ -202,7 +214,7 @@ relations: - nbi:nbi - - mon:keystone - keystone:keystone - - - mariadb-k8s:mysql + - - mariadb:mysql - pol:mysql - - grafana:db - - mariadb-k8s:mysql + - mariadb:mysql diff --git a/installers/charm/bundles/osm/charmcraft.yaml b/installers/charm/bundles/osm/charmcraft.yaml new file mode 100644 index 00000000..111b05c9 --- /dev/null +++ b/installers/charm/bundles/osm/charmcraft.yaml @@ -0,0 +1,14 @@ +# Copyright 2022 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. +type: bundle diff --git a/installers/charm/grafana/icon.svg b/installers/charm/grafana/icon.svg new file mode 100644 index 00000000..49c744d4 --- /dev/null +++ b/installers/charm/grafana/icon.svg @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/installers/charm/grafana/metadata.yaml b/installers/charm/grafana/metadata.yaml index 2db64c20..4a74db64 100644 --- a/installers/charm/grafana/metadata.yaml +++ b/installers/charm/grafana/metadata.yaml @@ -19,7 +19,7 @@ # osm-charmers@lists.launchpad.net ## -name: grafana +name: osm-grafana summary: OSM Grafana description: | A CAAS charm to deploy OSM's Grafana. diff --git a/installers/charm/kafka/icon.svg b/installers/charm/kafka/icon.svg new file mode 100644 index 00000000..de5ab1be --- /dev/null +++ b/installers/charm/kafka/icon.svg @@ -0,0 +1,21 @@ + + + kafka + Created with Sketch. + + + + + + + + + + + + + + + + + diff --git a/installers/charm/kafka/metadata.yaml b/installers/charm/kafka/metadata.yaml index d1544068..78bbee69 100644 --- a/installers/charm/kafka/metadata.yaml +++ b/installers/charm/kafka/metadata.yaml @@ -19,7 +19,7 @@ # osm-charmers@lists.launchpad.net ## -name: kafka +name: osm-kafka summary: "Kafka charm for Kubernetes." description: | A CAAS charm to deploy kafka. diff --git a/installers/charm/lcm/metadata.yaml b/installers/charm/lcm/metadata.yaml index c2d4985c..e81cdd9b 100644 --- a/installers/charm/lcm/metadata.yaml +++ b/installers/charm/lcm/metadata.yaml @@ -19,7 +19,7 @@ # osm-charmers@lists.launchpad.net ## -name: lcm +name: osm-lcm summary: OSM Lifecycle Management (LCM) description: | A CAAS charm to deploy OSM's Lifecycle Management (LCM). diff --git a/installers/charm/mariadb-k8s/charmcraft.yaml b/installers/charm/mariadb-k8s/charmcraft.yaml new file mode 100644 index 00000000..69a510cb --- /dev/null +++ b/installers/charm/mariadb-k8s/charmcraft.yaml @@ -0,0 +1,34 @@ +# Copyright 2021 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. +# +# For those usages not covered by the Apache License, Version 2.0 please +# contact: legal@canonical.com +# +# To get in touch with the maintainers, please contact: +# osm-charmers@lists.launchpad.net +## + +type: "charm" +bases: + - build-on: + - name: "ubuntu" + channel: "20.04" + run-on: + - name: "ubuntu" + channel: "20.04" +parts: + charm: + source: . + plugin: reactive + build-snaps: [charm] diff --git a/installers/charm/mariadb-k8s/metadata.yaml b/installers/charm/mariadb-k8s/metadata.yaml index 2823c61b..a8021153 100755 --- a/installers/charm/mariadb-k8s/metadata.yaml +++ b/installers/charm/mariadb-k8s/metadata.yaml @@ -19,12 +19,12 @@ # osm-charmers@lists.launchpad.net ## -name: mariadb-k8s +name: osm-mariadb summary: MariaDB is a popular database server made by the developers of MySQL. -docs: https://discourse.charmhub.io/t/mariadb-documentation-overview/4116 +# docs: https://discourse.charmhub.io/t/mariadb-documentation-overview/4116 maintainers: - OSM Charmers -description: > +description: | MariaDB Server is one of the most popular database servers in the world. It's made by the original developers of MySQL and guaranteed to stay open source. Notable users include Wikipedia, WordPress.com and Google. diff --git a/installers/charm/mariadb-k8s/reactive/mariadb.py b/installers/charm/mariadb-k8s/reactive/mariadb.py deleted file mode 100644 index 4eedcfbc..00000000 --- a/installers/charm/mariadb-k8s/reactive/mariadb.py +++ /dev/null @@ -1,141 +0,0 @@ -# Copyright 2021 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. -# -# For those usages not covered by the Apache License, Version 2.0 please -# contact: legal@canonical.com -# -# To get in touch with the maintainers, please contact: -# osm-charmers@lists.launchpad.net -## - -from charms.layer.caas_base import pod_spec_set -from charms.reactive import when, when_not, hook -from charms.reactive import endpoint_from_flag -from charms.reactive.flags import set_flag, get_state, clear_flag - -from charmhelpers.core.hookenv import ( - log, - metadata, - config, - application_name, -) -from charms import layer -from charms.osm.k8s import is_pod_up, get_service_ip - - -@hook("upgrade-charm") -@when("leadership.is_leader") -def upgrade(): - clear_flag("mariadb-k8s.configured") - - -@when("config.changed") -@when("leadership.is_leader") -def restart(): - clear_flag("mariadb-k8s.configured") - - -@when_not("mariadb-k8s.configured") -@when("leadership.is_leader") -def configure(): - layer.status.maintenance("Configuring mariadb-k8s container") - - spec = make_pod_spec() - log("set pod spec:\n{}".format(spec)) - pod_spec_set(spec) - - set_flag("mariadb-k8s.configured") - - -@when("mariadb-k8s.configured") -def set_mariadb_active(): - layer.status.active("ready") - - -@when_not("leadership.is_leader") -def non_leaders_active(): - layer.status.active("ready") - - -@when("mariadb-k8s.configured", "mysql.database.requested") -def provide_database(): - mysql = endpoint_from_flag("mysql.database.requested") - - if not is_pod_up("mysql"): - log("The pod is not ready.") - return - - for request, application in mysql.database_requests().items(): - try: - - log("request -> {0} for app -> {1}".format(request, application)) - user = get_state("user") - password = get_state("password") - database_name = get_state("database") - root_password = get_state("root_password") - - log("db params: {0}:{1}@{2}".format(user, password, database_name)) - - service_ip = get_service_ip("mysql") - if service_ip: - mysql.provide_database( - request_id=request, - host=service_ip, - port=3306, - database_name=database_name, - user=user, - password=password, - root_password=root_password, - ) - mysql.mark_complete() - except Exception as e: - log("Exception while providing database: {}".format(e)) - - -def make_pod_spec(): - """Make pod specification for Kubernetes - - Returns: - pod_spec: Pod specification for Kubernetes - """ - if config().get("ha-mode"): - with open("reactive/spec_template_ha.yaml") as spec_file: - pod_spec_template = spec_file.read() - image = config().get("ha-image") - else: - with open("reactive/spec_template.yaml") as spec_file: - pod_spec_template = spec_file.read() - image = config().get("image") - - md = metadata() - cfg = config() - - user = cfg.get("user") - password = cfg.get("password") - database = cfg.get("database") - root_password = cfg.get("root_password") - app_name = application_name() - - set_flag("user", user) - set_flag("password", password) - set_flag("database", database) - set_flag("root_password", root_password) - - data = { - "name": md.get("name"), - "docker_image": image, - "application_name": app_name, - } - data.update(cfg) - return pod_spec_template % data diff --git a/installers/charm/mariadb-k8s/reactive/osm_mariadb.py b/installers/charm/mariadb-k8s/reactive/osm_mariadb.py new file mode 100644 index 00000000..4eedcfbc --- /dev/null +++ b/installers/charm/mariadb-k8s/reactive/osm_mariadb.py @@ -0,0 +1,141 @@ +# Copyright 2021 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. +# +# For those usages not covered by the Apache License, Version 2.0 please +# contact: legal@canonical.com +# +# To get in touch with the maintainers, please contact: +# osm-charmers@lists.launchpad.net +## + +from charms.layer.caas_base import pod_spec_set +from charms.reactive import when, when_not, hook +from charms.reactive import endpoint_from_flag +from charms.reactive.flags import set_flag, get_state, clear_flag + +from charmhelpers.core.hookenv import ( + log, + metadata, + config, + application_name, +) +from charms import layer +from charms.osm.k8s import is_pod_up, get_service_ip + + +@hook("upgrade-charm") +@when("leadership.is_leader") +def upgrade(): + clear_flag("mariadb-k8s.configured") + + +@when("config.changed") +@when("leadership.is_leader") +def restart(): + clear_flag("mariadb-k8s.configured") + + +@when_not("mariadb-k8s.configured") +@when("leadership.is_leader") +def configure(): + layer.status.maintenance("Configuring mariadb-k8s container") + + spec = make_pod_spec() + log("set pod spec:\n{}".format(spec)) + pod_spec_set(spec) + + set_flag("mariadb-k8s.configured") + + +@when("mariadb-k8s.configured") +def set_mariadb_active(): + layer.status.active("ready") + + +@when_not("leadership.is_leader") +def non_leaders_active(): + layer.status.active("ready") + + +@when("mariadb-k8s.configured", "mysql.database.requested") +def provide_database(): + mysql = endpoint_from_flag("mysql.database.requested") + + if not is_pod_up("mysql"): + log("The pod is not ready.") + return + + for request, application in mysql.database_requests().items(): + try: + + log("request -> {0} for app -> {1}".format(request, application)) + user = get_state("user") + password = get_state("password") + database_name = get_state("database") + root_password = get_state("root_password") + + log("db params: {0}:{1}@{2}".format(user, password, database_name)) + + service_ip = get_service_ip("mysql") + if service_ip: + mysql.provide_database( + request_id=request, + host=service_ip, + port=3306, + database_name=database_name, + user=user, + password=password, + root_password=root_password, + ) + mysql.mark_complete() + except Exception as e: + log("Exception while providing database: {}".format(e)) + + +def make_pod_spec(): + """Make pod specification for Kubernetes + + Returns: + pod_spec: Pod specification for Kubernetes + """ + if config().get("ha-mode"): + with open("reactive/spec_template_ha.yaml") as spec_file: + pod_spec_template = spec_file.read() + image = config().get("ha-image") + else: + with open("reactive/spec_template.yaml") as spec_file: + pod_spec_template = spec_file.read() + image = config().get("image") + + md = metadata() + cfg = config() + + user = cfg.get("user") + password = cfg.get("password") + database = cfg.get("database") + root_password = cfg.get("root_password") + app_name = application_name() + + set_flag("user", user) + set_flag("password", password) + set_flag("database", database) + set_flag("root_password", root_password) + + data = { + "name": md.get("name"), + "docker_image": image, + "application_name": app_name, + } + data.update(cfg) + return pod_spec_template % data diff --git a/installers/charm/mon/metadata.yaml b/installers/charm/mon/metadata.yaml index 663315e4..f3c3990d 100644 --- a/installers/charm/mon/metadata.yaml +++ b/installers/charm/mon/metadata.yaml @@ -19,7 +19,7 @@ # osm-charmers@lists.launchpad.net ## -name: mon +name: osm-mon summary: OSM Monitoring (MON) description: | A CAAS charm to deploy OSM's Monitoring (MON). diff --git a/installers/charm/nbi/metadata.yaml b/installers/charm/nbi/metadata.yaml index 098387ff..381497b7 100644 --- a/installers/charm/nbi/metadata.yaml +++ b/installers/charm/nbi/metadata.yaml @@ -19,7 +19,7 @@ # osm-charmers@lists.launchpad.net ## -name: nbi +name: osm-nbi summary: OSM Northbound Interface (NBI) description: | A CAAS charm to deploy OSM's Northbound Interface (NBI). diff --git a/installers/charm/ng-ui/metadata.yaml b/installers/charm/ng-ui/metadata.yaml index 3ff7a975..60643b57 100644 --- a/installers/charm/ng-ui/metadata.yaml +++ b/installers/charm/ng-ui/metadata.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: ng-ui +name: osm-ng-ui summary: A Next Generation UI charm for Opensource MANO description: | New UI for OSM diff --git a/installers/charm/pla/metadata.yaml b/installers/charm/pla/metadata.yaml index b9a344bb..bd8b279d 100644 --- a/installers/charm/pla/metadata.yaml +++ b/installers/charm/pla/metadata.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: pla +name: osm-pla summary: A Placement charm for Opensource MANO description: | Placement module for OSM diff --git a/installers/charm/pol/metadata.yaml b/installers/charm/pol/metadata.yaml index e01293b4..f9f69231 100644 --- a/installers/charm/pol/metadata.yaml +++ b/installers/charm/pol/metadata.yaml @@ -19,7 +19,7 @@ # osm-charmers@lists.launchpad.net ## -name: pol +name: osm-pol summary: OSM Policy Module (POL) description: | A CAAS charm to deploy OSM's Policy Module (POL). diff --git a/installers/charm/prometheus/charmcraft.yaml b/installers/charm/prometheus/charmcraft.yaml index 0a285a9d..babeda83 100644 --- a/installers/charm/prometheus/charmcraft.yaml +++ b/installers/charm/prometheus/charmcraft.yaml @@ -34,4 +34,6 @@ bases: - arm64 parts: charm: - build-packages: [git] + build-packages: + - git + - libffi-dev diff --git a/installers/charm/prometheus/icon.svg b/installers/charm/prometheus/icon.svg new file mode 100644 index 00000000..5c51f66d --- /dev/null +++ b/installers/charm/prometheus/icon.svg @@ -0,0 +1,50 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/installers/charm/prometheus/metadata.yaml b/installers/charm/prometheus/metadata.yaml index 0e09c3b5..932ccc21 100644 --- a/installers/charm/prometheus/metadata.yaml +++ b/installers/charm/prometheus/metadata.yaml @@ -19,7 +19,7 @@ # osm-charmers@lists.launchpad.net ## -name: prometheus +name: osm-prometheus summary: OSM Prometheus description: | A CAAS charm to deploy OSM's Prometheus. diff --git a/installers/charm/prometheus/tests/test_charm.py b/installers/charm/prometheus/tests/test_charm.py index 687c38a6..965400a4 100644 --- a/installers/charm/prometheus/tests/test_charm.py +++ b/installers/charm/prometheus/tests/test_charm.py @@ -77,7 +77,7 @@ class TestCharm(unittest.TestCase): ) -> NoReturn: """Test to see if prometheus relation is updated.""" expected_result = { - "hostname": "prometheus", + "hostname": self.harness.charm.app.name, "port": "9090", "user": "admin", "password": "1234", @@ -85,7 +85,9 @@ class TestCharm(unittest.TestCase): relation_id = self.harness.add_relation("prometheus", "mon") self.harness.add_relation_unit(relation_id, "mon/0") - relation_data = self.harness.get_relation_data(relation_id, "prometheus") + relation_data = self.harness.get_relation_data( + relation_id, self.harness.charm.app.name + ) self.assertDictEqual(expected_result, relation_data) @@ -98,7 +100,9 @@ class TestCharm(unittest.TestCase): self.harness.set_leader(is_leader=False) relation_id = self.harness.add_relation("prometheus", "mon") self.harness.add_relation_unit(relation_id, "mon/0") - relation_data = self.harness.get_relation_data(relation_id, "prometheus") + relation_data = self.harness.get_relation_data( + relation_id, self.harness.charm.app.name + ) self.assertDictEqual(expected_result, relation_data) diff --git a/installers/charm/ro/metadata.yaml b/installers/charm/ro/metadata.yaml index eea0e9e7..6e82e8cc 100644 --- a/installers/charm/ro/metadata.yaml +++ b/installers/charm/ro/metadata.yaml @@ -19,7 +19,7 @@ # osm-charmers@lists.launchpad.net ## -name: ro +name: osm-ro summary: OSM Resource Orchestrator (RO) description: | A CAAS charm to deploy OSM's Resource Orchestrator (RO). diff --git a/installers/charm/zookeeper/icon.svg b/installers/charm/zookeeper/icon.svg new file mode 100644 index 00000000..0185a7e1 --- /dev/null +++ b/installers/charm/zookeeper/icon.svg @@ -0,0 +1,38 @@ + + + + zookeeper + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/installers/charm/zookeeper/metadata.yaml b/installers/charm/zookeeper/metadata.yaml index 5a8bfb41..d352a6cd 100644 --- a/installers/charm/zookeeper/metadata.yaml +++ b/installers/charm/zookeeper/metadata.yaml @@ -19,7 +19,7 @@ # osm-charmers@lists.launchpad.net ## -name: zookeeper +name: osm-zookeeper summary: "Zookeeper charm for Kubernetes." description: | A CAAS charm to deploy zookeeper. diff --git a/installers/charmed_install.sh b/installers/charmed_install.sh index 82c70b1d..a2b04aad 100755 --- a/installers/charmed_install.sh +++ b/installers/charmed_install.sh @@ -21,7 +21,7 @@ JUJU_AGENT_VERSION=2.9.22 K8S_CLOUD_NAME="k8s-cloud" KUBECTL="microk8s.kubectl" MICROK8S_VERSION=1.23 -OSMCLIENT_VERSION=10.0 +OSMCLIENT_VERSION=latest IMAGES_OVERLAY_FILE=~/.osm/images-overlay.yaml PATH=/snap/bin:${PATH} @@ -361,7 +361,7 @@ EOF function generate_images_overlay(){ echo "applications:" > /tmp/images-overlay.yaml - charms_with_resources="nbi lcm mon pol ng-ui ro pla keystone" + charms_with_resources="nbi lcm mon pol ng-ui ro pla" for charm in $charms_with_resources; do cat << EOF > /tmp/${charm}_registry.yaml registrypath: ${REGISTRY_URL}opensourcemano/${charm}:$TAG @@ -376,6 +376,23 @@ EOF resources: image: /tmp/${charm}_registry.yaml +EOF + done + ch_charms_with_resources="keystone" + for charm in $ch_charms_with_resources; do + cat << EOF > /tmp/${charm}_registry.yaml +registrypath: ${REGISTRY_URL}opensourcemano/${charm}:$TAG +EOF + if [ ! -z "$REGISTRY_USERNAME" ] ; then + echo username: $REGISTRY_USERNAME >> /tmp/${charm}_registry.yaml + echo password: $REGISTRY_PASSWORD >> /tmp/${charm}_registry.yaml + fi + + cat << EOF >> /tmp/images-overlay.yaml + ${charm}: + resources: + ${charm}-image: /tmp/${charm}_registry.yaml + EOF done