Files
herolib/examples/threefold/tfgrid3deployer/open_webui_gw/open_webui_gw.vsh
mariobassem babbb610d9 feat(tfgrid3deployer): add openwebui deployment example
- Adds a new example demonstrating deployment of OpenWebUI on the ThreeFold Grid using the `tfgrid3deployer` module.
- Provides detailed instructions and a README file for easy setup and execution.

Co-authored-by: mahmmoud.hassanein <mahmmoud.hassanein@gmail.com>
2025-02-05 11:51:05 +02:00

42 lines
1.1 KiB
GLSL
Executable File

#!/usr/bin/env -S v -gc none -no-retry-compilation -d use_openssl -enable-globals -cg run
//#!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals -cg run
import freeflowuniverse.herolib.threefold.gridproxy
import freeflowuniverse.herolib.threefold.tfgrid3deployer
import freeflowuniverse.herolib.installers.threefold.griddriver
import os
import time
griddriver.install()!
v := tfgrid3deployer.get()!
println('cred: ${v}')
deployment_name := 'openwebui_example'
mut deployment := tfgrid3deployer.new_deployment(deployment_name)!
deployment.add_machine(
name: 'vm1'
cpu: 1
memory: 16
planetary: true
size: 100 // 10 gig
flist: 'https://hub.grid.tf/mariobassem1.3bot/docker.io-threefolddev-open_webui-latest.flist'
)
deployment.deploy()!
vm1 := deployment.vm_get('vm1')!
println('vm1 info: ${vm1}')
deployment.add_webname(
name: 'openwebui'
backend: 'http://${vm1.wireguard_ip}:8080'
use_wireguard_network: true
)
deployment.deploy()!
gw1 := deployment.webname_get('openwebui')!
println('gw info: ${gw1}')
// tfgrid3deployer.delete_deployment(deployment_name)!