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 CommunicationLayer to ADB and HDC #142

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

TriedAngle
Copy link
Contributor

The ipc example is working, as a small bonus, I'd add an automatic compile -> send to device for mobile into the build_bench.

Warning:
adb identifier is still changed and should be investigated further

benchkit/devices/adb/__init__.py Show resolved Hide resolved
benchkit/devices/adb/__init__.py Show resolved Hide resolved
def get_process_status(self, process_handle: subprocess.Popen) -> str:
raise NotImplementedError("TODO")

def get_process_nb_threads(self, process_handle: subprocess.Popen) -> int:
Copy link
Member

Choose a reason for hiding this comment

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

Is the number of threads of adb something anyone would be interested in?

Copy link
Collaborator

Choose a reason for hiding this comment

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

isn't that required by the upper class somehow?

benchkit/devices/hdc/__init__.py Outdated Show resolved Hide resolved

@property
def remote_host(self) -> Optional[str]:
return self._conn.identifier
Copy link
Member

Choose a reason for hiding this comment

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

I find it confusing that the function is called remote_host but returns the identifier of the target device.
Just from the function name I would guess that the target device is potentially connected to a remote machine, which our local machine is connected to via ssh.
(E.g. local machine ---- ssh -> remote host ----- hdc -> OpenHarmony device )

Copy link
Collaborator

Choose a reason for hiding this comment

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

i think it's ok, the spec of the upper class is: "Returns an identifier (typically hostname) of the remote host, or None if communication happens locally."

Co-authored-by: Jonathan Schwender <[email protected]>
Signed-off-by: TryAngle <[email protected]>


def _identifier_from(ip_addr: str, port: int) -> str:
return f"{ip_addr}:{port}"
# def _identifier_from(ip_addr: str, port: int) -> str:
Copy link
Collaborator

Choose a reason for hiding this comment

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

either remove or let it but please do not comment it

@@ -43,23 +45,40 @@ def is_connected(self) -> bool:
return "device" == self.status


class AndroidDebugBridge: # TODO add commlayer for "host"
# TODO: investigate the identifier and daemon. temporarily it's mirrored like HDC does it.
Copy link
Collaborator

Choose a reason for hiding this comment

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

have you tested your solution with Android?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

partially, I will add a test to demonstrate and test this behavior.

def get_process_status(self, process_handle: subprocess.Popen) -> str:
raise NotImplementedError("TODO")

def get_process_nb_threads(self, process_handle: subprocess.Popen) -> int:
Copy link
Collaborator

Choose a reason for hiding this comment

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

isn't that required by the upper class somehow?


@property
def remote_host(self) -> Optional[str]:
return self._conn.identifier
Copy link
Collaborator

Choose a reason for hiding this comment

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

i think it's ok, the spec of the upper class is: "Returns an identifier (typically hostname) of the remote host, or None if communication happens locally."

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.

3 participants