Skip to content

Conversation

@csfmomo
Copy link
Contributor

@csfmomo csfmomo commented Oct 30, 2020

feat:

  • Add a go routine to update NC host version from NMAgent periodically.
  • If orchestrator type is CRD, update pending programming IPs as well.

Reason for Change:
NC version from DNC can be different with NC version from NMAgent when NMAgent didn't keep up the NC version change from DNC side.
This feature enable CNS sync NC version from NMAgent periodically and update related info.
fix: Bug Fixes 🐞
test: Testing 💚

  • [X ] adds unit tests

@codecov
Copy link

codecov bot commented Oct 30, 2020

Codecov Report

Merging #714 (2f2cc80) into master (169d7d7) will increase coverage by 0.08%.
The diff coverage is 64.70%.

@@            Coverage Diff             @@
##           master     #714      +/-   ##
==========================================
+ Coverage   39.61%   39.69%   +0.08%     
==========================================
  Files          82       82              
  Lines       10800    10858      +58     
==========================================
+ Hits         4278     4310      +32     
- Misses       6017     6031      +14     
- Partials      505      517      +12     

@csfmomo csfmomo force-pushed the bgForNcV branch 2 times, most recently from f97a86e to bc35910 Compare November 18, 2020 05:07
@csfmomo
Copy link
Contributor Author

csfmomo commented Nov 18, 2020

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@csfmomo
Copy link
Contributor Author

csfmomo commented Nov 18, 2020

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@csfmomo csfmomo force-pushed the bgForNcV branch 3 times, most recently from 392f83d to 71bb051 Compare November 24, 2020 18:55

// SyncHostNCVersion will check NC version from NMAgent and save it as host NC version in container status.
// If NMAgent NC version got updated, CNS will refresh the pending programming IP status.
func (service *HTTPRestService) SyncHostNCVersion(ctx context.Context, channelMode string, lastUpdatedHostNCTimeStamp time.Time, forceMarkIPAvailableTimeRange time.Duration) {
Copy link
Member

Choose a reason for hiding this comment

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

I highly recommend to move this to a separate file (like IPAMPoolMonitor). we only add apis called by internal cns client in this file.

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 file is not for internal cns call from begining. It's AKS start using it for internal CNS call. There are 6 functions in internalapi.go, only 2 of them are called by cns client. CreateOrUpdateNetworkContainerInternal and ReconcileNCState are called by cns client. The rest of 4 are not called by cns client.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could I remain the function here for this version?
I can do moving logic to separate file for next PR and we can move all the related logic, including what managed DNC use in a separate file.

@csfmomo csfmomo force-pushed the bgForNcV branch 4 times, most recently from 6a6fa28 to 946cbbf Compare December 1, 2020 01:42
If orchestrator type is CRD, update pending programming IPs as well.
…tate as Avaialable instead of pending programming.
Resovle conflicts manually.

Update unit test nc version value.

Update unit test nc version.

Add get nmagent default value back for integ testing purpose.
Unit test can be break by this change.

Update default new IP CNS status to available.

Assign value to host version if none exist in util.go

Addressed feedback and perform cluster integ test with 1 sec frequent nc version update.
Need to clean logNCSnapshots when send out PR.

Update nc version associate with secondary ip. Add new nmagent api test.

Add versionResponseWithoutToken.Containers log

Add containerId from our runner sub.
Add containerId from NMAgent team.

Addressed feedback and add real nmagent logic.

Add timeout when query nmagent for nc version.
This is the final version.

Change the way of http get request to add context. Change channel to no buffer with same goroutine.
Found always fall in ctx.Done() condition.
Add channel close for get nc version list.
Add milisecond unit for timeout.

Testing with different context version.
… retry if no response from NMAgent.

Release pending programming IP when scale down.
@csfmomo csfmomo force-pushed the bgForNcV branch 5 times, most recently from f48b691 to 4dc342e Compare December 1, 2020 20:21
@csfmomo
Copy link
Contributor Author

csfmomo commented Dec 2, 2020

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

return
}

nmaclient, err := nmagentclient.NewNMAgentClient("")
Copy link
Member

Choose a reason for hiding this comment

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

what's the use of having empty param to this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In case we want to override nmagent client url.

@csfmomo csfmomo dismissed neaggarwMS’s stale review December 11, 2020 21:54

Can't find where is this request. Sync up offline we can merege it first.

@csfmomo csfmomo merged commit 3c48a34 into Azure:master Dec 11, 2020
@csfmomo csfmomo deleted the bgForNcV branch December 12, 2020 05:27
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.

4 participants