Skip to content

Commit

Permalink
feat(export): add introspect and parallel cli options
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Igrychev <alexey.igrychev@flant.com>
  • Loading branch information
alexey-igrychev committed Jun 7, 2024
1 parent 45ecd0e commit db20884
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cmd/werf/export/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ func NewExportCmd(ctx context.Context) *cobra.Command {
common.SetupCacheStagesStorageOptions(&commonCmdData, cmd)
common.SetupRepoOptions(&commonCmdData, cmd, common.RepoDataOptions{OptionalRepo: true})
common.SetupFinalRepo(&commonCmdData, cmd)
common.SetupParallelOptions(&commonCmdData, cmd, common.DefaultBuildParallelTasksLimit)

common.SetupIntrospectAfterError(&commonCmdData, cmd)
common.SetupIntrospectBeforeError(&commonCmdData, cmd)
common.SetupIntrospectStage(&commonCmdData, cmd)

common.SetupRequireBuiltImages(&commonCmdData, cmd)

Expand Down Expand Up @@ -241,9 +246,14 @@ func run(ctx context.Context, imagesToProcess build.ImagesToProcess, tagTemplate

storageManager := manager.NewStorageManager(projectName, stagesStorage, finalStagesStorage, secondaryStagesStorageList, cacheStagesStorageList, storageLockManager)

buildOptions, err := common.GetBuildOptions(ctx, &commonCmdData, werfConfig, imagesToProcess.OnlyImages)
if err != nil {
return err
}

logboek.Context(ctx).Info().LogOptionalLn()

conveyorOptions, err := common.GetConveyorOptions(ctx, &commonCmdData, imagesToProcess)
conveyorOptions, err := common.GetConveyorOptionsWithParallel(ctx, &commonCmdData, imagesToProcess, buildOptions)
if err != nil {
return err
}
Expand Down
26 changes: 26 additions & 0 deletions docs/_includes/reference/cli/werf_export.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,27 @@ werf export [IMAGE_NAME...] [options]
configuration (default $WERF_INSECURE_HELM_DEPENDENCIES)
--insecure-registry=false
Use plain HTTP requests when accessing a registry (default $WERF_INSECURE_REGISTRY)
--introspect-before-error=false
Introspect failed stage in the clean state, before running all assembly instructions of
the stage
--introspect-error=false
Introspect failed stage in the state, right after running failed assembly instruction
--introspect-stage=[]
Introspect a specific stage. The option can be used multiple times to introspect
several stages.

There are the following formats to use:
* specify IMAGE_NAME/STAGE_NAME to introspect stage STAGE_NAME of either image or
artifact IMAGE_NAME
* specify STAGE_NAME or */STAGE_NAME for the introspection of all existing stages with
name STAGE_NAME

IMAGE_NAME is the name of an image or artifact described in werf.yaml, the nameless
image specified with ~.
STAGE_NAME should be one of the following: from, beforeInstall,
dependenciesBeforeInstall, gitArchive, install, dependenciesAfterInstall, beforeSetup,
dependenciesBeforeSetup, setup, dependenciesAfterSetup, gitCache, gitLatestPatch,
dockerInstructions, dockerfile
--kube-config=''
Kubernetes config file path (default $WERF_KUBE_CONFIG, or $WERF_KUBECONFIG, or
$KUBECONFIG)
Expand Down Expand Up @@ -148,6 +169,11 @@ werf export [IMAGE_NAME...] [options]
Enable verbose output (default $WERF_LOG_VERBOSE).
--loose-giterminism=false
Loose werf giterminism mode restrictions
-p, --parallel=true
Run in parallel (default $WERF_PARALLEL or true)
--parallel-tasks-limit=5
Parallel tasks limit, set -1 to remove the limitation (default
$WERF_PARALLEL_TASKS_LIMIT or 5)
--platform=[]
Enable platform emulation when building images with werf, format: OS/ARCH[/VARIANT]
($WERF_PLATFORM or $DOCKER_DEFAULT_PLATFORM by default)
Expand Down

0 comments on commit db20884

Please sign in to comment.