Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
    npro  
 Modern all-safe Rust Network Protocol library supporting h1, h2, h3, ws, wt sans-IO and with socket IO + tls
git clone https://npro.rs/repo/npro
 
root / src / push / pu-private.h
Author[]Andy Green <andy@warmcat.com> 2025-10-12 06:20 UTC
Committer[]Andy Green <andy@warmcat.com> 2025-10-13 07:29 UTC
Tree563ce6efe74973c3be1b6490ec1a85e990998f23   Raw Patch
 
cleaning
cleaning
diff --git a/assets/sai.js b/assets/sai.js index 50db89f..215412f 100644 --- a/assets/sai.js +++ b/assets/sai.js @@ -800,10 +800,10 @@ function summarize_build_situation(event_uuid) text = total + " pending"; else { var parts = []; - if (good) parts.push(good + " passed"); - if (bad) parts.push(bad + " failed"); - if (ongoing) parts.push(ongoing + " ongoing"); - if (pending) parts.push(pending + " pending"); + if (good) parts.push(good + " OK"); + if (bad) parts.push(bad + " bad"); + if (ongoing) parts.push(ongoing + " building"); + if (pending) parts.push(pending + " wait"); text = parts.join(", "); } @@ -1055,10 +1055,11 @@ function createBuilderDiv(plat) { `<div class="res-bar"><div class="res-bar-inner res-bar-ram w-0"></div></div>` + `<div class="res-bar"><div class="res-bar-inner res-bar-disk w-0"></div></div>` + `</div>`; - innerHTML += `<br>${plat.peer_ip}<div class="server-state">` + - `Slots: ${plat.s_avail_slots}, In-flight: ${plat.s_inflight_count}<br>` + - `Last Reject: ${plat.s_last_rej_task_uuid ? plat.s_last_rej_task_uuid.substring(0, 8) : 'none'}` + - `</div></td></tr></tbody></table>`; + innerHTML += `${plat.peer_ip}`; +// `<div class="server-state">` + +// `Slots: ${plat.s_avail_slots}, In-flight: ${plat.s_inflight_count}<br>` + +// `Last Reject: ${plat.s_last_rej_task_uuid ? plat.s_last_rej_task_uuid.substring(0, 8) : 'none'}` + "</div>" + + innerHTML += `</td></tr></tbody></table>`; platDiv.innerHTML = innerHTML; @@ -1320,6 +1321,8 @@ function ws_open_sai() return; // Stop processing this old message } + console.log(jso.schema); + switch (jso.schema) { case "com.warmcat.sai.builders": @@ -1447,7 +1450,7 @@ function ws_open_sai() /* this is just the summary box, not the tasks */ document.getElementById("esr-" + jso.overview[0].e.uuid).innerHTML = sai_event_summary_render(jso.overview[0], now_ut, 1); - + /* if the task status icons exist, update their state */ for (n = jso.overview[0].t.length - 1; n >= 0; n--) @@ -1596,6 +1599,8 @@ function ws_open_sai() if (document.getElementById("esr-" + jso.e.uuid)) document.getElementById("esr-" + jso.e.uuid).innerHTML = sai_event_summary_render(jso, now_ut, 1); + update_summary_and_progress(jso.e.uuid); + } else { console.log("NO taskinfo- or taskstate_" + jso.t.uuid); @@ -1637,9 +1642,9 @@ function ws_open_sai() document.getElementById("esr-" + jso.e.uuid).innerHTML = sai_event_summary_render(jso, now_ut, 1); - update_summary_and_progress(jso.e.uuid); } - + update_summary_and_progress(jso.e.uuid); + if (document.getElementById("rebuild-" + san(jso.t.uuid))) { document.getElementById("rebuild-" + san(jso.t.uuid)). addEventListener("click", function(e) { diff --git a/src/builder/b-nspawn.c b/src/builder/b-nspawn.c index e0d7992..7f8803e 100644 --- a/src/builder/b-nspawn.c +++ b/src/builder/b-nspawn.c @@ -189,7 +189,7 @@ sai_lsp_reap_cb(void *opaque, const lws_spawn_resource_us_t *res, siginfo_t *si, char s[256]; int n; - saib_log_chunk_create(ns, ">saib> Reaping build process\n", 29, 3); + saib_log_chunk_create(ns, ">saib> <=== Reaping build process\n", 34, 3); #if !defined(WIN32) diff --git a/src/builder/b-task.c b/src/builder/b-task.c index 41ac815..81a2843 100644 --- a/src/builder/b-task.c +++ b/src/builder/b-task.c @@ -226,6 +226,7 @@ enum { SAIB_RX_REBUILD }; +#if 0 static const char * const nsstates[] = { "NSSTATE_INIT", "NSSTATE_MOUNTING", @@ -234,26 +235,27 @@ static const char * const nsstates[] = { "NSSTATE_UPLOADING_ARTIFACTS", "NSSTATE_FAILED", }; +#endif static void saib_start_artifact_upload(struct sai_nspawn *ns); int saib_set_ns_state(struct sai_nspawn *ns, int state) { - char log[100]; - int n; +// char log[100]; +// int n; ns->state = (uint8_t)state; ns->state_changed = 1; - if (state >= 0 && state < (int)LWS_ARRAY_SIZE(nsstates)) - n = lws_snprintf(log, sizeof(log), ">saib> %s\n", nsstates[state]); - else - n = lws_snprintf(log, sizeof(log), ">saib> ILLEGAL_STATE %d\n", (int)state); +// if (state >= 0 && state < (int)LWS_ARRAY_SIZE(nsstates)) +// n = lws_snprintf(log, sizeof(log), ">saib> %s\n", nsstates[state]); +// else +// n = lws_snprintf(log, sizeof(log), ">saib> ILLEGAL_STATE %d\n", (int)state); - lwsl_user("%s: task %s: %s\n", __func__, ns->task ? ns->task->uuid : "null", log); +// lwsl_user("%s: task %s: %s\n", __func__, ns->task ? ns->task->uuid : "null", log); - saib_log_chunk_create(ns, log, (unsigned int)n, 3); +// saib_log_chunk_create(ns, log, (unsigned int)n, 3); if (state == NSSTATE_EXECUTING_STEPS && ns->spm && !ns->spm->sul_load_report.list.owner) @@ -703,7 +705,9 @@ saib_ws_json_rx_builder(struct sai_plat_server *spm, const void *in, size_t len) sai_rebuild_t *reb; sai_task_t *task; int n, m, en; + char mb[96]; char *p; + int ml; /* * use the schema name on the incoming JSON to decide what kind of @@ -920,24 +924,33 @@ saib_ws_json_rx_builder(struct sai_plat_server *spm, const void *in, size_t len) ns->current_step = task->build_step; ns->build_step_count = task->build_step_count; if (!ns->current_step) { - ns->spins = 0; + ns->spins = 0; ns->user_cancel = 0; ns->us_cpu_user = 0; - ns->us_cpu_sys = 0; - ns->worst_mem = 0; - ns->worst_stg = 0; + ns->us_cpu_sys = 0; + ns->worst_mem = 0; + ns->worst_stg = 0; } ns->spm = spm; /* bind this task to the spm the req came in on */ - { - int ml; - char mb[96]; + if (!ns->current_step) { + saib_log_chunk_create(ns, ">saib>\n", 7, 3); + saib_log_chunk_create(ns, ">saib>\n", 7, 3); + saib_log_chunk_create(ns, ">saib>\n", 7, 3); ml = lws_snprintf(mb, sizeof(mb), ">saib> Sai Builder Version: %s, lws: %s\n", BUILD_INFO, LWS_BUILD_HASH); saib_log_chunk_create(ns, mb, (unsigned int)ml, 3); } + + saib_log_chunk_create(ns, ">saib>\n", 7, 3); + ml = lws_snprintf(mb, sizeof(mb), + ">saib> Starting task step %d ===>\n", + ns->current_step + 1); + + saib_log_chunk_create(ns, mb, (unsigned int)ml, 3); + saib_set_ns_state(ns, NSSTATE_INIT); #if defined(__linux__) @@ -945,17 +958,16 @@ saib_ws_json_rx_builder(struct sai_plat_server *spm, const void *in, size_t len) ns->fsm.layers[1] = "env"; #endif - lws_snprintf(ns->fsm.ovname, sizeof(ns->fsm.ovname), "%s", - task->uuid); + lws_snprintf(ns->fsm.ovname, sizeof(ns->fsm.ovname), "%s", task->uuid); - lwsl_notice("%s: server %s\n", __func__, ns->server_name); - lwsl_notice("%s: project %s\n", __func__, ns->project_name); - lwsl_notice("%s: ref %s\n", __func__, ns->ref); - lwsl_notice("%s: hash %s\n", __func__, ns->hash); - lwsl_notice("%s: distro %s\n", __func__, ns->fsm.distro); - lwsl_notice("%s: ovname %s\n", __func__, ns->fsm.ovname); - lwsl_notice("%s: git_repo_url %s\n", __func__, ns->git_repo_url); - lwsl_notice("%s: mountpoint %s\n", __func__, ns->fsm.mp); +// lwsl_notice("%s: server %s\n", __func__, ns->server_name); +// lwsl_notice("%s: project %s\n", __func__, ns->project_name); +// lwsl_notice("%s: ref %s\n", __func__, ns->ref); +// lwsl_notice("%s: hash %s\n", __func__, ns->hash); +// lwsl_notice("%s: distro %s\n", __func__, ns->fsm.distro); +// lwsl_notice("%s: ovname %s\n", __func__, ns->fsm.ovname); +// lwsl_notice("%s: git_repo_url %s\n", __func__, ns->git_repo_url); +// lwsl_notice("%s: mountpoint %s\n", __func__, ns->fsm.mp); n = lws_snprintf(ns->inp, sizeof(ns->inp), "%s%c", builder.home, csep); @@ -1052,7 +1064,6 @@ saib_ws_json_rx_builder(struct sai_plat_server *spm, const void *in, size_t len) /* we're busy, we're not in the mood for suspending */ - lwsl_notice("%s: cancelling suspend grace time\n", __func__); lws_sul_cancel(&ns->builder->sul_idle); /* diff --git a/src/power/p-api.c b/src/power/p-api.c index 8c9e635..d16c255 100644 --- a/src/power/p-api.c +++ b/src/power/p-api.c @@ -231,7 +231,7 @@ local_srv_state(void *userobj, void *sh, lws_ss_constate_t state, case LWSSSCS_SERVER_TXN: lws_ss_get_metadata(lws_ss_from_user(g), "path", (const void **)&path, &len); - lwsl_ss_user(lws_ss_from_user(g), "LWSSSCS_SERVER_TXN path '%.*s' (%d)", (int)len, path, (int)len); + // lwsl_ss_user(lws_ss_from_user(g), "LWSSSCS_SERVER_TXN path '%.*s' (%d)", (int)len, path, (int)len); /* * path is containing a string like "/power-off/b32"
Page fetched 0s ago, creation time: 5ms (vhost etag hits: 0%, cache hits: 0%)