Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeDockerActuator ¶
func MakeDockerActuator(initFunc InitFunction) *dockerActuator
func MakeFucntionActuator ¶
func MakeFucntionActuator(runFunc RunFunction, initFunc InitFunction) (*fucntionActuator, error)
runFunc 待调度的执行函数,注意实现该函数的时候,需要使用传入 ctx 进行超时和退出处理,框架否则无法控制超时时间 callbackChannel 用来执行器进行任务回调,返回已经完成的任务,如果不需要回调,传入 nil 即可
Types ¶
type DockerTask ¶
type DockerTask struct { Image string // 镜像 Cmd []string // 容器执行命令 ContainerName string // 容器名,不能重复 // 资源限制 MemoryLimit int64 // bytes CpuPercent int // cpu 占用百分比, 比如暂用 2 核就是 200 // 可选配置 ExposedPorts []string // 暴露端口 Env []string // 环境变量 WorkingDir string // 工作目录 NetworkDisabled bool // 是否关闭网络 NetworkMode string // 网络模式 Privileged bool // Is the container in privileged mode VolumeBinds map[string]string // host 路径到容器路径的映射,类似于 -v 参数 ContainerId string // 执行后对应的 容器 Id }
DockerTask docker 任务
Click to show internal directories.
Click to hide internal directories.