From b4209903d09ef2b6e3bf7bf6d950a6382c63f170 Mon Sep 17 00:00:00 2001 From: frikky Date: Wed, 26 Jan 2022 16:26:40 +0000 Subject: [PATCH] Fixed merge issues --- backend/app_sdk/build.sh | 2 +- docker-compose.yml | 4 ++-- functions/onprem/worker/build.sh | 2 +- functions/onprem/worker/go.sum | 2 ++ functions/onprem/worker/worker.go | 35 ++++++++++++++++++++++++++++++- 5 files changed, 40 insertions(+), 5 deletions(-) diff --git a/backend/app_sdk/build.sh b/backend/app_sdk/build.sh index 198177c4..7c517076 100644 --- a/backend/app_sdk/build.sh +++ b/backend/app_sdk/build.sh @@ -3,7 +3,7 @@ ### DEFAULT NAME=shuffle-app_sdk -VERSION=0.9.50 +VERSION=0.9.51 docker rmi docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION --force docker build . -f Dockerfile -t frikky/shuffle:app_sdk -t frikky/$NAME:$VERSION -t docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION -t ghcr.io/frikky/$NAME:$VERSION -t ghcr.io/frikky/$NAME:nightly diff --git a/docker-compose.yml b/docker-compose.yml index 0fe72b68..be62e916 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -47,10 +47,10 @@ services: volumes: - /var/run/docker.sock:/var/run/docker.sock environment: - - SHUFFLE_WORKER_VERSION=nightly + - SHUFFLE_WORKER_VERSION=0.9.52 - ORG_ID=${ORG_ID} - ENVIRONMENT_NAME=${ENVIRONMENT_NAME} - - BASE_URL=http://${OUTER_HOSTNAME}:${BACKEND_PORT} + - BASE_URL=https://frikky-shuffle-5gvr4xx62w64-5001.githubpreview.dev - DOCKER_API_VERSION=1.40 - SHUFFLE_BASE_IMAGE_NAME=${SHUFFLE_BASE_IMAGE_NAME} - SHUFFLE_BASE_IMAGE_REGISTRY=${SHUFFLE_BASE_IMAGE_REGISTRY} diff --git a/functions/onprem/worker/build.sh b/functions/onprem/worker/build.sh index 87919a26..41bb323d 100644 --- a/functions/onprem/worker/build.sh +++ b/functions/onprem/worker/build.sh @@ -1,5 +1,5 @@ NAME=shuffle-worker -VERSION=0.9.50 +VERSION=0.9.52 echo "Running docker build with $NAME:$VERSION" #CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o worker.bin . diff --git a/functions/onprem/worker/go.sum b/functions/onprem/worker/go.sum index 5a1d006a..4874096e 100644 --- a/functions/onprem/worker/go.sum +++ b/functions/onprem/worker/go.sum @@ -595,6 +595,8 @@ github.com/shuffle/shuffle-shared v0.1.78 h1://YsgQ85Ep40AA3pLUXb+85BUrNz5sqGqh0 github.com/shuffle/shuffle-shared v0.1.78/go.mod h1:cW8LBv8P24rCPyJqGV6czxqrpnrv/R1d97EOqNgIvSk= github.com/shuffle/shuffle-shared v0.1.81 h1:/lOt7NSuMTWlRzgOKg2e7j95eakg3MgW6i/4Fp30kd4= github.com/shuffle/shuffle-shared v0.1.81/go.mod h1:cW8LBv8P24rCPyJqGV6czxqrpnrv/R1d97EOqNgIvSk= +github.com/shuffle/shuffle-shared v0.1.83 h1:xfmcqceBGXJVUyZNBmI+c6RKndrtKJyBIqdHD86v/XA= +github.com/shuffle/shuffle-shared v0.1.83/go.mod h1:cW8LBv8P24rCPyJqGV6czxqrpnrv/R1d97EOqNgIvSk= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= diff --git a/functions/onprem/worker/worker.go b/functions/onprem/worker/worker.go index 775fc8fd..390a2012 100644 --- a/functions/onprem/worker/worker.go +++ b/functions/onprem/worker/worker.go @@ -1163,7 +1163,6 @@ func handleExecutionResult(workflowExecution shuffle.WorkflowExecution) { // if everything is generated during execution //log.Printf("[DEBUG][%s] Deployed with CALLBACK_URL %s and BASE_URL %s", workflowExecution.ExecutionId, appCallbackUrl, baseUrl) env := []string{ - fmt.Sprintf("ACTION=%s", string(actionData)), fmt.Sprintf("EXECUTIONID=%s", workflowExecution.ExecutionId), fmt.Sprintf("AUTHORIZATION=%s", workflowExecution.Authorization), fmt.Sprintf("CALLBACK_URL=%s", baseUrl), @@ -1171,6 +1170,40 @@ func handleExecutionResult(workflowExecution shuffle.WorkflowExecution) { fmt.Sprintf("TZ=%s", timezone), } + if len(actionData) >= 100000 { + log.Printf("[WARNING] Omitting some data from action execution. Length: %d. Fix in SDK!", len(actionData)) + newParams := []shuffle.WorkflowAppActionParameter{} + for _, param := range action.Parameters { + paramData, err := json.Marshal(param) + if err != nil { + log.Printf("[WARNING] Failed to marshal param %s: %s", param.Name, err) + newParams = append(newParams, param) + continue + } + + if len(paramData) >= 50000 { + log.Printf("[WARNING] Removing a lot of data from param %s with length %d", param.Name, len(paramData)) + param.Value = "SHUFFLE_AUTO_REMOVED" + } + + newParams = append(newParams, param) + } + + action.Parameters = newParams + actionData, err = json.Marshal(action) + if err == nil { + log.Printf("[DEBUG] Ran data replace on action %s. new length: %d", action.Name, len(actionData)) + } else { + log.Printf("[WARNING] Failed to marshal new actionData: %s", err) + + } + } else { + log.Printf("[DEBUG] Actiondata is NOT 100000 in length. Adding as normal.") + } + + actionEnv := fmt.Sprintf("ACTION=%s", string(actionData)) + env = append(env, actionEnv) + if strings.ToLower(os.Getenv("SHUFFLE_PASS_APP_PROXY")) == "true" { //log.Printf("APPENDING PROXY TO THE APP!") env = append(env, fmt.Sprintf("HTTP_PROXY=%s", os.Getenv("HTTP_PROXY")))