Documentation ¶
Index ¶
- Constants
- Variables
- func CreateCustomImage(n *Node) *string
- type Container
- type Dag
- func (dag *Dag) AddCommand(id, cmd string) (node *Node)
- func (dag *Dag) AddEdge(from, to string) error
- func (dag *Dag) AddNodeToStartNode(to *Node) error
- func (dag *Dag) ConnectRunner() bool
- func (dag *Dag) CreateImage(healthChecker string)
- func (dag *Dag) CreateImageT(ctx context.Context, healthChecker string)
- func (dag *Dag) DisableTimeout()
- func (dag *Dag) FinishDag() error
- func (dag *Dag) GetReady(ctx context.Context) bool
- func (dag *Dag) GetReadyT(ctx context.Context) bool
- func (dag *Dag) SetContainerCmd(r Runnable)
- func (dag *Dag) SetTimeout(d time.Duration)
- func (dag *Dag) Start() bool
- func (dag *Dag) Wait(ctx context.Context) bool
- type Edge
- type ErrorType
- type Node
- type Pipeline
- type Runnable
- Bugs
Constants ¶
const ( Create createEdgeErrorType = iota Exist Fault )
const ( Start runningStatus = iota Preflight PreflightFailed InFlight InFlightFailed PostFlight PostFlightFailed FlightEnd Failed Succeed )
The status displayed when running the runner on each node.
const ( StartNode = "start_node" EndNode = "end_node" )
const ( Max int = 100 Min int = 1 StatusDefault int = 3 )
channel buffer size
Variables ¶
var Log = logrus.New()
Functions ¶
func CreateCustomImage ¶
Types ¶
type Container ¶
func (*Container) CreateImage ¶
CreateImage TODO healthCheckr 의 empty 검사만 하지만 실제로 healthchecker.sh 가 있는지 파악하는 구문 들어갈지 생각하자. 각 노드의 이미지 를만들어 줌.
type Dag ¶
type Dag struct { Pid string Id string Edges []*Edge StartNode *Node EndNode *Node RunningStatus chan *printStatus // timeout Timeout time.Duration ContainerCmd Runnable // contains filtered or unexported fields }
Dag (Directed Acyclic Graph) is an acyclic graph, not a cyclic graph. In other words, there is no cyclic cycle in the DAG algorithm, and it has only one direction.
func NewDag ¶
func NewDag() *Dag
NewDag creates a pointer to the Dag structure. One channel must be put in the start node. Enter this channel value in the start function. And this channel is not included in Edge. TODO 파라미터 nil 허용해주도록 바꿔줄지 생각함.
func (*Dag) AddCommand ¶
AddCommand add command to node.
func (*Dag) AddNodeToStartNode ¶
AddNodeToStartNode check TODO 확인하자.
func (*Dag) ConnectRunner ¶
func (*Dag) CreateImage ¶
func (*Dag) CreateImageT ¶
CreateImageT 이건 컨테이너 전용- 이미지 생성할때 고루틴 돌리니 에러 발생.. TODO check ContainerCmd
func (*Dag) SetContainerCmd ¶
func (*Dag) Start ¶
Start start_node has one vertex. That is, it has only one channel and this channel is not included in the edge. It is started by sending a value to this channel when starting the dag's operation.
func (*Dag) Wait ¶
Wait waits until all channels are closed. RunningStatus channel has multiple senders and one receiver Closing a channel on a receiver violates the general channel close principle. However, when Wait terminates, it seems safe to close the channel here because all tasks are finished.
type Edge ¶
type Edge struct {
// contains filtered or unexported fields
}
Edge is a channel. It has the same meaning as the connecting line connecting the parent and child nodes.
type Node ¶
type Pipeline ¶
func NewPipeline ¶
func NewPipeline() *Pipeline
NewPipeline 파이프라인은 dag NewPipeline와 데이터를 연계해야 하는데 데이터의 경우는 다른 xml 처리하는 것이 바람직할 것이다. 외부에서 데이터를 가지고 올 경우, ftp 나 scp 나 기타 다른 프롤토콜을 사용할 경우도 생각을 해야 한다.
func (*Pipeline) NewDags ¶
NewDags 파이프라인과 dag 의 차이점은 데이터의 차이이다. 즉, 같은 dag 이지만 데이터가 다를 수 있다. 파이프라인에서 데이터 연계가 일어난다. 하지만 데이터 관련 datakit 이 아직 만들어 지지 않았기 때문에 입력파라미터로 dag 수를 지정한다. 이부분에서 두가지를 생각할 수 있다. dag 하나를 받아들여서 늘리는 방향과 dag 는 하나이고 데이터만큼만 어떠한 방식으로 진행하는 것이다. 전자가 쉽게 생각할 수 있지만 메모리 낭비 가있다. 일단 전자로 개발한다. 후자는 아직 아이디어가 없다. TODO 데이터와 관련해서 추가 해서 수정해줘야 한다. 추후 안정화 되면 panic 은 error 로 교체한다.
func (*Pipeline) SetContainerCmd ¶
Notes ¶
Bugs ¶
이상 현상 발생 detectCycle runningStatus 과 start, restart, pause, stop 등 추가 후 버그 개선