From a5c2197eeba4c2e20e7c952f04f3aa85fd259c4f Mon Sep 17 00:00:00 2001 From: Adam Olech Date: Tue, 22 Dec 2020 23:56:47 +0000 Subject: [PATCH] JobRunner: hardcode virtIp for now --- src/Runner.Worker/JobRunner.cs | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/Runner.Worker/JobRunner.cs b/src/Runner.Worker/JobRunner.cs index e4809559d74..a7ca1cf8d90 100644 --- a/src/Runner.Worker/JobRunner.cs +++ b/src/Runner.Worker/JobRunner.cs @@ -50,7 +50,7 @@ public async Task RunAsync(Pipelines.AgentJobRequestMessage message, var virtIpPath = Path.Combine(HostContext.GetDirectory(WellKnownDirectory.Work), "ip"); var virtPidPath = Path.Combine(virtDir, "work", "qemu.pid"); var virtFileReadSuccess = true; - string virtIp = "", virtPid = ""; + string virtIp = "172.17.0.2", virtPid = ""; Trace.Info($"QEMU tools directory: {virtDir}"); @@ -66,10 +66,11 @@ public async Task RunAsync(Pipelines.AgentJobRequestMessage message, try { - using (StreamReader reader = new StreamReader(new FileStream(virtIpPath, FileMode.Open))) - { - virtIp = reader.ReadLine(); - } + // TODO: IMPLEMENT THIS PROPERLY ONCE MULTITHREADING IS IN PLACE! + //using (StreamReader reader = new StreamReader(new FileStream(virtIpPath, FileMode.Open))) + //{ + // virtIp = reader.ReadLine(); + //} using (StreamReader reader = new StreamReader(new FileStream(virtPidPath, FileMode.Open))) { @@ -84,6 +85,17 @@ public async Task RunAsync(Pipelines.AgentJobRequestMessage message, } + if (virtIp == "") + { + Trace.Error("virtIp is an empty string!"); + + } + + if (virtPid == "") + { + Trace.Error("virtPid is an empty string!"); + } + message.Variables["system.qemuDir"] = virtDir; message.Variables["system.qemuIp"] = virtIp;