Skip to content

Conversation

ashiven
Copy link

@ashiven ashiven commented May 19, 2025

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
This PR introduces a new feature

What is the current behavior? (You can also link to an open issue here)
Currently it is not possible to scan for and register the workers belonging to a config or to connect to a specific worker

https://github.com/orgs/amosproj/projects/79/views/2?pane=issue&itemId=108209914&issue=amosproj%7Camos2025ss01-embark-orchestration-framework%7C15

What is the new behavior (if this is a feature change)? If possible add a screenshot.
It is now possible to scan for and register the workers in the IP range of a given config and then to connect to specific workers in order to gather information about their HW and OS type and version

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
No

ashiven added 7 commits May 15, 2025 16:15
Signed-off-by: ashiven <nevisha@pm.me>
Signed-off-by: ashiven <nevisha@pm.me>
… script, implement worker connect and registration endpoints

Signed-off-by: ashiven <nevisha@pm.me>
…can belong to multiple configs

Signed-off-by: ashiven <nevisha@pm.me>
Signed-off-by: ashiven <nevisha@pm.me>
…amiko.exec_command)

Signed-off-by: ashiven <nevisha@pm.me>
Signed-off-by: ashiven <nevisha@pm.me>
ashiven and others added 2 commits May 19, 2025 17:03
…ost keys when using Paramiko

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: ashiven <nevisha@pm.me>
@ashiven
Copy link
Author

ashiven commented May 19, 2025

There is one linter error/warning that I don't know how to fix. It says that executing commands on a remote host via paramiko.exec_command is potentially unsafe, but I don't know how else to get the system info from the remote host.

Also, paramiko.RejectPolicy may need to be reverted to paramiko.AutoAddPolicy because otherwise we would need to add each worker and its public key to the known SSH hosts manually. Even though paramiko.AutoAddPolicy is marked as unsafe by CodeQL.

Signed-off-by: ashiven <nevisha@pm.me>
@ashiven ashiven requested a review from ClProsser May 19, 2025 15:31
@ashiven ashiven self-assigned this May 19, 2025
Signed-off-by: ClProsser <clemens.prosser@gmail.com>
Copy link

@ClProsser ClProsser left a comment

Choose a reason for hiding this comment

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

Good job @ashiven. Some minor changes, otherwise suggestions.

Having multiple configurations per worker looks confusing to me. You might want to change that, if you agree.
Edit: I changed my mind. See the comment in workers/models.py

If those endpoints are API endpoints, please add them to the openapi.yaml.

Note that your branch has conflicts with the mainbranch. Please fix that.

Comment on lines 10 to 12
path('worker/scan/<int:configuration_id>/', views.config_worker_scan, name='embark-worker-scan'),
path('worker/connect/<int:configuration_id>/<int:worker_id>/', views.connect_worker, name='embark-worker-connect'),
path('worker/registered/<int:configuration_id>/', views.registered_workers, name='embark-worker-registered'),

Choose a reason for hiding this comment

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

If these are API endpoints, I'd add a prefix such as api to make it implicitly clear. E.g. api/worker/scan/<int:configuration_id>/

Copy link
Author

@ashiven ashiven May 21, 2025

Choose a reason for hiding this comment

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

I think it would make development easier for now to leave these endpoints as they are and maybe change them into api endpoints later on. Otherwise we would have to provide a valid api key whenever we want to test these endpoints or use them in developing the orchestrator and create documentation that might be subject to change

@ashiven ashiven merged commit caa2337 into main May 21, 2025
11 of 13 checks passed
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