Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
vnf-onboarding
OSM Packages
Commits
629c1606
Commit
629c1606
authored
Sep 15, 2021
by
Mark Beierl
Browse files
Merge branch 'manual-scaling-for-juju-app' into 'master'
New Package for testing Bug 1609 See merge request
!164
parents
288f8a18
f05b2d73
Pipeline
#2136
failed with stage
in 2 minutes
Changes
15
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
283 additions
and
0 deletions
+283
-0
.gitmodules
.gitmodules
+3
-0
charm-packages/native_manual_scale_charm_ns/icons/osm.png
charm-packages/native_manual_scale_charm_ns/icons/osm.png
+0
-0
charm-packages/native_manual_scale_charm_ns/native_charm_nsd.yaml
...ckages/native_manual_scale_charm_ns/native_charm_nsd.yaml
+26
-0
charm-packages/native_manual_scale_charm_vnf/charms/simple/actions.yaml
.../native_manual_scale_charm_vnf/charms/simple/actions.yaml
+25
-0
charm-packages/native_manual_scale_charm_vnf/charms/simple/config.yaml
...s/native_manual_scale_charm_vnf/charms/simple/config.yaml
+17
-0
charm-packages/native_manual_scale_charm_vnf/charms/simple/hooks/install
...native_manual_scale_charm_vnf/charms/simple/hooks/install
+1
-0
charm-packages/native_manual_scale_charm_vnf/charms/simple/hooks/start
...s/native_manual_scale_charm_vnf/charms/simple/hooks/start
+1
-0
charm-packages/native_manual_scale_charm_vnf/charms/simple/hooks/upgrade-charm
..._manual_scale_charm_vnf/charms/simple/hooks/upgrade-charm
+1
-0
charm-packages/native_manual_scale_charm_vnf/charms/simple/lib/ops
...kages/native_manual_scale_charm_vnf/charms/simple/lib/ops
+1
-0
charm-packages/native_manual_scale_charm_vnf/charms/simple/metadata.yaml
...native_manual_scale_charm_vnf/charms/simple/metadata.yaml
+25
-0
charm-packages/native_manual_scale_charm_vnf/charms/simple/mod/operator
.../native_manual_scale_charm_vnf/charms/simple/mod/operator
+1
-0
charm-packages/native_manual_scale_charm_vnf/charms/simple/src/charm.py
.../native_manual_scale_charm_vnf/charms/simple/src/charm.py
+67
-0
charm-packages/native_manual_scale_charm_vnf/cloud_init/cloud-config.txt
...native_manual_scale_charm_vnf/cloud_init/cloud-config.txt
+12
-0
charm-packages/native_manual_scale_charm_vnf/icons/osm.png
charm-packages/native_manual_scale_charm_vnf/icons/osm.png
+0
-0
charm-packages/native_manual_scale_charm_vnf/native_charm_vnfd.yaml
...ages/native_manual_scale_charm_vnf/native_charm_vnfd.yaml
+103
-0
No files found.
.gitmodules
View file @
629c1606
...
...
@@ -67,3 +67,6 @@
[submodule "charm-packages/native_k8s_scale_charm_vnf/charms/nginx-k8s/mod/operator"]
path = charm-packages/native_k8s_scale_charm_vnf/charms/nginx-k8s/mod/operator
url = https://github.com/canonical/operator
[submodule "charm-packages/native_manual_scale_charm_vnf/charms/simple/mod/operator"]
path = charm-packages/native_manual_scale_charm_vnf/charms/simple/mod/operator
url = https://github.com/canonical/operator.git
charm-packages/native_manual_scale_charm_ns/icons/osm.png
0 → 100644
View file @
629c1606
54.6 KB
charm-packages/native_manual_scale_charm_ns/native_charm_nsd.yaml
0 → 100644
View file @
629c1606
nsd
:
nsd
:
-
description
:
NS with 1 VNFs with cloudinit connected by datanet and mgmtnet VLs
df
:
-
id
:
default-df
vnf-profile
:
-
id
:
'
1'
virtual-link-connectivity
:
-
constituent-cpd-id
:
-
constituent-base-element-id
:
'
1'
constituent-cpd-id
:
vnf-mgmt-ext
virtual-link-profile-id
:
mgmtnet
-
constituent-cpd-id
:
-
constituent-base-element-id
:
'
1'
constituent-cpd-id
:
vnf-data-ext
virtual-link-profile-id
:
datanet
vnfd-id
:
native_manual_scale_charm-vnf
id
:
native_manual_scale_charm-ns
name
:
native_manual_scale_charm-ns
version
:
'
1.0'
virtual-link-desc
:
-
id
:
mgmtnet
mgmt-network
:
'
true'
-
id
:
datanet
vnfd-id
:
-
native_manual_scale_charm-vnf
charm-packages/native_manual_scale_charm_vnf/charms/simple/actions.yaml
0 → 100644
View file @
629c1606
##
# Copyright 2020 Canonical Ltd.
# All rights reserved.
#
# 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.
##
touch
:
description
:
"
Touch
a
file
on
the
VNF."
params
:
filename
:
description
:
"
The
name
of
the
file
to
touch."
type
:
string
default
:
"
"
required
:
-
filename
charm-packages/native_manual_scale_charm_vnf/charms/simple/config.yaml
0 → 100644
View file @
629c1606
##
# Copyright 2020 Canonical Ltd.
# All rights reserved.
#
# 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.
##
options
:
{}
\ No newline at end of file
charm-packages/native_manual_scale_charm_vnf/charms/simple/hooks/install
0 → 120000
View file @
629c1606
../src/charm.py
\ No newline at end of file
charm-packages/native_manual_scale_charm_vnf/charms/simple/hooks/start
0 → 120000
View file @
629c1606
../src/charm.py
\ No newline at end of file
charm-packages/native_manual_scale_charm_vnf/charms/simple/hooks/upgrade-charm
0 → 120000
View file @
629c1606
../src/charm.py
\ No newline at end of file
charm-packages/native_manual_scale_charm_vnf/charms/simple/lib/ops
0 → 120000
View file @
629c1606
../mod/operator/ops
\ No newline at end of file
charm-packages/native_manual_scale_charm_vnf/charms/simple/metadata.yaml
0 → 100644
View file @
629c1606
##
# Copyright 2020 Canonical Ltd.
# All rights reserved.
#
# 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
:
simple-native
summary
:
A simple native charm
description
:
|
Simple native charm
series
:
-
bionic
-
xenial
-
focal
\ No newline at end of file
operator
@
a84ce877
Subproject commit a84ce8776b368a8b2bccdb173716e342db9a6b36
charm-packages/native_manual_scale_charm_vnf/charms/simple/src/charm.py
0 → 100755
View file @
629c1606
#!/usr/bin/env python3
##
# Copyright 2020 Canonical Ltd.
# All rights reserved.
#
# 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.
##
import
sys
import
subprocess
sys
.
path
.
append
(
"lib"
)
from
ops.charm
import
CharmBase
from
ops.main
import
main
from
ops.model
import
ActiveStatus
class
MyNativeCharm
(
CharmBase
):
def
__init__
(
self
,
framework
,
key
):
super
().
__init__
(
framework
,
key
)
# Listen to charm events
self
.
framework
.
observe
(
self
.
on
.
config_changed
,
self
.
on_config_changed
)
self
.
framework
.
observe
(
self
.
on
.
install
,
self
.
on_install
)
self
.
framework
.
observe
(
self
.
on
.
start
,
self
.
on_start
)
# Listen to the touch action event
self
.
framework
.
observe
(
self
.
on
.
touch_action
,
self
.
on_touch_action
)
def
on_config_changed
(
self
,
event
):
"""Handle changes in configuration"""
self
.
model
.
unit
.
status
=
ActiveStatus
()
def
on_install
(
self
,
event
):
"""Called when the charm is being installed"""
self
.
model
.
unit
.
status
=
ActiveStatus
()
def
on_start
(
self
,
event
):
"""Called when the charm is being started"""
self
.
model
.
unit
.
status
=
ActiveStatus
()
def
on_touch_action
(
self
,
event
):
"""Touch a file."""
filename
=
event
.
params
[
"filename"
]
try
:
subprocess
.
run
([
"touch"
,
filename
],
check
=
True
)
event
.
set_results
({
"created"
:
True
,
"filename"
:
filename
})
except
subprocess
.
CalledProcessError
as
e
:
event
.
fail
(
"Action failed: {}"
.
format
(
e
))
self
.
model
.
unit
.
status
=
ActiveStatus
()
if
__name__
==
"__main__"
:
main
(
MyNativeCharm
)
charm-packages/native_manual_scale_charm_vnf/cloud_init/cloud-config.txt
0 → 100755
View file @
629c1606
#cloud-config
password: osm4u
chpasswd: { expire: False }
ssh_pwauth: True
write_files:
- content: |
# My new helloworld file
owner: root:root
permissions: '0644'
path: /root/helloworld.txt
charm-packages/native_manual_scale_charm_vnf/icons/osm.png
0 → 100644
View file @
629c1606
54.6 KB
charm-packages/native_manual_scale_charm_vnf/native_charm_vnfd.yaml
0 → 100644
View file @
629c1606
vnfd
:
description
:
A VNF consisting of 1 VDU connected to two external VL, and one for
data and another one for management
df
:
-
id
:
default-df
instantiation-level
:
-
id
:
default-instantiation-level
vdu-level
:
-
number-of-instances
:
2
vdu-id
:
mgmtVM
scaling-aspect
:
-
id
:
manual-scaling_mgmtVM
aspect-delta-details
:
deltas
:
-
id
:
mgmtVM_manual-scaling
vdu-delta
:
-
id
:
mgmtVM
number-of-instances
:
1
name
:
manual-scaling_mgmtVM
vdu-profile
:
-
id
:
mgmtVM
min-number-of-instances
:
2
lcm-operations-configuration
:
operate-vnf-op-config
:
day1-2
:
-
config-access
:
ssh-access
:
default-user
:
ubuntu
required
:
true
config-primitive
:
-
name
:
touch
execution-environment-ref
:
simple-ee
parameter
:
-
data-type
:
STRING
default-value
:
/home/ubuntu/touched
name
:
filename
id
:
mgmtVM
execution-environment-list
:
-
id
:
simple-ee
juju
:
charm
:
simple
proxy
:
false
initial-config-primitive
:
-
name
:
touch
execution-environment-ref
:
simple-ee
parameter
:
-
data-type
:
STRING
name
:
filename
value
:
/home/ubuntu/first-touch
seq
:
1
ext-cpd
:
-
id
:
vnf-mgmt-ext
int-cpd
:
cpd
:
mgmtVM-eth0-int
vdu-id
:
mgmtVM
-
id
:
vnf-data-ext
int-cpd
:
cpd
:
dataVM-xe0-int
vdu-id
:
mgmtVM
id
:
native_manual_scale_charm-vnf
mgmt-cp
:
vnf-mgmt-ext
product-name
:
native_manual_scale_charm-vnf
sw-image-desc
:
-
id
:
ubuntu18.04
image
:
ubuntu18.04
name
:
ubuntu18.04
-
id
:
ubuntu18.04-azure
name
:
ubuntu18.04-azure
image
:
Canonical:UbuntuServer:18.04-LTS:latest
vim-type
:
azure
vdu
:
-
cloud-init-file
:
cloud-config.txt
id
:
mgmtVM
int-cpd
:
-
id
:
mgmtVM-eth0-int
virtual-network-interface-requirement
:
-
name
:
mgmtVM-eth0
position
:
1
virtual-interface
:
type
:
PARAVIRT
-
id
:
dataVM-xe0-int
virtual-network-interface-requirement
:
-
name
:
dataVM-xe0
position
:
2
virtual-interface
:
type
:
PARAVIRT
name
:
mgmtVM
sw-image-desc
:
ubuntu18.04
alternative-sw-image-desc
:
-
ubuntu18.04-azure
virtual-compute-desc
:
mgmtVM-compute
virtual-storage-desc
:
-
mgmtVM-storage
version
:
1.0
virtual-compute-desc
:
-
id
:
mgmtVM-compute
virtual-cpu
:
num-virtual-cpu
:
1
virtual-memory
:
size
:
1.0
virtual-storage-desc
:
-
id
:
mgmtVM-storage
size-of-storage
:
10
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment