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

Pre release cnf docs #6808

Closed
wants to merge 261 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
261 commits
Select commit Hold shift + click to select a range
4fa8b8a
VNF generate and deploy bare bones, not working
sunnycarter Apr 28, 2023
4ea921a
predeployer maybe working
sunnycarter May 2, 2023
27a2597
Fix up VNF generate and deploy
sunnycarter May 2, 2023
c19920e
printing
sunnycarter May 2, 2023
8bbe2b7
artifact upload half broken
sunnycarter May 3, 2023
91cfe36
Artifact manifest stuff over to SDK
sunnycarter May 3, 2023
a2410b4
delete NFD function
sunnycarter May 3, 2023
bfadbeb
linting
sunnycarter May 3, 2023
1625852
add psudo code for CNF generation
jddarby May 4, 2023
18d00d0
Fix up json config -> VNFConfiguration
sunnycarter May 4, 2023
1b77c7e
add psudo code for CNF generation
jddarby May 4, 2023
0d15355
Add CNFConfiguration
jddarby May 5, 2023
fb0a3d3
Merge branch 'add-cnf-generation' of https://github.com/jddarby/azure…
May 5, 2023
bf0a29f
artifact manifests separate
sunnycarter May 5, 2023
c741773
style
sunnycarter May 5, 2023
a956ce6
renames
sunnycarter May 5, 2023
7088b06
style
sunnycarter May 5, 2023
3e224a2
lint and reverse some renames
sunnycarter May 5, 2023
155c533
dev instructions
sunnycarter May 5, 2023
edd5d10
oops. bad find and replace work.
sunnycarter May 5, 2023
d2e19c2
undo friday afternoon bad changes
sunnycarter May 5, 2023
1aaa00a
manifest optional
sunnycarter May 5, 2023
1c598cb
Basic README
sunnycarter May 5, 2023
985ceb2
delete publisher definition
sunnycarter May 5, 2023
eb83c78
unwanted constant
sunnycarter May 5, 2023
fe87a11
d
sunnycarter May 5, 2023
cb51f0a
fill in init function
jddarby May 9, 2023
5d3bc12
Merge remote-tracking branch 'origin/sunny/bicep-deployer' into add-c…
jddarby May 9, 2023
08cbca0
Add more boilerplate
jddarby May 10, 2023
c94535e
Merge branch 'add-cnf-generation' of https://github.com/jddarby/azure…
May 11, 2023
b69aa14
initial commit; will remove input.json after testing done
May 12, 2023
057ef05
Sunny/bicep deployer (#3)
sunnycarter May 12, 2023
9f2136f
tried a few functions
May 12, 2023
da317e8
up to generate nf application
May 15, 2023
e1e8c67
tidied + fixed helmconfig as dict issue
May 15, 2023
80f9a32
fixed merge conflicts
May 15, 2023
1eaa34f
removed deploy with sdk
May 15, 2023
21809b2
added artifact list
May 16, 2023
89636e5
push example cnf bicep
jddarby May 16, 2023
715c925
Add temporary build workflow for AOSM extension (#4)
PerfectChaos May 16, 2023
0f50403
added output dir; fixing getchartmappingschema
May 16, 2023
fbba297
Merge branch 'jl/add-cnf-generation' of github.com:jddarby/azure-cli-…
May 16, 2023
f92435c
Add empty init files to inner modules so setuptools recognises them a…
PerfectChaos May 16, 2023
0b1266f
Merge pull request #5 from jddarby/chaos/fixpackages
PerfectChaos May 16, 2023
599ac38
Use latest RG model to remove unnecessary dependency on version
PerfectChaos May 16, 2023
5437fac
Merge pull request #6 from jddarby/chaos/generalrgmodel
PerfectChaos May 16, 2023
2efdba6
Use latest deployment model to remove unnecessary dependency on version
PerfectChaos May 16, 2023
c80ced8
Merge pull request #7 from jddarby/chaos/generaldeploymodel
PerfectChaos May 16, 2023
dfd5790
fixed parameter mappings + copied needed files to output folder
May 17, 2023
4747224
jinja2 and find value paths
jddarby May 17, 2023
58d525d
Merge branch 'jl/add-cnf-generation' of github.com:jddarby/azure-cli-…
jddarby May 17, 2023
3188399
fixed typos + self.aritfacts only has unique artifacts
May 17, 2023
30921b8
use regex instead of string to find deploy params
jddarby May 18, 2023
3501b82
delete accidentaly commited input.json
jddarby May 18, 2023
7064890
fixed deploy params; added indent to mapping file
May 18, 2023
ae4f8fe
Merge branch 'jl/add-cnf-generation' of github.com:jddarby/azure-cli-…
May 18, 2023
2604a71
Update readme with install/bug reporting instructions
PerfectChaos May 18, 2023
961daad
Adjust headers so rendered readme looks nicer
PerfectChaos May 18, 2023
8274996
renamed values.nondef + added cli errors
May 18, 2023
d4fbc16
Split help command example lines
PerfectChaos May 18, 2023
671fb64
Clarify that bug process is internal
PerfectChaos May 18, 2023
b3573e8
Merge pull request #9 from jddarby/chaos/installinstructions
PerfectChaos May 18, 2023
eb3c1a5
fixed parameter vals not updating
May 18, 2023
1a29b43
delete unuseed temoplate and update jinja2 templates
jddarby May 18, 2023
13f72f4
Merge pull request #8 from jddarby/jl/add-cnf-generation
jordlay May 19, 2023
6099b7a
Update README.md
jordlay May 22, 2023
3c52481
Update README.md
jordlay May 22, 2023
8c94905
added docstrings; added basic error catching with file handling
May 22, 2023
aa0b061
small refactor of generate nfd
May 23, 2023
c988938
Merge pull request #11 from jddarby/jl/tidy-up
jordlay May 23, 2023
9d15f95
fixed j2 template captions; added create_nfd to cnf; edited error mes…
May 24, 2023
1853cba
fixed file not found erroe
May 24, 2023
c6d6680
Refactor commands to az aosm nfd|nsd build (#10)
sunnycarter May 24, 2023
13c27cc
fixed most style errors; ran static checks and azdev style
May 24, 2023
ff1793c
pre merge commit
May 24, 2023
651ba78
Merge branch 'add-aosm-extension' of github.com:jddarby/azure-cli-ext…
May 24, 2023
5bde597
more style changes; renamed vnfbicepnfd to vnfnfd
May 24, 2023
a79ef57
Update readme with workflow
sunnycarter May 24, 2023
168c265
added configfile validation
May 24, 2023
e43cb92
added temp dir to vnf; renamed shared constants
May 25, 2023
9694c9b
sunny markups
sunnycarter May 25, 2023
9efa296
removed create_nfd_folder; added schema prefix to constant
May 25, 2023
2d19e34
fixed merge conflicts
May 25, 2023
a40cc3d
added deploymentparams to constants.py
May 25, 2023
e63f199
added error catching for get chart name and version
May 25, 2023
c26369a
Merge pull request #12 from jddarby/jl/post-review-fixes
jordlay May 25, 2023
2dee8c4
added meaningful logs; prevent auto overwriting input.json
May 25, 2023
bb6302a
edited vnf schema to have accepted types
May 26, 2023
d5b03c6
added templates to setup.py
May 26, 2023
f43f313
Merge pull request #14 from jddarby/jl/fix-python-wheel
jordlay May 26, 2023
276d3ca
Merge pull request #13 from jddarby/jl/first-round-feedback
jordlay May 26, 2023
d7f1b7a
added location from input file not resourceGroup().location
May 26, 2023
938b02e
Merge pull request #16 from jddarby/jl/manifest-location-bug
jordlay May 26, 2023
ab95a7c
added path_to_mappings to input.json; added logic to take mappings fr…
Jun 2, 2023
65ac401
renamed non_def_values to mappings_path
Jun 2, 2023
371a1ea
Merge pull request #18 from jddarby/jl/change-value-mappings
jordlay Jun 2, 2023
dda5957
Pk5/add nsd cli (#15)
patrykkulik-microsoft Jun 2, 2023
cdfde0f
fix CNF depends on
jddarby Jun 6, 2023
25d05b1
Merge pull request #19 from jddarby/jdd/fix-depends-on
jddarby Jun 6, 2023
6ed8ffa
Merge remote-tracking branch 'origin/main' into add-aosm-extension
jddarby Jun 6, 2023
5b1e3aa
initial commit; ran python static checks fmt (except on vendored sdks…
Jun 6, 2023
a1035f7
Name uploaded VHD correctly
Jamieparsons Jun 6, 2023
77e2e95
Self review markups
Jamieparsons Jun 6, 2023
1c642bb
broken config generation code
jddarby Jun 6, 2023
b557b7f
fixed up configuration.py
Jun 6, 2023
a7d7574
fixed cnf generator styling
Jun 6, 2023
6d0520d
fixed styling for cnf generator
Jun 6, 2023
4c1a2ee
fixed up nfd generator base and deploy with arm
Jun 6, 2023
8e8db34
fixed styling for artifact.py
Jun 6, 2023
44299e6
fixed styling for atrifact manifest .py
Jun 6, 2023
e38d425
Code review markups
Jamieparsons Jun 6, 2023
6cda523
Merge pull request #20 from jddarby/JDP/bug-735056
jamiedparsons Jun 6, 2023
d0f1276
fixed more linting
Jun 7, 2023
a6c292c
fixed merge conflicts
Jun 7, 2023
649ace6
Merge pull request #21 from jddarby/jl/fix-style
jordlay Jun 7, 2023
5f7b608
first attempt at regex
Jun 9, 2023
09be248
Sunny/choose deploy parameters (#23)
sunnycarter Jun 9, 2023
e680931
Fix for oras target string with erroneous spaces
Jun 14, 2023
a087421
Merge pull request #26 from jddarby/achurchard/fix_oras_target_string
Cyclam Jun 14, 2023
4c54367
fixed regex; tested on existing charts and sas charts; committing to …
Jun 15, 2023
70c7346
changed regex constants + tidied
Jun 15, 2023
126c68c
fixed blankspace
Jun 15, 2023
cbf8f67
fix merge conflicts
Jun 15, 2023
93fb6af
markups
Jun 15, 2023
b19dcc3
Merge pull request #28 from jddarby/jl/edit-image-secrets-paths
jordlay Jun 15, 2023
c57e4c5
initial commit
Jun 16, 2023
63b4346
tidied code and added comments
Jun 16, 2023
a88e757
add multi nf config
jddarby Jun 17, 2023
9e67219
Merge branch 'Azure:main' into add-aosm-extension
jddarby Jun 17, 2023
93840e8
Add style and lint check
jddarby Jun 17, 2023
6c9a478
added logic for handling deployparams within lists
Jun 19, 2023
3adcb80
one line fix from review
Jun 19, 2023
1c0dbe1
Merge pull request #29 from jddarby/jl/refactor-deploy-params
jordlay Jun 19, 2023
85ae247
removing print statement
Jun 19, 2023
0f2fb35
Merge pull request #31 from jddarby/jl/refactor-deploy-params
jordlay Jun 19, 2023
7719df2
added new test file and one unit test
Jun 20, 2023
077531d
added workflow for unit tests in pipeline + set up rough structure of…
Jun 20, 2023
9419ef9
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
sunnycarter Jun 20, 2023
d7a4abf
instantiated cnf class; added fake invalid helm package; added new fi…
Jun 21, 2023
4013895
Nsd for cnfs (#33)
sunnycarter Jun 22, 2023
689acf4
Add Publish command to the CNF azure CLI (#24)
patrykkulik-microsoft Jun 23, 2023
a403856
Expose NFD version and managed identities (#34)
jamiedparsons Jun 27, 2023
c492fae
Merge branch 'add-aosm-extension' into jl/add-unit-testing
Jamieparsons Jun 28, 2023
aad112f
Add a first VNF test
Jamieparsons Jun 28, 2023
f06efc3
achurchard/style fixes (#35)
Cyclam Jun 29, 2023
31672ae
Add CNF UTs that will fail at the moment
Jamieparsons Jun 30, 2023
f8b317f
Actually include all files.
Jamieparsons Jun 30, 2023
53e7729
Always run tests
Jamieparsons Jun 30, 2023
51eb04b
Merge branch 'add-aosm-extension' into jl/add-unit-testing
Jamieparsons Jun 30, 2023
9d21900
Add another test that won't pass yet
Jamieparsons Jun 30, 2023
716737e
remove github pipeline tests - they should run in Azure
Jamieparsons Jun 30, 2023
0f86392
Sundry fixes for CNF quickstart (#38)
sunnycarter Jul 4, 2023
ad88098
NSD UTs
Jamieparsons Jul 4, 2023
9f4f269
Merge branch 'add-aosm-extension' into jl/add-unit-testing
Jamieparsons Jul 4, 2023
de248c1
Update read me.
Jamieparsons Jul 4, 2023
0497ec7
Improve path handling, other small refactorings (#39)
Cyclam Jul 4, 2023
91b7f39
Fix Artifact upload on Windows (#40)
sunnycarter Jul 4, 2023
ea3fd77
Black
Jamieparsons Jul 5, 2023
e994c60
Mark ups
Jamieparsons Jul 5, 2023
95af0fc
Merge in add-aosm-extension
Jamieparsons Jul 5, 2023
b5b70b9
Merge pull request #32 from jddarby/jl/add-unit-testing
jamiedparsons Jul 5, 2023
09f6a45
Sunny/fix artifact upload windows (#41)
sunnycarter Jul 5, 2023
21154ff
Fix VNFD build (#42)
sunnycarter Jul 5, 2023
d02bc45
Multiple instances of the same NF
Jamieparsons Jul 7, 2023
a299eba
fix vnf deploy schema types (#44)
sunnycarter Jul 7, 2023
ebb5b46
Tidy up
Jamieparsons Jul 8, 2023
1f18b8d
Mypy and docs
Jamieparsons Jul 8, 2023
64e9a44
history.rst
Jamieparsons Jul 8, 2023
7460892
Update README with logging info (#43)
patrykkulik-microsoft Jul 10, 2023
8a05139
Merge in add-aosm-extension
Jamieparsons Jul 11, 2023
71ae242
self markups
Jamieparsons Jul 11, 2023
44344ff
Take oras 0.1.19 to fix Windows artifact upload (#46)
sunnycarter Jul 12, 2023
60140e2
Fix merge
Jamieparsons Jul 17, 2023
ab98755
Merge pull request #45 from jddarby/JDP/multiple_NFs
jamiedparsons Jul 17, 2023
3199a57
Horrific merge
Jamieparsons Jul 18, 2023
607b2d1
Rename a few things
Jamieparsons Jul 18, 2023
5da563b
Fix another merge
Jamieparsons Jul 18, 2023
b40b62c
DRY the deploy_nfd_from_bicep code
Jul 18, 2023
3241761
Make conditional statements clearer
Jul 18, 2023
5388f19
black
Jul 18, 2023
68e11cc
Update custom.py to use new nfd deploy method
Jul 19, 2023
b28e5f5
Black with text processing
Jul 19, 2023
64c645b
Create new nfRET class
Jamieparsons Jul 19, 2023
d11e82c
Merge branch 'achurchard/dry-the-deploy-nfd-code' into jdd/multi-nf-s…
Jamieparsons Jul 19, 2023
dc9deca
Mypy passing
Jamieparsons Jul 21, 2023
bfdb6dc
UTs passing
Jamieparsons Jul 21, 2023
ed20b35
Dry the deploy_nfd_from_bicep() code (#48)
Cyclam Jul 21, 2023
0a7dc2d
Unit tests added
Jamieparsons Jul 24, 2023
17147d7
Versions are wrong in NSD template comments
sunnycarter Jul 24, 2023
980ebc2
Self review markups
Jamieparsons Jul 24, 2023
55a2320
Remove wrong comments
sunnycarter Jul 24, 2023
e286c17
Code review markups
Jamieparsons Jul 25, 2023
e9925a1
Extra markups
Jamieparsons Jul 26, 2023
6c6ec80
Merge in changes
Jamieparsons Jul 26, 2023
100a844
Fix mypy
Jamieparsons Jul 26, 2023
9483466
Pk5/add integration tests (#51)
patrykkulik-microsoft Jul 26, 2023
6c5bea2
More markups
Jamieparsons Jul 26, 2023
ea6e507
Update output in tests
Jamieparsons Jul 26, 2023
c087b45
Pk5/minor integration tests changes (#52)
patrykkulik-microsoft Jul 26, 2023
7a4154d
Merge in changes
Jamieparsons Jul 26, 2023
12a2179
Update recordings
Jamieparsons Jul 27, 2023
d39d584
Fix up merge
Jamieparsons Jul 27, 2023
687d506
Update developer docs
Jamieparsons Jul 27, 2023
b192027
Merge pull request #47 from jddarby/jdd/multi-nf-support
jamiedparsons Jul 27, 2023
5646f52
Remove credentials
Jamieparsons Jul 27, 2023
aaf2e39
Merge pull request #53 from jddarby/JDP/remove_creds
jamiedparsons Jul 27, 2023
430f57c
Fix linting
Jamieparsons Aug 1, 2023
8827e75
cheeky extra change
sunnycarter Aug 1, 2023
1ebce61
Merge pull request #55 from jddarby/JDP/fix_linting
jamiedparsons Aug 1, 2023
28096d2
Remove credentials from the integration test recordings (#54)
patrykkulik-microsoft Aug 8, 2023
cf6b144
Remove the integration test from the repo (#56)
patrykkulik-microsoft Aug 11, 2023
2d89e7a
prerequisite docker for cnf
sunnycarter Aug 14, 2023
6276a13
Fix bicep render on Windows (#57)
sunnycarter Aug 16, 2023
d1c7b8b
Fixes for Windows (#58)
sunnycarter Aug 17, 2023
63ebf43
ADO-880627: Use docker-less ACR login
wbradley94 Aug 21, 2023
9250046
docker is not required any more
sunnycarter Aug 22, 2023
9290087
Merge branch 'Azure:main' into pre-release-add-aosm-extension
sunnycarter Aug 22, 2023
482d9c1
linting fixes
sunnycarter Aug 24, 2023
2471089
pre-release version of release markups (#66)
sunnycarter Aug 24, 2023
d0aadff
Fix integration tests (#67) (#69)
sunnycarter Aug 24, 2023
60ace56
move artifact upload to before nfd/nsd deploy (#62) (#70)
sunnycarter Aug 25, 2023
d7e392d
Change pre-release branch
sunnycarter Aug 25, 2023
755bc17
Jl/nfdv proxy (#73) (#75)
jordlay Sep 5, 2023
3878263
Update HISTORY.rst
jordlay Sep 11, 2023
a20bf1b
Add aosm to service_name.json
sunnycarter Aug 24, 2023
d1b8afb
non-working attempt to use token creds
sunnycarter Aug 30, 2023
1ffa670
Check for Azure features on deploy and delete (#71)
sunnycarter Aug 31, 2023
5a55693
code working
sunnycarter Sep 1, 2023
c2ec0ad
Fix generate-config
sunnycarter Sep 1, 2023
c440683
Fix tests
sunnycarter Sep 1, 2023
f68d5c2
lint
sunnycarter Sep 1, 2023
caef329
linting
sunnycarter Sep 1, 2023
e87ad61
Code review mark ups
Jamieparsons Sep 5, 2023
1c241ac
Linting and fix UTs
Jamieparsons Sep 5, 2023
458f415
Delete unused ContainerRegistryManagementClient import
Sep 16, 2023
4f9b953
aosm codeowner
sunnycarter Sep 6, 2023
89063c3
Update HISTORY.rst
jordlay Sep 11, 2023
c99b2cd
Merge pull request #78 from jddarby/andy/catchup-with-GA-branch
Cyclam Sep 16, 2023
b3359e9
Merge branch 'Azure:main' into pre-release-add-aosm-extension
PerfectChaos Sep 19, 2023
7f26dc7
Fix source_local_docker_image defaults to placeholder text (#79) (#80)
jordlay Sep 21, 2023
07a5f3d
Fix license header formatting
PerfectChaos Sep 20, 2023
efb0423
Remove nonexistent entry from codeowners
PerfectChaos Sep 20, 2023
9501b63
renamed nsdg to nsd
Sep 21, 2023
5436a0c
Merge pull request #83 from jddarby/andy/catch-up-with-main-add-aosm-…
Cyclam Sep 25, 2023
a10ec2e
Return True if _all_ required artifact manifests exist, not just the …
Sep 26, 2023
f3584bb
Check pre release ff not ga (#88)
sunnycarter Sep 26, 2023
8335405
Helptext + a little bit of validation
Jamieparsons Sep 22, 2023
6d761c6
Fixed up validation
Jamieparsons Sep 25, 2023
075ab02
Code markups + linting.
Jamieparsons Sep 26, 2023
5dc9869
Docs: CNF publish options and permissions (#91)
sunnycarter Sep 26, 2023
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
21 changes: 14 additions & 7 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@
max-line-length = 120
max-complexity = 10
ignore =
E501, # line too long, it is covered by pylint
E722, # bare except, bad practice, to be removed in the future
F401, # imported but unused, too many violations, to be removed in the future
F811, # redefinition of unused, to be removed in the future
C901 # code flow is too complex, too many violations, to be removed in the future
W503 # line break before binary operator effect on readability is subjective
W504 # line break after binary operator effect on readability is subjective
# line too long, it is covered by pylint
E501,
# bare except, bad practice, to be removed in the future
E722,
# imported but unused, too many violations, to be removed in the future
F401,
# redefinition of unused, to be removed in the future
F811,
# code flow is too complex, too many violations, to be removed in the future
C901,
# line break before binary operator effect on readability is subjective
W503,
# line break after binary operator effect on readability is subjective
W504
exclude =
*/vendored_sdks
docs
Expand Down
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@

/src/alb/ @jaishals

/src/aosm/ @sunnycarter

/src/managedccfs/ @msftsettiy

/src/acrquery/ @CarolineNB
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/BuildAOSMWheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
on:
push:
branches:
- pre-release-add-aosm-extension

jobs:
build_aosm:
runs-on: ubuntu-latest
container: mcr.microsoft.com/azure-cli/tools:latest
permissions: write-all
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Build AOSM Wheel
run: |
# Pretend we have a valid git repo to satisfy azdev.
mkdir .git
azdev setup -r .
azdev extension build aosm
- name: Upload AOSM Wheel
uses: actions/upload-artifact@v3
with:
name: aosm-extension
path: dist/*.whl
- name: Update Release
uses: pyTooling/Actions/releaser@r0
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
dist/*.whl
tag: aosm-extension
18 changes: 18 additions & 0 deletions .github/workflows/CheckStyleAndLinting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Style and Lint Check

on:
pull_request:
types: [opened]

jobs:
build_aosm:
runs-on: ubuntu-latest
container: mcr.microsoft.com/azure-cli/tools:latest
permissions: write-all
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Check Style
run: azdev style aosm
- name: Check Linting
run: azdev linter aosm
49 changes: 49 additions & 0 deletions src/aosm/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
.. :changelog:

Release History
===============

upcoming
++++++++++
* Added a `--clean` flag to the NSD `delete` command. This flag will delete the NSDG on top of the other resources deleted by the `delete` command.
* Added integration tests for `publish` and `delete` commands.
* Added a `--force` flag to the aosm `build` and `delete` commands. This command will force the `build` or `delete` commands to proceed without waiting on user input to confirm.
* `az aosm nfd build` options `--order-params` and `--interactive` to help users choose which NF parameters to expose as deployParameters. Feature added that allows CNF value mappings file to be generated if none is supplied.
* NFDV version exposed as a CGV on an SNS.
* `az aosm nfd publish` option added for `--definition-type cnf` to publish the CNF bicep templates, upload helm charts from disk to the ACR and copy the images from a source ACR to the target ACR.
* Managed Identity added to VNF NF templates - requires subscription to be registered for the feature flag.
* Various fixes to NFD build of deployParameters schema and interactive mode create of deployParameters mappings file.
* Fix CNF NFD publish so that it doesn't render the ACR unuseable for future Artifact publishing.
* Allow CNF NFD image copy from a source ACR using a namespace.
* Fix - Add new CGSchema parameters not from the NFD to the `required` section of the schema.
* Add the ability to skip bicep publish or artifact upload during publish commands.
* Fix Manifest name for NSDs so it isn't the same as that for NFDs
* Add validation of source_registry_id format for CNF configuration
* Workaround Oras client bug (#90) on Windows for Artifact upload to ACR
* Take Oras 0.1.18 so above Workaround could be removed
* Take Oras 0.1.19 to fix NSD Artifact upload on Windows
* Support deploying multiple instances of the same NF in an SNS
* Fix CNF publish on Windows by using Linux style paths in rendered NFD bicep templates (bicep always requires Linux style paths).
* Re-order publish steps so that artifacts are uploaded before the NFD/NSD is published.
* Add progress information for VHD upload
* Change optional argument from `manifest_parameters_json_file` to `manifest_params_file` to appease linter.
* NB CHANGE TO PREVIOUS CONFIG FILE FORMAT FOR NFDS
- Add options for CNF image upload. By default CNF images are copied from a source ACR using `az acr import` which is fast but requires subscription-wide permissions.
- If permissions are not available then CNF images can be copies from the source ACR using `docker pull` then `docker push`, which is slower and requires Docker to be installed. This is governed by a new --no-subscription-permissions flag.
- Also, if only a single image is required, it can be specified in the config file and uploaded from local docker registry using `docker push`
- CNF image config has been moved into an `images` section of the config file. Please run `az aosm nfd generate-config --definition-type cnf` to generate a new config file.
- Remove pre-deploy check to check source ACR exists. This will be found at the time that images are copied / accessed.
- Change from using ContainerRegistryManagementClient to `az acr import` subprocess call, so that we don't need to know the Resource Group.
* NB CHANGE TO PREVIOUS CONFIG FILE FORMAT FOR NSDs
- Added publisher scope and removed publisher resource group from network function object, as now using proxy references
0.2.0
++++++
Breaking change to commands - now use `nfd` instead of `definition`. Publish option removed from build.
* `az aosm nfd generate-config` for vnf and cnf. This is for NFDVs
* `az aosm nfd build|publish|delete --definition-type vnf|cnf` for vnf and `build` only for cnf. This is for NFDVs

0.1.0
++++++
* Initial release - alpha quality
* `az aosm definition generate-config` for vnf and cnf. This is for NFDVs
* `az aosm definition build|publish|delete` for vnf and `build` only for cnf. This is for NFDVs
218 changes: 218 additions & 0 deletions src/aosm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
# Microsoft Azure CLI 'aosm' Extension

This package is for the 'aosm' extension to support Azure Operator Service Manager
functions.
i.e. `az aosm`

## Background

The `az aosm` extension is intended to provide support for working with AOSM
resources and definitions. Currently it only implements commands which aid the
process of publishing Network Function Definitions and Network Service Designs to
use with Azure Operator Service Manager or Network Function Manager.

## Installation

Eventually the extension will be published through the usual process and it will be
installed as usual, via `az extension add --name aosm`

Until then, the latest development version can be found here:
https://github.com/jddarby/azure-cli-extensions/releases/download/aosm-extension/aosm-0.2.0-py2.py3-none-any.whl

To install, download this wheel and run:
`az extension add --source path/to/aosm-0.2.0-py2.py3-none-any.whl`

For CNFs you will also need helm installed. See [CNFs](#cnfs) below for details.

## Updating

We are currently not bumping versions, so if you would like the most up to date version of the CLI. You should run:
'az extension remove --name aosm'

And then re-add with the new wheel, as detailed in Installation above.

# nfd and nsd commands

These commands help with the publishing of Network Function Definition and Network
Service Design resources.

## Overview of function
A generic workflow of using the tool would be:
- Find the pre-requisite items you require for your use-case
- Run a `generate-config` command to output an example JSON config file for subsequent commands
- Fill in the config file
- Run a `build` command to output one or more bicep templates for your Network Function Definition or Network Service Design
- Review the output of the build command, edit the output as necessary for your requirements
- Run a `publish` command to:
* Create all pre-requisite resources such as Resource Group, Publisher, Artifact Stores, Groups
* Deploy those bicep templates
* Upload artifacts to the artifact stores

### Pre-requisites

#### VNFs

For VNFs, you will need a single ARM template which would create the Azure resources
for your VNF, for example a Virtual Machine, disks and NICs. You'll also need a VHD
image that would be used for the VNF Virtual Machine.

#### CNFs

For CNFs you must have these packages installed on the machine you are running the CLI from:
- `helm` package installed . Instructions on how to do this can be found [here](https://helm.sh/docs/intro/install/).

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.
* 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": [
{
"name": "A",
"path_to_chart": "Path to package A",
"path_to_mappings": "Path to package A mappings",
"depends_on": [
"Names of the Helm packages this package depends on"
]
},
{
"name": "B",
"path_to_chart": "Path to package B",
"path_to_mappings": "Path to package B mappings",
"depends_on": [
"Names of the Helm packages this package depends on"
]
},

##### Permissions for publishing CNFs
If sourcing the CNF images from an existing ACR, you need to have `Reader`/`AcrPull` permissions
from this ACR, and ideally, `Contributor` role + `AcrPush` role (or a custom role that allows the `importImage` action and `AcrPush`) over the whole subscription in order to be able to import to the new Artifact store. If you have these, you
do not need docker to be installed locally, and the image copy is very quick.

If you do not have the subscription-wide permissions then you can run the `az aosm nfd publish` command using the `--no-subscription-permissions` flag to pull the image to your local machine and then push it to the Artifact Store using manifest credentials scoped only to the store. This requires Docker to be installed locally.

#### NSDs
For NSDs, you will need to have a Resource Group with a deployed Publisher, Artifact Store, Network Function Definition and Network Function Definition Version. You can use the `az aosm nfd` commands to create all of these resources.

#### Subscription Feature Flags
For this pre-release version of the CLI, your subscription needs to have enabled the following Feature Flags:
- `Microsoft.HybridNetwork/AllowPreReleaseFeatures`
- `Microsoft.HybridNetwork/Allow-2023-04-01-preview`

### Command examples

#### Before you start
`az login` to login to the Azure CLI.
`az account set --subscription <subscription>` to choose the subscription you will work on.

#### NFDs

Get help on command arguments

`az aosm -h`
`az aosm nfd -h`
`az aosm nfd build -h`
etc...

All these commands take a `--definition-type` argument of `vnf` or `cnf`

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.
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]`

Publish a pre-built definition

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

Delete a published definition

`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

Get help on command arguments

`az aosm -h`
`az aosm nsd -h`
`az aosm nsd build -h`
etc...

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.
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`

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 delete --config-file input.json --clean`

## Bug Reporting

Especially as this extension is still in development, you may encounter bugs or
usability issues as you try to use it in its current form. It would be much
appreciated if you could report these so that we're aware of them!

The (Microsoft internal) process for bug reporting during development is here:
https://eng.ms/docs/strategic-missions-and-technologies/strategic-missions-and-technologies-organization/azure-for-operators/aiops/aiops-orchestration/aosm-product-docs/processes/bug_process

CLI issues should be tagged and triaged as UX bugs.

## Logging

The CLI uses the standard Azure CLI logging mechanism. To enable logging to the console, you can use the following flags depending on the desired level of logging:
- `--verbose` - This flag changes the logging level to Info and above.
- `--debug` - This flag changes the logging level to Debug and above.
- `--only-show-errors` - This flag changes the logging level to Error only, suppressing Warning.

It is also possible to enable logging to file by running the following command:
```
az config set logging.enable_log_file=true
```
This will create a log file in the `~/.azure/logs` directory.

**Note:** The above command will enable logging for all Azure CLI commands until the logging is disabled again by the user. Not disabling file logging could slow down the performance of the CLI. To disable file logging, run the following command:
```
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).
30 changes: 30 additions & 0 deletions src/aosm/azext_aosm/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader

from azext_aosm._help import helps # pylint: disable=unused-import


class AosmCommandsLoader(AzCommandsLoader):
def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType

aosm_custom = CliCommandType(operations_tmpl="azext_aosm.custom#{}")
super().__init__(cli_ctx=cli_ctx, custom_command_type=aosm_custom)

def load_command_table(self, args):
from azext_aosm.commands import load_command_table

load_command_table(self, args)
return self.command_table

def load_arguments(self, command):
from azext_aosm._params import load_arguments

load_arguments(self, command)


COMMAND_LOADER_CLS = AosmCommandsLoader
Loading
Loading