Fixed hotloading app comparison overwrites

This commit is contained in:
frikky
2021-06-14 02:08:05 +02:00
parent d19eb5fcaa
commit fde84958ee
7 changed files with 29 additions and 26 deletions
+1 -2
View File
@@ -22,9 +22,8 @@ require (
github.com/docker/go-units v0.4.0 // indirect github.com/docker/go-units v0.4.0 // indirect
github.com/elastic/go-elasticsearch v0.0.0 // indirect github.com/elastic/go-elasticsearch v0.0.0 // indirect
github.com/elastic/go-elasticsearch/v7 v7.12.0 // indirect github.com/elastic/go-elasticsearch/v7 v7.12.0 // indirect
github.com/elastic/go-elasticsearch/v8 v8.0.0-20210519083322-55daf7425ecb // indirect
github.com/frikky/kin-openapi v0.39.0 github.com/frikky/kin-openapi v0.39.0
github.com/frikky/shuffle-shared v0.0.61 github.com/frikky/shuffle-shared v0.0.62
github.com/fsouza/go-dockerclient v1.7.2 // indirect github.com/fsouza/go-dockerclient v1.7.2 // indirect
github.com/ghodss/yaml v1.0.0 github.com/ghodss/yaml v1.0.0
github.com/go-git/go-billy/v5 v5.0.0 github.com/go-git/go-billy/v5 v5.0.0
+4
View File
@@ -115,6 +115,8 @@ github.com/elastic/go-elasticsearch/v7 v7.12.0 h1:j4tvcMrZJLp39L2NYvBb7f+lHKPqPH
github.com/elastic/go-elasticsearch/v7 v7.12.0/go.mod h1:OJ4wdbtDNk5g503kvlHLyErCgQwwzmDtaFC4XyOxXA4= github.com/elastic/go-elasticsearch/v7 v7.12.0/go.mod h1:OJ4wdbtDNk5g503kvlHLyErCgQwwzmDtaFC4XyOxXA4=
github.com/elastic/go-elasticsearch/v8 v8.0.0-20210519083322-55daf7425ecb h1:svC8T5+v+aWpWiTt3nsGfpdqVb4NIWK/WamGXXECBXA= github.com/elastic/go-elasticsearch/v8 v8.0.0-20210519083322-55daf7425ecb h1:svC8T5+v+aWpWiTt3nsGfpdqVb4NIWK/WamGXXECBXA=
github.com/elastic/go-elasticsearch/v8 v8.0.0-20210519083322-55daf7425ecb/go.mod h1:xe9a/L2aeOgFKKgrO3ibQTnMdpAeL0GC+5/HpGScSa4= github.com/elastic/go-elasticsearch/v8 v8.0.0-20210519083322-55daf7425ecb/go.mod h1:xe9a/L2aeOgFKKgrO3ibQTnMdpAeL0GC+5/HpGScSa4=
github.com/elastic/go-elasticsearch/v8 v8.0.0-20210608143047-aa1301e7ba9d h1:id0CyeIuvJ9hzYhLlKsXHQ10d/k4G+CexAu53Pl3hf4=
github.com/elastic/go-elasticsearch/v8 v8.0.0-20210608143047-aa1301e7ba9d/go.mod h1:xe9a/L2aeOgFKKgrO3ibQTnMdpAeL0GC+5/HpGScSa4=
github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
@@ -173,6 +175,8 @@ github.com/frikky/shuffle-shared v0.0.57 h1:YDlOVjg8bUBcinehcmorxzOoV5O55oUfG8q7
github.com/frikky/shuffle-shared v0.0.57/go.mod h1:BknTfpun3qte5bumR3OqQHf9XWPIsyj8woiXCjIlbBc= github.com/frikky/shuffle-shared v0.0.57/go.mod h1:BknTfpun3qte5bumR3OqQHf9XWPIsyj8woiXCjIlbBc=
github.com/frikky/shuffle-shared v0.0.60 h1:o6/QLsu3Rbjr4+BQWs9DF4B5qZCg0gPpZWPYXmjVWqM= github.com/frikky/shuffle-shared v0.0.60 h1:o6/QLsu3Rbjr4+BQWs9DF4B5qZCg0gPpZWPYXmjVWqM=
github.com/frikky/shuffle-shared v0.0.60/go.mod h1:BknTfpun3qte5bumR3OqQHf9XWPIsyj8woiXCjIlbBc= github.com/frikky/shuffle-shared v0.0.60/go.mod h1:BknTfpun3qte5bumR3OqQHf9XWPIsyj8woiXCjIlbBc=
github.com/frikky/shuffle-shared v0.0.62 h1:1M8y7rX8nQW7072+bUD4vgHcf65AG0kJ8m3ihmY2bPQ=
github.com/frikky/shuffle-shared v0.0.62/go.mod h1:BknTfpun3qte5bumR3OqQHf9XWPIsyj8woiXCjIlbBc=
github.com/fsouza/go-dockerclient v1.7.2 h1:bBEAcqLTkpq205jooP5RVroUKiVEWgGecHyeZc4OFjo= github.com/fsouza/go-dockerclient v1.7.2 h1:bBEAcqLTkpq205jooP5RVroUKiVEWgGecHyeZc4OFjo=
github.com/fsouza/go-dockerclient v1.7.2/go.mod h1:+ugtMCVRwnPfY7d8/baCzZ3uwB0BrG5DB8OzbtxaRz8= github.com/fsouza/go-dockerclient v1.7.2/go.mod h1:+ugtMCVRwnPfY7d8/baCzZ3uwB0BrG5DB8OzbtxaRz8=
github.com/getkin/kin-openapi v0.8.0 h1:a6TQjTqwkyscC4/hShJX7WhCVE+4bi9lzw61XHQW5hE= github.com/getkin/kin-openapi v0.8.0 h1:a6TQjTqwkyscC4/hShJX7WhCVE+4bi9lzw61XHQW5hE=
+1 -3
View File
@@ -3881,9 +3881,7 @@ func runInitEs(ctx context.Context) {
// Add all users to it // Add all users to it
if len(activeOrgs) == 1 { if len(activeOrgs) == 1 {
setUsers = true setUsers = true
} } else if len(activeOrgs) == 0 {
if len(activeOrgs) == 0 {
log.Printf(`[DEBUG] No orgs. Setting NEW org "default"`) log.Printf(`[DEBUG] No orgs. Setting NEW org "default"`)
runInitCloudSetup() runInitCloudSetup()
+8 -8
View File
@@ -3001,9 +3001,9 @@ func handleAppHotloadRequest(resp http.ResponseWriter, request *http.Request) {
} }
ctx := context.Background() ctx := context.Background()
cacheKey := fmt.Sprintf("workflowapps-sorted-100") cacheKey := fmt.Sprintf("workflowapps-sorted-500")
shuffle.DeleteCache(ctx, cacheKey) shuffle.DeleteCache(ctx, cacheKey)
cacheKey = fmt.Sprintf("workflowapps-sorted-500") cacheKey = fmt.Sprintf("workflowapps-sorted-0")
shuffle.DeleteCache(ctx, cacheKey) shuffle.DeleteCache(ctx, cacheKey)
// Just need to be logged in // Just need to be logged in
@@ -3535,20 +3535,20 @@ func iterateAppGithubFolders(fs billy.Filesystem, dir []os.FileInfo, extra strin
appPython := fmt.Sprintf("%s/src/app.py", extra) appPython := fmt.Sprintf("%s/src/app.py", extra)
appPythonReader, err := fs.Open(appPython) appPythonReader, err := fs.Open(appPython)
if err != nil { if err != nil {
log.Printf("Failed to read %s", appPython) log.Printf("Failed to read python app %s", appPython)
continue continue
} }
appPythonData, err := ioutil.ReadAll(appPythonReader) appPythonData, err := ioutil.ReadAll(appPythonReader)
if err != nil { if err != nil {
log.Printf("Failed reading %s: %s", appPython, err) log.Printf("Failed reading appdata %s: %s", appPython, err)
continue continue
} }
dockerFp := fmt.Sprintf("%s/Dockerfile", extra) dockerFp := fmt.Sprintf("%s/Dockerfile", extra)
dockerfile, err := fs.Open(dockerFp) dockerfile, err := fs.Open(dockerFp)
if err != nil { if err != nil {
log.Printf("Failed to read %s", appPython) log.Printf("Failed to read dockerfil %s", appPython)
continue continue
} }
@@ -3580,9 +3580,9 @@ func iterateAppGithubFolders(fs billy.Filesystem, dir []os.FileInfo, extra strin
} }
if len(allapps) == 0 { if len(allapps) == 0 {
allapps, err = shuffle.GetAllWorkflowApps(ctx, 500) allapps, err = shuffle.GetAllWorkflowApps(ctx, 0)
if err != nil { if err != nil {
log.Printf("Failed getting apps to verify: %s", err) log.Printf("[WARNING] Failed getting apps to verify: %s", err)
continue continue
} }
} }
@@ -3659,7 +3659,7 @@ func iterateAppGithubFolders(fs billy.Filesystem, dir []os.FileInfo, extra strin
err = checkWorkflowApp(workflowapp) err = checkWorkflowApp(workflowapp)
if err != nil { if err != nil {
log.Printf("%s for app %s:%s", err, workflowapp.Name, workflowapp.AppVersion) log.Printf("[DEBUG] %s for app %s:%s", err, workflowapp.Name, workflowapp.AppVersion)
continue continue
} }
+12 -10
View File
@@ -96,9 +96,9 @@ const ParsedAction = (props) => {
} }
} }
// Remove self // Some obscure bug made this have to be done.. zz
results = results.filter(data => data.id !== action.id) results = results.filter(data => data !== undefined && action !== undefined && data.id !== action.id)
results = results.filter(data => data.type !== "TRIGGER") results = results.filter(data => data !== undefined && data.type !== "TRIGGER")
results.push({"label": "Execution Argument", "type": "INTERNAL"}) results.push({"label": "Execution Argument", "type": "INTERNAL"})
return results return results
} }
@@ -767,12 +767,12 @@ const ParsedAction = (props) => {
//const str = = data.value.search(submatch) //const str = = data.value.search(submatch)
//console.log("FOUND? ", n) //console.log("FOUND? ", n)
for (var key in keywords) { //for (var key in keywords) {
const keyword = keywords[key] // const keyword = keywords[key]
if (data.value.includes(keyword)) { // if (data.value.includes(keyword)) {
console.log("INCLUDED: ", keyword) // console.log("INCLUDED: ", keyword)
} // }
} //}
//const keywords = ["len", "lower", "upper", "trim", "split", "length", "number", "parse", "join"] //const keywords = ["len", "lower", "upper", "trim", "split", "length", "number", "parse", "join"]
if (selectedActionParameters[count].schema !== undefined && selectedActionParameters[count].schema !== null && selectedActionParameters[count].schema.type === "file") { if (selectedActionParameters[count].schema !== undefined && selectedActionParameters[count].schema !== null && selectedActionParameters[count].schema.type === "file") {
@@ -1485,7 +1485,9 @@ const ParsedAction = (props) => {
{workflow.execution_variables !== undefined && workflow.execution_variables !== null && workflow.execution_variables.length > 0 ? {workflow.execution_variables !== undefined && workflow.execution_variables !== null && workflow.execution_variables.length > 0 ?
<div style={{marginTop: "20px"}}> <div style={{marginTop: "20px"}}>
Set execution variable (optional) <Typography>
Set execution variable (optional)
</Typography>
<Select <Select
value={selectedAction.execution_variable !== undefined ? selectedAction.execution_variable.name : "No selection"} value={selectedAction.execution_variable !== undefined ? selectedAction.execution_variable.name : "No selection"}
SelectDisplayProps={{ SelectDisplayProps={{
+2 -2
View File
@@ -52,7 +52,7 @@ var baseimagetagsuffix = os.Getenv("SHUFFLE_BASE_IMAGE_TAG_SUFFIX")
var orgId = os.Getenv("ORG_ID") var orgId = os.Getenv("ORG_ID")
var baseUrl = os.Getenv("BASE_URL") var baseUrl = os.Getenv("BASE_URL")
//var environment = os.Getenv("ENVIRONMENT_NAME") var environment = os.Getenv("ENVIRONMENT_NAME")
var dockerApiVersion = os.Getenv("DOCKER_API_VERSION") var dockerApiVersion = os.Getenv("DOCKER_API_VERSION")
var runningMode = strings.ToLower(os.Getenv("RUNNING_MODE")) var runningMode = strings.ToLower(os.Getenv("RUNNING_MODE"))
var cleanupEnv = strings.ToLower(os.Getenv("CLEANUP")) var cleanupEnv = strings.ToLower(os.Getenv("CLEANUP"))
@@ -729,7 +729,7 @@ func zombiecheck(ctx context.Context, workerTimeout int) error {
// Check image name // Check image name
if !shuffleFound { if !shuffleFound {
log.Printf("[WARNING] Zombie container skip: %#v, %s", container.Labels, container.Image) //log.Printf("[WARNING] Zombie container skip: %#v, %s", container.Labels, container.Image)
continue continue
} }
//} else { //} else {
+1 -1
View File
@@ -518,7 +518,7 @@ func removeIndex(s []string, i int) []string {
} }
func handleExecutionResult(workflowExecution shuffle.WorkflowExecution) { func handleExecutionResult(workflowExecution shuffle.WorkflowExecution) {
log.Printf("[INFO] Inside execution results with %d / %d results", len(workflowExecution.Results), len(workflowExecution.Workflow.Actions)) log.Printf("[INFO] Inside execution results with %d / %d results", len(workflowExecution.Results), len(workflowExecution.Workflow.Actions)+extra)
if len(startAction) == 0 { if len(startAction) == 0 {
startAction = workflowExecution.Start startAction = workflowExecution.Start
if len(startAction) == 0 { if len(startAction) == 0 {