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

Sunny/nf agent #27

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
01a1f99
choose-deploy-parameters
sunnycarter Jun 6, 2023
d83dcec
optioned deployParameters for CNF
sunnycarter Jun 6, 2023
1722871
lint
sunnycarter Jun 6, 2023
229e60e
lint2
sunnycarter Jun 6, 2023
381c0cd
docs
sunnycarter Jun 7, 2023
51dc63e
docs
sunnycarter Jun 7, 2023
729874b
Merge branch 'add-aosm-extension' into sunny/choose-deploy-parameters
sunnycarter Jun 7, 2023
4a9fe89
lint
sunnycarter Jun 7, 2023
c0a8862
9.82 score
sunnycarter Jun 7, 2023
3211ad1
Fix bugs
sunnycarter Jun 8, 2023
0be3e11
more useful debug logs
sunnycarter Jun 8, 2023
9f1b203
Working publish
patrykkulik-microsoft Jun 8, 2023
ad41715
Fix bugs and logging
sunnycarter Jun 8, 2023
d8edfa9
lint
sunnycarter Jun 8, 2023
15405c2
Merge branch 'add-aosm-extension' into pk5/publish_CNF
patrykkulik-microsoft Jun 9, 2023
f37f49a
Fix the artifact upload
patrykkulik-microsoft Jun 9, 2023
6d6cf2f
Working image copy
patrykkulik-microsoft Jun 9, 2023
05e08da
minor fix
patrykkulik-microsoft Jun 9, 2023
de34077
Minor fixes
patrykkulik-microsoft Jun 9, 2023
1e29dcf
sunny merge add-aosm-extension into patryk's branch (#25)
sunnycarter Jun 12, 2023
6af0564
minor TODOs
patrykkulik-microsoft Jun 12, 2023
7165aef
deleted comment
patrykkulik-microsoft Jun 12, 2023
eea0484
fix bring your own parameters
sunnycarter Jun 14, 2023
bee2ec7
merge patryks branch
sunnycarter Jun 15, 2023
661d449
add test files so chaos can see what I'm doing
sunnycarter Jun 15, 2023
0c058d3
latest fixes
sunnycarter Jun 16, 2023
61a6e7c
forgot these
sunnycarter Jun 16, 2023
afa0c59
check in where I got to
sunnycarter Jun 16, 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
Prev Previous commit
Next Next commit
Minor fixes
  • Loading branch information
patrykkulik-microsoft committed Jun 9, 2023
commit de340773c996a2eb3b337dc207771ebf78217fa0
5 changes: 3 additions & 2 deletions src/aosm/azext_aosm/_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,10 @@ def __post_init__(self):

Used when creating CNFConfiguration object from a loaded json config file.
"""
for package in self.helm_packages:
for package_index in range(len(self.helm_packages)):
package = self.helm_packages[package_index]
if isinstance(package, dict):
package = HelmPackageConfig(**dict(package))
self.helm_packages[package_index] = HelmPackageConfig(**dict(package))

@property
def build_output_folder_name(self) -> str:
Expand Down
4 changes: 0 additions & 4 deletions src/aosm/azext_aosm/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,6 @@ def publish_definition(
config_file=config_file, configuration_type=definition_type
)

for package in config.helm_packages:
print(f"Type of package: {type(package)}")

return
if definition_type == VNF:
deployer = DeployerViaArm(api_clients, config=config)
deployer.deploy_vnfd_from_bicep(
Expand Down
20 changes: 9 additions & 11 deletions src/aosm/azext_aosm/deploy/artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,12 @@ def upload(self, artifact_config: ArtifactConfig or HelmPackageConfig) -> None:
:param artifact_config: configuration for the artifact being uploaded
"""
if type(self.artifact_client) == OrasClient:
self._upload_helm_to_acr(artifact_config)

## TODO: pk5 fix this

# if type(artifact_config) == HelmPackageConfig:
# self._upload_helm_to_acr(artifact_config)
# elif type(artifact_config) == ArtifactConfig:
# self._upload_arm_to_acr(artifact_config)
if type(artifact_config) == HelmPackageConfig:
self._upload_helm_to_acr(artifact_config)
elif type(artifact_config) == ArtifactConfig:
self._upload_arm_to_acr(artifact_config)
else:
raise ValueError(f"Unsupported artifact type: {type(artifact_config)}.")
else:
self._upload_to_storage_account(artifact_config)

Expand Down Expand Up @@ -77,11 +75,11 @@ def _upload_helm_to_acr(self, artifact_config: HelmPackageConfig) -> None:
# If not included in config, the file path value will be the description of
# the field.

if artifact_config["path_to_chart"]:
if artifact_config.path_to_chart:
target = f"{self.artifact_client.remote.hostname.replace('https://', '')}/{self.artifact_name}:{self.artifact_version}"
logger.debug(f"Uploading {artifact_config['path_to_chart']} to {target}")
logger.debug(f"Uploading {artifact_config.path_to_chart} to {target}")
self.artifact_client.push(
files=[artifact_config["path_to_chart"]],
files=[artifact_config.path_to_chart],
target=target,
)

Expand Down
4 changes: 2 additions & 2 deletions src/aosm/azext_aosm/deploy/deploy_with_arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,11 @@ def deploy_cnfd_from_bicep(
artifact_dictionary[artifact.artifact_name] = artifact

for package_number in range(len(self.config.helm_packages)):
helm_package_name = self.config.helm_packages[package_number]["name"]
helm_package_name = self.config.helm_packages[package_number].name

if helm_package_name not in artifact_dictionary.keys():
print(
f"Artifact {self.config.helm_packages[package_number]['name']} not found in the artifact manifest"
f"Artifact {helm_package_name} not found in the artifact manifest"
)
continue

Expand Down