rename some installers, fix installer service startup w/ zinit

This commit is contained in:
Timur Gordon
2025-11-19 11:42:55 +01:00
parent 28313ad22f
commit fcb178156b
13 changed files with 49 additions and 27 deletions

View File

@@ -2,7 +2,7 @@
// This file demonstrates how to configure all Horus components using heroscript // This file demonstrates how to configure all Horus components using heroscript
// Configure Coordinator // Configure Coordinator
!!herocoordinator.configure !!coordinator.configure
name:'default' name:'default'
binary_path:'/hero/var/bin/coordinator' binary_path:'/hero/var/bin/coordinator'
redis_addr:'127.0.0.1:6379' redis_addr:'127.0.0.1:6379'

View File

@@ -13,6 +13,11 @@ import incubaid.herolib.osal.tmux
import incubaid.herolib.installers.base import incubaid.herolib.installers.base
import incubaid.herolib.installers.lang.vlang import incubaid.herolib.installers.lang.vlang
import incubaid.herolib.installers.lang.herolib import incubaid.herolib.installers.lang.herolib
import incubaid.herolib.installers.horus.coordinator
import incubaid.herolib.installers.horus.supervisor
import incubaid.herolib.installers.horus.herorunner
import incubaid.herolib.installers.horus.osirisrunner
import incubaid.herolib.installers.horus.salrunner
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// run entry point for all HeroScript playcommands // run entry point for all HeroScript playcommands
@@ -69,6 +74,13 @@ pub fn run(args_ PlayArgs) ! {
giteaclient.play(mut plbook)! giteaclient.play(mut plbook)!
// Horus
coordinator.play(mut plbook)!
supervisor.play(mut plbook)!
herorunner.play(mut plbook)!
osirisrunner.play(mut plbook)!
salrunner.play(mut plbook)!
if args.emptycheck { if args.emptycheck {
// Ensure we did not leave any actions unprocessed // Ensure we did not leave any actions unprocessed
plbook.empty_check()! plbook.empty_check()!

View File

@@ -21,6 +21,11 @@ import incubaid.herolib.clients.zerodb_client
import incubaid.herolib.clients.zinit import incubaid.herolib.clients.zinit
import incubaid.herolib.develop.heroprompt import incubaid.herolib.develop.heroprompt
import incubaid.herolib.installers.db.meilisearch_installer import incubaid.herolib.installers.db.meilisearch_installer
import incubaid.herolib.installers.horus.coordinator
import incubaid.herolib.installers.horus.supervisor
import incubaid.herolib.installers.horus.herorunner
import incubaid.herolib.installers.horus.osirisrunner
import incubaid.herolib.installers.horus.salrunner
import incubaid.herolib.installers.infra.coredns import incubaid.herolib.installers.infra.coredns
import incubaid.herolib.installers.infra.gitea import incubaid.herolib.installers.infra.gitea
import incubaid.herolib.installers.infra.livekit import incubaid.herolib.installers.infra.livekit
@@ -38,7 +43,6 @@ import incubaid.herolib.installers.sysadmintools.garage_s3
import incubaid.herolib.installers.threefold.griddriver import incubaid.herolib.installers.threefold.griddriver
import incubaid.herolib.installers.virt.cloudhypervisor import incubaid.herolib.installers.virt.cloudhypervisor
import incubaid.herolib.installers.virt.docker import incubaid.herolib.installers.virt.docker
import incubaid.herolib.installers.virt.herorunner
import incubaid.herolib.installers.virt.kubernetes_installer import incubaid.herolib.installers.virt.kubernetes_installer
import incubaid.herolib.installers.virt.lima import incubaid.herolib.installers.virt.lima
import incubaid.herolib.installers.virt.pacman import incubaid.herolib.installers.virt.pacman
@@ -109,4 +113,9 @@ pub fn run_all(args_ PlayArgs) ! {
zola.play(mut plbook)! zola.play(mut plbook)!
hetznermanager.play(mut plbook)! hetznermanager.play(mut plbook)!
kubernetes.play(mut plbook)! kubernetes.play(mut plbook)!
coordinator.play(mut plbook)!
supervisor.play(mut plbook)!
herorunner.play(mut plbook)!
osirisrunner.play(mut plbook)!
salrunner.play(mut plbook)!
} }

View File

@@ -1,7 +1,7 @@
!!hero_code.generate_installer !!hero_code.generate_installer
name:'' name:''
classname:'CoordinatorServer' classname:'Coordinator'
singleton:0 singleton:0
templates:1 templates:1
default:1 default:1

View File

@@ -1,7 +1,7 @@
!!hero_code.generate_installer !!hero_code.generate_installer
name:'' name:''
classname:'HerorunnerServer' classname:'Herorunner'
singleton:0 singleton:0
templates:1 templates:1
default:1 default:1

View File

@@ -12,7 +12,7 @@ const default = true
// THIS THE THE SOURCE OF THE INFORMATION OF THIS FILE, HERE WE HAVE THE CONFIG OBJECT CONFIGURED AND MODELLED // THIS THE THE SOURCE OF THE INFORMATION OF THIS FILE, HERE WE HAVE THE CONFIG OBJECT CONFIGURED AND MODELLED
@[heap] @[heap]
pub struct HerorunnerServer { pub struct Herorunner {
pub mut: pub mut:
name string = 'default' name string = 'default'
binary_path string = os.join_path(os.home_dir(), 'hero/bin/herorunner') binary_path string = os.join_path(os.home_dir(), 'hero/bin/herorunner')
@@ -21,7 +21,7 @@ pub mut:
} }
// your checking & initialization code if needed // your checking & initialization code if needed
fn obj_init(mycfg_ HerorunnerServer) !HerorunnerServer { fn obj_init(mycfg_ Herorunner) !Herorunner {
mut mycfg := mycfg_ mut mycfg := mycfg_
if mycfg.name == '' { if mycfg.name == '' {
mycfg.name = 'default' mycfg.name = 'default'
@@ -48,11 +48,11 @@ fn configure() ! {
/////////////NORMALLY NO NEED TO TOUCH /////////////NORMALLY NO NEED TO TOUCH
pub fn heroscript_dumps(obj HerorunnerServer) !string { pub fn heroscript_dumps(obj Herorunner) !string {
return encoderhero.encode[HerorunnerServer](obj)! return encoderhero.encode[Herorunner](obj)!
} }
pub fn heroscript_loads(heroscript string) !HerorunnerServer { pub fn heroscript_loads(heroscript string) !Herorunner {
mut obj := encoderhero.decode[HerorunnerServer](heroscript)! mut obj := encoderhero.decode[Herorunner](heroscript)!
return obj return obj
} }

View File

@@ -1,7 +1,7 @@
!!hero_code.generate_installer !!hero_code.generate_installer
name:'' name:''
classname:'OsirisrunnerServer' classname:'Osirisrunner'
singleton:0 singleton:0
templates:1 templates:1
default:1 default:1

View File

@@ -12,7 +12,7 @@ const default = true
// THIS THE THE SOURCE OF THE INFORMATION OF THIS FILE, HERE WE HAVE THE CONFIG OBJECT CONFIGURED AND MODELLED // THIS THE THE SOURCE OF THE INFORMATION OF THIS FILE, HERE WE HAVE THE CONFIG OBJECT CONFIGURED AND MODELLED
@[heap] @[heap]
pub struct OsirisrunnerServer { pub struct Osirisrunner {
pub mut: pub mut:
name string = 'default' name string = 'default'
binary_path string = os.join_path(os.home_dir(), 'hero/bin/runner_osiris') binary_path string = os.join_path(os.home_dir(), 'hero/bin/runner_osiris')
@@ -22,7 +22,7 @@ pub mut:
} }
// your checking & initialization code if needed // your checking & initialization code if needed
fn obj_init(mycfg_ OsirisrunnerServer) !OsirisrunnerServer { fn obj_init(mycfg_ Osirisrunner) !Osirisrunner {
mut mycfg := mycfg_ mut mycfg := mycfg_
if mycfg.name == '' { if mycfg.name == '' {
mycfg.name = 'default' mycfg.name = 'default'
@@ -52,11 +52,11 @@ fn configure() ! {
/////////////NORMALLY NO NEED TO TOUCH /////////////NORMALLY NO NEED TO TOUCH
pub fn heroscript_dumps(obj OsirisrunnerServer) !string { pub fn heroscript_dumps(obj Osirisrunner) !string {
return encoderhero.encode[OsirisrunnerServer](obj)! return encoderhero.encode[Osirisrunner](obj)!
} }
pub fn heroscript_loads(heroscript string) !OsirisrunnerServer { pub fn heroscript_loads(heroscript string) !Osirisrunner {
mut obj := encoderhero.decode[OsirisrunnerServer](heroscript)! mut obj := encoderhero.decode[Osirisrunner](heroscript)!
return obj return obj
} }

View File

@@ -1,7 +1,7 @@
!!hero_code.generate_installer !!hero_code.generate_installer
name:'' name:''
classname:'SalrunnerServer' classname:'Salrunner'
singleton:0 singleton:0
templates:1 templates:1
default:1 default:1

View File

@@ -12,7 +12,7 @@ const default = true
// THIS THE THE SOURCE OF THE INFORMATION OF THIS FILE, HERE WE HAVE THE CONFIG OBJECT CONFIGURED AND MODELLED // THIS THE THE SOURCE OF THE INFORMATION OF THIS FILE, HERE WE HAVE THE CONFIG OBJECT CONFIGURED AND MODELLED
@[heap] @[heap]
pub struct SalrunnerServer { pub struct Salrunner {
pub mut: pub mut:
name string = 'default' name string = 'default'
binary_path string = os.join_path(os.home_dir(), 'hero/bin/runner_sal') binary_path string = os.join_path(os.home_dir(), 'hero/bin/runner_sal')
@@ -22,7 +22,7 @@ pub mut:
} }
// your checking & initialization code if needed // your checking & initialization code if needed
fn obj_init(mycfg_ SalrunnerServer) !SalrunnerServer { fn obj_init(mycfg_ Salrunner) !Salrunner {
mut mycfg := mycfg_ mut mycfg := mycfg_
if mycfg.name == '' { if mycfg.name == '' {
mycfg.name = 'default' mycfg.name = 'default'
@@ -52,11 +52,11 @@ fn configure() ! {
/////////////NORMALLY NO NEED TO TOUCH /////////////NORMALLY NO NEED TO TOUCH
pub fn heroscript_dumps(obj SalrunnerServer) !string { pub fn heroscript_dumps(obj Salrunner) !string {
return encoderhero.encode[SalrunnerServer](obj)! return encoderhero.encode[Salrunner](obj)!
} }
pub fn heroscript_loads(heroscript string) !SalrunnerServer { pub fn heroscript_loads(heroscript string) !Salrunner {
mut obj := encoderhero.decode[SalrunnerServer](heroscript)! mut obj := encoderhero.decode[Salrunner](heroscript)!
return obj return obj
} }

View File

@@ -1,7 +1,7 @@
!!hero_code.generate_installer !!hero_code.generate_installer
name:'' name:''
classname:'SupervisorServer' classname:'Supervisor'
singleton:0 singleton:0
templates:1 templates:1
default:1 default:1

View File

@@ -18,7 +18,8 @@ pub fn get(cat StartupManagerType) !StartupManager {
} }
match sm.cat { match sm.cat {
.zinit { .zinit {
mut zinit_client_test := zinit.get()! // 'create:true' ensures a client object is initiated even if the socket isn't active. mut zinit_client_test := zinit.get(create: true)! // 'create:true' ensures a client object is initiated even if the socket isn't active.
if _ := zinit_client_test.rpc_discover() { if _ := zinit_client_test.rpc_discover() {
sm.cat = .zinit sm.cat = .zinit
} else { } else {

View File

@@ -33,7 +33,7 @@ pub fn (mut t UnixSocketTransport) send(request string, params SendParams) !stri
// Close the socket explicitly // Close the socket explicitly
unix.shutdown(socket.sock.handle) unix.shutdown(socket.sock.handle)
socket.close() or {} socket.close() or {}
print_backtrace() // print_backtrace()
console.print_debug('The server did not close the socket, we did timeout or there was other error.') console.print_debug('The server did not close the socket, we did timeout or there was other error.')
} }