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.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)
if err != nil {
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
// Want read/write with full access for the container
// Should mount
sourceFolder := "/Users/frikky/git/shuffle/shuffle-database/tenzir"
destinationFolder := "/var/lib/tenzir"
hostConfig.Mounts = append(hostConfig.Mounts, mount.Mount{
Type: mount.TypeBind,
Source: sourceFolder,
Target: destinationFolder,
})
//sourceFolder := "/Users/frikky/git/shuffle/shuffle-database"
//destinationFolder := "/tmp/storage"
//hostConfig.Mounts = append(hostConfig.Mounts, mount.Mount{
// Type: mount.TypeBind,
// Source: sourceFolder,
// 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{
Image: image,
Env: envVariables,
Cmd: []string{
"mkdir",
"-p",
destinationFolder,
command,
},
}
@@ -1922,6 +1932,7 @@ func deployPipeline(image, identifier, command string) error {
}
// Wait for the container to finish
/*
statusCh, errCh := dockercli.ContainerWait(ctx, cont.ID, container.WaitConditionNotRunning)
select {
case err := <-errCh:
@@ -1931,7 +1942,7 @@ func deployPipeline(image, identifier, command string) error {
case <-statusCh:
log.Printf("[INFO] Container finished")
}
*/
return nil
}