Added contributor tracking apps, and started tracking revisions the same way as workflows

This commit is contained in:
Frikky
2024-02-28 20:06:45 +01:00
parent 3489d26c73
commit 54f6b07cb6
2 changed files with 29 additions and 12 deletions
+6
View File
@@ -3183,6 +3183,12 @@ func setNewWorkflowApp(resp http.ResponseWriter, request *http.Request) {
workflowapp.Generated = false workflowapp.Generated = false
workflowapp.Activated = true workflowapp.Activated = true
if !shuffle.ArrayContains(api.Contributors, user.Id) {
api.Contributors = append(api.Contributors, user.Id)
}
shuffle.SetAppRevision(ctx, workflowapp)
err = shuffle.SetWorkflowAppDatastore(ctx, workflowapp, workflowapp.ID) err = shuffle.SetWorkflowAppDatastore(ctx, workflowapp, workflowapp.ID)
if err != nil { if err != nil {
log.Printf("[WARNING] Failed setting workflowapp: %s", err) log.Printf("[WARNING] Failed setting workflowapp: %s", err)
+23 -12
View File
@@ -1825,22 +1825,32 @@ func deployPipeline(image, identifier, command string) error {
// Add volume binds for storage // Add volume binds for storage
// Want read/write with full access for the container // Want read/write with full access for the container
// Should mount //sourceFolder := "/Users/frikky/git/shuffle/shuffle-database"
sourceFolder := "/Users/frikky/git/shuffle/shuffle-database/tenzir" //destinationFolder := "/tmp/storage"
destinationFolder := "/var/lib/tenzir" //hostConfig.Mounts = append(hostConfig.Mounts, mount.Mount{
hostConfig.Mounts = append(hostConfig.Mounts, mount.Mount{ // Type: mount.TypeBind,
Type: mount.TypeBind, // Source: sourceFolder,
Source: sourceFolder, // Target: destinationFolder,
Target: destinationFolder, //})
})
// FIXME: Is using sigma "automatically" here good?
// Or is it better to run it as a separate workflow?
if strings.Contains(command, "sigma") {
log.Printf("[DEBUG] Should LOAD sigma from backend in realtime and dump it in a folder inside the container")
//sourceFolder := "/tmp/tenzir/sigma"
//sigmaFolder := "/tmp/tenzir/sigma"
//hostConfig.Mounts = append(hostConfig.Mounts, mount.Mount{
// Type: mount.TypeBind,
// Source: sigmaFolder,
// Target: sigmaFolder,
//}
}
config := &container.Config{ config := &container.Config{
Image: image, Image: image,
Env: envVariables, Env: envVariables,
Cmd: []string{ Cmd: []string{
"mkdir",
"-p",
destinationFolder,
command, command,
}, },
} }
@@ -1922,6 +1932,7 @@ func deployPipeline(image, identifier, command string) error {
} }
// Wait for the container to finish // Wait for the container to finish
/*
statusCh, errCh := dockercli.ContainerWait(ctx, cont.ID, container.WaitConditionNotRunning) statusCh, errCh := dockercli.ContainerWait(ctx, cont.ID, container.WaitConditionNotRunning)
select { select {
case err := <-errCh: case err := <-errCh:
@@ -1931,7 +1942,7 @@ func deployPipeline(image, identifier, command string) error {
case <-statusCh: case <-statusCh:
log.Printf("[INFO] Container finished") log.Printf("[INFO] Container finished")
} }
*/
return nil return nil
} }