#293: Entire fix in a single button
This commit is contained in:
@@ -2,7 +2,6 @@ FROM golang:1.16.0-buster as builder
|
||||
|
||||
RUN mkdir /app
|
||||
WORKDIR /app
|
||||
RUN go get github.com/docker/docker/api/types github.com/docker/docker/api/types/container github.com/docker/docker/client
|
||||
|
||||
COPY orborus.go /app/orborus.go
|
||||
RUN go mod init orborus
|
||||
|
||||
@@ -3,13 +3,14 @@ module orborus
|
||||
go 1.13
|
||||
|
||||
require (
|
||||
github.com/Microsoft/go-winio v0.4.16 // indirect
|
||||
github.com/containerd/containerd v1.4.3 // indirect
|
||||
github.com/docker/distribution v2.7.1+incompatible // indirect
|
||||
github.com/docker/docker v20.10.1+incompatible
|
||||
github.com/docker/go-connections v0.4.0 // indirect
|
||||
github.com/docker/go-units v0.4.0 // indirect
|
||||
github.com/gogo/protobuf v1.3.1 // indirect
|
||||
github.com/mackerelio/go-osstat v0.1.0 // indirect
|
||||
github.com/mackerelio/go-osstat v0.1.0
|
||||
github.com/opencontainers/go-digest v1.0.0 // indirect
|
||||
github.com/opencontainers/image-spec v1.0.1 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk=
|
||||
github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||
@@ -41,6 +43,7 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/mackerelio/go-osstat v0.1.0 h1:e57QHeHob8kKJ5FhcXGdzx5O6Ktuc5RHMDIkeqhgkFA=
|
||||
github.com/mackerelio/go-osstat v0.1.0/go.mod h1:1K3NeYLhMHPvzUu+ePYXtoB58wkaRpxZsGClZBJyIFw=
|
||||
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
|
||||
@@ -53,9 +56,11 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
|
||||
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
|
||||
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
|
||||
github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM=
|
||||
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
@@ -73,8 +78,10 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190410235845-0ad05ae3009d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4=
|
||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
FROM golang:1.16.0-buster as builder
|
||||
|
||||
WORKDIR /app
|
||||
RUN go get github.com/docker/docker/api/types github.com/docker/docker/api/types/container github.com/docker/docker/client
|
||||
|
||||
#RUN go env -w GO111MODULE=auto
|
||||
COPY worker.go /app/worker.go
|
||||
RUN go env -w GO111MODULE=auto
|
||||
|
||||
RUN go get github.com/docker/docker/api/types
|
||||
RUN go get github.com/docker/docker/api/types/container
|
||||
RUN go get github.com/docker/docker/client
|
||||
RUN go get github.com/gorilla/mux
|
||||
RUN go get github.com/patrickmn/go-cache
|
||||
RUN go mod init worker
|
||||
RUN go get github.com/docker/docker/api/types && \
|
||||
go get github.com/docker/docker/api/types/container && \
|
||||
go get github.com/docker/docker/client && \
|
||||
go get github.com/gorilla/mux && \
|
||||
go get github.com/patrickmn/go-cache
|
||||
|
||||
RUN go build
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o worker .
|
||||
|
||||
## ALPINE IMAGE
|
||||
FROM alpine:3.12
|
||||
|
||||
ENV SHUFFLE_BASE_IMAGE_REGISTRY=docker.io
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
NAME=shuffle-worker
|
||||
VERSION=0.8.62
|
||||
VERSION=0.8.63
|
||||
|
||||
echo "Running docker build with $NAME:$VERSION"
|
||||
#CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o worker.bin .
|
||||
|
||||
@@ -524,7 +524,7 @@ type WorkflowAppActionParameter struct {
|
||||
Description string `json:"description" datastore:"description,noindex" yaml:"description"`
|
||||
ID string `json:"id" datastore:"id" yaml:"id,omitempty"`
|
||||
Name string `json:"name" datastore:"name" yaml:"name"`
|
||||
Example string `json:"example" datastore:"example" yaml:"example"`
|
||||
Example string `json:"example" datastore:"example,noindex" yaml:"example"`
|
||||
Value string `json:"value" datastore:"value,noindex" yaml:"value,omitempty"`
|
||||
Multiline bool `json:"multiline" datastore:"multiline" yaml:"multiline"`
|
||||
Options []string `json:"options" datastore:"options" yaml:"options"`
|
||||
@@ -536,6 +536,7 @@ type WorkflowAppActionParameter struct {
|
||||
Schema SchemaDefinition `json:"schema" datastore:"schema" yaml:"schema"`
|
||||
SkipMulticheck bool `json:"skip_multicheck" datastore:"skip_multicheck" yaml:"skip_multicheck"`
|
||||
ValueReplace []Valuereplace `json:"value_replace" datastore:"value_replace,noindex" yaml:"value_replace,omitempty"`
|
||||
UniqueToggled bool `json:"unique_toggled" datastore:"unique_toggled" yaml:"unique_toggled"`
|
||||
}
|
||||
|
||||
type Valuereplace struct {
|
||||
@@ -2335,9 +2336,9 @@ func runWorkflowExecutionTransaction(ctx context.Context, attempts int64, workfl
|
||||
} else {
|
||||
log.Printf("[WARNING] Actionresult is %s for node %s in %s. Continuing anyway because of workflow configuration.", actionResult.Status, actionResult.Action.ID, workflowExecution.ExecutionId)
|
||||
// Finds ALL childnodes to set them to SKIPPED
|
||||
childNodes = findChildNodes(*workflowExecution, actionResult.Action.ID)
|
||||
// Remove duplicates
|
||||
//log.Printf("CHILD NODES: %d", len(childNodes))
|
||||
childNodes = findChildNodes(*workflowExecution, actionResult.Action.ID)
|
||||
for _, nodeId := range childNodes {
|
||||
if nodeId == actionResult.Action.ID {
|
||||
continue
|
||||
@@ -2490,6 +2491,84 @@ func runWorkflowExecutionTransaction(ctx context.Context, attempts int64, workfl
|
||||
log.Printf("[INFO] Setting value (2) of %s in execution %s to %s. New result length: %d", actionResult.Action.ID, workflowExecution.ExecutionId, actionResult.Status, len(workflowExecution.Results))
|
||||
}
|
||||
|
||||
if actionResult.Status == "SKIPPED" {
|
||||
log.Printf("\n\n[INFO] Handling special case for SKIPPED!\n\n")
|
||||
childNodes := findChildNodes(*workflowExecution, actionResult.Action.ID)
|
||||
for _, nodeId := range childNodes {
|
||||
if nodeId == actionResult.Action.ID {
|
||||
continue
|
||||
}
|
||||
|
||||
// 1. Find the action itself
|
||||
// 2. Create an actionresult
|
||||
curAction := Action{ID: ""}
|
||||
for _, action := range workflowExecution.Workflow.Actions {
|
||||
if action.ID == nodeId {
|
||||
curAction = action
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if len(curAction.ID) == 0 {
|
||||
log.Printf("Couldn't find subnode %s", nodeId)
|
||||
continue
|
||||
}
|
||||
|
||||
resultExists := false
|
||||
for _, result := range workflowExecution.Results {
|
||||
if result.Action.ID == curAction.ID {
|
||||
resultExists = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if !resultExists {
|
||||
// Check parents are done here. Only add it IF all parents are skipped
|
||||
skipNodeAdd := false
|
||||
for _, branch := range workflowExecution.Workflow.Branches {
|
||||
if branch.DestinationID == nodeId {
|
||||
// If the branch's source node is NOT in childNodes, it's not a skipped parent
|
||||
sourceNodeFound := false
|
||||
for _, item := range childNodes {
|
||||
if item == branch.SourceID {
|
||||
sourceNodeFound = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if !sourceNodeFound {
|
||||
log.Printf("[INFO] Not setting node %s to SKIPPED", nodeId)
|
||||
skipNodeAdd = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !skipNodeAdd {
|
||||
newAction := Action{
|
||||
AppName: curAction.AppName,
|
||||
AppVersion: curAction.AppVersion,
|
||||
Label: curAction.Label,
|
||||
Name: curAction.Name,
|
||||
ID: curAction.ID,
|
||||
}
|
||||
|
||||
newResult := ActionResult{
|
||||
Action: newAction,
|
||||
ExecutionId: actionResult.ExecutionId,
|
||||
Authorization: actionResult.Authorization,
|
||||
Result: "Skipped because of previous node",
|
||||
StartedAt: 0,
|
||||
CompletedAt: 0,
|
||||
Status: "SKIPPED",
|
||||
}
|
||||
|
||||
workflowExecution.Results = append(workflowExecution.Results, newResult)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: Have a check for skippednodes and their parents
|
||||
/*
|
||||
for resultIndex, result := range workflowExecution.Results {
|
||||
|
||||
Reference in New Issue
Block a user