Built PoC of execution in workflow view (#23)

This commit is contained in:
frikky
2020-05-24 20:58:05 +02:00
parent 34d0416c2b
commit 7a4e9560a2
10 changed files with 158 additions and 50 deletions
+1
View File
@@ -4,6 +4,7 @@ docker rm shuffle-backend
docker rmi frikky/shuffle:backend docker rmi frikky/shuffle:backend
docker build . -t frikky/shuffle:backend docker build . -t frikky/shuffle:backend
docker push frikky/shuffle:backend
echo "Starting server" echo "Starting server"
#docker run -it \ #docker run -it \
+3 -6
View File
@@ -5248,12 +5248,9 @@ func handleSwaggerValidation(body []byte) (ParsedOpenApi, error) {
body = swaggerdata body = swaggerdata
} }
//parsed := ParsedOpenApi{} // Overwrite with new json data
if !isJson { _ = isJson
//yaml.l body = swaggerdata
log.Printf("Parsing from YAML to json!")
body = swaggerdata
}
// Parsing it to swagger 3 // Parsing it to swagger 3
parsed = ParsedOpenApi{ parsed = ParsedOpenApi{
+1 -1
View File
@@ -46,7 +46,7 @@ services:
- database - database
orborus: orborus:
#build: ./functions/onprem/orborus #build: ./functions/onprem/orborus
image: frikky/shuffle:orborus image: frikky/orborus:latest
container_name: shuffle-orborus container_name: shuffle-orborus
hostname: shuffle-orborus hostname: shuffle-orborus
networks: networks:
+9 -9
View File
@@ -1,17 +1,17 @@
#!/bin/sh #!/bin/sh
docker stop frikky/shuffle:frontend docker stop shuffle-frontend
docker rm frikky/shuffle:frontend docker rm shuffle-frontend
docker rmi frikky/shuffle:frontend docker rmi frikky/shuffle:frontend
echo "Running build for website" echo "Running build for website"
sudo npm run build #sudo npm run build
docker build . -t frikky/shuffle:frontend docker build . -t frikky/shuffle:frontend
echo "Starting server" echo "Starting server"
# Rerun build locally for it to update :) # Rerun build locally for it to update :)
docker run -it \ #docker run -it \
-p 3001:80 \ # -p 3001:80 \
-p 3002:443 \ # -p 3002:443 \
-v $(pwd)/build:/usr/share/nginx/html:ro \ # -v $(pwd)/build:/usr/share/nginx/html:ro \
--rm \ # --rm \
nginx # nginx
+101 -14
View File
@@ -3,7 +3,9 @@ import { useInterval } from 'react-powerhooks';
import uuid from "uuid"; import uuid from "uuid";
import {Link} from 'react-router-dom';
import TextField from '@material-ui/core/TextField'; import TextField from '@material-ui/core/TextField';
import Drawer from '@material-ui/core/Drawer';
import Button from '@material-ui/core/Button'; import Button from '@material-ui/core/Button';
import Paper from '@material-ui/core/Paper'; import Paper from '@material-ui/core/Paper';
import Grid from '@material-ui/core/Grid'; import Grid from '@material-ui/core/Grid';
@@ -23,7 +25,11 @@ import Input from '@material-ui/core/Input';
import FormGroup from '@material-ui/core/FormGroup'; import FormGroup from '@material-ui/core/FormGroup';
import FormControlLabel from '@material-ui/core/FormControlLabel'; import FormControlLabel from '@material-ui/core/FormControlLabel';
import Checkbox from '@material-ui/core/Checkbox'; import Checkbox from '@material-ui/core/Checkbox';
import Breadcrumbs from '@material-ui/core/Breadcrumbs';
import CircularProgress from '@material-ui/core/CircularProgress';
import ReactJson from 'react-json-view'
import PolymerIcon from '@material-ui/icons/Polymer';
import CreateIcon from '@material-ui/icons/Create'; import CreateIcon from '@material-ui/icons/Create';
import PlayArrowIcon from '@material-ui/icons/PlayArrow'; import PlayArrowIcon from '@material-ui/icons/PlayArrow';
import AspectRatioIcon from '@material-ui/icons/AspectRatio'; import AspectRatioIcon from '@material-ui/icons/AspectRatio';
@@ -111,6 +117,7 @@ const AngularWorkflow = (props) => {
const [workflowDone, setWorkflowDone] = React.useState(false) const [workflowDone, setWorkflowDone] = React.useState(false)
const [localFirstrequest, setLocalFirstrequest] = React.useState(true) const [localFirstrequest, setLocalFirstrequest] = React.useState(true)
const [requiresAuthentication, setRequiresAuthentication] = React.useState(true) const [requiresAuthentication, setRequiresAuthentication] = React.useState(true)
const [rightSideBarOpen, setRightSideBarOpen] = React.useState(false)
const [variableAnchorEl, setVariableAnchorEl] = React.useState(null) const [variableAnchorEl, setVariableAnchorEl] = React.useState(null)
@@ -148,6 +155,8 @@ const AngularWorkflow = (props) => {
const [, setExecutingNodes] = React.useState([]) const [, setExecutingNodes] = React.useState([])
const [executionRunning, setExecutionRunning] = React.useState(false) const [executionRunning, setExecutionRunning] = React.useState(false)
const [executionModalOpen, setExecutionModalOpen] = React.useState(true)
const [executionData, setExecutionData] = React.useState({})
const [lastSaved, setLastSaved] = React.useState(true) const [lastSaved, setLastSaved] = React.useState(true)
@@ -269,6 +278,11 @@ const AngularWorkflow = (props) => {
//console.log(responseJson) //console.log(responseJson)
// Loop nodes and find results // Loop nodes and find results
// Update on every interval? idk // Update on every interval? idk
if (JSON.stringify(responseJson) !== JSON.stringify(executionData)) {
console.log("Executiondata: ", responseJson)
setExecutionData(responseJson)
}
if (responseJson.execution_id !== executionRequest.execution_id) { if (responseJson.execution_id !== executionRequest.execution_id) {
cy.elements().removeClass('success-highlight failure-highlight executing-highlight') cy.elements().removeClass('success-highlight failure-highlight executing-highlight')
return return
@@ -640,6 +654,8 @@ const AngularWorkflow = (props) => {
"authorization": responseJson.authorization, "authorization": responseJson.authorization,
}) })
setExecutingNodes([workflow.start]) setExecutingNodes([workflow.start])
setExecutionData({})
setExecutionModalOpen(true)
start() start()
}) })
.catch(error => { .catch(error => {
@@ -792,7 +808,8 @@ const AngularWorkflow = (props) => {
//setSelectedTriggerIndex(-1) //setSelectedTriggerIndex(-1)
//setTriggerFolders([]) //setTriggerFolders([])
//setLocalFirstrequest(true) // Can be used for right side view
setRightSideBarOpen(false)
console.timeEnd("UNSELECT") console.timeEnd("UNSELECT")
} }
@@ -2520,10 +2537,10 @@ const AngularWorkflow = (props) => {
const appApiView = Object.getOwnPropertyNames(selectedAction).length > 0 && Object.getOwnPropertyNames(selectedApp).length > 0 ? const appApiView = Object.getOwnPropertyNames(selectedAction).length > 0 && Object.getOwnPropertyNames(selectedApp).length > 0 ?
<div style={appApiViewStyle}> <div style={appApiViewStyle}>
<div style={{display: "flex", height: "40px", marginBottom: 30}}> <div style={{display: "flex", height: 40, marginBottom: 30}}>
<div style={{flex: "1"}}> <div style={{flex: "1"}}>
<h3 style={{marginBottom: "5px"}}>{selectedAction.app_name}</h3> <h3 style={{marginBottom: "5px"}}>{selectedAction.app_name}</h3>
<a href="/docs/apps" style={{textDecoration: "none", color: "#f85a3e"}}>What are apps?</a> <Link to="/docs/apps" style={{textDecoration: "none", color: "#f85a3e"}}>What are apps?</Link>
</div> </div>
<div style={{flex: "1"}}> <div style={{flex: "1"}}>
<Button disabled={selectedAction.id === workflow.start} style={{zIndex: 5000, marginTop: "15px",}} color="primary" variant="outlined" onClick={(e) => { <Button disabled={selectedAction.id === workflow.start} style={{zIndex: 5000, marginTop: "15px",}} color="primary" variant="outlined" onClick={(e) => {
@@ -2635,7 +2652,7 @@ const AngularWorkflow = (props) => {
: null : null
const headerSize = 74 const headerSize = 68
const rightsidebarStyle = { const rightsidebarStyle = {
position: "fixed", position: "fixed",
right: 0, right: 0,
@@ -3248,7 +3265,7 @@ const AngularWorkflow = (props) => {
<div style={{display: "flex", height: "40px", marginBottom: "30px"}}> <div style={{display: "flex", height: "40px", marginBottom: "30px"}}>
<div style={{flex: "1"}}> <div style={{flex: "1"}}>
<h3 style={{marginBottom: "5px"}} >Branch: Conditions - {selectedEdgeIndex}</h3> <h3 style={{marginBottom: "5px"}} >Branch: Conditions - {selectedEdgeIndex}</h3>
<a href="/docs/conditions" style={{textDecoration: "none", color: "#f85a3e"}}>What are conditions?</a> <Link to="/docs/conditions" style={{textDecoration: "none", color: "#f85a3e"}}>What are conditions?</Link>
</div> </div>
</div> </div>
<Divider style={{marginBottom: "10px", marginTop: "10px", height: "1px", width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/> <Divider style={{marginBottom: "10px", marginTop: "10px", height: "1px", width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/>
@@ -3478,7 +3495,7 @@ const AngularWorkflow = (props) => {
<div style={{display: "flex", height: "40px", marginBottom: "30px"}}> <div style={{display: "flex", height: "40px", marginBottom: "30px"}}>
<div style={{flex: "1"}}> <div style={{flex: "1"}}>
<h3 style={{marginBottom: "5px"}}>{selectedTrigger.app_name}: {selectedTrigger.status}</h3> <h3 style={{marginBottom: "5px"}}>{selectedTrigger.app_name}: {selectedTrigger.status}</h3>
<a href="/docs/webhooks" style={{textDecoration: "none", color: "#f85a3e"}}>What are webhooks?</a> <Link to="/docs/triggers#webhook" style={{textDecoration: "none", color: "#f85a3e"}}>What are webhooks?</Link>
</div> </div>
</div> </div>
<Divider style={{marginBottom: "10px", marginTop: "10px", height: "1px", width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/> <Divider style={{marginBottom: "10px", marginTop: "10px", height: "1px", width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/>
@@ -3564,7 +3581,7 @@ const AngularWorkflow = (props) => {
<div style={{display: "flex", height: "40px", marginBottom: "30px"}}> <div style={{display: "flex", height: "40px", marginBottom: "30px"}}>
<div style={{flex: "1"}}> <div style={{flex: "1"}}>
<h3 style={{marginBottom: "5px"}}>{selectedTrigger.app_name}: {selectedTrigger.status}</h3> <h3 style={{marginBottom: "5px"}}>{selectedTrigger.app_name}: {selectedTrigger.status}</h3>
<a href="/docs/webhooks" style={{textDecoration: "none", color: "#f85a3e"}}>What are webhooks?</a> <Link to="/docs/triggers#webhook" style={{textDecoration: "none", color: "#f85a3e"}}>What are webhooks?</Link>
</div> </div>
</div> </div>
<Divider style={{marginBottom: "10px", marginTop: "10px", height: "1px", width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/> <Divider style={{marginBottom: "10px", marginTop: "10px", height: "1px", width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/>
@@ -3914,7 +3931,7 @@ const AngularWorkflow = (props) => {
<div style={{display: "flex", height: "40px", marginBottom: "30px"}}> <div style={{display: "flex", height: "40px", marginBottom: "30px"}}>
<div style={{flex: "1"}}> <div style={{flex: "1"}}>
<h3 style={{marginBottom: "5px"}}>{selectedTrigger.app_name}: {selectedTrigger.status}</h3> <h3 style={{marginBottom: "5px"}}>{selectedTrigger.app_name}: {selectedTrigger.status}</h3>
<a href="/docs/schedules" style={{textDecoration: "none", color: "#f85a3e"}}>What are schedules?</a> <Link to="/docs/triggers#schedule" style={{textDecoration: "none", color: "#f85a3e"}}>What are schedules?</Link>
</div> </div>
</div> </div>
<Divider style={{marginBottom: "10px", marginTop: "10px", height: "1px", width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/> <Divider style={{marginBottom: "10px", marginTop: "10px", height: "1px", width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/>
@@ -4043,7 +4060,7 @@ const AngularWorkflow = (props) => {
<div style={{display: "flex", height: "40px", marginBottom: "30px"}}> <div style={{display: "flex", height: "40px", marginBottom: "30px"}}>
<div style={{flex: "1"}}> <div style={{flex: "1"}}>
<h3 style={{marginBottom: "5px"}}>{selectedTrigger.app_name}: {selectedTrigger.status}</h3> <h3 style={{marginBottom: "5px"}}>{selectedTrigger.app_name}: {selectedTrigger.status}</h3>
<a href="/docs/schedules" style={{textDecoration: "none", color: "#f85a3e"}}>What are schedules?</a> <Link to="/docs/triggers#schedule" style={{textDecoration: "none", color: "#f85a3e"}}>What are schedules?</Link>
</div> </div>
</div> </div>
<Divider style={{marginBottom: "10px", marginTop: "10px", height: "1px", width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/> <Divider style={{marginBottom: "10px", marginTop: "10px", height: "1px", width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/>
@@ -4195,7 +4212,17 @@ const AngularWorkflow = (props) => {
return ( return (
<div style={topBarStyle}> <div style={topBarStyle}>
<div style={{margin: 10}}> <div style={{margin: 10}}>
<h3>Editing workflow {workflow.name}</h3> <Breadcrumbs aria-label="breadcrumb" separator="" style={{color: "white",}}>
<Link to="/workflows" style={{textDecoration: "none", color: "inherit",}}>
<h2 style={{color: "rgba(255,255,255,0.5)"}}>
<PolymerIcon style={{marginRight: 10}} />
Workflows
</h2>
</Link>
<h2>
{workflow.name}
</h2>
</Breadcrumbs>
</div> </div>
</div> </div>
) )
@@ -4219,7 +4246,7 @@ const AngularWorkflow = (props) => {
const BottomCytoscapeBar = () => { const BottomCytoscapeBar = () => {
const boxSize = 100 const boxSize = 100
const executionButton = executionRunning ? const executionButton = executionRunning ?
<Tooltip color="primary" title="Stop running workflow (ctrl+a)" placement="top"> <Tooltip color="primary" title="Stop execution" placement="top">
<Button style={{height: boxSize, width: boxSize}} color="secondary" variant="contained" onClick={() => { <Button style={{height: boxSize, width: boxSize}} color="secondary" variant="contained" onClick={() => {
abortExecution() abortExecution()
}}> }}>
@@ -4227,7 +4254,7 @@ const AngularWorkflow = (props) => {
</Button> </Button>
</Tooltip> </Tooltip>
: :
<Tooltip color="primary" title="Execute workflow once (ctrl+a)" placement="top"> <Tooltip color="primary" title="Test execution" placement="top">
<Button disabled={executionRequestStarted} style={{height: boxSize, width: boxSize}} color="primary" variant="contained" onClick={() => { <Button disabled={executionRequestStarted} style={{height: boxSize, width: boxSize}} color="primary" variant="contained" onClick={() => {
executeWorkflow() executeWorkflow()
}}> }}>
@@ -4281,6 +4308,7 @@ const AngularWorkflow = (props) => {
const RightSideBar = () => { const RightSideBar = () => {
setLastSaved(false) setLastSaved(false)
if (Object.getOwnPropertyNames(selectedAction).length > 0 && Object.getOwnPropertyNames(selectedApp).length > 0) { if (Object.getOwnPropertyNames(selectedAction).length > 0 && Object.getOwnPropertyNames(selectedApp).length > 0) {
setRightSideBarOpen(true)
//console.time('ACTIONSTART'); //console.time('ACTIONSTART');
return( return(
<div style={rightsidebarStyle}> <div style={rightsidebarStyle}>
@@ -4289,6 +4317,7 @@ const AngularWorkflow = (props) => {
) )
} else if (Object.getOwnPropertyNames(selectedTrigger).length > 0) { } else if (Object.getOwnPropertyNames(selectedTrigger).length > 0) {
if (selectedTrigger.trigger_type === "SCHEDULE") { if (selectedTrigger.trigger_type === "SCHEDULE") {
setRightSideBarOpen(true)
console.log("SCHEDULE") console.log("SCHEDULE")
return( return(
<div style={rightsidebarStyle}> <div style={rightsidebarStyle}>
@@ -4296,6 +4325,7 @@ const AngularWorkflow = (props) => {
</div> </div>
) )
} else if (selectedTrigger.trigger_type === "WEBHOOK") { } else if (selectedTrigger.trigger_type === "WEBHOOK") {
setRightSideBarOpen(true)
console.log("WEBHOOK") console.log("WEBHOOK")
return( return(
<div style={rightsidebarStyle}> <div style={rightsidebarStyle}>
@@ -4303,6 +4333,7 @@ const AngularWorkflow = (props) => {
</div> </div>
) )
} else if (selectedTrigger.trigger_type === "EMAIL") { } else if (selectedTrigger.trigger_type === "EMAIL") {
setRightSideBarOpen(true)
console.log("EMAIL") console.log("EMAIL")
return( return(
<div style={rightsidebarStyle}> <div style={rightsidebarStyle}>
@@ -4310,6 +4341,7 @@ const AngularWorkflow = (props) => {
</div> </div>
) )
} else if (selectedTrigger.trigger_type === "USERINPUT") { } else if (selectedTrigger.trigger_type === "USERINPUT") {
setRightSideBarOpen(true)
console.log("USER INPUT SIDEBAR") console.log("USER INPUT SIDEBAR")
return( return(
<div style={rightsidebarStyle}> <div style={rightsidebarStyle}>
@@ -4323,6 +4355,7 @@ const AngularWorkflow = (props) => {
return null return null
} }
} else if (Object.getOwnPropertyNames(selectedEdge).length > 0) { } else if (Object.getOwnPropertyNames(selectedEdge).length > 0) {
setRightSideBarOpen(true)
return( return(
<div style={rightsidebarStyle}> <div style={rightsidebarStyle}>
<EdgeSidebar /> <EdgeSidebar />
@@ -4356,6 +4389,59 @@ const AngularWorkflow = (props) => {
</div> </div>
</div> </div>
const ExecutionModal = () => {
return (
<Drawer anchor={"right"} open={executionModalOpen} onClose={() => setExecutionModalOpen(false)}>
<div style={{padding: 20, maxWidth: 250, minWidth: 250,}}>
<h2>Executing Workflow</h2>
<Divider />
<h3>Execution Argument: </h3>{executionText}
{executionData.status !== undefined && executionData.status.length > 0 ?
<div>
<h3>Status: </h3>{executionData.status}
</div>
: null
}
<h3>Results: </h3>
{executionData.results === undefined || executionData.results === null || executionData.results.length === 0 ?
<CircularProgress />
:
executionData.results.map(data => {
var showResult = data.result.trim()
showResult.split(" None").join(" \"None\"")
//showResult = replaceAll(showResult, " None", " \"None\"");
var jsonvalid = true
try {
JSON.parse(showResult)
} catch (e) {
jsonvalid = false
}
return (
<div style={{margin: 10, border: "1px solid rgba(0,0,0,0.5)"}}>
<div style={{width: 17, height: 17, borderRadius: 17 / 2, backgroundColor: "#f85a3e", marginRight: 10}}/>
<b>Name:</b> {data.action.label}<div/>
<b>Status:</b> {data.status}<div/>
<b>Result:</b>&nbsp;
{jsonvalid ? <ReactJson
src={JSON.parse(showResult)}
theme="solarized"
collapsed={false}
displayDataTypes={false}
name={"Results for "+data.action.label}
/>
:
data.result
}
</div>
)
})
}
</div>
</Drawer>
)
}
const newView = isLoggedIn ? const newView = isLoggedIn ?
<div style={{color: "white"}}> <div style={{color: "white"}}>
<div style={{display: "flex", borderTop: "1px solid rgba(91, 96, 100, 1)"}}> <div style={{display: "flex", borderTop: "1px solid rgba(91, 96, 100, 1)"}}>
@@ -4373,6 +4459,7 @@ const AngularWorkflow = (props) => {
}} }}
/> />
</div> </div>
<ExecutionModal />
<RightSideBar /> <RightSideBar />
<BottomCytoscapeBar /> <BottomCytoscapeBar />
<TopCytoscapeBar /> <TopCytoscapeBar />
@@ -4383,7 +4470,7 @@ const AngularWorkflow = (props) => {
<div style={{color: "white"}}> <div style={{color: "white"}}>
TMP FOR NOT LOGGED IN TMP FOR NOT LOGGED IN
</div> </div>
const variablesModal = variablesModalOpen ? const variablesModal = variablesModalOpen ?
<Dialog modal <Dialog modal
open={variablesModalOpen} open={variablesModalOpen}
@@ -4598,7 +4685,7 @@ const AngularWorkflow = (props) => {
> >
<DialogTitle><div style={{color: "white"}}>Authentication for {selectedApp.name}</div></DialogTitle> <DialogTitle><div style={{color: "white"}}>Authentication for {selectedApp.name}</div></DialogTitle>
<DialogContent> <DialogContent>
<a href="/docs/apps#authentication" style={{textDecoration: "none", color: "#f85a3e"}}>What is this?</a> <Link to="/docs/apps#authentication" style={{textDecoration: "none", color: "#f85a3e"}}>What is this?</Link>
<div /> <div />
{selectedApp.link.length > 0 ? <EndpointData /> : null} {selectedApp.link.length > 0 ? <EndpointData /> : null}
<div style={{marginTop: 15, marginBottom: 15, }}/> <div style={{marginTop: 15, marginBottom: 15, }}/>
+5 -5
View File
@@ -32,7 +32,7 @@ import DialogContent from '@material-ui/core/DialogContent';
const surfaceColor = "#27292D" const surfaceColor = "#27292D"
const Workflows = (props) => { const Workflows = (props) => {
const { globalUrl, isLoggedIn, isLoaded, } = props; const { globalUrl, isLoggedIn, isLoaded, } = props;
document.title = "Shuffle - Workflows" document.title = "Shuffle - Workflows"
const alert = useAlert() const alert = useAlert()
@@ -158,7 +158,7 @@ const Workflows = (props) => {
const getWorkflowExecution = (id) => { const getWorkflowExecution = (id) => {
fetch(globalUrl+"/api/v1/workflows/"+id+"/executions", { fetch(globalUrl+"/api/v1/workflows/"+id+"/executions", {
method: 'GET', method: 'GET',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
@@ -186,7 +186,7 @@ const Workflows = (props) => {
const abortExecution = (workflowid, executionid) => { const abortExecution = (workflowid, executionid) => {
alert.success("Aborting execution") alert.success("Aborting execution")
fetch(globalUrl+"/api/v1/workflows/"+workflowid+"/executions/"+executionid+"/abort", { fetch(globalUrl+"/api/v1/workflows/"+workflowid+"/executions/"+executionid+"/abort", {
method: 'GET', method: 'GET',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
@@ -210,7 +210,7 @@ const Workflows = (props) => {
alert.show("Executing workflow "+id) alert.show("Executing workflow "+id)
setTrackingId(id) setTrackingId(id)
fetch(globalUrl+"/api/v1/workflows/"+id+"/execute", { fetch(globalUrl+"/api/v1/workflows/"+id+"/execute", {
method: 'GET', method: 'GET',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
@@ -290,7 +290,7 @@ const Workflows = (props) => {
const deleteWorkflow = (id) => { const deleteWorkflow = (id) => {
alert.success("Deleted workflow "+id) alert.success("Deleted workflow "+id)
fetch(globalUrl+"/api/v1/workflows/"+id, { fetch(globalUrl+"/api/v1/workflows/"+id, {
method: 'DELETE', method: 'DELETE',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
+8 -3
View File
@@ -1,4 +1,9 @@
docker rmi frikky/shuffle:orborus --force NAME=orborus
VERSION=0.1.0
docker build . -t frikky/shuffle:orborus echo "Running docker build with $NAME:$VERSION"
docker push frikky/shuffle:orborus #docker rmi frikky/shuffle:$NAME --force
docker build . -t frikky/shuffle:$NAME -t docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION -t frikky/$NAME:$VERSION
docker push frikky/$NAME:$VERSION
#docker push docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION
+8 -1
View File
@@ -146,6 +146,9 @@ func initializeImages(dockercli *dockerclient.Client) {
ctx := context.Background() ctx := context.Background()
// check whether theyre the same first // check whether theyre the same first
//version := "0.1.0"
// fmt.Sprintf("docker.pkg.github.com/frikky/shuffle/orborus:%s", version),
// fmt.Sprintf("docker.pkg.github.com/frikky/shuffle/worker:%s", version),
images := []string{ images := []string{
fmt.Sprintf("docker.io/%s:app_sdk", baseimagename), fmt.Sprintf("docker.io/%s:app_sdk", baseimagename),
fmt.Sprintf("docker.io/%s:worker", baseimagename), fmt.Sprintf("docker.io/%s:worker", baseimagename),
@@ -155,7 +158,7 @@ func initializeImages(dockercli *dockerclient.Client) {
for _, image := range images { for _, image := range images {
reader, err := dockercli.ImagePull(ctx, image, pullOptions) reader, err := dockercli.ImagePull(ctx, image, pullOptions)
if err != nil { if err != nil {
log.Printf("Failed getting %s", image) log.Printf("Failed getting %s: %s", image, err)
continue continue
} }
@@ -197,6 +200,10 @@ func main() {
log.Printf("--- Setting up Docker environment. Downloading worker and App SDK! ---") log.Printf("--- Setting up Docker environment. Downloading worker and App SDK! ---")
initializeImages(dockercli) initializeImages(dockercli)
//workerName := "worker"
//workerVersion := "0.1.0"
//workerImage := fmt.Sprintf("docker.pkg.github.com/frikky/shuffle/%s:%s", workerName, workerVersion)
workerImage := fmt.Sprintf("%s:worker", baseimagename) workerImage := fmt.Sprintf("%s:worker", baseimagename)
log.Printf("--- Finished configuring docker environment ---\n") log.Printf("--- Finished configuring docker environment ---\n")
+11
View File
@@ -0,0 +1,11 @@
NAME=worker
VERSION=0.1.0
echo "Running docker build with $NAME:$VERSION"
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o worker.bin .
docker build . -t frikky/shuffle:$NAME -t docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION -t frikky/$NAME:$VERSION
# Push both for now..
docker push frikky/$NAME:$VERSION
docker push frikky/shuffle:$NAME
#docker push docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION
+11 -11
View File
@@ -1,15 +1,15 @@
echo "Compiling program" echo "Compiling program"
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o worker.bin . #CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o worker.bin .
echo "Fixing docker env" echo "Fixing docker env"
docker rmi frikky/shuffle:worker --force #docker rmi frikky/shuffle:worker --force
docker build . -t frikky/shuffle:worker #docker build . -t frikky/shuffle:worker
docker push frikky/shuffle:worker #docker push frikky/shuffle:worker
#docker run \ docker run \
# --env "AUTHORIZATION=ASD" \ --env "AUTHORIZATION=ASD" \
# --env "DOCKER_API_VERSION=1.39" \ --env "DOCKER_API_VERSION=1.39" \
# --env "EXECUTIONID=ASD" \ --env "EXECUTIONID=ASD" \
# --env "BASE_URI=$BASE_URI" \ --env "BASE_URI=$BASE_URI" \
# -v /var/run/docker.sock:/var/run/docker.sock \ -v /var/run/docker.sock:/var/run/docker.sock \
# frikky/shuffle:worker frikky/shuffle:worker