-
Notifications
You must be signed in to change notification settings - Fork 233
[2.7] Redesign Job-level Authorization Example #4074
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
Conversation
|
/build |
Greptile OverviewGreptile SummaryThis PR successfully redesigns the job-level-authorization example to use the modern Recipe API with Key changes:
The example still demonstrates the same authorization concept where site_a's Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant JobScript as job1.py/job2.py
participant ProdEnv
participant Server as NVFlare Server
participant SiteA as site_a
participant SiteB as site_b
participant SecHandler as CustomSecurityHandler
User->>JobScript: Execute python job1.py or job2.py
JobScript->>JobScript: Create NumpyFedAvgRecipe with job name
JobScript->>ProdEnv: Initialize ProdEnv with startup kit
JobScript->>ProdEnv: recipe.execute(env)
ProdEnv->>Server: Submit job via Flare API
Server->>SiteA: Deploy job and check_resources command
SiteA->>SecHandler: AUTHORIZE_COMMAND_CHECK event
SecHandler->>SecHandler: Check job name == "FL-Demo-Job2"
alt Job name is "FL-Demo-Job2"
SecHandler->>SiteA: Return False with error message
SiteA->>Server: Authorization failed
Server->>ProdEnv: Job rejected by site_a
else Job name is NOT "FL-Demo-Job2"
SecHandler->>SiteA: Return True
SiteA->>Server: Authorization success
SiteA->>SiteA: Execute training (client.py)
end
Server->>SiteB: Deploy job and check_resources command
SiteB->>SiteB: No security handler, allow all jobs
SiteB->>SiteB: Execute training (client.py)
SiteB->>Server: Training results
Server->>ProdEnv: Job status and results
ProdEnv->>JobScript: Return run object
JobScript->>User: Display job status and results
|
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.
5 files reviewed, no comments
…to job_level_auth_2.7
|
/build |
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.
5 files reviewed, no comments
|
/build |
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.
5 files reviewed, no comments
|
/build |
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.
5 files reviewed, no comments
examples/advanced/job-level-authorization/security/site_a/resources.json
Show resolved
Hide resolved
chesterxgchen
left a 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.
not sure why do we need a process launcher component at site system level
|
/build |
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.
5 files reviewed, 1 comment
chesterxgchen
left a 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.
LGTM
Fixes # . ### Description Redesign job-level-authorization example to utilize Recipe and ProdEnv. ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Quick tests passed locally by running `./runtest.sh`. - [ ] In-line docstrings updated. - [ ] Documentation updated.
…ization Example, Replace NLP-NER with link to tutorial (#4092) Fixes # . ### Description Cherry-pick recent example updates to main #4064 #4065 #4074 #4077 ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Quick tests passed locally by running `./runtest.sh`. - [ ] In-line docstrings updated. - [ ] Documentation updated. --------- Signed-off-by: Holger Roth <hroth@nvidia.com>
Fixes # .
Description
Redesign job-level-authorization example to utilize Recipe and ProdEnv.
Types of changes
./runtest.sh.