Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AZ AOSM Extension Refactor #7429

Merged
merged 46 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
fad2c74
Merge Temp mavenir wheel into MAIN (#135)
jordlay Jan 19, 2024
cb0e602
fix silly yaml import
Jan 19, 2024
ce911b5
moved config validate to init, commented out delete command, add cont…
Jan 19, 2024
bd0e37b
Add Helm template validation to the build method in the CLI (#136)
patrykkulik-microsoft Jan 23, 2024
7af973e
Pk5/add image parsing (#137)
patrykkulik-microsoft Jan 30, 2024
02df460
Validate that helm chart values exist (#138)
patrykkulik-microsoft Jan 30, 2024
540511e
Jl/nsd publish paths (#139)
jordlay Jan 30, 2024
f89c939
Bump version to 1.0.0b5
Jan 31, 2024
8694270
Linting and typing (#141)
Cyclam Feb 7, 2024
ca3d8d0
Temp 16feb wheel (#145)
jordlay Feb 28, 2024
262fcc5
add to changelog; bump version
Feb 29, 2024
af1730b
added check for filepath before making absolute (#154)
jordlay Mar 11, 2024
f61cc99
Template Parameters Bug (#156)
jordlay Mar 11, 2024
af4ac2a
fixed config comment (#153)
jordlay Mar 11, 2024
7408ac8
removed image name parameter, added imageName to default config for a…
jordlay Mar 12, 2024
e774963
bumped version and updated changelog (#158)
jordlay Mar 12, 2024
a73a246
Improve Unit Testing (#152)
jordlay Mar 15, 2024
54b02ea
Fix bool in schema bug (#160)
jordlay Mar 19, 2024
817be2b
Use common.utils function to check if docker/helm is installed (code …
Cyclam Mar 19, 2024
3e5977c
changed configuration type from secret to open; updated changelog (#162)
jordlay Mar 22, 2024
0c90032
Support using multiple images sources in our CLI (#142)
patrykkulik-microsoft Mar 26, 2024
6ed34e0
Fix integration tests (#163)
patrykkulik-microsoft Mar 27, 2024
9b6fcde
Add docker dependency option to oras in setup.py (#164)
Cyclam Mar 27, 2024
4694663
Revert "Add docker dependency option to oras in setup.py (#164)" (#165)
patrykkulik-microsoft Mar 28, 2024
d42ce1f
update history + bump version (#166)
jordlay Mar 28, 2024
34f5aca
hot fix: anyOf bug
Mar 28, 2024
1af516c
hotfix: fixed 2 style errors
Mar 28, 2024
eb3a3b7
bumped version to 2 (#170)
jordlay Apr 2, 2024
95f768c
Fix linting + tests for release (#171)
jordlay Apr 4, 2024
78a7aff
added license headers to fix release jobs (#172)
jordlay Apr 5, 2024
b7d6cbf
Add Webhook (#159)
jordlay Apr 8, 2024
8be279b
Expose All PRs (#173)
jordlay Apr 12, 2024
78e977d
updated history
Apr 12, 2024
7d0b131
Fix minor config bugs (#174)
jordlay Apr 16, 2024
f92d7ff
Help text additions (#175)
Cyclam Apr 17, 2024
27c77ad
Remove parameters from help file. Instead, use the help defined in _p…
Apr 17, 2024
3cfec58
Fix lines too long (#176)
Cyclam Apr 17, 2024
c78743e
updated changelog (#180)
jordlay Apr 19, 2024
06b2ac4
Autogen CLI: (#181)
Cyclam Apr 22, 2024
20f72a6
Add quotes to the CNF input config image sources comment (#182)
patrykkulik-microsoft Apr 22, 2024
761fd8d
Bump jinja2 to 3.1.4. (#190)
Cyclam May 14, 2024
ca17b6d
Remove azure-storage-blob from dependencies. (#192)
Cyclam May 14, 2024
f5a787a
Pk5/fix integration tests for release (#195)
patrykkulik-microsoft May 16, 2024
1e1d255
Re-record test (#196)
patrykkulik-microsoft May 16, 2024
89f0872
ran vnf test live (#197)
jordlay May 16, 2024
9438a1e
Make the vnf test live only (#198)
patrykkulik-microsoft May 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions src/aosm/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,39 @@
Release History
===============

2.0.0b1
++++++++
* Renamed nfdvName to nfdv in CGVs
* Added useful comments to input files
* Added 1:1 mapping between NFVIsFromSite and NF RETs
* Added expose_all parameter in input file to expose all parameters in deployParameters and CGS
* Removed multiple_instances and depends_on from input file
* Added: mutating webhook for injectArtifactStoreDetails
* Added: Users can specify multiple image sources from all types of registries (not just ACRs). General improvements in how CNF image sources are handled.
* Fixed: Namespace appeared twice in the `artifacts.json` file, leading to errors in the publish step of the CLI.
* Changed configurationType for NF Resources from Secret to Open
* Removed imageName from deployParameters
* Removed image name parameter from input file
* Fixed camel casing of VHD Parameters
* Fixed blob sas url bug
* Edited comment in input file to reflect RGs are created if they do not exist
* Added creating RG if it does not exist
* Removed use of permanent temp file for helm package
* Fixed: helm charts not uploading correctly
* Added creation of resource groups if does not exist
* Fixed: Manifest name built from ACR name, so clashes
* Fixed: Nexus image version must be semver
* Fixed: Sensible error when no type given in helm chart schema
* Fixed: customLocation missing from Nexus
* Fixed: helm charts not uploading correctly
* Added: Nexus support
* Add `publisher` command group for management of publisher resources.
* Changed the name of the `path_to_mappings` parameter in the CNF input file to `default_values`
* Added a `helm template` validation step to the `az aosm nfd build` command for the `cnf` definition type
* Added validation of the values file for helm charts when using the `az aosm nfd build` command for the `cnf` definition type
* Fixed helm chart image parsing in the `az aosm nfd build` command for the `cnf` definition type. This means that the images can now be extracted correctly from the helm chart.
* Fixed: infinite loop bug when retrying failed artifact uploads to the ACR

1.0.0b4
++++++++
* Fixed: Remove check for Allow-2023-09-01 feature flag that is no longer required (Bug #1063964)
Expand Down
49 changes: 11 additions & 38 deletions src/aosm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,10 @@ For CNFs you must have these packages installed on the machine you are running t
- `docker` installed only in some circumstances, those being if the source image is in your local docker repository, or you do not have subscription-wide permissions required to push charts and images. See the remainder of this section for further details. Docker provides packages that easily configure docker on [Windows](https://docs.docker.com/docker-for-windows/), or [Linux](https://docs.docker.com/engine/install/#supported-platforms) systems.

For CNFs, you must provide:
* helm packages with an associated schema. These files must be on your disk and will be referenced in the `input.json` config file.
* images for your CNF. For these you have the following options:
- a reference to an existing Azure Container Registry which contains the images for your CNF. Currently, only one ACR and namespace is supported per CNF. The images to be copied from this ACR are populated automatically based on the helm package schema. You must have Reader/AcrPull permissions on this ACR. To use this option, fill in `source_registry` and optionally `source_registry_namespace` in the input.json file.
- or, the image name of the source docker image from local machine. This is for a limited use case where the CNF only requires a single docker image which exists in the local docker repository. To use this option, fill in `source_local_docker_image` in the input.json file. This requires docker to be installed.
* optionally, you can provide a file (on disk) path_to_mappings which is a copy of values.yaml with your chosen values replaced by deployment parameters, thus exposing them as parameters to the CNF. You can get this file auto-generated by leaving the value as a blank string, either having every value as a deployment parameter, or using `--interactive` to interactively choose.
When filling in the input.json file, you must list helm packages in the order they are to be deployed. For example, if A must be deployed before B, your input.json should look something like this:
* Helm packages with an associated schema. These files must be on your disk and will be referenced in the `cnf-input.jsonc` config file.
* A reference to an existing Azure Container Registry which contains the images for your CNF. Currently, only one ACR and namespace is supported per CNF. The images to be copied from this ACR are populated automatically based on the helm package schema. You must have Reader/AcrPull permissions on this ACR. To use this, fill in `source_registry` and optionally `source_registry_namespace` in the cnf-input.jsonc file.
* Optionally, you can provide a file (on disk) path_to_mappings which is a copy of values.yaml with your chosen values replaced by deployment parameters, thus exposing them as parameters to the CNF.
* When filling in the cnf-input.jsonc file, you must list helm packages in the order they are to be deployed. For example, if A must be deployed before B, your cnf-input.jsonc should look something like this:

"helm_packages": [
{
Expand Down Expand Up @@ -106,35 +104,17 @@ Create an example config file for building a definition

`az aosm nfd generate-config`

This will output a file called `input.json` which must be filled in.
This will output a file called `cnf-input.jsonc` which must be filled in.
Once the config file has been filled in the following commands can be run.

Build an nfd definition locally

`az aosm nfd build --config-file input.json`

More options on building an nfd definition locally:

Choose which of the VNF ARM template parameters you want to expose as NFD deploymentParameters, with the option of interactively choosing each one.

`az aosm nfd build --config-file input.json --definition_type vnf --order_params`
`az aosm nfd build --config-file input.json --definition_type vnf --order_params --interactive`

Choose which of the CNF Helm values parameters you want to expose as NFD deploymentParameters.

`az aosm nfd build --config-file input.json --definition_type cnf [--interactive]`
`az aosm nfd build --config-file cnf-input.jsonc`

Publish a pre-built definition

`az aosm nfd publish --config-file input.json`

Delete a published definition
`az aosm nfd publish --build-output-folder cnf-cli-output`

`az aosm nfd delete --config-file input.json`

Delete a published definition and the publisher, artifact stores and NFD group

`az aosm nfd delete --config-file input.json --clean`

#### NSDs

Expand All @@ -149,24 +129,17 @@ Create an example config file for building a definition

`az aosm nsd generate-config`

This will output a file called `input.json` which must be filled in.
This will output a file called `nsd-input.jsonc` which must be filled in.
Once the config file has been filled in the following commands can be run.

Build an nsd locally

`az aosm nsd build --config-file input.json`
`az aosm nsd build --config-file nsd-input.jsonc`

Publish a pre-built design

`az aosm nsd publish --config-file input.json`

Delete a published design

`az aosm nsd delete --config-file input.json`

Delete a published design and the publisher, artifact stores and NSD group
`az aosm nsd publish --build-output-folder nsd-cli-output`

`az aosm nsd delete --config-file input.json --clean`

## Bug Reporting

Expand Down Expand Up @@ -200,4 +173,4 @@ az config set logging.enable_log_file=false
```

## Development
Information about setting up and maintaining a development environment for this extension can be found [here](./development.md).
Information about setting up and maintaining a development environment for this extension can be found [here](https://eng.ms/docs/strategic-missions-and-technologies/strategic-missions-and-technologies-organization/azure-for-operators/aiops/aiops-orchestration/aosm-product-docs/processes/cli_contributing).
9 changes: 9 additions & 0 deletions src/aosm/azext_aosm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,17 @@ def __init__(self, cli_ctx=None):
super().__init__(cli_ctx=cli_ctx, custom_command_type=aosm_custom)

def load_command_table(self, args):
from azure.cli.core.aaz import load_aaz_command_table

from azext_aosm.commands import load_command_table

try:
from . import aaz
except ImportError:
aaz = None
if aaz:
load_aaz_command_table(loader=self, aaz_pkg_name=aaz.__name__, args=args)

load_command_table(self, args)
return self.command_table

Expand Down
4 changes: 3 additions & 1 deletion src/aosm/azext_aosm/_client_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ def cf_aosm(cli_ctx, *_) -> HybridNetworkManagementClient:
# By default, get_mgmt_service_client() sets a parameter called 'base_url' when creating
# the client. For us, doing so results in a key error. Setting base_url_bound=False prevents
# that from happening
return get_mgmt_service_client(cli_ctx, HybridNetworkManagementClient, base_url_bound=False)
return get_mgmt_service_client(
cli_ctx, HybridNetworkManagementClient, base_url_bound=False
)


def cf_resources(cli_ctx, subscription_id=None):
Expand Down
Loading
Loading