diff --git a/backend/go-app/walkoff.go b/backend/go-app/walkoff.go index 6c91d2ec..899e40d5 100644 --- a/backend/go-app/walkoff.go +++ b/backend/go-app/walkoff.go @@ -691,7 +691,7 @@ func handleGetWorkflowqueue(resp http.ResponseWriter, request *http.Request) { executionRequests.Data = []shuffle.ExecutionRequest{} } else { log.Printf("[INFO] Executionrequests (%s): %d", id, len(executionRequests.Data)) - log.Printf("IDS: %#v", executionRequests.Data[0].ExecutionId) + //log.Printf("IDS: %#v", executionRequests.Data[0].ExecutionId) } newjson, err := json.Marshal(executionRequests) @@ -768,6 +768,7 @@ func validateNewWorkerExecution(body []byte) error { log.Printf("[WARNING] Failed execution unmarshaling: %s", err) return err } + //log.Printf("\n\nGOT EXEC WITH RESULT %#v (%d)\n\n", execution.Status, len(execution.Results)) baseExecution, err := shuffle.GetWorkflowExecution(ctx, execution.ExecutionId) if err != nil { @@ -788,9 +789,9 @@ func validateNewWorkerExecution(body []byte) error { return errors.New(fmt.Sprintf("Bad length of trigger: %d (probably normal app)", len(execution.Workflow.Triggers))) } - if baseExecution.Status != "WAITING" && baseExecution.Status != "EXECUTING" { - return errors.New(fmt.Sprintf("Workflow is already finished or failed. Can't update")) - } + //if baseExecution.Status != "WAITING" && baseExecution.Status != "EXECUTING" { + // return errors.New(fmt.Sprintf("Workflow is already finished or failed. Can't update")) + //} if execution.Status == "EXECUTING" { //log.Printf("[INFO] Inside executing.") @@ -818,7 +819,7 @@ func validateNewWorkerExecution(body []byte) error { //log.Printf("\n\nSHOULD SET BACKEND DATA FOR EXEC \n\n") err = shuffle.SetWorkflowExecution(ctx, execution, true) if err == nil { - log.Printf("[INFO] Set workflowexecution based on new worker (>0.8.53) for execution %s. Actions: %d, Triggers: %d, Results: %d, Status: %s, Result: %s", execution.ExecutionId, len(execution.Workflow.Actions), len(execution.Workflow.Triggers), len(execution.Results), execution.Status, execution.Result) + log.Printf("[INFO] Set workflowexecution based on new worker (>0.8.53) for execution %s. Actions: %d, Triggers: %d, Results: %d, Status: %s", execution.ExecutionId, len(execution.Workflow.Actions), len(execution.Workflow.Triggers), len(execution.Results), execution.Status) //, execution.Result) //log.Printf("[INFO] Successfully set the execution to wait.") } else { log.Printf("[WARNING] Failed to set the execution to wait.") diff --git a/docker-compose.yml b/docker-compose.yml index 20bd3ec9..4f648a84 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -49,11 +49,11 @@ services: - /var/run/docker.sock:/var/run/docker.sock environment: - SHUFFLE_APP_SDK_VERSION=0.8.97 - - SHUFFLE_WORKER_VERSION=0.8.97 + - SHUFFLE_WORKER_VERSION=nightly - ORG_ID=${ORG_ID} - ENVIRONMENT_NAME=${ENVIRONMENT_NAME} - BASE_URL=http://${OUTER_HOSTNAME}:${BACKEND_PORT} - - DOCKER_API_VERSION=1.40 + - DOCKER_API_VERSION=1.35 - SHUFFLE_BASE_IMAGE_NAME=${SHUFFLE_BASE_IMAGE_NAME} - SHUFFLE_BASE_IMAGE_REGISTRY=${SHUFFLE_BASE_IMAGE_REGISTRY} - SHUFFLE_BASE_IMAGE_TAG_SUFFIX=${SHUFFLE_BASE_IMAGE_TAG_SUFFIX} diff --git a/frontend/src/components/ConfigureWorkflow.jsx b/frontend/src/components/ConfigureWorkflow.jsx index c77bbf54..0cc6182a 100644 --- a/frontend/src/components/ConfigureWorkflow.jsx +++ b/frontend/src/components/ConfigureWorkflow.jsx @@ -99,7 +99,7 @@ const Workflow = (props) => { var filled = true for (var key in action.parameters) { if (action.parameters[key].configuration) { - console.log("Found config: ", action.parameters[key]) + //console.log("Found config: ", action.parameters[key]) if (action.parameters[key].value === null || action.parameters[key].value.length === 0) { filled = false break diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index 5cc65caa..8951a295 100644 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -11,7 +11,7 @@ import NestedMenuItem from "material-ui-nested-menu-item"; import {TextField, Drawer, Button, Paper, Grid, Tabs, InputAdornment, Tab, ButtonBase, Tooltip, Select, MenuItem, Divider, Dialog, Modal, DialogActions, DialogTitle, InputLabel, DialogContent, FormControl, IconButton, Menu, Input, FormGroup, FormControlLabel, Typography, Checkbox, Breadcrumbs, CircularProgress, Switch, Fade} from '@material-ui/core'; -import {Undo as UndoIcon, FileCopy as FileCopyIcon, GetApp as GetAppIcon, Search as SearchIcon, ArrowUpward as ArrowUpwardIcon, Visibility as VisibilityIcon, Done as DoneIcon, Close as CloseIcon, Error as ErrorIcon, FindReplace as FindreplaceIcon, ArrowLeft as ArrowLeftIcon, Cached as CachedIcon, DirectionsRun as DirectionsRunIcon, Add as AddIcon, Polymer as PolymerIcon, FormatListNumbered as FormatListNumberedIcon, Create as CreateIcon, PlayArrow as PlayArrowIcon, AspectRatio as AspectRatioIcon, MoreVert as MoreVertIcon, Apps as AppsIcon, Schedule as ScheduleIcon, FavoriteBorder as FavoriteBorderIcon, Pause as PauseIcon, Delete as DeleteIcon, AddCircleOutline as AddCircleOutlineIcon, Save as SaveIcon, KeyboardArrowLeft as KeyboardArrowLeftIcon, KeyboardArrowRight as KeyboardArrowRightIcon, ArrowBack as ArrowBackIcon, Settings as SettingsIcon, LockOpen as LockOpenIcon, ExpandMore as ExpandMoreIcon, VpnKey as VpnKeyIcon} from '@material-ui/icons'; +import {OpenInNew as OpenInNewIcon,Undo as UndoIcon, FileCopy as FileCopyIcon, GetApp as GetAppIcon, Search as SearchIcon, ArrowUpward as ArrowUpwardIcon, Visibility as VisibilityIcon, Done as DoneIcon, Close as CloseIcon, Error as ErrorIcon, FindReplace as FindreplaceIcon, ArrowLeft as ArrowLeftIcon, Cached as CachedIcon, DirectionsRun as DirectionsRunIcon, Add as AddIcon, Polymer as PolymerIcon, FormatListNumbered as FormatListNumberedIcon, Create as CreateIcon, PlayArrow as PlayArrowIcon, AspectRatio as AspectRatioIcon, MoreVert as MoreVertIcon, Apps as AppsIcon, Schedule as ScheduleIcon, FavoriteBorder as FavoriteBorderIcon, Pause as PauseIcon, Delete as DeleteIcon, AddCircleOutline as AddCircleOutlineIcon, Save as SaveIcon, KeyboardArrowLeft as KeyboardArrowLeftIcon, KeyboardArrowRight as KeyboardArrowRightIcon, ArrowBack as ArrowBackIcon, Settings as SettingsIcon, LockOpen as LockOpenIcon, ExpandMore as ExpandMoreIcon, VpnKey as VpnKeyIcon} from '@material-ui/icons'; import * as cytoscape from 'cytoscape'; import * as edgehandles from 'cytoscape-edgehandles'; @@ -7864,7 +7864,8 @@ const AngularWorkflow = (props) => { if (triggers.length > 2) { if (data.action.app_name === "shuffle-subflow") { - actionimg = {"Shuffle + const parsedImage = triggers[1].large_image + actionimg = {"Shuffle } if (data.action.app_name === "User Input") { @@ -7872,8 +7873,40 @@ const AngularWorkflow = (props) => { } } + if (data.action.app_name === "Shuffle Tools") { + console.log("APP (TOOLS): ", data.action) + + const nodedata = cy.getElementById(data.action.id).data() + if (nodedata.fillstyle === "linear-gradient") { + console.log("LINEAR :D") + var imgStyle = { + marginRight: 20, + width: imgsize, + height: imgsize, + border: `2px solid ${statusColor}`, + borderRadius: executionData.start === data.action.id ? 25 : 5, + background: `linear-gradient(to right, ${nodedata.fillGradient})` + } + + console.log("STYLE: ", imgStyle) + + actionimg = {nodedata.label} + } + } + + if (validate.valid && typeof(validate.result) === "string") { validate.result = JSON.parse(validate.result) + } + + if (validate.valid && typeof(validate.result) === "object") { + if (validate.result.result !== undefined && validate.result.result !== null) { + try { + validate.result.result = JSON.parse(validate.result.result) + } catch (e) { + console.log("ERROR PARSING: ", e) + } + } } return ( @@ -7888,24 +7921,46 @@ const AngularWorkflow = (props) => { currentnode.removeClass('shuffle-hover-highlight') } }}> -
- { - setSelectedResult(data) - setCodeModalOpen(true) - }}> - - - - - {actionimg} -
-
{data.action.label}
-
- - {data.action.name} - +
+
+ { + setSelectedResult(data) + setCodeModalOpen(true) + }}> + + + + + {actionimg} +
+
{data.action.label}
+
+ + {data.action.name} + +
+ {data.action.app_name === "shuffle-subflow" && validate.result.success !== undefined && validate.result.success === true ? + + {validate.valid && data.action.parameters !== undefined && data.action.parameters !== null ? + data.action.parameters[0].value === props.match.params.key ? + { + getWorkflowExecution(props.match.params.key, validate.result.execution_id) + }}> + See sub-execution + + : + { + }}> + + + : + "TBD: Load subexecution result for" + } + + : null + }
@@ -7930,24 +7985,6 @@ const AngularWorkflow = (props) => { }} name={"Results for "+data.action.label} /> - {data.action.app_name === "shuffle-subflow" && validate.result.success !== undefined && validate.result.success === true ? - - {validate.valid && data.action.parameters !== undefined && data.action.parameters !== null ? - data.action.parameters[0].value === props.match.params.key ? - { - getWorkflowExecution(props.match.params.key, validate.result.execution_id) - }}> - See sub-execution - - : - { - }}>See subflow execution - : - "TBD: Load subexecution result for" - } - - : null - } :
diff --git a/functions/onprem/orborus/build.sh b/functions/onprem/orborus/build.sh index 61413801..8a35018c 100644 --- a/functions/onprem/orborus/build.sh +++ b/functions/onprem/orborus/build.sh @@ -1,5 +1,5 @@ NAME=shuffle-orborus -VERSION=0.8.97 +VERSION=0.8.98 echo "Running docker build with $NAME:$VERSION" #docker rmi frikky/shuffle:$NAME --force diff --git a/functions/onprem/orborus/orborus.go b/functions/onprem/orborus/orborus.go index 3df6657d..a3b28c4e 100644 --- a/functions/onprem/orborus/orborus.go +++ b/functions/onprem/orborus/orborus.go @@ -254,7 +254,7 @@ func initializeImages() { log.Printf("[WARNING] SHUFFLE_APP_SDK_VERSION not defined. Defaulting to %s", appSdkVersion) } if workerVersion == "" { - workerVersion = "nighty" + workerVersion = "nightly" log.Printf("[WARNING] SHUFFLE_WORKER_VERSION not defined. Defaulting to %s", workerVersion) } @@ -438,7 +438,6 @@ func main() { //log.Printf("Prerequest") //go getStats() newresp, err := client.Do(req) - executionCount := getRunningWorkers(ctx, workerTimeout) //log.Printf("Postrequest") if err != nil { log.Printf("[WARNING] Failed making request: %s", err) @@ -501,7 +500,8 @@ func main() { continue } - // Anything below here verifies concurrency virification + // Anything below here verifies concurrency + executionCount := getRunningWorkers(ctx, workerTimeout) if executionCount >= maxConcurrency { if zombiecounter*sleepTime > workerTimeout { go zombiecheck(ctx, workerTimeout) @@ -641,12 +641,17 @@ func getRunningWorkers(ctx context.Context, workerTimeout int) int { containers, err := dockercli.ContainerList(ctx, types.ContainerListOptions{ All: true, }) - //Filters: filters.Args{ - // map[string][]string{"ancestor": {":"}}, - //}, + // Automatically updates the version if err != nil { log.Printf("[ERROR] Error getting containers: %s", err) + + newVersionSplit := strings.Split(fmt.Sprintf("%s", err), "version is") + if len(newVersionSplit) > 1 { + dockerApiVersion = strings.TrimSpace(newVersionSplit[1]) + log.Printf("[INFO] Changed the API version to default to %s", dockerApiVersion) + } + return maxConcurrency } diff --git a/functions/onprem/worker/build.sh b/functions/onprem/worker/build.sh index 214ab948..c5fc2dbf 100644 --- a/functions/onprem/worker/build.sh +++ b/functions/onprem/worker/build.sh @@ -1,5 +1,5 @@ NAME=shuffle-worker -VERSION=0.8.97 +VERSION=0.8.99 echo "Running docker build with $NAME:$VERSION" #CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o worker.bin . diff --git a/functions/onprem/worker/go.mod b/functions/onprem/worker/go.mod index 6d099c67..82422869 100644 --- a/functions/onprem/worker/go.mod +++ b/functions/onprem/worker/go.mod @@ -12,7 +12,7 @@ require ( github.com/docker/docker v20.10.5+incompatible github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.4.0 // indirect - github.com/frikky/shuffle-shared v0.0.45 + github.com/frikky/shuffle-shared v0.0.55 github.com/fsouza/go-dockerclient v1.7.2 github.com/go-git/go-billy/v5 v5.3.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect