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

Consume IsVersionFromRSM Property #2934

Closed
wants to merge 1 commit into from

Conversation

nagworld9
Copy link
Contributor

Description

Now GS sends IsVersionFromRSM property in agent family to tell requested version is from RSM or not. We use this flag and fall back to old behavior of agent update in non-rsm case.

The schema would be

ExtensionConfig.xml

<GAFamily>
 <IsVersionFromRSM>false</IsVersionFromRSM>
<Name>Prod</Name>
<Uris>
<Uri>[https://umsal13dz3z2wk343xwz.blob.core.windows.net/568bb00f-455e-32b8-8deb-0e1bf1636254/568bb00f-455e-32b8-8deb-0e1bf1636254_manifest.xml</Uri>](https://umsal13dz3z2wk343xwz.blob.core.windows.net/568bb00f-455e-32b8-8deb-0e1bf1636254/568bb00f-455e-32b8-8deb-0e1bf1636254_manifest.xml%3C/Uri%3E)
<Uri>[https://umsang5g4cckr0t4xrdm.blob.core.windows.net/568bb00f-455e-32b8-8deb-0e1bf1636254/568bb00f-455e-32b8-8deb-0e1bf1636254_manifest.xml</Uri>](https://umsang5g4cckr0t4xrdm.blob.core.windows.net/568bb00f-455e-32b8-8deb-0e1bf1636254/568bb00f-455e-32b8-8deb-0e1bf1636254_manifest.xml%3C/Uri%3E)
<Uri>[https://umsadkjlshzqkmb23hqp.blob.core.windows.net/568bb00f-455e-32b8-8deb-0e1bf1636254/568bb00f-455e-32b8-8deb-0e1bf1636254_manifest.xml</Uri>](https://umsadkjlshzqkmb23hqp.blob.core.windows.net/568bb00f-455e-32b8-8deb-0e1bf1636254/568bb00f-455e-32b8-8deb-0e1bf1636254_manifest.xml%3C/Uri%3E)
</Uris>
<Version>2.10.0.3</Version>

Vmsettings.json

"gaFamilies": [
        {
            "name": "Win7",
            "version": "2.7.41491.1089",
            "isVersionFromRSM": true
            "uris": [
                "[https://umsawqtlsshtn5v2nfgh.blob.core.windows.net/94aa54c8-fa97-60bf-6426-fc691f622cd6/94aa54c8-fa97-60bf-6426-fc691f622cd6_manifest.xml"](https://umsawqtlsshtn5v2nfgh.blob.core.windows.net/94aa54c8-fa97-60bf-6426-fc691f622cd6/94aa54c8-fa97-60bf-6426-fc691f622cd6_manifest.xml%22),
                "[https://umsajbjtqrb3zqjvgb2z.blob.core.windows.net/94aa54c8-fa97-60bf-6426-fc691f622cd6/94aa54c8-fa97-60bf-6426-fc691f622cd6_manifest.xml"](https://umsajbjtqrb3zqjvgb2z.blob.core.windows.net/94aa54c8-fa97-60bf-6426-fc691f622cd6/94aa54c8-fa97-60bf-6426-fc691f622cd6_manifest.xml%22),
                "[https://umsavbvncrpzbnxmxzmr.blob.core.windows.net/94aa54c8-fa97-60bf-6426-fc691f622cd6/94aa54c8-fa97-60bf-6426-fc691f622cd6_manifest.xml"](https://umsavbvncrpzbnxmxzmr.blob.core.windows.net/94aa54c8-fa97-60bf-6426-fc691f622cd6/94aa54c8-fa97-60bf-6426-fc691f622cd6_manifest.xml%22)
            ]
        }
    ],

Issue #


PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which has an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • If applicable, the PR references the bug/issue that it fixes in the description.
  • New Unit tests were added for the changes made

Quality of Code and Contribution Guidelines

@nagworld9 nagworld9 changed the title consume rsm flag consume IsVersionFromRSM Property Sep 27, 2023
@nagworld9 nagworld9 changed the title consume IsVersionFromRSM Property Consume IsVersionFromRSM Property Sep 27, 2023
@codecov
Copy link

codecov bot commented Sep 28, 2023

Codecov Report

Merging #2934 (4748b0b) into develop (19b970b) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop    #2934      +/-   ##
===========================================
+ Coverage    72.02%   72.03%   +0.01%     
===========================================
  Files          106      106              
  Lines        16063    16070       +7     
  Branches      2304     2306       +2     
===========================================
+ Hits         11569    11576       +7     
  Misses        3962     3962              
  Partials       532      532              
Files Coverage Δ
...ol/extensions_goal_state_from_extensions_config.py 92.14% <100.00%> (+0.08%) ⬆️
...protocol/extensions_goal_state_from_vm_settings.py 83.63% <100.00%> (+0.18%) ⬆️
azurelinuxagent/common/protocol/restapi.py 97.51% <100.00%> (+0.01%) ⬆️
azurelinuxagent/ga/agent_update_handler.py 92.30% <100.00%> (ø)

@@ -73,6 +73,8 @@ def __init__(self, name, version=None):
self.name = name
# This is the Requested version as specified by the Goal State, it defaults to 0.0.0.0 if not specified in GS
self.requested_version_string = VERSION_0 if version is None else version
# Set to False if the version from rsm property is not specified in the GS
self.is_version_from_rsm = False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

having is_version_from_rsm and is_requested_version_specified seems redundant/overcomplicated. can we simplify that?

@@ -295,23 +295,23 @@ def run(self, goal_state):
requested_version = self.__get_requested_version(agent_family)
agent_manifest = None # This is to make sure fetch agent manifest once per update
warn_msg = ""
if requested_version is None:
if requested_version is not None and agent_family.is_version_from_rsm:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this even possible? if RSM is not requesting an update then we would simply get the version from the manifest, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition exactly for that to go to else for doing manifest call. The requested version could None if GS itself don't have it or when we disable the GA versioning.

# Do not proceed with update if self-update needs to download the manifest again with in an hour
if not self.__should_agent_attempt_manifest_download():
return
if conf.get_enable_ga_versioning(): # log the warning only when ga versioning is enabled
if conf.get_enable_ga_versioning() and not agent_family.is_version_from_rsm: # log the warning only when ga versioning is enabled
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but aren't you planning on enabling ga versioning? (and hence this warning would always be there until RSM updates are enabled?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yet, I'll do it in separate PR. We only log the warning when RSM updates are enabled and still missing requested version

@@ -338,8 +338,8 @@ def run(self, goal_state):
raise AgentUpdateError("The Agent received a request to downgrade to version {0}, but downgrading to a version less than "
"the Agent installed on the image ({1}) is not supported. Skipping downgrade.".format(requested_version, daemon_version))

msg = "Goal state {0} is requesting a new agent version {1}, will update the agent before processing the goal state.".format(
self._gs_id, str(requested_version))
msg = "Goal state {0} is requesting a new agent version {1} [VersionFromRSM:{2}], will update the agent before processing the goal state.".format(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change "VersionFromRSM" to something like "Is RSM update"?

@nagworld9 nagworld9 closed this Nov 1, 2023
@nagworld9
Copy link
Contributor Author

I'm working on new PR

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