From 0d9fd1262863efd192837850e1579fa6d8a26665 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 18 Jul 2026 20:49:16 +0100 Subject: [PATCH] Move Bifrost Persona feedback deployment onto Yggdrasil --- crates/idunn-daemon/src/main.rs | 60 ++++++++++++------- ...loy-yggdrasil-bifrost-persona-feedback.ps1 | 14 ----- scripts/linux/idunn-yggdrasil | 4 +- 3 files changed, 42 insertions(+), 36 deletions(-) delete mode 100644 scripts/deploy-yggdrasil-bifrost-persona-feedback.ps1 diff --git a/crates/idunn-daemon/src/main.rs b/crates/idunn-daemon/src/main.rs index 79c0f46..a159f2f 100644 --- a/crates/idunn-daemon/src/main.rs +++ b/crates/idunn-daemon/src/main.rs @@ -2935,6 +2935,29 @@ fn swarm_targets(options: &SwarmOptions) -> Result> { enabled: true, interval_seconds: 300, }, + DaemonTarget { + daemon_id: "yggdrasil-bifrost-persona-feedback".to_string(), + verse_id: "yggdrasil.local".to_string(), + name: "Yggdrasil Bifrost Persona feedback".to_string(), + health_contract: health_contract( + "bifrost.cultnet-rudp-persona-feedback-health", + "stale-deployment", + ), + deploy_command: Some(yggdrasil_actuator("deploy", "bifrost-persona-feedback")), + restart_command: None, + release: Some(requiring_bifrost_authority(with_deployed_revision_witness( + release_target( + "Bifrost", + PathBuf::from("/srv/build/Bifrost-persona-feedback"), + "restart-after-verified-build", + None, + "restart-required", + ), + PathBuf::from("/srv/bifrost/persona-feedback/runtime/deployment.env"), + ))), + enabled: true, + interval_seconds: 30, + }, DaemonTarget { daemon_id: "yggdrasil-repixelizer".to_string(), verse_id: "yggdrasil.local".to_string(), @@ -3116,20 +3139,6 @@ fn swarm_targets(options: &SwarmOptions) -> Result> { enabled: true, interval_seconds: 300, }, - DaemonTarget { - daemon_id: "yggdrasil-bifrost-persona-feedback".to_string(), - verse_id: "yggdrasil.local".to_string(), - name: "Yggdrasil Bifrost Persona feedback".to_string(), - health_contract: health_contract( - "bifrost.cultnet-rudp-persona-feedback-health", - "stale-deployment", - ), - deploy_command: Some(script("deploy-yggdrasil-bifrost-persona-feedback.ps1")), - restart_command: None, - release: None, - enabled: true, - interval_seconds: 30, - }, DaemonTarget { daemon_id: "yggdrasil-repixelizer".to_string(), verse_id: "yggdrasil.local".to_string(), @@ -5151,7 +5160,12 @@ mod tests { for legacy in yggdrasil .iter() - .filter(|target| target.daemon_id != "yggdrasil-epiphany") + .filter(|target| { + !matches!( + target.daemon_id.as_str(), + "yggdrasil-epiphany" | "yggdrasil-bifrost-persona-feedback" + ) + }) .filter_map(|target| target.release.as_ref()) { assert!( @@ -5173,7 +5187,9 @@ mod tests { assert!(unit.contains("--command-timeout-seconds 3600")); assert!(actuator.contains("deploy:epiphany|restart:epiphany")); assert!(actuator.contains("/usr/local/bin/idunn validate-release-authority")); - assert!(actuator.contains("epiphany) target_requires_bifrost_authority=true")); + assert!(actuator.contains( + "epiphany|bifrost-persona-feedback) target_requires_bifrost_authority=true" + )); assert!(actuator.contains( "voidbot|heimdall|repixelizer|streampixels) target_requires_bifrost_authority=false" )); @@ -5402,10 +5418,10 @@ mod tests { #[test] fn bifrost_persona_feedback_target_uses_daemon_health_and_idunn_deployment() { let options = SwarmOptions { - profile: "starfire-local".to_string(), - repo_root: PathBuf::from("E:/Projects/Odin"), + profile: "yggdrasil-local".to_string(), + repo_root: PathBuf::from("/srv/odin/source"), }; - let targets = swarm_targets(&options).expect("starfire-local targets"); + let targets = swarm_targets(&options).expect("yggdrasil-local targets"); let target = targets .iter() .find(|target| target.daemon_id == "yggdrasil-bifrost-persona-feedback") @@ -5416,9 +5432,13 @@ mod tests { ); assert_eq!( target.deploy_command.as_deref(), - Some("E:/Projects/Odin\\scripts\\deploy-yggdrasil-bifrost-persona-feedback.ps1") + Some("sudo -n /usr/local/libexec/idunn-yggdrasil deploy bifrost-persona-feedback \"$IDUNN_SOURCE_COMMIT\" \"$IDUNN_REPOSITORY_FULL_NAME\" \"$IDUNN_UPSTREAM_REF\" \"$BIFROST_RELEASE_AUTHORITY_ID\" \"$BIFROST_RELEASE_AUTHORITY_SHA256\" \"$IDUNN_DEPLOYMENT_REQUEST_ID\" \"$IDUNN_REQUIRES_BIFROST_AUTHORITY\"") ); assert!(target.restart_command.is_none()); + let release = target.release.as_ref().expect("release target"); + assert!(release.requires_bifrost_authority); + assert_eq!(release.repository_full_name, "GameCult/Bifrost"); + assert_eq!(release.repo_path, PathBuf::from("/srv/build/Bifrost-persona-feedback")); let desired = IdunnDesiredDaemonRecord { daemon_id: target.daemon_id.clone(), diff --git a/scripts/deploy-yggdrasil-bifrost-persona-feedback.ps1 b/scripts/deploy-yggdrasil-bifrost-persona-feedback.ps1 deleted file mode 100644 index ff04d53..0000000 --- a/scripts/deploy-yggdrasil-bifrost-persona-feedback.ps1 +++ /dev/null @@ -1,14 +0,0 @@ -[CmdletBinding()] -param([string] $SshTarget = "yggdrasil") -$ErrorActionPreference = "Stop" -if ($env:IDUNN_ACTUATOR -ne "1" -or $env:IDUNN_COMMAND_AUTHORITY -ne "idunn-daemon") { - throw "This command is owned by Idunn's deployment actuator." -} -if ($env:IDUNN_DEPLOYMENT_REQUEST_ID -notmatch '^deploy:yggdrasil-bifrost-persona-feedback:.+') { - throw "Idunn deployment request identity is absent or targets another daemon." -} -$requestId = $env:IDUNN_DEPLOYMENT_REQUEST_ID -if ($requestId -notmatch '^[A-Za-z0-9._:-]+$') { throw "Idunn deployment request identity contains unsafe characters." } -$remote = "sudo -n env IDUNN_ACTUATOR=1 IDUNN_COMMAND_AUTHORITY=idunn-daemon IDUNN_DEPLOYMENT_REQUEST_ID='$requestId' /usr/local/sbin/idunn-deploy-bifrost-persona-feedback-yggdrasil" -& ssh.exe $SshTarget $remote -if ($LASTEXITCODE -ne 0) { throw "Yggdrasil Bifrost Persona-feedback deployment failed with exit code $LASTEXITCODE." } diff --git a/scripts/linux/idunn-yggdrasil b/scripts/linux/idunn-yggdrasil index 0e2a4ef..09ae681 100644 --- a/scripts/linux/idunn-yggdrasil +++ b/scripts/linux/idunn-yggdrasil @@ -19,7 +19,7 @@ compose=/srv/compose/yggdrasil-apps.yaml require_release_lineage() { case "$target" in - epiphany) target_requires_bifrost_authority=true ;; + epiphany|bifrost-persona-feedback) target_requires_bifrost_authority=true ;; voidbot|heimdall|repixelizer|streampixels) target_requires_bifrost_authority=false ;; *) echo "deployment target has no release-authority policy: $target" >&2; exit 1 ;; esac @@ -88,7 +88,7 @@ case "$action:$target" in IDUNN_REQUIRES_BIFROST_AUTHORITY="$requires_bifrost_authority" \ exec "$manifest" "$action" ;; - deploy:heimdall|deploy:repixelizer|deploy:streampixels) + deploy:heimdall|deploy:repixelizer|deploy:streampixels|deploy:bifrost-persona-feedback) manifest="/srv/odin/deploy-manifests/$target" if [ ! -x "$manifest" ] || [ ! -O "$manifest" ]; then echo "root-owned executable deploy manifest is not installed: $manifest" >&2