Documentation
¶
Index ¶
- Variables
- func BuildDockerfile(dockerFile string) (inputBuf *bytes.Buffer, err error)
- func BuildImage(auto bool, job *tools.EdgeCmJob, jobCh chan<- *tools.JobStatus)
- func CWA() (*tools.CPUStat, *tools.MemoryStat, *tools.DiskStat, *tools.CurrentGpu)
- func CheckAndAutoRmImage()
- func CheckContainerStatus()
- func CheckFailedMessageAndResend()
- func CheckImageExistByName(name string) bool
- func CheckPendingJob()
- func ClearDanglingImage()
- func ContainerExistByName(name string) bool
- func ContainerRestart(c *gin.Context)
- func ContainerStop(c *gin.Context)
- func Containers(filters map[string][]string) ([]docker.APIContainers, error)
- func DelImage(c *gin.Context)
- func DeleteCWA(jobId string)
- func DeleteNodeData(jobID string)
- func GetAndStoreJobInfo(url, taskId string, r *Resp)
- func GetDockerfile(c *gin.Context)
- func HandleRequestData(c *gin.Context, out interface{}) bool
- func Images(filters map[string][]string) ([]docker.APIImages, error)
- func JobImageList() ([]docker.APIImages, error)
- func Peak(jobId string) (*tools.PeakValue, error)
- func PullImage(c *gin.Context)
- func PullJobCommand()
- func PullJobImageBuildRun()
- func PullJobStatus()
- func PushHardwareInfo()
- func PushJobStatusChanged()
- func PushRunningJob(forever bool)
- func RemoveImage(name string) error
- func Response(c *gin.Context, statusCode int, resp interface{})
- func RestartContainer(taskId, jobId string, jobCh chan<- *tools.JobStatus)
- func Run()
- func RunContainer(c *gin.Context)
- func RunningJob() ([]map[string]string, error)
- func Serve()
- func StartContainer(job *tools.EdgeCmJob, jobCh chan<- *tools.JobStatus)
- func StartP2pClient()
- func StopContainer(taskId, jobId string, jobCh chan<- *tools.JobStatus)
- func SystemCheck()
- type Dispatcher
- type JobCommand
- type Mount
- type ReqParam
- type Resp
- type ResponseInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var Client *docker.Client
View Source
var IsRunningJob = make(chan bool)
View Source
var JobDispatchers sync.Map
Functions ¶
func BuildImage ¶
Generate a image and deduce the state based on the job information
func CWA ¶
func CWA() (*tools.CPUStat, *tools.MemoryStat, *tools.DiskStat, *tools.CurrentGpu)
get current cwa value
func CheckFailedMessageAndResend ¶
func CheckFailedMessageAndResend()
Check to send the failed message and resend it
func CheckImageExistByName ¶
check images exist by name
func CheckPendingJob ¶
func CheckPendingJob()
Check the image build or the task that the image build successfully hangs
func ContainerExistByName ¶
check container exist by name
func Containers ¶
func Containers(filters map[string][]string) ([]docker.APIContainers, error)
get containers by filters
func DeleteNodeData ¶
func DeleteNodeData(jobID string)
func GetAndStoreJobInfo ¶
call api and store job information result
func HandleRequestData ¶
handle request data parse struct
func RestartContainer ¶
Restart the container and generate the state based on the job information
func StartContainer ¶
Start the container and generate the state based on the job information
func StopContainer ¶
Stop the container and generate the state based on the job information
Types ¶
type Dispatcher ¶
type Dispatcher struct {
C chan struct{}
}
dispatcher struct stop: use dispatcher.Stop()
type JobCommand ¶
type JobCommand struct {
Mac string `json:"mac"`
TaskId string `json:"taskId"`
JobId string `json:"jobId"`
Command string `json:"command"`
}
job command
Click to show internal directories.
Click to hide internal directories.