Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add poll watcher support to spec watcher for M1 #8449

Merged
merged 29 commits into from Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 13 additions & 1 deletion components/hab/src/command/studio/enter.rs
Expand Up @@ -8,7 +8,8 @@ use crate::{common::ui::{UIWriter,
BLDR_URL_ENVVAR,
ORIGIN_ENVVAR};
use habitat_common::cli_config::CliConfig;
use habitat_core::AUTH_TOKEN_ENVVAR;
use habitat_core::{package::target::PackageTarget,
AUTH_TOKEN_ENVVAR};
use same_file::is_same_file;
use std::{env,
ffi::OsString,
Expand All @@ -19,6 +20,7 @@ use std::{env,
pub const ARTIFACT_PATH_ENVVAR: &str = "ARTIFACT_PATH";
pub const CERT_PATH_ENVVAR: &str = "CERT_PATH";
pub const SSL_CERT_FILE_ENVVAR: &str = "SSL_CERT_FILE";
pub const STUDIO_HOST_ARCH_ENVVAR: &str = "HAB_STUDIO_SECRET_HAB_STUDIO_HOST_ARCH";
atrniv marked this conversation as resolved.
Show resolved Hide resolved

const STUDIO_PACKAGE_IDENT: &str = "core/hab-studio";

Expand All @@ -42,6 +44,14 @@ fn set_env_var_from_config(env_var: &str, config_val: Option<String>, sensitive:
}
}

// Set the environment variable for the host architecture to be used in
// hab studio. It must be set outside of studio and passed in through
// the environment variable defined in STUDIO_HOST_ARCH_ENVVAR.
fn set_arch_env_var() {
env::set_var(STUDIO_HOST_ARCH_ENVVAR,
format!("{}", PackageTarget::active_target()));
}

fn cache_ssl_cert_file(cert_file: &str, cert_cache_dir: &Path) -> Result<()> {
let cert_path = Path::new(&cert_file);

Expand Down Expand Up @@ -74,6 +84,8 @@ pub async fn start(ui: &mut UI, args: &[OsString]) -> Result<()> {
config.origin.map(|o| o.to_string()),
Sensitivity::PrintValue);

set_arch_env_var();

if config.ctl_secret.is_some() {
ui.warn("Your Supervisor CtlGateway secret is not being copied to the Studio \
environment because the Studio's Supervisor is local. If you wish to contact a \
Expand Down
2 changes: 2 additions & 0 deletions components/sup/src/manager.rs
Expand Up @@ -9,6 +9,7 @@ mod self_updater;
mod service_updater;
mod spec_dir;
mod spec_watcher;
mod sup_watcher;
pub(crate) mod sys;
mod user_config_watcher;

Expand Down Expand Up @@ -691,6 +692,7 @@ impl Manager {
spec_dir.migrate_specs();

let spec_watcher = SpecWatcher::run(&spec_dir)?;
trace!("Created SpecWatcher");

if let Some(config) = cfg.event_stream_config {
// Collect the FQDN of the running machine
Expand Down