175 lines
5.2 KiB
Markdown
175 lines
5.2 KiB
Markdown
<!-- Code generated by gomarkdoc. DO NOT EDIT -->
|
|
|
|
# docker
|
|
|
|
```go
|
|
import "github.com/Akilan1999/p2p-rendering-computation/server/docker"
|
|
```
|
|
|
|
## Index
|
|
|
|
- [func StopAndRemoveContainer\(containername string\) error](<#StopAndRemoveContainer>)
|
|
- [type DockerContainer](<#DockerContainer>)
|
|
- [type DockerContainers](<#DockerContainers>)
|
|
- [func ViewAllContainers\(\) \(\*DockerContainers, error\)](<#ViewAllContainers>)
|
|
- [type DockerVM](<#DockerVM>)
|
|
- [func BuildRunContainer\(NumPorts int, GPU string, ContainerName string, baseImage string, publicKey string\) \(\*DockerVM, error\)](<#BuildRunContainer>)
|
|
- [func \(d \*DockerVM\) CopyToTmpContainer\(\) error](<#DockerVM.CopyToTmpContainer>)
|
|
- [func \(d \*DockerVM\) TemplateDockerContainer\(\) error](<#DockerVM.TemplateDockerContainer>)
|
|
- [type ErrorDetail](<#ErrorDetail>)
|
|
- [type ErrorLine](<#ErrorLine>)
|
|
- [type Port](<#Port>)
|
|
- [type Ports](<#Ports>)
|
|
- [func OpenPortsFile\(filename string\) \(\*Ports, error\)](<#OpenPortsFile>)
|
|
|
|
|
|
<a name="StopAndRemoveContainer"></a>
|
|
## func [StopAndRemoveContainer](<https://github.com/Akilan1999/p2p-rendering-computation/blob/master/server/docker/docker.go#L340>)
|
|
|
|
```go
|
|
func StopAndRemoveContainer(containername string) error
|
|
```
|
|
|
|
StopAndRemoveContainer Stop and remove a container Reference \(https://gist.github.com/frikky/e2efcea6c733ea8d8d015b7fe8a91bf6\)
|
|
|
|
<a name="DockerContainer"></a>
|
|
## type [DockerContainer](<https://github.com/Akilan1999/p2p-rendering-computation/blob/master/server/docker/docker.go#L40-L43>)
|
|
|
|
|
|
|
|
```go
|
|
type DockerContainer struct {
|
|
ContainerName string `json:"DockerContainerName"`
|
|
ContainerDescription string `json:"ContainerDescription"`
|
|
}
|
|
```
|
|
|
|
<a name="DockerContainers"></a>
|
|
## type [DockerContainers](<https://github.com/Akilan1999/p2p-rendering-computation/blob/master/server/docker/docker.go#L36-L38>)
|
|
|
|
|
|
|
|
```go
|
|
type DockerContainers struct {
|
|
DockerContainer []DockerContainer `json:"DockerContainer"`
|
|
}
|
|
```
|
|
|
|
<a name="ViewAllContainers"></a>
|
|
### func [ViewAllContainers](<https://github.com/Akilan1999/p2p-rendering-computation/blob/master/server/docker/docker.go#L387>)
|
|
|
|
```go
|
|
func ViewAllContainers() (*DockerContainers, error)
|
|
```
|
|
|
|
ViewAllContainers returns all containers runnable and which can be built
|
|
|
|
<a name="DockerVM"></a>
|
|
## type [DockerVM](<https://github.com/Akilan1999/p2p-rendering-computation/blob/master/server/docker/docker.go#L22-L34>)
|
|
|
|
|
|
|
|
```go
|
|
type DockerVM struct {
|
|
SSHUsername string `json:"SSHUsername"`
|
|
SSHPublcKey string `json:"SSHPublicKey"`
|
|
ID string `json:"ID"`
|
|
TagName string `json:"TagName"`
|
|
ImagePath string `json:"ImagePath"`
|
|
Ports Ports `json:"Ports"`
|
|
GPU string `json:"GPU"`
|
|
TempPath string
|
|
BaseImage string
|
|
LogsPath string
|
|
SSHCommand string `json:"SSHCommand"`
|
|
}
|
|
```
|
|
|
|
<a name="BuildRunContainer"></a>
|
|
### func [BuildRunContainer](<https://github.com/Akilan1999/p2p-rendering-computation/blob/master/server/docker/docker.go#L70>)
|
|
|
|
```go
|
|
func BuildRunContainer(NumPorts int, GPU string, ContainerName string, baseImage string, publicKey string) (*DockerVM, error)
|
|
```
|
|
|
|
BuildRunContainer Function is incharge to invoke building and running contianer and also allocating external ports
|
|
|
|
<a name="DockerVM.CopyToTmpContainer"></a>
|
|
### func \(\*DockerVM\) [CopyToTmpContainer](<https://github.com/Akilan1999/p2p-rendering-computation/blob/master/server/docker/docker.go#L493>)
|
|
|
|
```go
|
|
func (d *DockerVM) CopyToTmpContainer() error
|
|
```
|
|
|
|
CopyToTmpContainer Creates a copy of the docker folder
|
|
|
|
<a name="DockerVM.TemplateDockerContainer"></a>
|
|
### func \(\*DockerVM\) [TemplateDockerContainer](<https://github.com/Akilan1999/p2p-rendering-computation/blob/master/server/docker/docker.go#L464>)
|
|
|
|
```go
|
|
func (d *DockerVM) TemplateDockerContainer() error
|
|
```
|
|
|
|
TemplateDockerContainer This function templates the docker container with the base docker image to use
|
|
|
|
<a name="ErrorDetail"></a>
|
|
## type [ErrorDetail](<https://github.com/Akilan1999/p2p-rendering-computation/blob/master/server/docker/docker.go#L62-L64>)
|
|
|
|
|
|
|
|
```go
|
|
type ErrorDetail struct {
|
|
Message string `json:"message"`
|
|
}
|
|
```
|
|
|
|
<a name="ErrorLine"></a>
|
|
## type [ErrorLine](<https://github.com/Akilan1999/p2p-rendering-computation/blob/master/server/docker/docker.go#L57-L60>)
|
|
|
|
|
|
|
|
```go
|
|
type ErrorLine struct {
|
|
Error string `json:"error"`
|
|
ErrorDetail ErrorDetail `json:"errorDetail"`
|
|
}
|
|
```
|
|
|
|
<a name="Port"></a>
|
|
## type [Port](<https://github.com/Akilan1999/p2p-rendering-computation/blob/master/server/docker/docker.go#L48-L55>)
|
|
|
|
|
|
|
|
```go
|
|
type Port struct {
|
|
PortName string `json:"PortName"`
|
|
InternalPort int `json:"InternalPort"`
|
|
Type string `json:"Type"`
|
|
ExternalPort int `json:"ExternalPort"`
|
|
IsUsed bool `json:"IsUsed"`
|
|
Description string `json:"Description"`
|
|
}
|
|
```
|
|
|
|
<a name="Ports"></a>
|
|
## type [Ports](<https://github.com/Akilan1999/p2p-rendering-computation/blob/master/server/docker/docker.go#L45-L47>)
|
|
|
|
|
|
|
|
```go
|
|
type Ports struct {
|
|
PortSet []Port `json:"Port"`
|
|
}
|
|
```
|
|
|
|
<a name="OpenPortsFile"></a>
|
|
### func [OpenPortsFile](<https://github.com/Akilan1999/p2p-rendering-computation/blob/master/server/docker/docker.go#L447>)
|
|
|
|
```go
|
|
func OpenPortsFile(filename string) (*Ports, error)
|
|
```
|
|
|
|
|
|
|
|
Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>)
|