Added contributor tracking apps, and started tracking revisions the same way as workflows
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user