Submission of docker containers without an executor (aka running container as a task) is now supported
This commit is contained in:
parent
66a2868aab
commit
76b404e087
2 changed files with 24 additions and 3 deletions
|
@ -82,7 +82,7 @@ func main() {
|
||||||
job = realis.NewJob().
|
job = realis.NewJob().
|
||||||
Environment("prod").
|
Environment("prod").
|
||||||
Role("vagrant").
|
Role("vagrant").
|
||||||
Name("hello_world_from_gorealis_docker").
|
Name("hello_world_from_gorealis").
|
||||||
ExecutorName(aurora.AURORA_EXECUTOR_NAME).
|
ExecutorName(aurora.AURORA_EXECUTOR_NAME).
|
||||||
ExecutorData(string(payload)).
|
ExecutorData(string(payload)).
|
||||||
CPU(1).
|
CPU(1).
|
||||||
|
@ -108,8 +108,20 @@ func main() {
|
||||||
AddLabel("fileName", "sample-app/docker-compose.yml").
|
AddLabel("fileName", "sample-app/docker-compose.yml").
|
||||||
AddURIs(true, true, "https://github.com/mesos/docker-compose-executor/releases/download/0.1.0/sample-app.tar.gz")
|
AddURIs(true, true, "https://github.com/mesos/docker-compose-executor/releases/download/0.1.0/sample-app.tar.gz")
|
||||||
break
|
break
|
||||||
|
case "none":
|
||||||
|
job = realis.NewJob().
|
||||||
|
Environment("prod").
|
||||||
|
Role("vagrant").
|
||||||
|
Name("docker_as_task").
|
||||||
|
CPU(1).
|
||||||
|
RAM(64).
|
||||||
|
Disk(100).
|
||||||
|
IsService(true).
|
||||||
|
InstanceCount(1).
|
||||||
|
AddPorts(1)
|
||||||
|
break
|
||||||
default:
|
default:
|
||||||
fmt.Println("Only thermos and compose are supported for now")
|
fmt.Println("Only thermos, compose, and none are supported for now")
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
11
job.go
11
job.go
|
@ -68,7 +68,6 @@ func NewJob() Job {
|
||||||
taskConfig.Job = jobKey
|
taskConfig.Job = jobKey
|
||||||
taskConfig.Container = aurora.NewContainer()
|
taskConfig.Container = aurora.NewContainer()
|
||||||
taskConfig.Container.Mesos = aurora.NewMesosContainer()
|
taskConfig.Container.Mesos = aurora.NewMesosContainer()
|
||||||
taskConfig.ExecutorConfig = aurora.NewExecutorConfig()
|
|
||||||
taskConfig.MesosFetcherUris = make(map[*aurora.MesosFetcherURI]bool)
|
taskConfig.MesosFetcherUris = make(map[*aurora.MesosFetcherURI]bool)
|
||||||
taskConfig.Metadata = make(map[*aurora.Metadata]bool)
|
taskConfig.Metadata = make(map[*aurora.Metadata]bool)
|
||||||
taskConfig.Constraints = make(map[*aurora.Constraint]bool)
|
taskConfig.Constraints = make(map[*aurora.Constraint]bool)
|
||||||
|
@ -116,12 +115,22 @@ func (j AuroraJob) Name(name string) Job {
|
||||||
|
|
||||||
// Set name of the executor that will the task will be configured to.
|
// Set name of the executor that will the task will be configured to.
|
||||||
func (j AuroraJob) ExecutorName(name string) Job {
|
func (j AuroraJob) ExecutorName(name string) Job {
|
||||||
|
|
||||||
|
if j.jobConfig.TaskConfig.ExecutorConfig == nil {
|
||||||
|
j.jobConfig.TaskConfig.ExecutorConfig = aurora.NewExecutorConfig()
|
||||||
|
}
|
||||||
|
|
||||||
j.jobConfig.TaskConfig.ExecutorConfig.Name = name
|
j.jobConfig.TaskConfig.ExecutorConfig.Name = name
|
||||||
return j
|
return j
|
||||||
}
|
}
|
||||||
|
|
||||||
// Will be included as part of entire task inside the scheduler that will be serialized.
|
// Will be included as part of entire task inside the scheduler that will be serialized.
|
||||||
func (j AuroraJob) ExecutorData(data string) Job {
|
func (j AuroraJob) ExecutorData(data string) Job {
|
||||||
|
|
||||||
|
if j.jobConfig.TaskConfig.ExecutorConfig == nil {
|
||||||
|
j.jobConfig.TaskConfig.ExecutorConfig = aurora.NewExecutorConfig()
|
||||||
|
}
|
||||||
|
|
||||||
j.jobConfig.TaskConfig.ExecutorConfig.Data = data
|
j.jobConfig.TaskConfig.ExecutorConfig.Data = data
|
||||||
return j
|
return j
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue