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

Add the ability in drivers to reference other drivers at the exporter level. #264

Open
mangelajo opened this issue Feb 7, 2025 · 3 comments

Comments

@mangelajo
Copy link
Member

mangelajo commented Feb 7, 2025

I.e.

apiVersion: jumpstarter.dev/v1alpha1
kind: ExporterConfig
metadata:
  name: corellium-exporter
  namespace: default
endpoint: ""
token: ""
export:
  rd1ae: 
    type: jumpstarter_driver_corellium.driver.CorelliumVirtualDevice
    config:
      api_base_url: "https://avh.app.corellium.com/api"
      api_token: "${CORELLIUM_API_TOKEN}"
      api_project_id: "${CORELLIUM_API_PROJECT_ID}"
      device_id: "rd1ae"
      flavor: "kronos"
      os: "1.0"
      name: "jmp-rd1ae"
      
  power:
    type: jumpstarter_driver_corellium.CorelliumPowerDriver
    config:
      object_id: "rd1ae"

  ssh:
    type: jumpstarter_driver_ssh.driver.SSH # jumpstarter_driver_corellium.CorelliumSSHDriver
    config:
      object_id: "rd1ae"
      # 

  storage:
    type: jumpstarter_driver_corellium.CorelliumStorageDriver # 
    config:
      object_id: "rd1ae"

That could be used to reference other objects in the exporter and compose drivers without needing to make them all children of each other, etc...

Ideally we should be able to reference by full path object_id: "object.sub_object.etc"

Could be useful to many use cases:

  • Arbitrary composition of drivers
  • Exporter/side image hashing by referencing a streaming video source...
  • SSH/TCP Tunneling that gets ip/port from other objects,
  • etc....

Ideally all drivers could have a method to find other objects on the exporter try by reference:

self.get_exporter_object(self.object_id)

@NickCao
Copy link
Collaborator

NickCao commented Feb 10, 2025

We now initialize drivers following a topological order from the leaves to the root. So It's not currently possible from child drivers to get a fully initialized reference to their parent drivers. And from a architecture perspective: child accessing parent is a abstraction layer violation. But still, this functionality is well needed, also for the "shared storage area" thing that would be used for the tftp and opendal driver.

@mangelajo
Copy link
Member Author

We now initialize drivers following a topological order from the leaves to the root. So It's not currently possible from child drivers to get a fully initialized reference to their parent drivers. And from a architecture perspective: child accessing parent is a abstraction layer violation. But still, this functionality is well needed, also for the "shared storage area" thing that would be used for the tftp and opendal driver.

Yes, I think childs should not access parents hierarchically (self.parent), but we need some way to at least get to the root, or a exporter base object, and ask for an specific instance based on the path, so we can make drivers work with each other while offering a uniform/flexible interface.

@mangelajo
Copy link
Member Author

Based on the discussion removed "Drivers could have references to the parent, or just to the top-level composite driver." from description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants