From 5d450cfb5bb6fdef0028be18d36a95c17d2486fb Mon Sep 17 00:00:00 2001 From: Frikky Date: Wed, 31 Jan 2024 11:27:34 +0100 Subject: [PATCH 01/27] Fixed baseimagename --- functions/onprem/orborus/orborus.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/onprem/orborus/orborus.go b/functions/onprem/orborus/orborus.go index d487832d..826c0f92 100755 --- a/functions/onprem/orborus/orborus.go +++ b/functions/onprem/orborus/orborus.go @@ -478,7 +478,7 @@ func deployServiceWorkers(image string) { fmt.Sprintf("DEBUG_MEMORY=%s", os.Getenv("DEBUG_MEMORY")), fmt.Sprintf("SHUFFLE_APP_SDK_TIMEOUT=%s", os.Getenv("SHUFFLE_APP_SDK_TIMEOUT")), fmt.Sprintf("SHUFFLE_MAX_SWARM_NODES=%d", os.Getenv("SHUFFLE_MAX_SWARM_NODES")), - fmt.Sprintf("SHUFFLE_BASE_IMAGE_NAME=%s", baseImageName), + fmt.Sprintf("SHUFFLE_BASE_IMAGE_NAME=%s", baseimagename), }, //Hosts: []string{ // innerContainerName, From 2bf210201db0206e52f577021e0988c748352d7c Mon Sep 17 00:00:00 2001 From: Frikky Date: Wed, 31 Jan 2024 17:51:01 +0100 Subject: [PATCH 02/27] Updating for 1.3.3 with small frontend fixes. --- .github/workflows/dockerbuild.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dockerbuild.yaml b/.github/workflows/dockerbuild.yaml index e6e0600c..0411279e 100644 --- a/.github/workflows/dockerbuild.yaml +++ b/.github/workflows/dockerbuild.yaml @@ -19,23 +19,23 @@ jobs: include: - app: frontend path: frontend - version: 1.3.2 + version: 1.3.3 experimental: true - app: backend path: backend - version: 1.3.2 + version: 1.3.3 experimental: true - app: app_sdk path: backend/app_sdk - version: 1.3.2 + version: 1.3.3 experimental: true - app: orborus path: functions/onprem/orborus - version: 1.3.2 + version: 1.3.3 experimental: true - app: worker path: functions/onprem/worker - version: 1.3.2 + version: 1.3.3 experimental: true steps: - name: Checkout From 08c3723773ac3cbcae3cb661263239bcffac9ebc Mon Sep 17 00:00:00 2001 From: Frikky Date: Wed, 31 Jan 2024 17:53:38 +0100 Subject: [PATCH 03/27] Rerun for 1.3.3 --- frontend/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/README.md b/frontend/README.md index fe883a45..571c5625 100755 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,5 +1,6 @@ ## Localhost Certificate info: + Creating a localhost certificate: ``` From 228fe48ecf2690f5cccc245f1be28dc90db738ba Mon Sep 17 00:00:00 2001 From: Frikky Date: Wed, 31 Jan 2024 17:54:15 +0100 Subject: [PATCH 04/27] 1.3.3 rebuild --- frontend/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 2a45fb5f..4bf5bf0b 100755 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -2,7 +2,6 @@ FROM node:18 as builder RUN mkdir /usr/src/app - WORKDIR /usr/src/app ENV PATH /usr/src/app/node_modules/.bin:$PATH From 01234ac251d7899289b8094df561101ff0774491 Mon Sep 17 00:00:00 2001 From: Aditya <60684641+0x0elliot@users.noreply.github.com> Date: Mon, 5 Feb 2024 15:44:56 +0530 Subject: [PATCH 05/27] fix: docker login issues --- .env | 1 + functions/onprem/worker/worker.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.env b/.env index 4bd36483..2a347b23 100755 --- a/.env +++ b/.env @@ -61,6 +61,7 @@ IS_KUBERNETES=false # Used for controlling if the environment should run in SHUFFLE_BASE_IMAGE_NAME=shuffle SHUFFLE_BASE_IMAGE_REGISTRY=ghcr.io +SHUFFLE_BASE_IMAGE_REPOSITORY=frikky SHUFFLE_BASE_IMAGE_TAG_SUFFIX="-1.3.1" # The eth0 interface inside a container corresponds diff --git a/functions/onprem/worker/worker.go b/functions/onprem/worker/worker.go index ee0349ce..e31beb89 100644 --- a/functions/onprem/worker/worker.go +++ b/functions/onprem/worker/worker.go @@ -53,7 +53,8 @@ var swarmNetworkName = os.Getenv("SHUFFLE_SWARM_NETWORK_NAME") var dockerApiVersion = strings.ToLower(os.Getenv("DOCKER_API_VERSION")) //var baseimagename = "frikky/shuffle" -var baseimagename = os.Getenv("SHUFFLE_BASE_IMAGE_NAME") +var baseimagerepository = os.Getenv("SHUFFLE_BASE_IMAGE_REPOSITORY") +var baseimagename = fmt.Sprintf("%s/%s", baseimagerepository, os.Getenv("SHUFFLE_BASE_IMAGE_NAME")) // var baseimagename = "registry.hub.docker.com/frikky/shuffle" var registryName = "registry.hub.docker.com" From bcf48075bf6df09a9b5e72410c76eeba195e0d71 Mon Sep 17 00:00:00 2001 From: Aditya <60684641+0x0elliot@users.noreply.github.com> Date: Mon, 5 Feb 2024 15:50:40 +0530 Subject: [PATCH 06/27] fix: handling edge-case with last change --- functions/onprem/worker/worker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/onprem/worker/worker.go b/functions/onprem/worker/worker.go index e31beb89..4eb0dc7f 100644 --- a/functions/onprem/worker/worker.go +++ b/functions/onprem/worker/worker.go @@ -2910,7 +2910,7 @@ func main() { timezone = "Europe/Amsterdam" } - if baseimagename == "" { + if baseimagename == "" || baseimagename == "/" { log.Printf("[DEBUG] Setting baseimagename") baseimagename = "frikky/shuffle" // Dockerhub //baseimagename = "shuffle" // Github (ghcr.io) From 356fbe6f35cdc69375b2399b93a08b57caeee6c9 Mon Sep 17 00:00:00 2001 From: Aditya <60684641+0x0elliot@users.noreply.github.com> Date: Mon, 5 Feb 2024 22:50:34 +0530 Subject: [PATCH 07/27] hotfix: fixing image errors --- functions/onprem/worker/worker.go | 104 ++++++++++++------------------ 1 file changed, 40 insertions(+), 64 deletions(-) diff --git a/functions/onprem/worker/worker.go b/functions/onprem/worker/worker.go index 4eb0dc7f..6b9edf24 100644 --- a/functions/onprem/worker/worker.go +++ b/functions/onprem/worker/worker.go @@ -3,7 +3,6 @@ package main import ( "github.com/shuffle/shuffle-shared" - "bytes" "context" "encoding/json" @@ -22,8 +21,8 @@ import ( "time" "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/mount" dockerclient "github.com/docker/docker/client" // This is for automatic removal of certain code :) @@ -52,9 +51,7 @@ var cleanupEnv = strings.ToLower(os.Getenv("CLEANUP")) var swarmNetworkName = os.Getenv("SHUFFLE_SWARM_NETWORK_NAME") var dockerApiVersion = strings.ToLower(os.Getenv("DOCKER_API_VERSION")) -//var baseimagename = "frikky/shuffle" -var baseimagerepository = os.Getenv("SHUFFLE_BASE_IMAGE_REPOSITORY") -var baseimagename = fmt.Sprintf("%s/%s", baseimagerepository, os.Getenv("SHUFFLE_BASE_IMAGE_NAME")) +var baseimagename = "frikky/shuffle" // var baseimagename = "registry.hub.docker.com/frikky/shuffle" var registryName = "registry.hub.docker.com" @@ -80,6 +77,7 @@ var startAction string //var allLogs map[string]string //var containerIds []string var downloadedImages []string + type ImageDownloadBody struct { Image string `json:"image"` } @@ -90,7 +88,6 @@ type ImageRequest struct { var finishedExecutions []string - // Images to be autodeployed in the latest version of Shuffle. var autoDeploy = map[string]string{ "http:1.4.0": "frikky/shuffle:http_1.4.0", @@ -137,7 +134,6 @@ func setWorkflowExecution(ctx context.Context, workflowExecution shuffle.Workflo return err } - handleExecutionResult(workflowExecution) validated := shuffle.ValidateFinished(ctx, -1, workflowExecution) if validated { @@ -177,7 +173,7 @@ func setWorkflowExecution(ctx context.Context, workflowExecution shuffle.Workflo } } - if len(subflowId) == 0 { + if len(subflowId) == 0 { log.Printf("[DEBUG][%s] No waiting result found. Not polling", workflowExecution.ExecutionId) for _, action := range workflowExecution.Workflow.Actions { @@ -185,19 +181,17 @@ func setWorkflowExecution(ctx context.Context, workflowExecution shuffle.Workflo workflowExecution.Workflow.Triggers = append(workflowExecution.Workflow.Triggers, shuffle.Trigger{ AppName: action.AppName, Parameters: action.Parameters, - ID: action.ID, + ID: action.ID, }) } } - for _, trigger := range workflowExecution.Workflow.Triggers { //log.Printf("[DEBUG] Found trigger %s", trigger.AppName) if trigger.AppName != "User Input" && trigger.AppName != "Shuffle Workflow" && trigger.AppName != "shuffle-subflow" { continue } - // check if it has wait for results in params wait := false for _, param := range trigger.Parameters { @@ -216,9 +210,9 @@ func setWorkflowExecution(ctx context.Context, workflowExecution shuffle.Workflo //log.Printf("[DEBUG][%s] Found result %s", workflowExecution.ExecutionId, result.Action.ID) if result.Action.ID == trigger.ID && result.Status != "SUCCESS" && result.Status != "FAILURE" { //log.Printf("[DEBUG][%s] Found subflow result that is not handled. Waiting for results", workflowExecution.ExecutionId) - + subflowId = result.Action.ID - found = true + found = true break } } @@ -237,21 +231,20 @@ func setWorkflowExecution(ctx context.Context, workflowExecution shuffle.Workflo if len(subflowId) > 0 { // Under rerun period timeout - timeComparison := 120 + timeComparison := 120 log.Printf("[DEBUG][%s] Starting polling for %d seconds to see if new subflow updates are found on the backend that are not handled. Subflow ID: %s", workflowExecution.ExecutionId, timeComparison, subflowId) timestart := time.Now() streamResultUrl := fmt.Sprintf("%s/api/v1/streams/results", baseUrl) for { - err = handleSubflowPoller(ctx, workflowExecution, streamResultUrl, subflowId) + err = handleSubflowPoller(ctx, workflowExecution, streamResultUrl, subflowId) if err == nil { log.Printf("[DEBUG] Subflow is finished and we are breaking the thingy") - + if os.Getenv("SHUFFLE_SWARM_CONFIG") != "run" && os.Getenv("SHUFFLE_SWARM_CONFIG") != "swarm" && workflowExecution.ExecutionSource != "default" { log.Printf("[DEBUG] Force shutdown of worker due to optimized run with webserver. Expecting reruns to take care of this") os.Exit(0) } - break } @@ -273,7 +266,6 @@ func setWorkflowExecution(ctx context.Context, workflowExecution shuffle.Workflo return nil } - // removes every container except itself (worker) func shutdown(workflowExecution shuffle.WorkflowExecution, nodeId string, reason string, handleResultSend bool) { log.Printf("[DEBUG][%s] Shutdown (%s) started with reason %#v. Result amount: %d. ResultsSent: %d, Send result: %#v, Parent: %#v", workflowExecution.ExecutionId, workflowExecution.Status, reason, len(workflowExecution.Results), requestsSent, handleResultSend, workflowExecution.ExecutionParent) @@ -313,7 +305,7 @@ func shutdown(workflowExecution shuffle.WorkflowExecution, nodeId string, reason } */ } else { - + } if len(reason) > 0 && len(nodeId) > 0 { @@ -443,9 +435,9 @@ func deployApp(cli *dockerclient.Client, image string, identifier string, env [] RestartPolicy: "Never", Containers: []corev1.Container{ { - Name: value, - Image: image, - Env: buildEnvVars(envMap), + Name: value, + Image: image, + Env: buildEnvVars(envMap), // ImagePullPolicy: corev1.PullAlways, }, }, @@ -479,7 +471,7 @@ func deployApp(cli *dockerclient.Client, image string, identifier string, env [] if !strings.Contains(param.Value, "shuffle-backend") { continue - } + } // Automatic replacement as this is default if len(os.Getenv("BASE_URL")) > 0 { @@ -494,7 +486,6 @@ func deployApp(cli *dockerclient.Client, image string, identifier string, env [] } } - // Max 10% CPU every second //CPUShares: 128, //CPUQuota: 10000, @@ -521,7 +512,7 @@ func deployApp(cli *dockerclient.Client, image string, identifier string, env [] // Get environment for certificates volumeBinds := []string{} - volumeBindString:= os.Getenv("SHUFFLE_VOLUME_BINDS") + volumeBindString := os.Getenv("SHUFFLE_VOLUME_BINDS") if len(volumeBindString) > 0 { volumeBindSplit := strings.Split(volumeBindString, ",") for _, volumeBind := range volumeBindSplit { @@ -562,7 +553,6 @@ func deployApp(cli *dockerclient.Client, image string, identifier string, env [] Env: env, } - // Checking as late as possible, just in case. newExecId := fmt.Sprintf("%s_%s", workflowExecution.ExecutionId, action.ID) _, err := shuffle.GetCache(ctx, newExecId) @@ -842,7 +832,7 @@ func askOtherWorkersToDownloadImage(image string) { // Check environment SHUFFLE_AUTO_IMAGE_DOWNLOAD if os.Getenv("SHUFFLE_AUTO_IMAGE_DOWNLOAD") == "false" { log.Printf("[DEBUG] SHUFFLE_AUTO_IMAGE_DOWNLOAD is false. NOT distributing images %s", image) - return + return } urls, err := getWorkerURLs() @@ -866,7 +856,7 @@ func askOtherWorkersToDownloadImage(image string) { req, err := http.NewRequest( "POST", url, - bytes.NewBuffer(imageJSON), + bytes.NewBuffer(imageJSON), ) if err != nil { @@ -901,7 +891,6 @@ func handleExecutionResult(workflowExecution shuffle.WorkflowExecution) { return } - startAction, extra, children, parents, visited, executed, nextActions, environments := shuffle.GetExecutionVariables(ctx, workflowExecution.ExecutionId) dockercli, err := dockerclient.NewEnvClient() @@ -968,7 +957,7 @@ func handleExecutionResult(workflowExecution shuffle.WorkflowExecution) { // marshal action and put it in there rofl //log.Printf("[INFO][%s] Time to execute %s (%s) with app %s:%s, function %s, env %s with %d parameters.", workflowExecution.ExecutionId, action.ID, action.Label, action.AppName, action.AppVersion, action.Name, action.Environment, len(action.Parameters)) - + log.Printf("[DEBUG][%s] Action: Send, Label: '%s', Action: '%s', Run status: %s, Extra=", workflowExecution.ExecutionId, action.Label, action.AppName, workflowExecution.Status) actionData, err := json.Marshal(action) @@ -1054,10 +1043,9 @@ func handleExecutionResult(workflowExecution shuffle.WorkflowExecution) { } if len(os.Getenv("SHUFFLE_APP_SDK_TIMEOUT")) > 0 { - env = append(env, fmt.Sprintf("SHUFFLE_APP_SDK_TIMEOUT=%s", os.Getenv("SHUFFLE_APP_SDK_TIMEOUT"))) + env = append(env, fmt.Sprintf("SHUFFLE_APP_SDK_TIMEOUT=%s", os.Getenv("SHUFFLE_APP_SDK_TIMEOUT"))) } - // Fixes issue: // standard_go init_linux.go:185: exec user process caused "argument list too long" // https://devblogs.microsoft.com/oldnewthing/20100203-00/?p=15083 @@ -1085,8 +1073,6 @@ func handleExecutionResult(workflowExecution shuffle.WorkflowExecution) { fmt.Sprintf("%s:%s_%s", baseimagename, parsedAppname, action.AppVersion), } - - // If cleanup is set, it should run for efficiency pullOptions := types.ImagePullOptions{} if cleanupEnv == "true" { @@ -1585,7 +1571,7 @@ func handleSubflowPoller(ctx context.Context, workflowExecution shuffle.Workflow } log.Printf("[INFO][%s] Status: %s, Results: %d, actions: %d", workflowExecution.ExecutionId, workflowExecution.Status, len(workflowExecution.Results), len(workflowExecution.Workflow.Actions)+extra) - return errors.New("Subflow status not found yet") + return errors.New("Subflow status not found yet") } func handleDefaultExecutionWrapper(ctx context.Context, workflowExecution shuffle.WorkflowExecution, streamResultUrl string, extra int) error { @@ -1980,10 +1966,9 @@ func runWorkflowExecutionTransaction(ctx context.Context, attempts int64, workfl resp.Write([]byte(fmt.Sprintf(`{"success": true, "reason": "Execution is not executing, but %s"}`, workflowExecution.Status))) } - log.Printf("[DEBUG][%s] Shutting down (35)", workflowExecution.ExecutionId) - // Force sending result + // Force sending result shutdownData, err := json.Marshal(workflowExecution) if err != nil { log.Printf("[ERROR][%s] Failed marshalling execution (35): %s", workflowExecution.ExecutionId, err) @@ -2058,11 +2043,11 @@ func runWorkflowExecutionTransaction(ctx context.Context, attempts int64, workfl attempts += 1 log.Printf("[DEBUG][%s] Rerunning transaction as results has changed. %d vs %d", workflowExecution.ExecutionId, len(parsedValue.Results), resultLength) /* - if len(workflowExecution.Results) <= len(workflowExecution.Workflow.Actions) { - log.Printf("[DEBUG][%s] Rerunning transaction as results has changed. %d vs %d", workflowExecution.ExecutionId, len(workflowExecution.Results), len(workflowExecution.Workflow.Actions)) - runWorkflowExecutionTransaction(ctx, attempts, workflowExecutionId, actionResult, resp) - return - } + if len(workflowExecution.Results) <= len(workflowExecution.Workflow.Actions) { + log.Printf("[DEBUG][%s] Rerunning transaction as results has changed. %d vs %d", workflowExecution.ExecutionId, len(workflowExecution.Results), len(workflowExecution.Workflow.Actions)) + runWorkflowExecutionTransaction(ctx, attempts, workflowExecutionId, actionResult, resp) + return + } */ } } @@ -2096,7 +2081,6 @@ func runWorkflowExecutionTransaction(ctx context.Context, attempts int64, workfl func sendSelfRequest(actionResult shuffle.ActionResult) { - data, err := json.Marshal(actionResult) if err != nil { log.Printf("[ERROR][%s] Shutting down (24): Failed to unmarshal data for backend: %s", actionResult.ExecutionId, err) @@ -2155,20 +2139,20 @@ func sendResult(workflowExecution shuffle.WorkflowExecution, data []byte) { // Basically to reduce backend strain /* - if shuffle.ArrayContains(finishedExecutions, workflowExecution.ExecutionId) { - log.Printf("[INFO][%s] NOT sending backend info since it's already been sent before.", workflowExecution.ExecutionId) - return - } + if shuffle.ArrayContains(finishedExecutions, workflowExecution.ExecutionId) { + log.Printf("[INFO][%s] NOT sending backend info since it's already been sent before.", workflowExecution.ExecutionId) + return + } */ // Take it down again /* - if len(finishedExecutions) > 100 { - log.Printf("[DEBUG][%s] Removing old execution from finishedExecutions: %s", workflowExecution.ExecutionId, finishedExecutions[0]) - finishedExecutions = finishedExecutions[99:] - } + if len(finishedExecutions) > 100 { + log.Printf("[DEBUG][%s] Removing old execution from finishedExecutions: %s", workflowExecution.ExecutionId, finishedExecutions[0]) + finishedExecutions = finishedExecutions[99:] + } - finishedExecutions = append(finishedExecutions, workflowExecution.ExecutionId) + finishedExecutions = append(finishedExecutions, workflowExecution.ExecutionId) */ streamUrl := fmt.Sprintf("%s/api/v1/streams", baseUrl) @@ -2222,7 +2206,7 @@ func validateFinished(workflowExecution shuffle.WorkflowExecution) bool { log.Printf("[INFO][%s] VALIDATION. Status: %s, shuffle.Actions: %d, Extra: %d, Results: %d. Parent: %#v", workflowExecution.ExecutionId, workflowExecution.Status, len(workflowExecution.Workflow.Actions), extra, len(workflowExecution.Results), workflowExecution.ExecutionParent) - if workflowExecution.Status == "FINISHED" || workflowExecution.Status == "ABORTED" || (len(environments) == 1 && requestsSent == 0 && len(workflowExecution.Results) >= 1 && os.Getenv("SHUFFLE_SWARM_CONFIG") != "run" && os.Getenv("SHUFFLE_SWARM_CONFIG") != "swarm") || (len(workflowExecution.Results) >= len(workflowExecution.Workflow.Actions)+extra && len(workflowExecution.Workflow.Actions) > 0) { + if workflowExecution.Status == "FINISHED" || workflowExecution.Status == "ABORTED" || (len(environments) == 1 && requestsSent == 0 && len(workflowExecution.Results) >= 1 && os.Getenv("SHUFFLE_SWARM_CONFIG") != "run" && os.Getenv("SHUFFLE_SWARM_CONFIG") != "swarm") || (len(workflowExecution.Results) >= len(workflowExecution.Workflow.Actions)+extra && len(workflowExecution.Workflow.Actions) > 0) { if workflowExecution.Status == "FINISHED" { for _, result := range workflowExecution.Results { @@ -2233,7 +2217,6 @@ func validateFinished(workflowExecution shuffle.WorkflowExecution) bool { } } - log.Printf("[DEBUG][%s] Should send full result to %s", workflowExecution.ExecutionId, baseUrl) //data = fmt.Sprintf(`{"execution_id": "%s", "authorization": "%s"}`, executionId, authorization) @@ -2317,7 +2300,6 @@ func handleGetStreamResults(resp http.ResponseWriter, request *http.Request) { // GetLocalIP returns the non loopback local IP of the host func getLocalIP() string { - addrs, err := net.InterfaceAddrs() if err != nil { return "" @@ -2363,7 +2345,6 @@ func webserverSetup(workflowExecution shuffle.WorkflowExecution) net.Listener { log.Printf("[DEBUG] OLD HOSTNAME: %s", appCallbackUrl) - port := listener.Addr().(*net.TCPAddr).Port // Set the port environment variable os.Setenv("WORKER_PORT", fmt.Sprintf("%d", port)) @@ -2521,7 +2502,6 @@ func findActiveSwarmNodes(dockercli *dockerclient.Client) (int64, error) { */ } - // Runs data discovery func sendAppRequest(ctx context.Context, incomingUrl, appName string, port int, action *shuffle.Action, workflowExecution *shuffle.WorkflowExecution) error { @@ -2765,7 +2745,7 @@ func getStreamResultsWrapper(client *http.Client, req *http.Request, workflowExe if newresp.StatusCode != 200 { log.Printf("[ERROR] %sStatusCode (1): %d", string(body), newresp.StatusCode) time.Sleep(time.Duration(sleepTime) * time.Second) - return environments, errors.New(fmt.Sprintf("Bad status code: %d", newresp.StatusCode) ) + return environments, errors.New(fmt.Sprintf("Bad status code: %d", newresp.StatusCode)) } err = json.Unmarshal(body, &workflowExecution) @@ -2848,7 +2828,6 @@ func getStreamResultsWrapper(client *http.Client, req *http.Request, workflowExe // Set environment variable - //log.Printf("Before wait") //wg := sync.WaitGroup{} //wg.Add(1) @@ -2910,7 +2889,7 @@ func main() { timezone = "Europe/Amsterdam" } - if baseimagename == "" || baseimagename == "/" { + if baseimagename == "" { log.Printf("[DEBUG] Setting baseimagename") baseimagename = "frikky/shuffle" // Dockerhub //baseimagename = "shuffle" // Github (ghcr.io) @@ -2920,7 +2899,6 @@ func main() { swarmConfig := os.Getenv("SHUFFLE_SWARM_CONFIG") log.Printf("[INFO] Running with timezone %s and swarm config %#v", timezone, swarmConfig) - authorization := "" executionId := "" @@ -3225,7 +3203,6 @@ func handleDownloadImage(resp http.ResponseWriter, request *http.Request) { return } - for _, img := range images { for _, tag := range img.RepoTags { splitTag := strings.Split(tag, ":") @@ -3238,7 +3215,7 @@ func handleDownloadImage(resp http.ResponseWriter, request *http.Request) { possibleNames = append(possibleNames, fmt.Sprintf("frikky/shuffle:%s", baseTag)) possibleNames = append(possibleNames, fmt.Sprintf("registry.hub.docker.com/frikky/shuffle:%s", baseTag)) - if (arrayContains(possibleNames, image.Image)) { + if arrayContains(possibleNames, image.Image) { log.Printf("[DEBUG] Image %s already downloaded that has been requested to download", image.Image) resp.WriteHeader(200) resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "image already present"}`))) @@ -3263,7 +3240,6 @@ func runWebserver(listener net.Listener) { r.HandleFunc("/api/v1/run", handleRunExecution).Methods("POST", "OPTIONS") r.HandleFunc("/api/v1/download", handleDownloadImage).Methods("POST", "OPTIONS") - if strings.ToLower(os.Getenv("SHUFFLE_DEBUG_MEMORY")) == "true" { r.HandleFunc("/debug/pprof/", pprof.Index) r.HandleFunc("/debug/pprof/heap", pprof.Handler("heap").ServeHTTP) From b7a415cb9b9cc75e9ea49f278d5b2cfc4f1b6032 Mon Sep 17 00:00:00 2001 From: Aditya <60684641+0x0elliot@users.noreply.github.com> Date: Tue, 6 Feb 2024 23:04:52 +0530 Subject: [PATCH 08/27] fix: moving comments to last line --- .env | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/.env b/.env index 2a347b23..3bb7b21b 100755 --- a/.env +++ b/.env @@ -49,15 +49,22 @@ DOCKER_API_VERSION=1.40 # Orborus/Proxy configurations HTTP_PROXY= HTTPS_PROXY= -SHUFFLE_PASS_WORKER_PROXY=TRUE # Decides if proxy configurations should be passed to workers or not -SHUFFLE_PASS_APP_PROXY=TRUE # Decides if proxy configurations should be passed to apps or not. Requires SHUFFLE_PASS_WORKER_PROXY=true -SHUFFLE_INTERNAL_HTTP_PROXY= # Used to differentiate proxies for shuffle internal vs external traffic +# Decides if proxy configurations should be passed to workers or not +SHUFFLE_PASS_WORKER_PROXY=TRUE +# Decides if proxy configurations should be passed to apps or not. Requires SHUFFLE_PASS_WORKER_PROXY=true +SHUFFLE_PASS_APP_PROXY=TRUE +# Used to differentiate proxies for shuffle internal vs external traffic +SHUFFLE_INTERNAL_HTTP_PROXY= SHUFFLE_INTERNAL_HTTPS_PROXY= -TZ=Europe/Amsterdam # Timezone-handler in Orborus, Worker and Apps -ORBORUS_CONTAINER_NAME= # Used to FIND the containername. cgroup v2: issue 501 -SHUFFLE_ORBORUS_STARTUP_DELAY= # Used for setting up a startup delay for Orborus -SHUFFLE_SKIPSSL_VERIFY=true -IS_KUBERNETES=false # Used for controlling if the environment should run in kubernetes or not +# Timezone-handler in Orborus, Worker and Apps +TZ=Europe/Amsterdam +# Used to FIND the containername. cgroup v2: issue 501 +ORBORUS_CONTAINER_NAME= +# Used for setting up a startup delay for Orborus +SHUFFLE_ORBORUS_STARTUP_DELAY= +SHUFFLE_SKIPSSL_VERIFY=true +# Used for controlling if the environment should run in kubernetes or not +IS_KUBERNETES=false SHUFFLE_BASE_IMAGE_NAME=shuffle SHUFFLE_BASE_IMAGE_REGISTRY=ghcr.io @@ -67,22 +74,27 @@ SHUFFLE_BASE_IMAGE_TAG_SUFFIX="-1.3.1" # The eth0 interface inside a container corresponds # to the virtual Ethernet interface that connects # the container to the docker0 -SHUFFLE_SWARM_BRIDGE_DEFAULT_INTERFACE=eth0 -SHUFFLE_SWARM_BRIDGE_DEFAULT_MTU=1500 # 1500 by default +SHUFFLE_SWARM_BRIDGE_DEFAULT_INTERFACE=eth0 +# 1500 by default +SHUFFLE_SWARM_BRIDGE_DEFAULT_MTU=1500 # Used for auto-cleanup of containers. REALLY important at scale. Set to false to see all container info. SHUFFLE_MEMCACHED= SHUFFLE_CONTAINER_AUTO_CLEANUP=true -SHUFFLE_ORBORUS_EXECUTION_CONCURRENCY=5 # The amount of concurrent executions Orborus can handle. This is a soft limit, but it's recommended to keep it low. +# The amount of concurrent executions Orborus can handle. This is a soft limit, but it's recommended to keep it low. +SHUFFLE_ORBORUS_EXECUTION_CONCURRENCY=5 SHUFFLE_HEALTHCHECK_DISABLED=false SHUFFLE_ELASTIC=true SHUFFLE_LOGS_DISABLED=false -SHUFFLE_CHAT_DISABLED=false # Controls support chat +SHUFFLE_CHAT_DISABLED=false SHUFFLE_DISABLE_RERUN_AND_ABORT=false SHUFFLE_RERUN_SCHEDULE=300 -SHUFFLE_WORKER_SERVER_URL= # Definition in case Worker & Orborus is talking to the wrong server -SHUFFLE_ORBORUS_PULL_TIME= # Definition in case Orborus is pulling too often/not often enough -SHUFFLE_MAX_EXECUTION_DEPTH= # Max recursion depth for subflows +# Definition in case Worker & Orborus is talking to the wrong server +SHUFFLE_WORKER_SERVER_URL= +# Definition in case Orborus is pulling too often/not often enough +SHUFFLE_ORBORUS_PULL_TIME= +# Max recursion depth for subflows +SHUFFLE_MAX_EXECUTION_DEPTH= # DATABASE CONFIGURATIONS DATASTORE_EMULATOR_HOST=shuffle-database:8000 From 94c26105ab5e260738fbe91fa41a8bb964790817 Mon Sep 17 00:00:00 2001 From: Aditya <60684641+0x0elliot@users.noreply.github.com> Date: Wed, 7 Feb 2024 14:17:13 +0530 Subject: [PATCH 09/27] chore(debugger-fix): updating to shuffle-shared v0.5.72 --- backend/go-app/go.mod | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/go-app/go.mod b/backend/go-app/go.mod index a3fcf9d6..fbb6f872 100644 --- a/backend/go-app/go.mod +++ b/backend/go-app/go.mod @@ -1,6 +1,6 @@ module shuffle-shared -//replace github.com/shuffle/shuffle-shared => ../../../shuffle-shared +// replace github.com/shuffle/shuffle-shared => ../../../shuffle-shared go 1.19 @@ -18,7 +18,7 @@ require ( github.com/gorilla/mux v1.8.0 github.com/h2non/filetype v1.1.3 github.com/satori/go.uuid v1.2.0 - github.com/shuffle/shuffle-shared v0.5.65 + github.com/shuffle/shuffle-shared v0.5.72 golang.org/x/crypto v0.16.0 google.golang.org/api v0.125.0 google.golang.org/grpc v1.55.0 @@ -39,11 +39,10 @@ require ( github.com/Masterminds/semver v1.5.0 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect - github.com/acomagu/bufpipe v1.0.4 // indirect github.com/adrg/strutil v0.2.3 // indirect github.com/algolia/algoliasearch-client-go/v3 v3.18.1 // indirect github.com/bitly/go-simplejson v0.5.0 // indirect - github.com/bradfitz/gomemcache v0.0.0-20221031212613-62deef7fc822 // indirect + github.com/bradfitz/gomemcache v0.0.0-20230905024940-24af94b03874 // indirect github.com/bradfitz/slice v0.0.0-20180809154707-2b758aa73013 // indirect github.com/cloudflare/circl v1.3.3 // indirect github.com/containerd/containerd v1.6.18 // indirect @@ -53,6 +52,7 @@ require ( github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/emirpasic/gods v1.18.1 // indirect + github.com/frikky/schemaless v0.0.5 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-logr/logr v1.2.4 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect @@ -69,7 +69,6 @@ require ( github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect github.com/googleapis/gax-go/v2 v2.10.0 // indirect github.com/googleapis/gnostic v0.5.5 // indirect - github.com/imdario/mergo v0.3.15 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect @@ -89,6 +88,7 @@ require ( github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/sashabaranov/go-openai v1.19.2 // indirect github.com/sergi/go-diff v1.1.0 // indirect github.com/sirupsen/logrus v1.9.0 // indirect github.com/skeema/knownhosts v1.2.1 // indirect @@ -106,7 +106,7 @@ require ( golang.org/x/time v0.3.0 // indirect golang.org/x/tools v0.13.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/appengine v1.6.7 // indirect + google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc // indirect google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect From cd3d97001001cedc30c897a6f8810ccdb7ce488b Mon Sep 17 00:00:00 2001 From: Aditya <60684641+0x0elliot@users.noreply.github.com> Date: Wed, 7 Feb 2024 14:35:45 +0530 Subject: [PATCH 10/27] chore(debugger-count): adding count endpoint on onprem as well --- backend/go-app/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/go-app/main.go b/backend/go-app/main.go index b702f16d..ddcb66df 100755 --- a/backend/go-app/main.go +++ b/backend/go-app/main.go @@ -4837,6 +4837,7 @@ func initHandlers() { r.HandleFunc("/api/v1/workflows/search", shuffle.HandleWorkflowRunSearch).Methods("POST", "OPTIONS") r.HandleFunc("/api/v1/workflows/schedules", shuffle.HandleGetSchedules).Methods("GET", "OPTIONS") r.HandleFunc("/api/v1/workflows/{key}/executions", shuffle.GetWorkflowExecutions).Methods("GET", "OPTIONS") + r.HandleFunc("/api/v1/workflows/{key}/executions/count", shuffle.HandleGetWorkflowRunCount).Methods("GET", "OPTIONS") r.HandleFunc("/api/v1/workflows/{key}/executions/{key}/rerun", checkUnfinishedExecution).Methods("GET", "POST", "OPTIONS") r.HandleFunc("/api/v1/workflows/{key}/executions/{key}/abort", shuffle.AbortExecution).Methods("GET", "OPTIONS") r.HandleFunc("/api/v1/workflows/{key}/schedule", scheduleWorkflow).Methods("POST", "OPTIONS") From 3a3a563f8acf960a2ff099f752507af8a580af8b Mon Sep 17 00:00:00 2001 From: Aditya <60684641+0x0elliot@users.noreply.github.com> Date: Wed, 7 Feb 2024 15:29:13 +0530 Subject: [PATCH 11/27] feat: shortcut keys for basic workflow navigation --- frontend/src/views/AngularWorkflow.jsx | 45 +++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index f22ee36b..0b48c2cb 100755 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -13785,9 +13785,44 @@ const AngularWorkflow = (defaultprops) => { : null + + const RightsideBar = () => { const [hovered, setHovered] = useState(false) + useEffect(() => { + const handleKeyDown = (event) => { + if ((event.metaKey || event.ctrlKey) && event.key === '/') { + event.preventDefault(); // Prevent default browser behavior (like opening search bar) + if (!workflow.public && !executionRequestStarted) { + executeWorkflow(executionText, workflow.start, lastSaved); + } + } + if ((event.ctrlKey || event.metaKey) && event.key === "'") { + // Check if Ctrl (Windows/Linux) or Command (Mac) key is pressed along with '/' + if (!workflow.public) { + setExecutionModalOpen(true); + getWorkflowExecution(props.match.params.key, ""); + } + } + + if ((event.ctrlKey || event.metaKey) && event.key === "]") { + console.log("Show workflow revisions key pressed") + if (!workflow.public) { + setShowWorkflowRevisions(true) + setSelectedRevision(workflow) + //setOriginalWorkflow(workflow) + } + } + }; + + document.addEventListener('keydown', handleKeyDown); + + return () => { + document.removeEventListener('keydown', handleKeyDown); + }; + }, [executeWorkflow, executionText, workflow, lastSaved, executionRequestStarted]); + return (
{ ) : ( - +
+ + { ) : (
- - { - setExecutionRunning(false); - stop(); - getWorkflowExecution(props.match.params.key, ""); - setExecutionModalView(0); - setLastExecution(executionData.execution_id); - }} + + - { - setExecutionRunning(false); - stop() - }} - > - - -

