Skip to content

Dieri/test ssh #5860

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

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix
  • Loading branch information
dieriba committed Jun 3, 2025
commit 504b95f381b6e9ccbbe7f8daccf89b01f83291cf
17 changes: 11 additions & 6 deletions backend/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ use windmill_common::{
scripts::ScriptLang,
stats_oss::schedule_stats,
triggers::TriggerKind,
utils::{hostname, rd_string, Mode, GIT_VERSION, MODE_AND_ADDONS},
utils::{
create_default_worker_suffix, create_ssh_agent_worker_suffix, worker_name_with_suffix,
Mode, GIT_VERSION, HOSTNAME, MODE_AND_ADDONS,
},
worker::{
reload_custom_tags_setting, Connection, HUB_CACHE_DIR, TMP_DIR, TMP_LOGS_DIR, WORKER_GROUP,
},
Expand Down Expand Up @@ -265,7 +268,7 @@ async fn windmill_main() -> anyhow::Result<()> {
tracing::error!("Failed to install rustls crypto provider");
}

let hostname = hostname();
let hostname = HOSTNAME.to_owned();

let mode_and_addons = MODE_AND_ADDONS.clone();
let mode = mode_and_addons.mode;
Expand Down Expand Up @@ -344,7 +347,7 @@ async fn windmill_main() -> anyhow::Result<()> {
"Creating http client for cluster using base internal url {}",
std::env::var("BASE_INTERNAL_URL").unwrap_or_default()
);
let suffix = windmill_common::utils::worker_suffix(&hostname, &rd_string(5));
let suffix = create_ssh_agent_worker_suffix(&hostname);
(
Connection::Http(build_agent_http_client(&suffix)),
Some(suffix),
Expand Down Expand Up @@ -679,19 +682,21 @@ Windmill Community Edition {GIT_VERSION}
let base_internal_url = base_internal_rx.await?;
if worker_mode {
let mut workers = vec![];

for i in 0..num_workers {
let suffix: String = if i == 0 && first_suffix.as_ref().is_some() {
let suffix = if i == 0 && first_suffix.is_some() {
first_suffix.as_ref().unwrap().clone()
} else {
windmill_common::utils::worker_suffix(&hostname, &rd_string(5))
create_default_worker_suffix(&hostname)
};

let worker_conn = WorkerConn {
conn: if i == 0 || mode != Mode::Agent {
conn.clone()
} else {
Connection::Http(build_agent_http_client(&suffix))
},
worker_name: windmill_common::utils::worker_name_with_suffix(
worker_name: worker_name_with_suffix(
mode == Mode::Agent,
WORKER_GROUP.as_str(),
&suffix,
Expand Down
12 changes: 6 additions & 6 deletions backend/src/monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1914,12 +1914,12 @@ async fn handle_zombie_jobs(db: &Pool<Postgres>, base_internal_url: &str, worker
.await
.expect("could not create job token");

let client = AuthedClient {
base_internal_url: base_internal_url.to_string(),
let client = AuthedClient::new(
base_internal_url.to_string(),
job.workspace_id.to_string(),
token,
workspace: job.workspace_id.to_string(),
force_client: None,
};
None,
);

let last_ping = job.last_ping.clone();
let error_message = format!(
Expand All @@ -1938,7 +1938,7 @@ async fn handle_zombie_jobs(db: &Pool<Postgres>, base_internal_url: &str, worker
None,
error::Error::ExecutionErr(error_message),
true,
same_worker_tx_never_used,
Some(&same_worker_tx_never_used),
"",
worker_name,
send_result_never_used,
Expand Down
Loading