add delete script for vm_caddy && fixes
This commit is contained in:
@@ -1,17 +1,3 @@
|
|||||||
:80 { # Set this path to your site's directory.
|
:80 {
|
||||||
root \* /usr/share/caddy
|
respond "Hello, World!"
|
||||||
|
|
||||||
# Enable the static file server.
|
|
||||||
file_server
|
|
||||||
|
|
||||||
# Another common task is to set up a reverse proxy:
|
|
||||||
# reverse_proxy localhost:8080
|
|
||||||
|
|
||||||
# Or serve a PHP site through php-fpm:
|
|
||||||
# php_fastcgi localhost:9000
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Refer to the Caddy docs for more information:
|
|
||||||
|
|
||||||
# https://caddyserver.com/docs/caddyfile
|
|
||||||
|
|||||||
25
examples/threefold/tfgrid3deployer/vm_gw_caddy/delete.vsh
Executable file
25
examples/threefold/tfgrid3deployer/vm_gw_caddy/delete.vsh
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/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
|
||||||
|
|
||||||
|
mut installer := griddriver.get()!
|
||||||
|
installer.install()!
|
||||||
|
|
||||||
|
v := tfgrid3deployer.get()!
|
||||||
|
println('cred: ${v}')
|
||||||
|
|
||||||
|
deployment_name := 'vm_caddy1'
|
||||||
|
mut deployment := tfgrid3deployer.get_deployment(deployment_name)!
|
||||||
|
deployment.remove_machine('vm_caddy1')!
|
||||||
|
deployment.deploy()!
|
||||||
|
os.rm('${os.home_dir()}/hero/db/0/session_deployer/${deployment_name}')!
|
||||||
|
|
||||||
|
deployment_name2 := 'vm_caddy_gw'
|
||||||
|
mut deployment2 := tfgrid3deployer.get_deployment(deployment_name2)!
|
||||||
|
deployment2.remove_webname('mywebname')!
|
||||||
|
deployment2.deploy()!
|
||||||
|
os.rm('${os.home_dir()}/hero/db/0/session_deployer/${deployment_name2}')!
|
||||||
@@ -34,6 +34,9 @@ mut deployment2 := tfgrid3deployer.new_deployment(deployment_name2)!
|
|||||||
deployment2.add_webname(name: 'mywebname', backend: 'http://${vm1_public_ip4}:80')
|
deployment2.add_webname(name: 'mywebname', backend: 'http://${vm1_public_ip4}:80')
|
||||||
deployment2.deploy()!
|
deployment2.deploy()!
|
||||||
|
|
||||||
|
gw1 := deployment2.webname_get('mywebname')!
|
||||||
|
println('gw info: ${gw1}')
|
||||||
|
|
||||||
// Retry logic to wait for the SSH server to be up
|
// Retry logic to wait for the SSH server to be up
|
||||||
max_retries := 10
|
max_retries := 10
|
||||||
mut retries := 0
|
mut retries := 0
|
||||||
|
|||||||
@@ -96,7 +96,6 @@ pub fn (mut h HTTPConnection) send(req_ Request) !Result {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
println(new_req)
|
|
||||||
if req.debug {
|
if req.debug {
|
||||||
console.print_debug('http request:\n${new_req.str()}')
|
console.print_debug('http request:\n${new_req.str()}')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ pub mut:
|
|||||||
// restart bool = true
|
// restart bool = true
|
||||||
// }
|
// }
|
||||||
// ```
|
// ```
|
||||||
pub fn install(args_ RedisInstallArgs) ! {
|
pub fn redis_install(args_ RedisInstallArgs) ! {
|
||||||
mut args := args_
|
mut args := args_
|
||||||
|
|
||||||
if !args.reset {
|
if !args.reset {
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ fn (mut self DeploymentSetup) match_versions(old_dls map[u32]grid_models.Deploym
|
|||||||
fn (mut st DeploymentSetup) setup_network_workloads(vms []VMachine, old_deployments map[u32]grid_models.Deployment) ! {
|
fn (mut st DeploymentSetup) setup_network_workloads(vms []VMachine, old_deployments map[u32]grid_models.Deployment) ! {
|
||||||
st.network_handler.load_network_state(old_deployments)!
|
st.network_handler.load_network_state(old_deployments)!
|
||||||
st.network_handler.create_network(vms)!
|
st.network_handler.create_network(vms)!
|
||||||
println('Network handler: ${st.network_handler}')
|
|
||||||
data := st.network_handler.generate_workloads()!
|
data := st.network_handler.generate_workloads()!
|
||||||
|
|
||||||
for node_id, workload in data {
|
for node_id, workload in data {
|
||||||
|
|||||||
Reference in New Issue
Block a user