-
Notifications
You must be signed in to change notification settings - Fork 469
Conditional based profiles for workers #8365
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
Conditional based profiles for workers #8365
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was only able to get through half of this and will do a second pass tomorrow. Please make sure that all the classes are documented with comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks great, nice work! Just adding some minor comments. Biggest takeaways for me is that the code needs to be commented, and unit tests need to be implemented for public methods
src/WebJobs.Script/Workers/Rpc/Configuration/RpcWorkerConfig.cs
Outdated
Show resolved
Hide resolved
src/WebJobs.Script/Workers/Rpc/WebHostRpcWorkerChannelManager.cs
Outdated
Show resolved
Hide resolved
src/WebJobs.Script/Workers/Profiles/WorkerDescriptionProfile.cs
Outdated
Show resolved
Hide resolved
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@soninaren @shreyas-gopalakrishna could diagnostic events be useful here? In a situation where a user edits the worker.config file, we might want to warn them about that?
I vaguely remember that there was a design document for this work. If it exists, can you please link that design document either to this PR or the linked issue? |
src/WebJobs.Script/Workers/Rpc/Configuration/RpcWorkerConfigFactory.cs
Outdated
Show resolved
Hide resolved
3d52ee6
to
7a8cde1
Compare
39c24d8
to
7a8cde1
Compare
/// <inheritdoc /> | ||
public void SaveWorkerDescriptionProfiles(List<WorkerDescriptionProfile> workerDescriptionProfiles, string language) | ||
{ | ||
_profiles[language] = workerDescriptionProfiles; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While running locally, this code block as well as RpcWorkerConfigFactory section was called thrice. Each the they had the same worker config. Checking if it is safe to do this assignment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fabiocav thoughts on this? I'm assuming this is expected, we could always check to see if the profile already exists in the dictionary before trying to assign / instead of overriding every time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was it on different instances of the WorkerProfileManager
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fabiocav Is hashcode a good way to verify the instance? I tried Console.WriteLine(this.GetHashCode());
after this line and get 3 outputs. The first hashcode is different. The second and third are the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without tracing the calls it would be difficult to say. For the instances, you can create and inspect the object ID while debugging, but I do expect a call in the parent scope and one in the inner scope (web and job host levels for workers initialized at each)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Should be good to go when we get Brett and Fabio to sign off.
It would be great to make sure the documentation is updated (I think a class diagram would be useful here) and we have an issue to track the detector work required
/// <inheritdoc /> | ||
public void SaveWorkerDescriptionProfiles(List<WorkerDescriptionProfile> workerDescriptionProfiles, string language) | ||
{ | ||
_profiles[language] = workerDescriptionProfiles; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fabiocav thoughts on this? I'm assuming this is expected, we could always check to see if the profile already exists in the dictionary before trying to assign / instead of overriding every time
resolves #8184
Design doc: https://dev.azure.com/msazure/One/_git/AAPT-Antares-Docs/pullrequest/5715621?_a=files
Issue describing the changes in this PR
Profiles enable workers to change how the worker is configured based on certain conditions, for example a worker may want to configure
itself differently for a consumption application vs a dedicated application. The profiles will be defined in the
worker.config.json
fileand will essentially override the default worker description based on a set of conditions.
The Java worker team is working on a prototype where an Application Insights (AI) agent is deployed along side the Java worker
to handle telemetry and logging to AI. Depending on the SKU and environment variables, the AI agent should be used.
Profiles will be used to add arguments required to enable the agent.
Sample
worker.config.json
with profilesSample
worker.config.json
with Java app insights - profilesPull request checklist
release_notes.md