Documentation ¶
Index ¶
- func CreateAzureBatchAccount(ctx context.Context, accountName, location, resourceGroupName string) (a batchARM.Account, err error)
- func CreateBatchJob(ctx context.Context, accountName, accountLocation, poolID, jobID string) error
- func CreateBatchPool(ctx context.Context, accountName, accountLocation, poolID string) error
- func CreateBatchTask(ctx context.Context, accountName, accountLocation, jobID string) (string, error)
- func WaitForTaskResult(ctx context.Context, accountName, accountLocation, jobID, taskID string) (stdout string, err error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAzureBatchAccount ¶
func CreateAzureBatchAccount(ctx context.Context, accountName, location, resourceGroupName string) (a batchARM.Account, err error)
CreateAzureBatchAccount creates a new azure batch account
Example ¶
var groupName = config.GenerateGroupName("Batch") config.SetGroupName(groupName) ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(time.Minute*30)) defer cancel() defer resources.Cleanup(ctx) _, err := resources.CreateGroup(ctx, config.GroupName()) if err != nil { util.LogAndPanic(err) } _, err = CreateAzureBatchAccount(ctx, accountName, config.Location(), config.GroupName()) if err != nil { util.LogAndPanic(err) } util.PrintAndLog("created batch account") err = CreateBatchPool(ctx, accountName, config.Location(), poolID) if err != nil { util.LogAndPanic(err) } util.PrintAndLog("created batch pool") err = CreateBatchJob(ctx, accountName, config.Location(), poolID, jobID) if err != nil { util.LogAndPanic(err) } util.PrintAndLog("created batch job") taskID, err := CreateBatchTask(ctx, accountName, config.Location(), jobID) if err != nil { util.LogAndPanic(err) } util.PrintAndLog("created batch task") taskOutput, err := WaitForTaskResult(ctx, accountName, config.Location(), jobID, taskID) if err != nil { util.LogAndPanic(err) } util.PrintAndLog("output from task:") util.PrintAndLog(taskOutput)
Output: created batch account created batch pool created batch job created batch task output from task: Hello world from the Batch Hello world sample!
func CreateBatchJob ¶
CreateBatchJob create an azure batch job
func CreateBatchPool ¶
CreateBatchPool creates an Azure Batch compute pool
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.