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

Use vmSettings for extension processing #2451

Merged
merged 6 commits into from
Dec 29, 2021
Merged

Conversation

narrieta
Copy link
Member

Now we use vmSettings for extension processing. We still fallback to extensionsConfig if the HostGAPlugin does not support Fast Track, if there are errors fetching the vmSettings, or if they are different to extensionsConfig.

@codecov
Copy link

codecov bot commented Dec 28, 2021

Codecov Report

Merging #2451 (7a809aa) into develop (2d1edd3) will increase coverage by 0.03%.
The diff coverage is 95.16%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2451      +/-   ##
===========================================
+ Coverage    71.84%   71.88%   +0.03%     
===========================================
  Files          101      101              
  Lines        14944    14964      +20     
  Branches      2367     2369       +2     
===========================================
+ Hits         10737    10757      +20     
- Misses        3727     3728       +1     
+ Partials       480      479       -1     
Impacted Files Coverage Δ
azurelinuxagent/common/protocol/wire.py 80.88% <93.18%> (+0.29%) ⬆️
...inuxagent/common/protocol/extensions_goal_state.py 89.10% <100.00%> (-0.14%) ⬇️
...ol/extensions_goal_state_from_extensions_config.py 92.33% <100.00%> (+0.11%) ⬆️
...protocol/extensions_goal_state_from_vm_settings.py 80.80% <100.00%> (-0.10%) ⬇️
azurelinuxagent/common/protocol/goal_state.py 93.47% <100.00%> (+0.21%) ⬆️
azurelinuxagent/ga/exthandlers.py 85.75% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d1edd3...7a809aa. Read the comment docs.

@@ -104,10 +103,8 @@ def compare_goal_states(first, second):
compare_attributes(first, second, "activity_id")
compare_attributes(first, second, "correlation_id")
compare_attributes(first, second, "created_on_timestamp")
# The status blob was added after version 112
Copy link
Member Author

Choose a reason for hiding this comment

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

now there is a global check for the version so this one is no longer needed

self.ext_handlers = extensions_goal_state.extensions
etag = self.protocol.client.get_goal_state().incarnation
Copy link
Member Author

Choose a reason for hiding this comment

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

despite the name of this local, this needs to be the incarnation number for status reporting to work - I introduced a regression a couple of PRs ago and was using the 'id' property; now i am fixing this to use the incarnation explicitly

there are a lot renames/refactoring needed in this module, i am planning on doing those gradually

if conf.get_enable_fast_track():
# Since currently we query vmSettings only to exercise the HostGAPlugin, errors in this section of the code should not
# prevent the agent from processing the goal state; we simply report a summary of those errors.
goal_state_updated = True
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe rename this to fabric_goal_state_updated for more clarity?

Copy link
Member Author

Choose a reason for hiding this comment

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

the 2 goal states are named _goal_state and _vm_settings_goal_state, the update variables are parallel to those names (goal_state_updated and vm_settings_goal_state updated)

renaming self._goal_state to self.fabric_goal_state would not be appropriate, since in the next iteration there will be only 1 goal state (which can come from fabric or fast track) and self._vm_settings_goal_state will go away)

Copy link
Contributor

Choose a reason for hiding this comment

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

sounds good.

if is_first_vm_settings:
message = "HostGAPlugin version: {0}".format(vm_settings.host_ga_plugin_version)
logger.info(message)
add_event(op=WALAEventOperation.HostPlugin, message=message, is_success=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

If the HGAP version < .115, we will keep emitting this event on every call to update_goal_state. We should only log this once irrespective

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, good point. I have another change in the pipeline where if we do not support vmsettings we will stop trying to use it for several hours. I'll add the check for minimum version there, too.

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool cool. So this will be taken care in the next PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I need some refactoring to get accurate telemetry and need to touch the error handling code first. That is the reason I postponed the handling of not supported. Version check is just a variation of not supported.

azurelinuxagent/common/protocol/wire.py Outdated Show resolved Hide resolved
azurelinuxagent/common/protocol/wire.py Outdated Show resolved Hide resolved
@narrieta narrieta merged commit 28b429e into Azure:develop Dec 29, 2021
@narrieta narrieta deleted the fast-track branch December 29, 2021 16:07
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.

3 participants