From bcfc525bee3b488f6aee2ec52c3b9654651d872a Mon Sep 17 00:00:00 2001 From: despiegk Date: Mon, 13 Oct 2025 10:43:37 +0400 Subject: [PATCH] ... --- lib/clients/livekit/.heroscript | 2 +- .../templates/objname_actions.vtemplate | 2 +- lib/installers/db/cometbft/cometbft_actions.v | 2 +- .../meilisearch_installer_actions.v | 13 ++++----- .../qdrant_installer_actions.v | 29 ++++++++++--------- lib/installers/web/lighttpd/installer.v | 2 +- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/lib/clients/livekit/.heroscript b/lib/clients/livekit/.heroscript index 8fb1278c..f32c3dfd 100644 --- a/lib/clients/livekit/.heroscript +++ b/lib/clients/livekit/.heroscript @@ -4,4 +4,4 @@ classname:'LivekitClient' singleton:0 default:1 - reset:0 \ No newline at end of file + active:0 \ No newline at end of file diff --git a/lib/core/generator/generic/templates/objname_actions.vtemplate b/lib/core/generator/generic/templates/objname_actions.vtemplate index 200f6755..8af55f06 100644 --- a/lib/core/generator/generic/templates/objname_actions.vtemplate +++ b/lib/core/generator/generic/templates/objname_actions.vtemplate @@ -147,7 +147,7 @@ fn build() ! { //url := 'https://github.com/threefoldtech/${args.name}' // make sure we install base on the node - // if osal.platform() != .ubuntu { + // if core.platform() != .ubuntu { // return error('only support ubuntu for now') // } // golang.install()! diff --git a/lib/installers/db/cometbft/cometbft_actions.v b/lib/installers/db/cometbft/cometbft_actions.v index 6b4eeb1e..87094697 100644 --- a/lib/installers/db/cometbft/cometbft_actions.v +++ b/lib/installers/db/cometbft/cometbft_actions.v @@ -126,7 +126,7 @@ fn build() ! { // url := 'https://github.com/threefoldtech/cometbft' // make sure we install base on the node - // if osal.platform() != .ubuntu { + // if core.platform() != .ubuntu { // return error('only support ubuntu for now') // } // golang.install()! diff --git a/lib/installers/db/meilisearch_installer/meilisearch_installer_actions.v b/lib/installers/db/meilisearch_installer/meilisearch_installer_actions.v index 9186f624..6371d105 100644 --- a/lib/installers/db/meilisearch_installer/meilisearch_installer_actions.v +++ b/lib/installers/db/meilisearch_installer/meilisearch_installer_actions.v @@ -6,6 +6,7 @@ import incubaid.herolib.osal.startupmanager import incubaid.herolib.installers.ulist import incubaid.herolib.core.httpconnection import incubaid.herolib.core.texttools +import incubaid.herolib.clients.zinit import os import rand import json @@ -164,14 +165,10 @@ fn destroy() ! { osal.execute_silent('sudo rm -rf /usr/local/bin/meilisearch')! } - mut zinit_factory := zinit.new()! - if zinit_factory.exists('meilisearch') { - zinit_factory.stop('meilisearch') or { - return error('Could not stop meilisearch service due to: ${err}') - } - zinit_factory.delete('meilisearch') or { - return error('Could not delete meilisearch service due to: ${err}') - } + mut zinit_factory := zinit.ZinitRPC{} + if zinit_factory.service_list()!.keys().contains('meilisearch') { + zinit_factory.service_stop('meilisearch')! + zinit_factory.service_delete('meilisearch')! } console.print_header('meilisearch is destroyed') diff --git a/lib/installers/db/qdrant_installer/qdrant_installer_actions.v b/lib/installers/db/qdrant_installer/qdrant_installer_actions.v index b5fbfa42..7eca81a6 100644 --- a/lib/installers/db/qdrant_installer/qdrant_installer_actions.v +++ b/lib/installers/db/qdrant_installer/qdrant_installer_actions.v @@ -2,7 +2,10 @@ module qdrant_installer import incubaid.herolib.ui.console import incubaid.herolib.osal.startupmanager +import incubaid.herolib.core import incubaid.herolib.installers.ulist +import incubaid.herolib.core.texttools +import incubaid.herolib.clients.zinit import os fn startupcmd() ![]startupmanager.ZProcessNewArgs { @@ -78,13 +81,17 @@ fn upload() ! { fn install() ! { console.print_header('install qdrant') mut url := '' - if core.is_linux_arm()! { + + if (core.platform() == core.PlatformType.ubuntu || core.platform() == core.PlatformType.arch) + && core.cputype() == core.CPUType.arm { url = 'https://github.com/qdrant/qdrant/releases/download/v${version}/qdrant-aarch64-unknown-linux-musl.tar.gz' - } else if core.is_linux_intel()! { + } else if + (core.platform() == core.PlatformType.ubuntu || core.platform() == core.PlatformType.arch) + && core.cputype() == core.CPUType.intel { url = 'https://github.com/qdrant/qdrant/releases/download/v${version}/qdrant-x86_64-unknown-linux-musl.tar.gz' - } else if core.is_osx_arm()! { + } else if core.platform() == core.PlatformType.osx && core.cputype() == core.CPUType.arm { url = 'https://github.com/qdrant/qdrant/releases/download/v${version}/qdrant-aarch64-apple-darwin.tar.gz' - } else if core.is_osx_intel()! { + } else if core.platform() == core.PlatformType.osx && core.cputype() == core.CPUType.intel { url = 'https://github.com/qdrant/qdrant/releases/download/v${version}/qdrant-x86_64-apple-darwin.tar.gz' } else { return error('unsported platform') @@ -93,7 +100,7 @@ fn install() ! { url: url minsize_kb: 18000 expand_dir: '/tmp/qdrant' - )! + ) mut binpath := dest.file_get('qdrant')! osal.cmd_add( @@ -110,14 +117,10 @@ fn destroy() ! { osal.rm('${os.home_dir()}/hero/bin/qdrant')! osal.rm('/usr/local/bin/qdrant')! - mut zinit_factory := zinit.new()! - if zinit_factory.exists('qdrant') { - zinit_factory.stop('qdrant') or { - return error('Could not stop qdrant service due to: ${err}') - } - zinit_factory.delete('qdrant') or { - return error('Could not delete qdrant service due to: ${err}') - } + mut zinit_factory := zinit.ZinitRPC{} + if zinit_factory.service_list()!.keys().contains('qdrant') { + zinit_factory.service_stop('qdrant')! + zinit_factory.service_delete('qdrant')! } console.print_header('qdrant removed') } diff --git a/lib/installers/web/lighttpd/installer.v b/lib/installers/web/lighttpd/installer.v index 231223f1..e02f1a4f 100644 --- a/lib/installers/web/lighttpd/installer.v +++ b/lib/installers/web/lighttpd/installer.v @@ -4,7 +4,7 @@ import incubaid.herolib.installers.base import incubaid.herolib.osal.core as osal import incubaid.herolib.core.pathlib import incubaid.herolib.core.texttools -import incubaid.herolib.installers.infra.zinit +import incubaid.herolib.clients.zinit import incubaid.herolib.osal.startupmanager as zinitmgmt import incubaid.herolib.ui.console import incubaid.herolib.osal.screen