Dagger
Search

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@16cadcc4d6ac6535dc843af0fcf4766e513d1741

Entrypoint

Return Type
Shadeform !
Arguments
NameTypeDescription
nameString !No description provided
shadeTokenSecret !A reference to a secret value, which can be handled more safely than the value itself.
vmIdString No description provided
sshKeyFile No description provided
cacheCacheVolume No description provided
templateFileFile No description provided
Example
dagger -m github.com/dciangot/daggerverse/shadeform@16cadcc4d6ac6535dc843af0fcf4766e513d1741 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@16cadcc4d6ac6535dc843af0fcf4766e513d1741 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
NameTypeDefault ValueDescription
cloudString !-No description provided
regionString !-No description provided
shadeInstanceTypeString !-No description provided
shadeCloudString !-No description provided
Example
dagger -m github.com/dciangot/daggerverse/shadeform@16cadcc4d6ac6535dc843af0fcf4766e513d1741 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@16cadcc4d6ac6535dc843af0fcf4766e513d1741 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@16cadcc4d6ac6535dc843af0fcf4766e513d1741 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()
}

getVmStatus() 🔗

Print the VM status

Return Type
String !
Example
dagger -m github.com/dciangot/daggerverse/shadeform@16cadcc4d6ac6535dc843af0fcf4766e513d1741 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@16cadcc4d6ac6535dc843af0fcf4766e513d1741 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@16cadcc4d6ac6535dc843af0fcf4766e513d1741 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
NameTypeDefault ValueDescription
maxRetriesInteger !10No description provided
Example
dagger -m github.com/dciangot/daggerverse/shadeform@16cadcc4d6ac6535dc843af0fcf4766e513d1741 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
NameTypeDefault ValueDescription
cloudString !"hyperstack"No description provided
regionString !"canada-1"No description provided
shadeInstanceTypeString !"A6000"No description provided
shadeCloudString !"true"No description provided
Example
dagger -m github.com/dciangot/daggerverse/shadeform@16cadcc4d6ac6535dc843af0fcf4766e513d1741 call \
 --name string --shade-token env:MYSECRET create-n-check --cloud string --region string --shade-instance-type string --shade-cloud string
func (m *myModule) example(ctx context.Context, name string, shadeToken *Secret, cloud string, region string, shadeInstanceType string, shadeCloud string) string  {
	return dag.
			Shadeform(name, shadeToken).
			CreateNCheck(ctx, cloud, region, shadeInstanceType, shadeCloud)
}
@function
async def example(name: str, shade_token: dagger.Secret, cloud: str, region: str, shade_instance_type: str, shade_cloud: str) -> str:
	return await (
		dag.shadeform(name, shade_token)
		.create_n_check(cloud, region, shade_instance_type, shade_cloud)
	)
@func()
async example(name: string, shadeToken: Secret, cloud: string, region: string, shadeInstanceType: string, shadeCloud: string): Promise<string> {
	return dag
		.shadeform(name, shadeToken)
		.createNCheck(cloud, region, shadeInstanceType, shadeCloud)
}

deleteVm() 🔗

Delete VM

Return Type
String !
Example
dagger -m github.com/dciangot/daggerverse/shadeform@16cadcc4d6ac6535dc843af0fcf4766e513d1741 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
NameTypeDefault ValueDescription
commandString !-No description provided
sshKeyFile !-A file.
Example
dagger -m github.com/dciangot/daggerverse/shadeform@16cadcc4d6ac6535dc843af0fcf4766e513d1741 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)
}