Skip to content

feat: run update-core on cluster init and restore - #1199

Draft
DavidePrincipi wants to merge 4 commits into
mainfrom
feat-8021-2
Draft

feat: run update-core on cluster init and restore#1199
DavidePrincipi wants to merge 4 commits into
mainfrom
feat-8021-2

Conversation

@DavidePrincipi

@DavidePrincipi DavidePrincipi commented Jun 9, 2026

Copy link
Copy Markdown
Member

When NS8 is installed from a prebuilt image, core and Traefik may be outdated. Add step 40update_cluster to create-cluster to force an update-core run immediately after cluster initialisation.

This also covers the disaster-recovery path: restore-cluster already calls create-cluster as a sub-task, so the new step is reached in both scenarios without duplication.

During core update the cluster agent receives SIGUSR1 and exits gracefully once all running actions complete, then systemd restarts it at the latest version.

Refs NethServer/dev#8021 NethServer/dev#8052

@DavidePrincipi DavidePrincipi added the testing Start test suite label Jun 9, 2026
)
if update_core_response['exit_code'] != 0:
print(agent.SD_ERR + "update-core failed", file=sys.stderr)
sys.exit(1)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to not abort the create-cluster if the update fails.
Also make sure that is safe enough to call the update-core even if the cluster is not still completely configured.

When NS8 is installed from a prebuilt image, core and Traefik may be
outdated. Add step 40update_cluster to create-cluster to force an
update-core run immediately after cluster initialisation.

This also covers the disaster-recovery path: restore-cluster already
calls create-cluster as a sub-task, so the new step is reached in
both scenarios without duplication.

During core update the cluster agent receives SIGUSR1 and exits
gracefully once all running actions complete, then systemd restarts
it at the latest version.

Assisted-by: copilot:claude-sonnet-4.6
The initialized flag was derived solely from cluster/network existing
in Redis, which is set early in create-cluster/50update. With the new
40update_cluster step running update-core (and restarting Traefik), a
page reload during that window would show the UI fully loaded while
the cluster was still being set up.

Set FIRST_CONFIGURATION=1 in the cluster agent environment during
install-finalize.sh, before any cluster action runs. get-cluster-status
returns initialized=false while FIRST_CONFIGURATION=1. At the end of
create-cluster/50update, unset_env removes the flag so that subsequent
calls to get-cluster-status correctly return initialized=true.

Existing clusters have no FIRST_CONFIGURATION key, so the expression
os.getenv('FIRST_CONFIGURATION') != '1' evaluates to True and they
are unaffected.
@DavidePrincipi
DavidePrincipi requested a review from andre8244 June 18, 2026 09:30
@DavidePrincipi
DavidePrincipi force-pushed the feat-8021-2 branch 2 times, most recently from 7ff5877 to 286d2e4 Compare June 18, 2026 10:18
Retry the cluster status task submission when api-server returns "client
idle check failed" during cluster agent restarts. Handle the retry in
the shared axios interceptor and scope it to /cluster/tasks so
concurrent node or module task requests do not consume the same retry
budget.

Assisted-by: copilot:gpt-5.4

@andre8244 andre8244 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UI part LGTM

@DavidePrincipi

Copy link
Copy Markdown
Member Author

I cannot merge this pull request: in my early tests the cluster-admin task progress (create-cluster, restore-cluster) hangs forever or logs out the user. I put the PR to draft, to investigate these behaviors further in a separate issue.

@DavidePrincipi
DavidePrincipi marked this pull request as draft June 22, 2026 08:15
@DavidePrincipi DavidePrincipi removed the testing Start test suite label Jun 22, 2026
@DavidePrincipi DavidePrincipi linked an issue Jun 22, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prevent Core Apps version mismatch

3 participants