Skip to content

Commit

Permalink
JobRunner: hardcode virtIp for now
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamOlech committed Jul 27, 2021
1 parent 8c5c168 commit a5c2197
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions src/Runner.Worker/JobRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public async Task<TaskResult> 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}");

Expand All @@ -66,10 +66,11 @@ public async Task<TaskResult> 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)))
{
Expand All @@ -84,6 +85,17 @@ public async Task<TaskResult> 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;

Expand Down

0 comments on commit a5c2197

Please sign in to comment.