Skip to content

Commit 97d7011

Browse files
Merge branch 'Shuffle:main' into support-llm
2 parents e0a80ff + 12455a9 commit 97d7011

20 files changed

+3228
-2618
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Shuffle-shared
22
A repository containing structures and commonly used functions between different deployments on Shuffle. Here to ensure consistency and not re-making the same functions multiple places.
33

4-
[![Shuffle repositories](https://github.com/user-attachments/assets/856f5faa-991c-47f5-9dd5-44e711b7d437)](https://www.figma.com/board/V6Kg7KxbmuhIUyTImb20t1/Shuffle-AI-Agent-system?node-id=0-1&p=f&t=ywpMQJ555sxggEpj-0)
4+
[![Shuffle repositories](https://github.com/user-attachments/assets/df117c01-f2fc-4000-8b5e-ffad33f5779e)](https://www.figma.com/board/V6Kg7KxbmuhIUyTImb20t1/Shuffle-AI-Agent-system?node-id=0-1&p=f&t=ywpMQJ555sxggEpj-0)
5+
56

67
### Sample areas
78
- [Shuffle backend (APIs)](https://github.com/Shuffle/Shuffle/tree/main/backend/go-app) (open source)

ai.go

Lines changed: 715 additions & 548 deletions
Large diffs are not rendered by default.

app_upload/stitcher.go

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"github.com/shuffle/shuffle-shared"
99

1010
"archive/zip"
11-
"runtime"
1211
"bytes"
1312
"context"
1413
"crypto/md5"
@@ -23,6 +22,7 @@ import (
2322
"os"
2423
"os/user"
2524
"path/filepath"
25+
"runtime"
2626
"strings"
2727
"time"
2828

@@ -323,7 +323,6 @@ func stitcher(appname string, appversion string) string {
323323
return ""
324324
}
325325

326-
327326
err = ioutil.WriteFile(fmt.Sprintf("%s/main.py", foldername), stitched, os.ModePerm)
328327
if err != nil {
329328
log.Println("Failed writing to stitched: %s", err)
@@ -464,7 +463,7 @@ func deployFunction(appname, localization, applocation string, environmentVariab
464463
log.Println("[WARNING] Failed creating new function. Attempting patch, as it might exist already")
465464

466465
// Get the function
467-
// Then replicate environment variables, maxinstance & memory
466+
// Then replicate environment variables, maxinstance & memory
468467
getcall := projectsLocationsFunctionsService.Get(fmt.Sprintf("%s/functions/%s", location, appname))
469468
existingFunction, err := getcall.Do()
470469
if err != nil {
@@ -488,7 +487,6 @@ func deployFunction(appname, localization, applocation string, environmentVariab
488487
}
489488
}
490489

491-
492490
patchCall := projectsLocationsFunctionsService.Patch(fmt.Sprintf("%s/functions/%s", location, appname), cloudFunction)
493491
_, err = patchCall.Do()
494492
if err != nil {
@@ -599,7 +597,6 @@ func loadYaml(fileLocation string) (shuffle.WorkflowApp, error) {
599597
return action, nil
600598
}
601599

602-
603600
// Deploys to backend (YAML config)
604601
func deployConfigToBackend(basefolder, appname, appversion string) error {
605602
location := fmt.Sprintf("%s/%s/%s/api.yaml", basefolder, appname, appversion)
@@ -664,7 +661,7 @@ func deployConfigToBackend(basefolder, appname, appversion string) error {
664661
storageclient, err := storage.NewClient(ctx)
665662
if err != nil {
666663
log.Printf("[ERROR] Failed to create client: %v", err)
667-
return nil
664+
return nil
668665
}
669666

670667
bucket := storageclient.Bucket(bucketName)
@@ -940,8 +937,8 @@ func sendRebuildRequest(imageName string) {
940937

941938
client := &http.Client{}
942939
req, err := http.NewRequest(
943-
http.MethodPost,
944-
url,
940+
http.MethodPost,
941+
url,
945942
nil,
946943
)
947944

@@ -964,7 +961,7 @@ func sendRebuildRequest(imageName string) {
964961
func main() {
965962
//addRequirements("generated_apps/shuffle-tools_1.0.0/requirements.txt")
966963
if len(os.Args) < 3 {
967-
log.Printf("[WARNING] Missing arguments. <> are NOT required. Input: go run stitcher.go APIKEY URL <GCEPROJECT> <GCE_REGION> <BUCKETNAME>\n\n\nSample: go run stitcher.go APIKEY https://ca.shuffler.io shuffle-na-northeast1 northamerica-northeast1 shuffle_org_files_na_northeast1")
964+
log.Printf("[WARNING] Missing arguments. <> are NOT required. Input: go run stitcher.go APIKEY URL <GCEPROJECT> <GCE_REGION> <BUCKETNAME>\n\n\nSample: go run stitcher.go APIKEY https://ca.shuffler.io shuffle-na-northeast1 northamerica-northeast1 shuffle_org_files_na_northeast1")
968965
return
969966
}
970967

@@ -986,7 +983,7 @@ func main() {
986983
appbasefile = strings.Replace(appbasefile, "/home/", "/Users/", -1)
987984
appfolder = strings.Replace(appfolder, "/home/", "/Users/", -1)
988985
}
989-
986+
990987
if strings.Contains(appbasefile, "$USER") || strings.Contains(appfolder, "$USER") {
991988
log.Printf("[INFO] Replacing $USER with current user in paths")
992989
currentUser, err := user.Current()

0 commit comments

Comments
 (0)