gce_au_worker: Use internal IP to connect to DUTs when on GCE

This is to unblock the move of lakitu builders onto GCE. gce_au_worker
now uses the DUT's internap IP address to connect, such that the
connection won't be blocked by any firewall.

To make this not break the existing workflow, i.e., using baremetal
builders, a compat logic is added. When it detects that it's not run
from GCE, it will fall back to creating a static external IP address,
and using that to connect.

TEST=GCETestStage (of lakitu-pre-cq) passes on both baremetal and GCE.

Change-Id: Ia345f8a7ea09194f558e91fb3b862e4532368327
Reviewed-on: https://chromium-review.googlesource.com/669883
Commit-Ready: Daniel Wang <wonderfly@google.com>
Tested-by: Daniel Wang <wonderfly@google.com>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
1 file changed