Skip to content

Add skip steps, improve typing, stop passing variables around in method signatures#49

Merged
Cyclam merged 6 commits intoachurchard/dry-the-deploy-nfd-codefrom
achurchard/dont-pass-variables-around
Jul 21, 2023
Merged

Add skip steps, improve typing, stop passing variables around in method signatures#49
Cyclam merged 6 commits intoachurchard/dry-the-deploy-nfd-codefrom
achurchard/dont-pass-variables-around

Conversation

@Cyclam
Copy link
Copy Markdown
Collaborator

@Cyclam Cyclam commented Jul 21, 2023

Main changes:

  • Moved variables onto the class instance and stop passing them around in the method signatures
    • Also made the deployer class a dataclass for cleaner __init__
  • Made parameters a property of the class, and moved the logic for getting/generating them into that property method
  • Improved the typing
    • Included adding enums for SkipSteps and DeployableResourceTypes
  • Added the new skip step logic for image uploads
    • Added a new skip step type of IMAGE_UPLOAD

Testing

  • No MyPy errors
  • Following live tests

VNF

  • az aosm nfd publish -f input_files/input.json_nfd --definition-type vnf
  • az aosm nfd publish -f input_files/input.json_nfd --definition-type vnf --skip image-upload
  • az aosm nfd publish -f input_files/input.json_nfd --definition-type vnf --skip artifact-upload
  • az aosm nfd publish -f input_files/input.json_nfd --definition-type vnf --skip bicep-publish
  • az aosm nsd build -f input_files/input.json_nsd
  • az aosm nsd publish -f input_files/input.json_nsd
  • az aosm nsd publish -f input_files/input.json_nsd --skip bicep-publish
  • az aosm nsd publish -f input_files/input.json_nsd --skip artifact-upload

CNF

  • az aosm nfd generate-config --definition-type cnf
  • az aosm nfd build -f input_files/input.json_nfd --definition-type cnf --interactive
  • az aosm nfd publish -f input_files/input.json_nfd --definition-type cnf
  • az aosm nfd publish -f input_files/input.json_nfd --definition-type cnf --skip bicep-publish
  • az aosm nfd publish -f input_files/input.json_nfd --definition-type cnf --skip image-upload
  • az aosm nfd publish -f input_files/input.json_nfd --definition-type cnf --skip artifact-upload

@Cyclam Cyclam changed the base branch from add-aosm-extension to jdd/multi-nf-support July 21, 2023 13:23
@Cyclam Cyclam changed the base branch from jdd/multi-nf-support to achurchard/dry-the-deploy-nfd-code July 21, 2023 15:19
@sunnycarter
Copy link
Copy Markdown
Collaborator

Needs an update to the README about skip steps pls

@Cyclam Cyclam changed the title Achurchard/dont pass variables around Add skip steps, improve typing, stop passing variables around in method signatures Jul 21, 2023
@sunnycarter
Copy link
Copy Markdown
Collaborator

Needs an update to the README about skip steps pls

Hmm - I didn't add one about the last ones. Maybe we don't need to bother. I feel that's the sort of thing that comes in more verbose docs than we currently have.

@Cyclam
Copy link
Copy Markdown
Collaborator Author

Cyclam commented Jul 21, 2023

Re the README, I have added some very brief explanation in the command help:

    --skip                         : Optional skip steps. 'bicep-publish' will skip deploying the
                                     bicep template; 'artifact-upload' will skip uploading any
                                     artifacts; 'image-upload' will skip uploading the VHD image
                                     (for VNFs) or the container images (for CNFs).  Allowed values:
                                     artifact-upload, bicep-publish, image-upload.

It's not great because formatting is non-existent in the help text (as far as I can tell). I tried adding a \n and it completely borked the alignment :-(

@Cyclam Cyclam merged commit 51be9ae into achurchard/dry-the-deploy-nfd-code Jul 21, 2023
@Cyclam Cyclam deleted the achurchard/dont-pass-variables-around branch July 21, 2023 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants