This is an archive of the discontinued LLVM Phabricator instance.

Add support for lldb remote test
ClosedPublic

Authored by chying on Mar 30 2015, 3:05 PM.

Details

Summary
  • Write function to add lldb remote test steps
  • Modify lldb cmake factory to accept optional remote test related arguments
  • Add remote test on x86&clang-3.5 to cmake builder

Diff Detail

Repository
rL LLVM

Event Timeline

chying updated this revision to Diff 22915.Mar 30 2015, 3:05 PM
chying retitled this revision from to Add support for lldb remote test.
chying updated this object.
chying edited the test plan for this revision. (Show Details)
chying added reviewers: sivachandra, ovyalov, chaoren.
chying added a subscriber: Unknown Object (MLST).
chaoren edited edge metadata.Mar 30 2015, 3:24 PM

Please see comments below:

buildbot/osuosl/master/config/builders.py
724 ↗(On Diff #22915)

Does this have to be hardcoded? You should probably use a hostname instead if it must be hardcoded.

zorg/buildbot/builders/LLDBBuilder.py
266 ↗(On Diff #22915)

screen -d -m

Why not ssh -f?

--listen *:5432

Is this remote machine accessible from anywhere besides the build machine? If you know the hostname of the build machine, you should probably use that instead of *. Also, must the port be hardcoded?

sivachandra requested changes to this revision.Mar 30 2015, 3:54 PM
sivachandra edited edge metadata.
sivachandra added inline comments.
zorg/buildbot/builders/LLDBBuilder.py
295 ↗(On Diff #22915)

Lines 272-295 and lines 385-406 should probably live in a common function.

376 ↗(On Diff #22915)

The remote test steps should probably be added after the local test steps? That is, after line 406?

This revision now requires changes to proceed.Mar 30 2015, 3:54 PM
chying added inline comments.Mar 30 2015, 4:05 PM
buildbot/osuosl/master/config/builders.py
724 ↗(On Diff #22915)

The remote test instance was created with static ip, so this should be fine. It was not easy to debug with hostname, because gce instance cannot be reached by hostname from workstation(maybe there is some way that i don't know about).
But hostname could be used from one gce to another.
I will find if hostname works.

zorg/buildbot/builders/LLDBBuilder.py
266 ↗(On Diff #22915)

"ssh -f" doesn't detach the process from current shell, the process is still running in the background when using "ssh -f". Since buildbot will wait for current process exit to continue next step, so use "screen -d -m" to return immediately.

Yes, it's accessible from any machine for authorized users.
Same as above, I will find if hostname works.
Port could be specified by builder.

chying added inline comments.Mar 30 2015, 4:10 PM
zorg/buildbot/builders/LLDBBuilder.py
295 ↗(On Diff #22915)

Yes, I will re-factor the code.

376 ↗(On Diff #22915)

I put it here, to avoid making changes to 378-379
But I will re-factor the code as suggested above.

chying updated this revision to Diff 23022.Mar 31 2015, 6:41 PM
chying edited edge metadata.

Refactor code to have a common getLLDBTestSteps function
Use hostname instead of ip address for remote host
Remote host only listen to connection from builder

chying updated this revision to Diff 23023.Mar 31 2015, 6:48 PM
chying edited edge metadata.

Remove local workaround

chying updated this revision to Diff 23031.Apr 1 2015, 12:45 AM

Remove hard-coded values of remote target information, get these from cfg file

sivachandra requested changes to this revision.Apr 1 2015, 10:57 AM
sivachandra edited edge metadata.

Mostly LGTM.
You should probably add vharron to the reviews, or at least add him as a subscriber so that he in the know of the changes you are making, and also of the changes that I am suggesting.

zorg/buildbot/builders/LLDBBuilder.py
310 ↗(On Diff #23031)

You should put the remote config in a JSON file. That will eliminate parsing. Something like remote_cfg.json. You can generate this JSON from Python interpreter (and need not hand create it).

313 ↗(On Diff #23031)

For my knowledge: Do the extracted dictionary keys become properties automagically?

367 ↗(On Diff #23031)

Nit: Fix the indentation of the function params here to align with the opening '('.

This revision now requires changes to proceed.Apr 1 2015, 10:57 AM
chying added inline comments.Apr 1 2015, 12:27 PM
zorg/buildbot/builders/LLDBBuilder.py
310 ↗(On Diff #23031)

That is probably a good idea. I have to learn more about JSON.
This will require Json parser installed, like 'jq', is that right?

313 ↗(On Diff #23031)

Yes, dictionary keys returned from extract_fn will be added to property list. This code has been verified.

367 ↗(On Diff #23031)

This should be ok based on PEP8.
https://www.python.org/dev/peps/pep-0008/

chying updated this revision to Diff 23099.Apr 1 2015, 4:32 PM
chying edited edge metadata.

Put configuration of remote target to a Json file

sivachandra accepted this revision.Apr 1 2015, 4:39 PM
sivachandra edited edge metadata.

LGTM to avoid another round trip. But please address comments before submitting.

zorg/buildbot/builders/LLDBBuilder.py
14 ↗(On Diff #23099)

Nit: This is standard library module. Should be above 'import os' at line #1.

312 ↗(On Diff #23099)

The JSON file itself should have keys 'remote_host', 'remote_port', and 'remote_dir'. You just do this:

return json.loads(stdout)
369 ↗(On Diff #23099)

Nit (repeating from last time): Fix the indentation of the params to align to the opening '('.

This revision is now accepted and ready to land.Apr 1 2015, 4:39 PM
This revision was automatically updated to reflect the committed changes.