Fixed execution colors for shuffle tools
This commit is contained in:
@@ -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.")
|
||||
|
||||
+2
-2
@@ -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}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 = <img alt={"Shuffle Subflow"} src={triggers[1].large_image} style={{marginRight: 20, width: imgsize, height: imgsize, border: `2px solid ${statusColor}`, borderRadius: executionData.start === data.action.id ? 25 : 5}} />
|
||||
const parsedImage = triggers[1].large_image
|
||||
actionimg = <img alt={"Shuffle Subflow"} src={parsedImage} style={{marginRight: 20, width: imgsize, height: imgsize, border: `2px solid ${statusColor}`, borderRadius: executionData.start === data.action.id ? 25 : 5}} />
|
||||
}
|
||||
|
||||
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 = <img alt={nodedata.label} src={nodedata.large_image} style={imgStyle} />
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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')
|
||||
}
|
||||
}}>
|
||||
<div style={{display: "flex", marginBottom: 15,}}>
|
||||
<IconButton style={{marginTop: "auto", marginBottom: "auto", height: 30, paddingLeft: 0, width: 30}} onClick={() => {
|
||||
setSelectedResult(data)
|
||||
setCodeModalOpen(true)
|
||||
}}>
|
||||
<Tooltip color="primary" title="Expand result window" placement="top">
|
||||
<ArrowLeftIcon style={{color: "white"}}/>
|
||||
</Tooltip>
|
||||
</IconButton>
|
||||
{actionimg}
|
||||
<div>
|
||||
<div style={{fontSize: 24, marginTop: "auto", marginBottom: "auto"}}><b>{data.action.label}</b></div>
|
||||
<div style={{fontSize: 14}}>
|
||||
<Typography variant="body2" color="textSecondary">
|
||||
{data.action.name}
|
||||
</Typography>
|
||||
<div style={{display: "flex", }}>
|
||||
<div style={{display: "flex", marginBottom: 15,}}>
|
||||
<IconButton style={{marginTop: "auto", marginBottom: "auto", height: 30, paddingLeft: 0, width: 30}} onClick={() => {
|
||||
setSelectedResult(data)
|
||||
setCodeModalOpen(true)
|
||||
}}>
|
||||
<Tooltip color="primary" title="Expand result window" placement="top">
|
||||
<ArrowLeftIcon style={{color: "white"}}/>
|
||||
</Tooltip>
|
||||
</IconButton>
|
||||
{actionimg}
|
||||
<div>
|
||||
<div style={{fontSize: 24, marginTop: "auto", marginBottom: "auto"}}><b>{data.action.label}</b></div>
|
||||
<div style={{fontSize: 14}}>
|
||||
<Typography variant="body2" color="textSecondary">
|
||||
{data.action.name}
|
||||
</Typography>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{data.action.app_name === "shuffle-subflow" && validate.result.success !== undefined && validate.result.success === true ?
|
||||
<span style={{flex: 10, float: "right", textAlign: "right",}}>
|
||||
{validate.valid && data.action.parameters !== undefined && data.action.parameters !== null ?
|
||||
data.action.parameters[0].value === props.match.params.key ?
|
||||
<span style={{cursor: "pointer", color: "#f85a3e"}} onClick={(event) => {
|
||||
getWorkflowExecution(props.match.params.key, validate.result.execution_id)
|
||||
}}>
|
||||
See sub-execution
|
||||
</span>
|
||||
:
|
||||
<a rel="norefferer" href={`/workflows/${data.action.parameters[0].value}?view=executions&execution_id=${validate.result.execution_id}`} target="_blank" style={{textDecoration: "none", color: "#f85a3e"}} onClick={(event) => {
|
||||
}}>
|
||||
<OpenInNewIcon />
|
||||
</a>
|
||||
:
|
||||
"TBD: Load subexecution result for"
|
||||
}
|
||||
</span>
|
||||
: null
|
||||
}
|
||||
</div>
|
||||
<div style={{marginBottom: 5, display: "flex",}}>
|
||||
<Typography variant="body1">
|
||||
@@ -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 ?
|
||||
<span>
|
||||
{validate.valid && data.action.parameters !== undefined && data.action.parameters !== null ?
|
||||
data.action.parameters[0].value === props.match.params.key ?
|
||||
<span style={{cursor: "pointer", color: "#f85a3e"}} onClick={(event) => {
|
||||
getWorkflowExecution(props.match.params.key, validate.result.execution_id)
|
||||
}}>
|
||||
See sub-execution
|
||||
</span>
|
||||
:
|
||||
<a rel="norefferer" href={`/workflows/${data.action.parameters[0].value}?view=executions&execution_id=${validate.result.execution_id}`} target="_blank" style={{textDecoration: "none", color: "#f85a3e"}} onClick={(event) => {
|
||||
}}>See subflow execution</a>
|
||||
:
|
||||
"TBD: Load subexecution result for"
|
||||
}
|
||||
</span>
|
||||
: null
|
||||
}
|
||||
</span>
|
||||
:
|
||||
<div style={{maxHeight: 250, overflowX: "hidden", overflowY: "auto", whiteSpace: "pre-wrap", }}>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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": {"<imagename>:<version>"}},
|
||||
//},
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
|
||||
@@ -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 .
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user