Optimized Orborus for tenzir running

This commit is contained in:
Frikky
2024-11-06 21:47:15 +01:00
parent c16168bef4
commit bc395990d5
2 changed files with 17 additions and 2 deletions
+9
View File
@@ -832,14 +832,23 @@ func handleRemoteDownloadApp(resp http.ResponseWriter, ctx context.Context, user
type tmpapp struct { type tmpapp struct {
Success bool `json:"success"` Success bool `json:"success"`
OpenAPI string `json:"openapi"` OpenAPI string `json:"openapi"`
App string `json:"app"`
} }
app := tmpapp{} app := tmpapp{}
err := json.Unmarshal(respBody, &app) err := json.Unmarshal(respBody, &app)
if err != nil || app.Success == false || len(app.OpenAPI) == 0 { if err != nil || app.Success == false || len(app.OpenAPI) == 0 {
log.Printf("[ERROR] Failed app unmarshal during auto-download. Success: %#v. Applength: %d: %s", app.Success, len(app.OpenAPI), err) log.Printf("[ERROR] Failed app unmarshal during auto-download. Success: %#v. Applength: %d: %s", app.Success, len(app.OpenAPI), err)
resp.WriteHeader(401) resp.WriteHeader(401)
if len(app.App) > 0 {
resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "Not an OpenAPI app, but a Python app. Please download the app using the Remote Download system: https://shuffler.io/docs/apps#importing-remote-apps"}`)))
} else {
resp.Write([]byte(`{"success": false, "reason": "App doesn't exist"}`))
}
resp.Write([]byte(`{"success": false, "reason": "App doesn't exist"}`)) resp.Write([]byte(`{"success": false, "reason": "App doesn't exist"}`))
return return
} }
+8 -2
View File
@@ -2903,7 +2903,7 @@ func createAndStartTenzirNode(ctx context.Context, containerName, imageName stri
_, err := dockercli.ContainerCreate(ctx, config, hostConfig, networkingConfig, nil, containerName) _, err := dockercli.ContainerCreate(ctx, config, hostConfig, networkingConfig, nil, containerName)
if err != nil { if err != nil {
if strings.Contains(err.Error(), "path does not exist") { if strings.Contains(err.Error(), "path does not exist") {
log.Printf("[ERROR] Not using permanent pipeline storage as storage folder /opt/tenzir/ does not exist. If you want permanent storage, create the /opt/tendir/ folder then restart Orborus. Raw: %s", err) log.Printf("[ERROR] Not using permanent pipeline storage as storage folder %s does not exist. If you want permanent storage, create the %s folder then restart Orborus (1). Raw: %s", tenzirStorageFolder, tenzirStorageFolder, err)
skipPipelineMount = true skipPipelineMount = true
} else { } else {
log.Printf("[ERROR] Failed to create Tenzir Node container: %v", err) log.Printf("[ERROR] Failed to create Tenzir Node container: %v", err)
@@ -2914,7 +2914,13 @@ func createAndStartTenzirNode(ctx context.Context, containerName, imageName stri
err = dockercli.ContainerStart(ctx, containerName, containerStartOptions) err = dockercli.ContainerStart(ctx, containerName, containerStartOptions)
if err != nil { if err != nil {
log.Printf("[ERROR] Failed to start Tenzir Node container: %v", err) if strings.Contains(err.Error(), "path does not exist") {
log.Printf("[ERROR] Not using permanent pipeline storage as storage folder %s does not exist. If you want permanent storage, create the %s folder then restart Orborus (2). Raw: %s", tenzirStorageFolder, tenzirStorageFolder, err)
skipPipelineMount = true
} else {
log.Printf("[ERROR] Failed to START Tenzir Node container: %v", err)
}
return err return err
} }