chore(tfgrid3deployer): improve example and logging

This commit is contained in:
2025-01-15 18:52:48 +02:00
parent 5256ab6f23
commit 3812052ffa
3 changed files with 11 additions and 20 deletions

View File

@@ -24,11 +24,12 @@ fn main() {
nodes: [u32(167)]
)
deployment.add_machine(
name: 'my_vm2'
cpu: 1
memory: 2
planetary: false
mycelium: tfgrid3deployer.Mycelium{}
name: 'my_vm2'
cpu: 1
memory: 2
planetary: false
public_ip4: true
mycelium: tfgrid3deployer.Mycelium{}
// nodes: [u32(164)]
)
@@ -36,19 +37,10 @@ fn main() {
deployment.add_webname(name: 'mywebname2', backend: 'http://37.27.132.47:8000')
deployment.deploy()!
// deployment.add_machine(
// name: 'my_vm4'
// cpu: 2
// memory: 3
// planetary: false
// mycelium: tfgrid3deployer.Mycelium{}
// )
// deployment.deploy()!
// deployment.remove_machine('my_vm1')!
// deployment.remove_webname('mywebname2')!
// deployment.remove_zdb('my_zdb')!
// deployment.deploy()!
deployment.remove_machine('my_vm1')!
deployment.remove_webname('mywebname2')!
deployment.remove_zdb('my_zdb')!
deployment.deploy()!
tfgrid3deployer.delete_deployment(deployment_name)!
}

View File

@@ -235,7 +235,7 @@ pub fn (mut d Deployer) wait_deployment(node_id u32, mut dl models.Deployment, w
if (time.now() - start).minutes() > 5 {
return error('failed to deploy deployment: contractID: ${contract_id}, some workloads are not ready after wating 5 minutes')
} else {
d.logger.info('Waiting for deployment to become ready')
d.logger.info('Waiting for deployment with contract ${contract_id} to become ready')
time.sleep(500 * time.millisecond)
}
}

View File

@@ -163,7 +163,6 @@ pub fn to_map[T](t T) map[string]string {
encode_val(field.name, value, mut m)
}
}
println('encoded map: ${m}')
return m
}