{ - const cursearch = typeof window === "undefined" || window.location === undefined ? "" : window.location.search; - const newitem = removeParam("execution_id", cursearch); - navigate(curpath + newitem) - setExecutionRunning(false); - stop() - }} - > - See more runs -

-
-
+ { + setExecutionRunning(false); + stop(); + getWorkflowExecution(props.match.params.key, ""); + setExecutionModalView(0); + setLastExecution(executionData.execution_id); + }} + > + { + setExecutionRunning(false); + stop() + }} + > + + + +

{ + const cursearch = typeof window === "undefined" || window.location === undefined ? "" : window.location.search; + const newitem = removeParam("execution_id", cursearch); + navigate(curpath + newitem) + setExecutionRunning(false); + stop() + }} + > + See more runs +

+
+
+ Date: Mon, 12 Feb 2024 23:39:36 +0530 Subject: [PATCH 13/27] fix: making settings UI look better --- frontend/src/views/SettingsPage.jsx | 65 +++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/SettingsPage.jsx b/frontend/src/views/SettingsPage.jsx index 2b0c1ebd..be99104c 100755 --- a/frontend/src/views/SettingsPage.jsx +++ b/frontend/src/views/SettingsPage.jsx @@ -13,6 +13,11 @@ import { //import { useAlert import { ToastContainer, toast } from "react-toastify" +import { FileCopy, Visibility, VisibilityOff } from "@mui/icons-material"; +import IconButton from "@mui/material/IconButton"; +import { Tooltip } from "@mui/material"; + + const Settings = (props) => { const { globalUrl, isLoaded, userdata, setUserData } = props; //const alert = useAlert(); @@ -44,6 +49,17 @@ const Settings = (props) => { const [userSettings, setUserSettings] = useState({}); + const [showApiKey, setShowApiKey] = useState(false); + const [apiKeyCopied, setApiKeyCopied] = useState(false); + + const handleCopyApiKey = () => { + navigator.clipboard.writeText(userSettings.apikey); + setApiKeyCopied(true); + setTimeout(() => { + setApiKeyCopied(false); + }, 2000); + } + /* const [userdata.eth_info, setEthInfo] = useState(userdata.eth_info !== undefined && userdata.eth_info.account !== undefined && userdata.eth_info.account.length > 0 ? userdata.eth_info : { "account": "", @@ -467,7 +483,7 @@ const Settings = (props) => { > What is the API key used for? - { id="standard-required" margin="normal" variant="outlined" - /> + /> */} + + + setShowApiKey(!showApiKey)} + > + {showApiKey ? : } + + + + + + + + + ), + }} + color="primary" + value={showApiKey ? userSettings.apikey : '*'.repeat(36)} // Show API key if showApiKey is true, else show asterisks + required + disabled + fullWidth + placeholder="APIKEY" + id="standard-required" + margin="normal" + variant="outlined" + />

{passwordFormMessage}

- -

Creator Incentive Program

+ {isCloud && ( + <> + +

Creator Incentive Program

+ + )} +
{isCloud ? From b96b526b8206d65b9ef97e2ace7457b84048a90c Mon Sep 17 00:00:00 2001 From: lalitdeore Date: Thu, 15 Feb 2024 10:54:29 +0530 Subject: [PATCH 14/27] Fix: Ensured newaction.returns.example is defined before accessing it --- frontend/src/views/AngularWorkflow.jsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index fa90a3d1..c40a845a 100755 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -8588,13 +8588,15 @@ const AngularWorkflow = (defaultprops) => { // Further checks if those fields are already set in a previously used action newSelectedAction = RunAutocompleter(newSelectedAction); - if ( - newaction.returns.example !== undefined && - newaction.returns.example !== null && - newaction.returns.example.length > 0 - ) { - newSelectedAction.example = newaction.returns.example; - } + // Ensured newaction.returns is defined before accessing newaction.returns.example. +if ( + newaction.returns && + newaction.returns.example !== undefined && + newaction.returns.example !== null && + newaction.returns.example.length > 0 +) { + newSelectedAction.example = newaction.returns.example; +} if ( newaction.description !== undefined && From e04864d6ba351eb8d5452dab14c2409a0def7623 Mon Sep 17 00:00:00 2001 From: lalitdeore Date: Thu, 15 Feb 2024 11:40:32 +0530 Subject: [PATCH 15/27] Revert "Merge branch 'main' of https://github.com/Shuffle/Shuffle" This reverts commit 268ac2d2f6032763d21eccba7f2081858d5beff7, reversing changes made to b96b526b8206d65b9ef97e2ace7457b84048a90c. --- frontend/src/views/SettingsPage.jsx | 65 ++--------------------------- 1 file changed, 4 insertions(+), 61 deletions(-) diff --git a/frontend/src/views/SettingsPage.jsx b/frontend/src/views/SettingsPage.jsx index be99104c..2b0c1ebd 100755 --- a/frontend/src/views/SettingsPage.jsx +++ b/frontend/src/views/SettingsPage.jsx @@ -13,11 +13,6 @@ import { //import { useAlert import { ToastContainer, toast } from "react-toastify" -import { FileCopy, Visibility, VisibilityOff } from "@mui/icons-material"; -import IconButton from "@mui/material/IconButton"; -import { Tooltip } from "@mui/material"; - - const Settings = (props) => { const { globalUrl, isLoaded, userdata, setUserData } = props; //const alert = useAlert(); @@ -49,17 +44,6 @@ const Settings = (props) => { const [userSettings, setUserSettings] = useState({}); - const [showApiKey, setShowApiKey] = useState(false); - const [apiKeyCopied, setApiKeyCopied] = useState(false); - - const handleCopyApiKey = () => { - navigator.clipboard.writeText(userSettings.apikey); - setApiKeyCopied(true); - setTimeout(() => { - setApiKeyCopied(false); - }, 2000); - } - /* const [userdata.eth_info, setEthInfo] = useState(userdata.eth_info !== undefined && userdata.eth_info.account !== undefined && userdata.eth_info.account.length > 0 ? userdata.eth_info : { "account": "", @@ -483,7 +467,7 @@ const Settings = (props) => { > What is the API key used for? - {/* { id="standard-required" margin="normal" variant="outlined" - /> */} - - - setShowApiKey(!showApiKey)} - > - {showApiKey ? : } - - - - - - - - - ), - }} - color="primary" - value={showApiKey ? userSettings.apikey : '*'.repeat(36)} // Show API key if showApiKey is true, else show asterisks - required - disabled - fullWidth - placeholder="APIKEY" - id="standard-required" - margin="normal" - variant="outlined" - /> + />

{passwordFormMessage}

- {isCloud && ( - <> - -

Creator Incentive Program

- - )} - + +

Creator Incentive Program

{isCloud ? From 64222abaf418d065e87ab82e8609f5087a09979c Mon Sep 17 00:00:00 2001 From: Aditya <60684641+0x0elliot@users.noreply.github.com> Date: Thu, 15 Feb 2024 19:39:16 +0530 Subject: [PATCH 16/27] feat: adding a copy workflow execution id icon --- frontend/src/views/AngularWorkflow.jsx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index fa90a3d1..743b799d 100755 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -114,6 +114,7 @@ import { Polyline as PolylineIcon, QueryStats as QueryStatsIcon, AutoAwesome as AutoAwesomeIcon, + FileCopy as FileCopyIcon, } from "@mui/icons-material"; @@ -15532,6 +15533,25 @@ const AngularWorkflow = (defaultprops) => { + + + + + {executionData.status === "EXECUTING" ? ( Date: Thu, 15 Feb 2024 20:14:39 +0530 Subject: [PATCH 17/27] feat: adding timings of when executions got completed --- frontend/src/views/AngularWorkflow.jsx | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index a210b1be..084737d1 100755 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -16449,9 +16449,28 @@ if (
- Status {selectedResult.status} +
+
+ Status {" "} {selectedResult.status} +
+ + {selectedResult.started_at !== undefined && + selectedResult.started_at !== null && + selectedResult.started_at > 0 ? ( +
+ Started {" "} {new Date(selectedResult.started_at).toLocaleString("en-GB")} +
+ ): null} + {selectedResult.completed_at !== undefined && + selectedResult.completed_at !== null && + selectedResult.completed_at > 0 ? ( +
+ Finished {" "} {selectedResult.completed_at === null ? "Not finished" : new Date(selectedResult.completed_at).toLocaleString("en-GB")} +
+ ): null} +
- + {validate.valid ? ( Date: Fri, 16 Feb 2024 15:00:57 +0530 Subject: [PATCH 18/27] fix(minor-typo): Copy workflow id -> Copy execution id --- frontend/src/views/AngularWorkflow.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index 084737d1..6500a5d7 100755 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -15540,7 +15540,7 @@ if ( executionData.execution_id.length > 0 ? ( From 52583c0effa0ca63df435babce038d9541ddd89e Mon Sep 17 00:00:00 2001 From: Aditya <60684641+0x0elliot@users.noreply.github.com> Date: Fri, 16 Feb 2024 15:29:21 +0530 Subject: [PATCH 19/27] fix(revert-confusion): cleaning up mess made in reverts earlier --- frontend/src/views/SettingsPage.jsx | 67 ++++++++++++++++++++++++++--- 1 file changed, 62 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/SettingsPage.jsx b/frontend/src/views/SettingsPage.jsx index 2b0c1ebd..a9c86e67 100755 --- a/frontend/src/views/SettingsPage.jsx +++ b/frontend/src/views/SettingsPage.jsx @@ -13,6 +13,11 @@ import { //import { useAlert import { ToastContainer, toast } from "react-toastify" +import { FileCopy, Visibility, VisibilityOff } from "@mui/icons-material"; +import IconButton from "@mui/material/IconButton"; +import { Tooltip } from "@mui/material"; + + const Settings = (props) => { const { globalUrl, isLoaded, userdata, setUserData } = props; //const alert = useAlert(); @@ -44,6 +49,17 @@ const Settings = (props) => { const [userSettings, setUserSettings] = useState({}); + const [showApiKey, setShowApiKey] = useState(false); + const [apiKeyCopied, setApiKeyCopied] = useState(false); + + const handleCopyApiKey = () => { + navigator.clipboard.writeText(userSettings.apikey); + setApiKeyCopied(true); + setTimeout(() => { + setApiKeyCopied(false); + }, 2000); + } + /* const [userdata.eth_info, setEthInfo] = useState(userdata.eth_info !== undefined && userdata.eth_info.account !== undefined && userdata.eth_info.account.length > 0 ? userdata.eth_info : { "account": "", @@ -467,7 +483,7 @@ const Settings = (props) => { > What is the API key used for? - { id="standard-required" margin="normal" variant="outlined" - /> + /> */} + + + setShowApiKey(!showApiKey)} + > + {showApiKey ? : } + + + + + + + + + ), + }} + color="primary" + value={showApiKey ? userSettings.apikey : '*'.repeat(36)} // Show API key if showApiKey is true, else show asterisks + required + disabled + fullWidth + placeholder="APIKEY" + id="standard-required" + margin="normal" + variant="outlined" + />

{passwordFormMessage}

- -

Creator Incentive Program

+ {isCloud && ( + <> + +

Creator Incentive Program

+ + )} +
{isCloud ? @@ -882,4 +939,4 @@ const Settings = (props) => { return
{loadedCheck}
; }; -export default Settings; +export default Settings; \ No newline at end of file From 464bed4922797b17b18006f2b139df73f1308b9a Mon Sep 17 00:00:00 2001 From: Aditya <60684641+0x0elliot@users.noreply.github.com> Date: Thu, 22 Feb 2024 15:16:40 +0530 Subject: [PATCH 20/27] fix(app-timeout-env): adding app timeout control --- functions/onprem/orborus/orborus.go | 1 + 1 file changed, 1 insertion(+) diff --git a/functions/onprem/orborus/orborus.go b/functions/onprem/orborus/orborus.go index 0b8c08f3..c1a8b4e5 100755 --- a/functions/onprem/orborus/orborus.go +++ b/functions/onprem/orborus/orborus.go @@ -479,6 +479,7 @@ func deployServiceWorkers(image string) { fmt.Sprintf("SHUFFLE_APP_SDK_TIMEOUT=%s", os.Getenv("SHUFFLE_APP_SDK_TIMEOUT")), fmt.Sprintf("SHUFFLE_MAX_SWARM_NODES=%d", os.Getenv("SHUFFLE_MAX_SWARM_NODES")), fmt.Sprintf("SHUFFLE_BASE_IMAGE_NAME=%s", os.Getenv("SHUFFLE_BASE_IMAGE_NAME")), + fmt.Sprintf("SHUFFLE_APP_REQUEST_TIMEOUT=%s", os.Getenv("SHUFFLE_APP_REQUEST_TIMEOUT")), }, //Hosts: []string{ // innerContainerName, From 9355ae3792aee6465c938f26e605d22c32ff3826 Mon Sep 17 00:00:00 2001 From: Aditya <60684641+0x0elliot@users.noreply.github.com> Date: Sat, 24 Feb 2024 15:41:05 +0530 Subject: [PATCH 21/27] reversing: Copy execution id button --- frontend/src/views/AngularWorkflow.jsx | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index 6500a5d7..0c289058 100755 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -15535,29 +15535,6 @@ if ( - {executionData.execution_id !== undefined && - executionData.execution_id !== null && - executionData.execution_id.length > 0 ? ( - - - - - - ) : null} {executionData.status === "EXECUTING" ? ( Date: Tue, 27 Feb 2024 15:20:22 +0100 Subject: [PATCH 22/27] Moved references from /frikky/ to /shuffle/ --- README.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index e8c2f9c1..3e22c1d4 100755 --- a/README.md +++ b/README.md @@ -15,16 +15,16 @@ Shuffle Automation [_Community & Support_](https://discord.gg/B2CBzUm) — [_Documentation_](https://shuffler.io/docs) — [_Getting Started_](https://shuffler.io/docs/getting_started) — -[_Development_](https://github.com/frikky/Shuffle/blob/master/.github/CONTRIBUTING.md) +[_Development_](https://github.com/shuffle/Shuffle/blob/master/.github/CONTRIBUTING.md) Follow us on Twitter at [@shuffleio](https://twitter.com/shuffleio). -![Example Shuffle webhook integration](https://github.com/frikky/Shuffle/blob/main/frontend/src/assets/img/github_shuffle_img.png) +![Example Shuffle webhook integration](https://github.com/shuffle/Shuffle/blob/main/frontend/src/assets/img/github_shuffle_img.png) ## Try it -* Self-hosted: Check out the [installation guide](https://github.com/frikky/shuffle/blob/master/.github/install-guide.md) +* Self-hosted: Check out the [installation guide](https://github.com/shuffle/shuffle/blob/master/.github/install-guide.md) * Cloud: Register at https://shuffler.io/register and get cooking (missing a lot of features) Please consider [sponsoring](https://github.com/sponsors/frikky) the project if you want to see more rapid development. @@ -33,7 +33,7 @@ Please consider [sponsoring](https://github.com/sponsors/frikky) the project if * [Discord](https://discord.gg/B2CBzUm) * [Twitter](https://twitter.com/shuffleio) * [Email](mailto:frikky@shuffler.io) -* [Open issue](https://github.com/frikky/Shuffle/issues/new) +* [Open issue](https://github.com/shuffle/Shuffle/issues/new) * [Shuffler.io](https://shuffler.io/contact) ## Blogposts @@ -43,21 +43,21 @@ Please consider [sponsoring](https://github.com/sponsors/frikky) the project if * [4. Real-time executions with TheHive, Cortex and MISP](https://medium.com/@Frikkylikeme/indicators-and-webhooks-with-thehive-cortex-and-misp-open-source-soar-part-4-f70cde942e59) ## Documentation -[Documentation](https://shuffler.io/docs) can be found on [https://shuffler.io/docs](https://shuffler.io/docs) and is written here: [https://github.com/frikky/shuffle-docs](https://github.com/frikky/shuffle-docs). +[Documentation](https://shuffler.io/docs) can be found on [https://shuffler.io/docs](https://shuffler.io/docs) and is written here: [https://github.com/shuffle/shuffle-docs](https://github.com/shuffle/shuffle-docs). ### Setting up a local development environment Please follow the steps mentioned [here](https://github.com/Shuffle/Shuffle/blob/main/.github/install-guide.md#local-development-installation)! ## Related repositories -* OpenAPI apps: [https://github.com/frikky/security-openapis](https://github.com/frikky/security-openapis) -* Documentation: [https://github.com/frikky/shuffle-docs](https://github.com/frikky/shuffle-docs) -* Workflows: [https://github.com/frikky/shuffle-workflows](https://github.com/frikky/shuffle-workflows) -* Python apps: [https://github.com/frikky/shuffle-apps](https://github.com/frikky/shuffle-apps) +* OpenAPI apps: [https://github.com/shuffle/security-openapis](https://github.com/shuffle/security-openapis) +* Documentation: [https://github.com/shuffle/shuffle-docs](https://github.com/shuffle/shuffle-docs) +* Workflows: [https://github.com/shuffle/shuffle-workflows](https://github.com/shuffle/shuffle-workflows) +* Python apps: [https://github.com/shuffle/shuffle-apps](https://github.com/shuffle/python-apps) ## Features * Simple, feature rich [workflow editor](https://shuffler.io/docs/workflows) -* App creator using [OpenAPI](https://github.com/frikky/OpenAPI-security-definitions) +* App creator using [OpenAPI](https://github.com/shuffle/OpenAPI-security-definitions) * Premade apps for your security tools * Organization and sub-organization control * Hybrid resource sharing with shuffler.io (optional) @@ -66,7 +66,7 @@ Please follow the steps mentioned [here](https://github.com/Shuffle/Shuffle/blob [https://shuffler.io](https://shuffler.io) ## Contributing -We want to make the world of cybersecurity more accessible and need all the help we can get. Send an email to [frikky@shuffler](mailto:frikky@shuffler.io) and we'll make sure to give you any training you may need. +We want to make the world of cybersecurity more accessible and need all the help we can get. Send an email to [support@shuffler](mailto:support@shuffler.io) and we'll make sure to give you any training you may need. These are the main areas to contribute in: * Frontend (ReactJS) @@ -76,19 +76,19 @@ These are the main areas to contribute in: * Workflow creation (GUI & Conceptualizing) * Content Creation (Blogs, videos etc) -Contributing guidelines are outlined [here](https://github.com/frikky/Shuffle/blob/master/.github/CONTRIBUTING.md). +Contributing guidelines are outlined [here](https://github.com/shuffle/Shuffle/blob/master/.github/CONTRIBUTING.md). ## Contributors ![ICPL logo](https://github.com/Shuffle/Shuffle/blob/main/frontend/src/assets/img/icpl_logo.png) **Shuffle** - - + + -[**App magicians**](https://github.com/frikky/shuffle-apps) - - +[**App magicians**](https://github.com/shuffle/shuffle-apps) + + @@ -101,7 +101,7 @@ Shuffle backend: AGPLv3 Apps, specification and App SDK: MIT ## Architecture -![Shuffle Architecture](https://github.com/frikky/Shuffle/blob/main/frontend/src/assets/img/shuffle_architecture.png) +![Shuffle Architecture](https://github.com/shuffle/Shuffle/blob/main/frontend/src/assets/img/shuffle_architecture.png) ### Repository overview Below is the folder structure with a short explanation From 3bfeabd4e01a185826aa07fb0ee39eb2d3b29fc9 Mon Sep 17 00:00:00 2001 From: Aditya <60684641+0x0elliot@users.noreply.github.com> Date: Wed, 28 Feb 2024 15:35:04 +0530 Subject: [PATCH 23/27] feat: adding SHUFFLE_SWARM_CONTROL_MODE --- functions/onprem/orborus/orborus.go | 99 +++++++++++++++++------------ 1 file changed, 58 insertions(+), 41 deletions(-) diff --git a/functions/onprem/orborus/orborus.go b/functions/onprem/orborus/orborus.go index c1a8b4e5..34973ae2 100755 --- a/functions/onprem/orborus/orborus.go +++ b/functions/onprem/orborus/orborus.go @@ -19,6 +19,7 @@ import ( "io" "io/ioutil" "log" + "math" "net" "net/http" "os" @@ -26,9 +27,8 @@ import ( "runtime" "strconv" "strings" - "time" "sync" - "math" + "time" //"os/signal" //"syscall" @@ -62,8 +62,8 @@ import ( var sleepTime = 2 // Making it work on low-end machines even during busy times :) -// May cause some things to run slowly -var maxConcurrency = 7 +// May cause some things to run slowly +var maxConcurrency = 7 // Timeout if something rashes var workerTimeoutEnv = os.Getenv("SHUFFLE_ORBORUS_EXECUTION_TIMEOUT") @@ -74,7 +74,7 @@ var newWorkerImage = os.Getenv("SHUFFLE_WORKER_IMAGE") var dockerSwarmBridgeMTU = os.Getenv("SHUFFLE_SWARM_BRIDGE_DEFAULT_MTU") var dockerSwarmBridgeInterface = os.Getenv("SHUFFLE_SWARM_BRIDGE_DEFAULT_INTERFACE") var isKubernetes = os.Getenv("IS_KUBERNETES") -var maxCPUPercent = 95 +var maxCPUPercent = 95 // var baseimagename = "docker.pkg.github.com/shuffle/shuffle" // var baseimagename = "ghcr.io/frikky" @@ -687,9 +687,9 @@ func deployWorker(image string, identifier string, env []string, executionReques log.Printf("[INFO] Created pod %q in namespace %q\n", createdPod.Name, createdPod.Namespace) return nil - } + } - // Binds is the actual "-v" volume. + // Binds is the actual "-v" volume. // Max 20% CPU every second //CPUQuota: 25000, @@ -1041,12 +1041,10 @@ func getOrborusStats(ctx context.Context) shuffle.OrborusStats { return newStats } - if swarmConfig == "run" || swarmConfig == "swarm" { newStats.Swarm = true } - // Run this 1/10 times //if rand.Intn(10) != 1 { // return newStats @@ -1056,7 +1054,7 @@ func getOrborusStats(ctx context.Context) shuffle.OrborusStats { newStats.MaxQueue = maxConcurrency newStats.Queue = executionCount - if isKubernetes == "true" || runningMode == "kubernetes" || runningMode == "k8s" { + if isKubernetes == "true" || runningMode == "kubernetes" || runningMode == "k8s" { newStats.Kubernetes = true return newStats } @@ -1077,8 +1075,7 @@ func getOrborusStats(ctx context.Context) shuffle.OrborusStats { newStats.MaxMemory = int(pers.MemTotal) } - - // Get list of all running containers + // Get list of all running containers containers, err := dockercli.ContainerList(ctx, types.ContainerListOptions{}) if err != nil { log.Printf("[ERROR] Failed getting container list: %s", err) @@ -1138,33 +1135,33 @@ func getOrborusStats(ctx context.Context) shuffle.OrborusStats { // check if it's NaN or Inf if !math.IsNaN(result.cpuUsage) { totalCPU += float64(result.cpuUsage) - } + } if !math.IsNaN(result.memoryUsage) { memUsage += float64(result.memoryUsage) } } - newStats.CPUPercent = totalCPU/float64(newStats.CPU) + newStats.CPUPercent = totalCPU / float64(newStats.CPU) newStats.MemoryPercent = memUsage //log.Printf("[DEBUG] CPU: %.2f, Memory: %.2f", newStats.CPUPercent, newStats.MemoryPercent) /* - cpuPercent, err := cpu.Percent(250*time.Millisecond, false) - if err == nil && len(cpuPercent) > 0 { - newStats.CPUPercent = cpuPercent[0] - } - //Percent(interval time.Duration, percpu bool) ([]float64, error) + cpuPercent, err := cpu.Percent(250*time.Millisecond, false) + if err == nil && len(cpuPercent) > 0 { + newStats.CPUPercent = cpuPercent[0] + } + //Percent(interval time.Duration, percpu bool) ([]float64, error) - // Get memory usage - memory, err := memory.Get() - if err != nil { - log.Printf("[ERROR] Failed getting memory stats: %s", err) - } else { - newStats.Memory = int(memory.Used) - newStats.MaxMemory = int(memory.Total) - } + // Get memory usage + memory, err := memory.Get() + if err != nil { + log.Printf("[ERROR] Failed getting memory stats: %s", err) + } else { + newStats.Memory = int(memory.Used) + newStats.MaxMemory = int(memory.Total) + } */ // Get disk usage @@ -1402,13 +1399,20 @@ func main() { } if os.Getenv("SHUFFLE_MAX_CPU") != "" { - // parse + // parse tmpInt, err := strconv.Atoi(os.Getenv("SHUFFLE_MAX_CPU")) if err == nil { maxCPUPercent = tmpInt } } + swarmPollingTime := time.Now() + swarmRequestsMade := 0 + swarmControlMode := false + if os.Getenv("SHUFFLE_SWARM_CONTROL_MODE") == "true" { + swarmControlMode = true + } + log.Printf("[INFO] Waiting for executions at %s with Environment %#v", fullUrl, environment) hasStarted := false for { @@ -1529,6 +1533,20 @@ func main() { log.Printf("[WARNING] Throttle - Cutting down requests from %d to %d (MAX: %d, CUR: %d)", len(executionRequests.Data), allowed, maxConcurrency, executionCount) executionRequests.Data = executionRequests.Data[0:allowed] } + } else if (swarmControlMode && (swarmConfig == "run" || swarmConfig == "swarm")) { + if len(executionRequests.Data) > 50 { + executionRequests.Data = executionRequests.Data[0:50] + } + + if swarmRequestsMade > 100 && time.Since(swarmPollingTime).Seconds() > 5 { + log.Printf("[DEBUG] Swarm requests made: %d", swarmRequestsMade) + time.Sleep(time.Duration(sleepTime) * time.Second) + + swarmPollingTime = time.Now() + swarmRequestsMade = 0 + } + + swarmRequestsMade += len(executionRequests.Data) } // New, abortable version. Should check executionid and remove everything else @@ -1553,9 +1571,9 @@ func main() { // Should check when last this was ran, and if it's more than 10 minutes ago and it's not finished, we should run it again? /* - if swarmConfig != "run" && swarmConfig != "swarm" { - continue - } + if swarmConfig != "run" && swarmConfig != "swarm" { + continue + } */ } @@ -1611,7 +1629,6 @@ func main() { env = append(env, fmt.Sprintf("SHUFFLE_VOLUME_BINDS=%s", os.Getenv("SHUFFLE_VOLUME_BINDS"))) } - if len(os.Getenv("SHUFFLE_APP_SDK_TIMEOUT")) > 0 { env = append(env, fmt.Sprintf("SHUFFLE_APP_SDK_TIMEOUT=%s", os.Getenv("SHUFFLE_APP_SDK_TIMEOUT"))) } @@ -1720,7 +1737,7 @@ func main() { func getRunningWorkers(ctx context.Context, workerTimeout int) int { //log.Printf("[DEBUG] Getting running workers with API version %s", dockerApiVersion) counter := 0 - if isKubernetes == "true" { + if isKubernetes == "true" { log.Printf("[INFO] getting running workers in kubernetes") thresholdTime := time.Now().Add(time.Duration(-workerTimeout) * time.Second) @@ -1750,20 +1767,20 @@ func getRunningWorkers(ctx context.Context, workerTimeout int) int { containers, err := dockercli.ContainerList(ctx, types.ContainerListOptions{ All: true, }) - + // 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("[DEBUG] WANT to change the API version to default to %s?", strings.TrimSpace(newVersionSplit[1])) } - + return maxConcurrency } - + currenttime := time.Now().Unix() for _, container := range containers { @@ -1776,7 +1793,7 @@ func getRunningWorkers(ctx context.Context, workerTimeout int) int { break } } - + // Check image name if !shuffleFound { continue @@ -1784,13 +1801,13 @@ func getRunningWorkers(ctx context.Context, workerTimeout int) int { //} else { // log.Printf("NAME: %s", container.Image) } - + for _, name := range container.Names { // FIXME - add name_version_uid_uid regex check as well if !strings.HasPrefix(name, "/worker") { continue } - + //log.Printf("Time: %d - %d", currenttime-container.Created, int64(workerTimeout)) if container.State == "running" && currenttime-container.Created < int64(workerTimeout) { counter += 1 @@ -1934,7 +1951,7 @@ func sendWorkerRequest(workflowExecution shuffle.ExecutionRequest) error { streamUrl = fmt.Sprintf("%s:33333/api/v1/execute", parsedBaseurl) } - if len(workerServerUrl) > 0 { + if len(workerServerUrl) > 0 { streamUrl = fmt.Sprintf("%s:33333/api/v1/execute", workerServerUrl) } From 9f2a33afe86b0bbd790f8054da089aa88866488a Mon Sep 17 00:00:00 2001 From: Aditya <60684641+0x0elliot@users.noreply.github.com> Date: Tue, 5 Mar 2024 17:45:50 +0530 Subject: [PATCH 24/27] fix: cleaning up for HTTPS documentation --- frontend/run.sh | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/frontend/run.sh b/frontend/run.sh index 9a608216..5c9d3e0e 100755 --- a/frontend/run.sh +++ b/frontend/run.sh @@ -1,18 +1,26 @@ #!/bin/sh + +TAG="nightly" + +if [ "$1" = "--latest" ]; then + echo "Using latest tag for image!" + TAG="latest" +fi + docker stop shuffle-frontend docker rm shuffle-frontend -#docker rmi ghcr.io/frikky/shuffle-frontend:nightly echo "Running build for website" -#sudo npm run build -docker build . -t ghcr.io/frikky/shuffle-frontend:nightly -docker tag ghcr.io/frikky/shuffle-frontend:nightly ghcr.io/shuffle/shuffle-frontend:nightly +# sudo npm run build +docker build . -t ghcr.io/frikky/shuffle-frontend:$TAG +docker tag ghcr.io/frikky/shuffle-frontend:$TAG ghcr.io/shuffle/shuffle-frontend:$TAG + +echo "Image built as ghcr.io/frikky/shuffle-frontend:$TAG!" echo "Starting server" # Rerun build locally for it to update :) docker run -it \ - -p 3001:80 \ - -p 3002:443 \ - -v $(pwd)/build:/usr/share/nginx/html:ro \ - --rm \ - ghcr.io/frikky/shuffle-frontend:nightly + -p 3001:80 \ + -p 3002:443 \ + -v $(pwd)/build:/usr/share/nginx/html:ro \ + ghcr.io/frikky/shuffle-frontend:$TAG From 06ac921aa88f004f6e0dff8b2ecc337917ee323e Mon Sep 17 00:00:00 2001 From: Aditya <60684641+0x0elliot@users.noreply.github.com> Date: Tue, 5 Mar 2024 18:05:35 +0530 Subject: [PATCH 25/27] fix(cleaning-run.sh): adding removed lines back --- frontend/run.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/run.sh b/frontend/run.sh index 5c9d3e0e..43ec3d89 100755 --- a/frontend/run.sh +++ b/frontend/run.sh @@ -23,4 +23,5 @@ docker run -it \ -p 3001:80 \ -p 3002:443 \ -v $(pwd)/build:/usr/share/nginx/html:ro \ + --rm \ ghcr.io/frikky/shuffle-frontend:$TAG From 8658ffecf94b0eef7c959c9547a92aebcab87fe5 Mon Sep 17 00:00:00 2001 From: Aditya <60684641+0x0elliot@users.noreply.github.com> Date: Tue, 14 May 2024 08:08:41 +0530 Subject: [PATCH 26/27] fix: reference error fix for oauth --- frontend/src/components/Oauth2Auth.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Oauth2Auth.jsx b/frontend/src/components/Oauth2Auth.jsx index c76a6b59..f175d683 100755 --- a/frontend/src/components/Oauth2Auth.jsx +++ b/frontend/src/components/Oauth2Auth.jsx @@ -364,6 +364,11 @@ const AuthenticationOauth2 = (props) => { } } + let workflowIdNew = "" + if (workflow !== undefined && workflow !== null && workflow.id !== undefined && workflow.id !== null) { + workflowIdNew = workflow.id + } + const appAuthData = { "label": "OAuth2 for " + selectedApp.name, "app": { @@ -374,7 +379,7 @@ const AuthenticationOauth2 = (props) => { }, "fields": parsedFields, "type": "oauth2-app", - "reference_workflow": workflowId, + "reference_workflow": workflowIdNew, } if (setNewAppAuth !== undefined) { From 62b6918c08aea072d0ba1b38475d4c4b777a36e5 Mon Sep 17 00:00:00 2001 From: Aditya <60684641+0x0elliot@users.noreply.github.com> Date: Tue, 14 May 2024 09:50:07 +0530 Subject: [PATCH 27/27] fix: cytoscape errors in build --- frontend/package.json | 2 +- frontend/src/components/AppFramework.jsx | 2 +- frontend/src/views/AngularWorkflow.jsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 186c50c7..c6421d1b 100755 --- a/frontend/package.json +++ b/frontend/package.json @@ -27,7 +27,7 @@ "codemirror": "^6.0.1", "cpx": "^1.5.0", "create-react-app": "^5.0.1", - "cytoscape": "^3.23.0", + "cytoscape": "^3.29.2", "cytoscape-clipboard": "^2.2.1", "cytoscape-cxtmenu": "^3.4.0", "cytoscape-edgehandles": "^3.5.1", diff --git a/frontend/src/components/AppFramework.jsx b/frontend/src/components/AppFramework.jsx index 383553fd..c168d25d 100644 --- a/frontend/src/components/AppFramework.jsx +++ b/frontend/src/components/AppFramework.jsx @@ -32,7 +32,7 @@ import { } from "@mui/icons-material"; import * as edgehandles from "cytoscape-edgehandles"; -import * as cytoscape from "cytoscape"; +import cytoscape from "cytoscape"; import { toast } from 'react-toastify'; cytoscape.use(edgehandles); diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index 0c289058..8452f8fc 100755 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -118,7 +118,7 @@ import { } from "@mui/icons-material"; -import * as cytoscape from "cytoscape"; +import cytoscape from "cytoscape"; import * as edgehandles from "cytoscape-edgehandles"; //import * as clipboard from "cytoscape-clipboard"; //import undoRedo from "cytoscape-undo-redo";