shadeform
Dagger module to manage the lifecycle of a Shadeform VM. Handy for integration in data-science pipelines or in any DAG graph when one or more tasks can benefit from the execution on a GPU machine. See examples for a demonstration on how to use it
Installation
dagger install github.com/dciangot/daggerverse/shadeform@77a10bd443114753ae582ee99e6c583043ccad36
Entrypoint
Return Type
Shadeform !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
name | String ! | - | No description provided |
shadeToken | Secret ! | - | A reference to a secret value, which can be handled more safely than the value itself. |
vmId | String | - | No description provided |
sshKey | File | - | No description provided |
cache | CacheVolume | - | No description provided |
templateFile | File | - | No description provided |
Example
dagger -m github.com/dciangot/daggerverse/shadeform@77a10bd443114753ae582ee99e6c583043ccad36 call \
--name string --shade-token env:MYSECRET
func (m *myModule) example(name string, shadeToken *Secret) *Shadeform {
return dag.
Shadeform(name, shadeToken)
}
@function
def example(name: str, shade_token: dagger.Secret, ) -> dag.Shadeform:
return (
dag.shadeform(name, shade_token)
)
@func()
example(name: string, shadeToken: Secret, ): Shadeform {
return dag
.shadeform(name, shadeToken)
}
Types
Shadeform 🔗
client() 🔗
Return a CURL debug client with cache (vm information) mounted.
Return Type
Container !
Example
dagger -m github.com/dciangot/daggerverse/shadeform@77a10bd443114753ae582ee99e6c583043ccad36 call \
--name string --shade-token env:MYSECRET client
func (m *myModule) example(name string, shadeToken *Secret) *Container {
return dag.
Shadeform(name, shadeToken).
Client()
}
@function
def example(name: str, shade_token: dagger.Secret, ) -> dagger.Container:
return (
dag.shadeform(name, shade_token)
.client()
)
@func()
example(name: string, shadeToken: Secret, ): Container {
return dag
.shadeform(name, shadeToken)
.client()
}
createVm() 🔗
Returns a container executing all the needed steps for creating a machine starting from passed parameters
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
cloud | String ! | - | No description provided |
region | String ! | - | No description provided |
shadeInstanceType | String ! | - | No description provided |
shadeCloud | String ! | - | No description provided |
Example
dagger -m github.com/dciangot/daggerverse/shadeform@77a10bd443114753ae582ee99e6c583043ccad36 call \
--name string --shade-token env:MYSECRET create-vm --cloud string --region string --shade-instance-type string --shade-cloud string
func (m *myModule) example(name string, shadeToken *Secret, cloud string, region string, shadeInstanceType string, shadeCloud string) *Container {
return dag.
Shadeform(name, shadeToken).
CreateVm(cloud, region, shadeInstanceType, shadeCloud)
}
@function
def example(name: str, shade_token: dagger.Secret, cloud: str, region: str, shade_instance_type: str, shade_cloud: str) -> dagger.Container:
return (
dag.shadeform(name, shade_token)
.create_vm(cloud, region, shade_instance_type, shade_cloud)
)
@func()
example(name: string, shadeToken: Secret, cloud: string, region: string, shadeInstanceType: string, shadeCloud: string): Container {
return dag
.shadeform(name, shadeToken)
.createVm(cloud, region, shadeInstanceType, shadeCloud)
}
getVmId() 🔗
Return the VM ID
Return Type
String !
Example
dagger -m github.com/dciangot/daggerverse/shadeform@77a10bd443114753ae582ee99e6c583043ccad36 call \
--name string --shade-token env:MYSECRET get-vm-id
func (m *myModule) example(ctx context.Context, name string, shadeToken *Secret) string {
return dag.
Shadeform(name, shadeToken).
GetVmId(ctx)
}
@function
async def example(name: str, shade_token: dagger.Secret, ) -> str:
return await (
dag.shadeform(name, shade_token)
.get_vm_id()
)
@func()
async example(name: string, shadeToken: Secret, ): Promise<string> {
return dag
.shadeform(name, shadeToken)
.getVmId()
}
getVmInfo() 🔗
Return the VM info JSON
Return Type
String !
Example
dagger -m github.com/dciangot/daggerverse/shadeform@77a10bd443114753ae582ee99e6c583043ccad36 call \
--name string --shade-token env:MYSECRET get-vm-info
func (m *myModule) example(ctx context.Context, name string, shadeToken *Secret) string {
return dag.
Shadeform(name, shadeToken).
GetVmInfo(ctx)
}
@function
async def example(name: str, shade_token: dagger.Secret, ) -> str:
return await (
dag.shadeform(name, shade_token)
.get_vm_info()
)
@func()
async example(name: string, shadeToken: Secret, ): Promise<string> {
return dag
.shadeform(name, shadeToken)
.getVmInfo()
}
getAvailableList() 🔗
Return a list of available instances with the indicated boards sorted by price
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
gpuType | String ! | - | No description provided |
nGpus | Integer ! | - | No description provided |
Example
dagger -m github.com/dciangot/daggerverse/shadeform@77a10bd443114753ae582ee99e6c583043ccad36 call \
--name string --shade-token env:MYSECRET get-available-list --gpu-type string --n-gpus integer
func (m *myModule) example(ctx context.Context, name string, shadeToken *Secret, gpuType string, nGpus int) string {
return dag.
Shadeform(name, shadeToken).
GetAvailableList(ctx, gpuType, nGpus)
}
@function
async def example(name: str, shade_token: dagger.Secret, gpu_type: str, n_gpus: int) -> str:
return await (
dag.shadeform(name, shade_token)
.get_available_list(gpu_type, n_gpus)
)
@func()
async example(name: string, shadeToken: Secret, gpuType: string, nGpus: number): Promise<string> {
return dag
.shadeform(name, shadeToken)
.getAvailableList(gpuType, nGpus)
}
getVmStatus() 🔗
Print the VM status
Return Type
String !
Example
dagger -m github.com/dciangot/daggerverse/shadeform@77a10bd443114753ae582ee99e6c583043ccad36 call \
--name string --shade-token env:MYSECRET get-vm-status
func (m *myModule) example(ctx context.Context, name string, shadeToken *Secret) string {
return dag.
Shadeform(name, shadeToken).
GetVmStatus(ctx)
}
@function
async def example(name: str, shade_token: dagger.Secret, ) -> str:
return await (
dag.shadeform(name, shade_token)
.get_vm_status()
)
@func()
async example(name: string, shadeToken: Secret, ): Promise<string> {
return dag
.shadeform(name, shadeToken)
.getVmStatus()
}
getVmIp() 🔗
Print the VM IP
Return Type
String !
Example
dagger -m github.com/dciangot/daggerverse/shadeform@77a10bd443114753ae582ee99e6c583043ccad36 call \
--name string --shade-token env:MYSECRET get-vm-ip
func (m *myModule) example(ctx context.Context, name string, shadeToken *Secret) string {
return dag.
Shadeform(name, shadeToken).
GetVmIp(ctx)
}
@function
async def example(name: str, shade_token: dagger.Secret, ) -> str:
return await (
dag.shadeform(name, shade_token)
.get_vm_ip()
)
@func()
async example(name: string, shadeToken: Secret, ): Promise<string> {
return dag
.shadeform(name, shadeToken)
.getVmIp()
}
getVmUser() 🔗
Print the VM user to use for SSH connection
Return Type
String !
Example
dagger -m github.com/dciangot/daggerverse/shadeform@77a10bd443114753ae582ee99e6c583043ccad36 call \
--name string --shade-token env:MYSECRET get-vm-user
func (m *myModule) example(ctx context.Context, name string, shadeToken *Secret) string {
return dag.
Shadeform(name, shadeToken).
GetVmUser(ctx)
}
@function
async def example(name: str, shade_token: dagger.Secret, ) -> str:
return await (
dag.shadeform(name, shade_token)
.get_vm_user()
)
@func()
async example(name: string, shadeToken: Secret, ): Promise<string> {
return dag
.shadeform(name, shadeToken)
.getVmUser()
}
vmReady() 🔗
Wait for VM to be ready and return its ID
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
maxRetries | Integer ! | 10 | No description provided |
Example
dagger -m github.com/dciangot/daggerverse/shadeform@77a10bd443114753ae582ee99e6c583043ccad36 call \
--name string --shade-token env:MYSECRET vm-ready --max-retries integer
func (m *myModule) example(ctx context.Context, name string, shadeToken *Secret, maxRetries int) string {
return dag.
Shadeform(name, shadeToken).
VmReady(ctx, maxRetries)
}
@function
async def example(name: str, shade_token: dagger.Secret, max_retries: int) -> str:
return await (
dag.shadeform(name, shade_token)
.vm_ready(max_retries)
)
@func()
async example(name: string, shadeToken: Secret, maxRetries: number): Promise<string> {
return dag
.shadeform(name, shadeToken)
.vmReady(maxRetries)
}
createNcheck() 🔗
Create a VM and wait for its creation to succeed
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
cloud | String ! | "hyperstack" | No description provided |
region | String ! | "canada-1" | No description provided |
shadeInstanceType | String ! | "A6000" | No description provided |
shadeCloud | String ! | "true" | No description provided |
Example
no available example in current language
no available example in current language
async def shadeform_create_n_check(
self,
name: str,
shade_token: dagger.Secret,
cloud: str,
region: str,
shade_instance_type: str,
shade_cloud: str,
# interlink_key: File,
# interlink_endpoint: str,
# interlink_port: int
) -> str:
return await (
dag.shadeform(name, shade_token)
.create_n_check(
cloud=cloud,
region=region,
shade_instance_type=shade_instance_type,
shade_cloud=shade_cloud)
)
no available example in current language
deleteVm() 🔗
Delete VM
Return Type
String !
Example
dagger -m github.com/dciangot/daggerverse/shadeform@77a10bd443114753ae582ee99e6c583043ccad36 call \
--name string --shade-token env:MYSECRET delete-vm
func (m *myModule) example(ctx context.Context, name string, shadeToken *Secret) string {
return dag.
Shadeform(name, shadeToken).
DeleteVm(ctx)
}
@function
async def example(name: str, shade_token: dagger.Secret, ) -> str:
return await (
dag.shadeform(name, shade_token)
.delete_vm()
)
@func()
async example(name: string, shadeToken: Secret, ): Promise<string> {
return dag
.shadeform(name, shadeToken)
.deleteVm()
}
execSshCommand() 🔗
execute the provided through automatic ssh command
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
command | String ! | - | No description provided |
sshKey | File ! | - | A file. |
Example
dagger -m github.com/dciangot/daggerverse/shadeform@77a10bd443114753ae582ee99e6c583043ccad36 call \
--name string --shade-token env:MYSECRET exec-ssh-command --command string --ssh-key file:path
func (m *myModule) example(ctx context.Context, name string, shadeToken *Secret, command string, sshKey *File) string {
return dag.
Shadeform(name, shadeToken).
ExecSshCommand(ctx, command, sshKey)
}
@function
async def example(name: str, shade_token: dagger.Secret, command: str, ssh_key: dagger.File) -> str:
return await (
dag.shadeform(name, shade_token)
.exec_ssh_command(command, ssh_key)
)
@func()
async example(name: string, shadeToken: Secret, command: string, sshKey: File): Promise<string> {
return dag
.shadeform(name, shadeToken)
.execSshCommand(command, sshKey)
}
copyFile() 🔗
Copy a local file to the remote VM
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
sshKey | File ! | - | A file. |
file | File ! | - | A file. |
destination | String ! | - | No description provided |
Example
dagger -m github.com/dciangot/daggerverse/shadeform@77a10bd443114753ae582ee99e6c583043ccad36 call \
--name string --shade-token env:MYSECRET copy-file --ssh-key file:path --file file:path --destination string
func (m *myModule) example(ctx context.Context, name string, shadeToken *Secret, sshKey *File, file *File, destination string) string {
return dag.
Shadeform(name, shadeToken).
CopyFile(ctx, sshKey, file, destination)
}
@function
async def example(name: str, shade_token: dagger.Secret, ssh_key: dagger.File, file: dagger.File, destination: str) -> str:
return await (
dag.shadeform(name, shade_token)
.copy_file(ssh_key, file, destination)
)
@func()
async example(name: string, shadeToken: Secret, sshKey: File, file: File, destination: string): Promise<string> {
return dag
.shadeform(name, shadeToken)
.copyFile(sshKey, file, destination)
}
copyDir() 🔗
Copy a local directory to the remote VM
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
sshKey | File ! | - | A file. |
dir | Directory ! | - | A directory. |
destination | String ! | - | No description provided |
Example
dagger -m github.com/dciangot/daggerverse/shadeform@77a10bd443114753ae582ee99e6c583043ccad36 call \
--name string --shade-token env:MYSECRET copy-dir --ssh-key file:path --dir DIR_PATH --destination string
func (m *myModule) example(ctx context.Context, name string, shadeToken *Secret, sshKey *File, dir *Directory, destination string) string {
return dag.
Shadeform(name, shadeToken).
CopyDir(ctx, sshKey, dir, destination)
}
@function
async def example(name: str, shade_token: dagger.Secret, ssh_key: dagger.File, dir: dagger.Directory, destination: str) -> str:
return await (
dag.shadeform(name, shade_token)
.copy_dir(ssh_key, dir, destination)
)
@func()
async example(name: string, shadeToken: Secret, sshKey: File, dir: Directory, destination: string): Promise<string> {
return dag
.shadeform(name, shadeToken)
.copyDir(sshKey, dir, destination)
}