forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify executor commands to just 'init' and 'wait'. Improve volumes…
… examples
- Loading branch information
Showing
9 changed files
with
200 additions
and
225 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package commands | ||
|
||
import ( | ||
log "github.com/sirupsen/logrus" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func init() { | ||
RootCmd.AddCommand(initCmd) | ||
} | ||
|
||
var initCmd = &cobra.Command{ | ||
Use: "init", | ||
Short: "Load artifacts", | ||
Run: loadArtifacts, | ||
} | ||
|
||
func loadArtifacts(cmd *cobra.Command, args []string) { | ||
wfExecutor := initExecutor() | ||
// Download input artifacts | ||
err := wfExecutor.LoadScriptSource() | ||
if err != nil { | ||
log.Fatalf("Error loading script: %+v", err) | ||
} | ||
err = wfExecutor.LoadArtifacts() | ||
if err != nil { | ||
log.Fatalf("Error downloading input artifacts: %+v", err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package commands | ||
|
||
import ( | ||
"os" | ||
|
||
log "github.com/sirupsen/logrus" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func init() { | ||
RootCmd.AddCommand(waitCmd) | ||
} | ||
|
||
var waitCmd = &cobra.Command{ | ||
Use: "wait", | ||
Short: "wait for main container to finish and save artifacts", | ||
Run: waitContainer, | ||
} | ||
|
||
func waitContainer(cmd *cobra.Command, args []string) { | ||
wfExecutor := initExecutor() | ||
// Wait for main container to complete and kill sidecars | ||
err := wfExecutor.Wait() | ||
if err != nil { | ||
log.Errorf("Error waiting on main container to be ready, %+v", err) | ||
} | ||
err = wfExecutor.SaveArtifacts() | ||
if err != nil { | ||
log.Fatalf("Error saving output artifacts, %+v", err) | ||
} | ||
// Saving output parameters | ||
err = wfExecutor.SaveParameters() | ||
if err != nil { | ||
log.Fatalf("Error saving output parameters, %+v", err) | ||
} | ||
// Capture output script result | ||
err = wfExecutor.CaptureScriptResult() | ||
if err != nil { | ||
log.Fatalf("Error capturing script output, %+v", err) | ||
} | ||
err = wfExecutor.AnnotateOutputs() | ||
if err != nil { | ||
log.Fatalf("Error annotating outputs, %+v", err) | ||
} | ||
os.Exit(0) | ||
} |
Oops, something went wrong.