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@f0185187d0832b19d69a0d4cf074029da331f645

Entrypoint

Return Type
Shadeform !
Arguments
NameTypeDefault ValueDescription
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
func (m *myModule) 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
func (m *myModule) 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
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)
}

getVmId() 🔗

Return the VM ID

Return Type
String !
Example
func (m *myModule) example(ctx context.Context, name string, shadeToken *Secret) string  {
	return dag.
			Shadeform(name, shadeToken).
			GetVmId(ctx)
}

getVmInfo() 🔗

Return the VM info JSON

Return Type
String !
Example
func (m *myModule) example(ctx context.Context, name string, shadeToken *Secret) string  {
	return dag.
			Shadeform(name, shadeToken).
			GetVmInfo(ctx)
}

getAvailableList() 🔗

Return a list of available instances with the indicated boards sorted by price

Return Type
String !
Arguments
NameTypeDefault ValueDescription
gpuTypeString !-No description provided
nGpusInteger !-No description provided
Example
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)
}

getVmStatus() 🔗

Print the VM status

Return Type
String !
Example
func (m *myModule) example(ctx context.Context, name string, shadeToken *Secret) string  {
	return dag.
			Shadeform(name, shadeToken).
			GetVmStatus(ctx)
}

getVmIp() 🔗

Print the VM IP

Return Type
String !
Example
func (m *myModule) example(ctx context.Context, name string, shadeToken *Secret) string  {
	return dag.
			Shadeform(name, shadeToken).
			GetVmIp(ctx)
}

getVmUser() 🔗

Print the VM user to use for SSH connection

Return Type
String !
Example
func (m *myModule) example(ctx context.Context, name string, shadeToken *Secret) string  {
	return dag.
			Shadeform(name, shadeToken).
			GetVmUser(ctx)
}

vmReady() 🔗

Wait for VM to be ready and return its ID

Return Type
String !
Arguments
NameTypeDefault ValueDescription
maxRetriesInteger !10No description provided
Example
func (m *myModule) example(ctx context.Context, name string, shadeToken *Secret, maxRetries int) string  {
	return dag.
			Shadeform(name, shadeToken).
			VmReady(ctx, 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
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)
}

deleteVm() 🔗

Delete VM

Return Type
String !
Example
func (m *myModule) example(ctx context.Context, name string, shadeToken *Secret) string  {
	return dag.
			Shadeform(name, shadeToken).
			DeleteVm(ctx)
}

execSshCommand() 🔗

execute the provided through automatic ssh command

Return Type
String !
Arguments
NameTypeDefault ValueDescription
commandString !-No description provided
sshKeyFile !-A file.
Example
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)
}

copyFile() 🔗

Copy a local file to the remote VM

Return Type
String !
Arguments
NameTypeDefault ValueDescription
sshKeyFile !-A file.
fileFile !-A file.
destinationString !-No description provided
Example
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)
}

copyDir() 🔗

Copy a local directory to the remote VM

Return Type
String !
Arguments
NameTypeDefault ValueDescription
sshKeyFile !-A file.
dirDirectory !-A directory.
destinationString !-No description provided
Example
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)
}