Esempio n. 1
0
func testJob(jobID string) *api.Job {
	task := api.NewTask("task1", "mock_driver").
		SetConfig("kill_after", "1s").
		SetConfig("run_for", "5s").
		SetConfig("exit_code", 0).
		Require(&api.Resources{
			MemoryMB: 256,
			CPU:      100,
		}).
		SetLogConfig(&api.LogConfig{
			MaxFiles:      1,
			MaxFileSizeMB: 2,
		})

	group := api.NewTaskGroup("group1", 1).
		AddTask(task).
		RequireDisk(&api.LocalDisk{
			DiskMB: 20,
		})

	job := api.NewBatchJob(jobID, jobID, "region1", 1).
		AddDatacenter("dc1").
		AddTaskGroup(group)

	return job
}
Esempio n. 2
0
func testJob(jobID string) *api.Job {
	task := api.NewTask("task1", "exec").
		Require(&api.Resources{MemoryMB: 256})

	group := api.NewTaskGroup("group1", 1).
		AddTask(task)

	job := api.NewBatchJob(jobID, jobID, "region1", 1).
		AddDatacenter("dc1").
		AddTaskGroup(group)

	return job
}
Esempio n. 3
0
func testJob(jobID string) *api.Job {
	task := api.NewTask("task1", "exec").
		Require(&api.Resources{
			MemoryMB: 256,
			DiskMB:   20,
			CPU:      100,
		}).
		SetLogConfig(&api.LogConfig{
			MaxFiles:      1,
			MaxFileSizeMB: 2,
		})

	group := api.NewTaskGroup("group1", 1).
		AddTask(task)

	job := api.NewBatchJob(jobID, jobID, "region1", 1).
		AddDatacenter("dc1").
		AddTaskGroup(group)

	return job
}