local run UI (#663)

## Summary of the Pull Request

This PR add a UI to the local run. 
- The UI currently monitors the logs and  some of the directory created (the rest will be wired in a coming PR)
- pressing 'q' will quit the PR
- By default, the job directory is deleted when the ui quits unless the parameter 'keep_job_dir' is specified
This commit is contained in:
Cheick Keita
2021-04-06 14:44:37 -07:00
committed by GitHub
parent 794400adf1
commit 3e7b3df34f
34 changed files with 775 additions and 103 deletions

View File

@ -1,14 +1,17 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::env;
use std::error::Error;
use std::fs::File;
use std::io::prelude::*;
use std::process::Command;
use std::{env, process::Stdio};
fn run_cmd(args: &[&str]) -> Result<String, Box<dyn Error>> {
let cmd = Command::new(args[0]).args(&args[1..]).output()?;
let cmd = Command::new(args[0])
.args(&args[1..])
.stdin(Stdio::null())
.output()?;
if cmd.status.success() {
Ok(String::from_utf8_lossy(&cmd.stdout).trim().to_string())
} else {