...
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S v -n -w -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run
|
||||
#!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run
|
||||
|
||||
import freeflowuniverse.herolib.clients.vastai
|
||||
import json
|
||||
@@ -24,19 +24,19 @@ create_instance_res := va.create_instance(
|
||||
println('create instance res: ${create_instance_res}')
|
||||
|
||||
attach_sshkey_to_instance_res := va.attach_sshkey_to_instance(
|
||||
id: 1
|
||||
ssh_key: "ssh-rsa AAAA..."
|
||||
id: 1
|
||||
ssh_key: 'ssh-rsa AAAA...'
|
||||
)!
|
||||
println('attach sshkey to instance res: ${attach_sshkey_to_instance_res}')
|
||||
|
||||
stop_instance_res := va.stop_instance(
|
||||
id: 1
|
||||
state: "stopped"
|
||||
id: 1
|
||||
state: 'stopped'
|
||||
)!
|
||||
println('stop instance res: ${stop_instance_res}')
|
||||
|
||||
destroy_instance_res := va.destroy_instance(
|
||||
id: 1
|
||||
id: 1
|
||||
)!
|
||||
println('destroy instance res: ${destroy_instance_res}')
|
||||
|
||||
@@ -44,23 +44,23 @@ println('destroy instance res: ${destroy_instance_res}')
|
||||
// (request failed with code 500: {"error":"server_error","msg":"Something went wrong on the server"})
|
||||
launch_instance_res := va.launch_instance(
|
||||
// Required
|
||||
num_gpus: 1,
|
||||
gpu_name: "RTX_3090",
|
||||
image: 'vastai/tensorflow',
|
||||
disk: 10,
|
||||
region: "us-west",
|
||||
num_gpus: 1
|
||||
gpu_name: 'RTX_3090'
|
||||
image: 'vastai/tensorflow'
|
||||
disk: 10
|
||||
region: 'us-west'
|
||||
|
||||
// Optional
|
||||
env: "user=7amada, home=/home/7amada",
|
||||
env: 'user=7amada, home=/home/7amada'
|
||||
)!
|
||||
println('destroy instance res: ${launch_instance_res}')
|
||||
|
||||
start_instances_res := va.start_instances(
|
||||
ids: [1, 2, 3]
|
||||
ids: [1, 2, 3]
|
||||
)!
|
||||
println('start instances res: ${start_instances_res}')
|
||||
|
||||
start_instance_res := va.start_instance(
|
||||
id: 1
|
||||
id: 1
|
||||
)!
|
||||
println('start instance res: ${start_instance_res}')
|
||||
|
||||
Reference in New Issue
Block a user