[cdc_stream] Add a CLI client to start/stop asset streaming sessions (#4)

Implements the cdc_stream client and adjusts asset streaming in
various places to work better outside of a GGP environment.

This CL tries to get quoting for SSH commands right. It also brings
back the ability to start a streaming session from
asset_stream_manager.

Also cleans up Bazel targets setup. Since the sln file is now in root,
it is no longer necessary to prepend ../ to relative filenames to
make clicking on errors work.
This commit is contained in:
Lutz Justen
2022-11-18 10:59:42 +01:00
committed by GitHub
parent ca84d3dd2e
commit 269fb2be45
38 changed files with 797 additions and 356 deletions

View File

@@ -23,6 +23,7 @@
#include "absl/status/status.h"
#include "asset_stream_manager/session_config.h"
#include "session.h"
namespace cdc_ft {
@@ -38,7 +39,6 @@ class AssetStreamConfig {
// Loads a configuration from the JSON file at |path| and overrides any config
// values that are set in this file. Sample json file:
// {
// "src_dir":"C:\\path\\to\\assets",
// "verbosity":3,
// "debug":0,
// "singlethreaded":0,
@@ -67,34 +67,29 @@ class AssetStreamConfig {
// read from the JSON file.
std::string GetFlagReadErrors();
// Workstation directory to stream. Should usually be empty since mounts are
// triggered by the CLI or the partner portal via a gRPC call, but useful
// during development.
const std::string& src_dir() const { return src_dir_; }
// IP address of the instance to stream to. Should usually be empty since
// mounts are triggered by the CLI or the partner portal via a gRPC call, but
// useful during development.
const std::string& instance_ip() const { return instance_ip_; }
// IP address of the instance to stream to. Should usually be unset (0) since
// mounts are triggered by the CLI or the partner portal via a gRPC call, but
// useful during development.
const uint16_t instance_port() const { return instance_port_; }
// Session configuration.
const SessionConfig session_cfg() const { return session_cfg_; }
const SessionConfig& session_cfg() const { return session_cfg_; }
// Workstation directory to be streamed. Used for development purposes only
// to start a session right away when the service starts up. See dev CLI args.
const std::string& dev_src_dir() const { return dev_src_dir_; }
// Session target. Used for development purposes only to start a session right
// away when the service starts up. See dev CLI args.
const SessionTarget& dev_target() const { return dev_target_; }
// Whether to log to a file or to stdout.
bool log_to_stdout() const { return log_to_stdout_; }
private:
std::string src_dir_;
std::string instance_ip_;
uint16_t instance_port_ = 0;
SessionConfig session_cfg_;
bool log_to_stdout_ = false;
// Configuration used for development. Allows users to specify a session
// via the service's command line.
std::string dev_src_dir_;
SessionTarget dev_target_;
// Use a set, so the flags are sorted alphabetically.
std::set<std::string> flags_read_from_file_;