diff --git a/docs-website/static/docs/tutorials/package_create_size.html b/docs-website/static/docs/tutorials/package_create_size.html deleted file mode 100644 index 256c1cb076..0000000000 --- a/docs-website/static/docs/tutorials/package_create_size.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - -
-
-Specify a maximum file size for this package in Megabytes. Above this size, the package will be split into multiple files. 0 will disable this feature.
- ? Please provide a value for "Maximum Package Size"(0) 0
-
-
- - diff --git a/docs/2-the-zarf-cli/100-cli-commands/zarf_package_create.md b/docs/2-the-zarf-cli/100-cli-commands/zarf_package_create.md index c9f87d35d4..4d7f3f9933 100644 --- a/docs/2-the-zarf-cli/100-cli-commands/zarf_package_create.md +++ b/docs/2-the-zarf-cli/100-cli-commands/zarf_package_create.md @@ -21,7 +21,7 @@ zarf package create [ DIRECTORY ] [flags] -h, --help help for create -k, --key string Path to private key file for signing packages --key-pass string Password to the private key file used for signing packages - -m, --max-package-size int Specify the maximum size of the package in megabytes, packages larger than this will be split into multiple parts. Use 0 to disable splitting. + -m, --max-package-size int Specify the maximum size of the package in megabytes, packages larger than this will be split into multiple parts to be loaded onto smaller media (i.e. DVDs). Use 0 to disable splitting. -o, --output string Specify the output (either a directory or an oci:// URL) for the created Zarf package --registry-override stringToString Specify a map of domains to override on package create when pulling images (e.g. --registry-override docker.io=dockerio-reg.enterprise.intranet) (default []) -s, --sbom View SBOM contents after creating the package diff --git a/docs/4-deploy-a-zarf-package/2-package-sources.md b/docs/4-deploy-a-zarf-package/2-package-sources.md index c36cecdbe7..d99101f1e0 100644 --- a/docs/4-deploy-a-zarf-package/2-package-sources.md +++ b/docs/4-deploy-a-zarf-package/2-package-sources.md @@ -1,11 +1,24 @@ # Package Sources -Zarf currently supports consuming the following package sources: +Zarf currently supports consuming packages from the following sources: -- Local Tarball Path (`.tar` and `.tar.zst`) - The default output on `zarf package create` -- Split Tarball Path (`.part...`) - Optionally created by specifying `--max-package-size` -- Remote Tarball URL (`http://` and `https://` ) - A package tarball hosted on a web server -- Remote OCI Reference (`oci://`) - A package published to an OCI compatible registry +### Local Tarball Path (`.tar` and `.tar.zst`) + +A local tarball is the default output of `zarf package create` and is a package contained within a tarball with or without [Zstandard](https://facebook.github.io/zstd/) compression. Compression is determined by a given package's [`metadata.uncompressed` key](https://docs.zarf.dev/docs/create-a-zarf-package/zarf-schema#metadata) within it's `zarf.yaml` package definition + +### Split Tarball Path (`.part...`) + +A split tarball is a local tarball that has been split into multiple parts so that it can fit on smaller media when traveling to a disconnected environment (i.e. on DVDs). These packages are created by specifying a maximum number of megabytes with [`--max-package-size`](../2-the-zarf-cli/100-cli-commands/zarf_package_create.md) on `zarf package create` and if the resulting tarball is larger than that size it will be split into chunks. + +### Remote Tarball URL (`http://` and `https://` ) + +A remote tarball is a Zarf package tarball that is hosted on a web server that is accessible to the current machine. By default Zarf does not provide a mechanism to place a package on a web server, but this is easy to orchestrate with other tooling such as uploading a package to a continuous integration system's artifact storage or to a repository's release page. + +### Remote OCI Reference (`oci://`) + +An OCI package is one that has been published to an OCI compatible registry using `zarf package publish` or the `-o` option on `zarf package create`. These packages live within a given registry and you can learn more about them in our [Publish & Deploy Packages w/OCI Tutorial](../5-zarf-tutorials/7-publish-and-deploy.md). + +## Commands with Sources A source can be used with the following commands as their first argument: @@ -18,11 +31,11 @@ A source can be used with the following commands as their first argument: :::note -In addition to the traditional sources, there is also a special Cluster source available on `inspect` and `remove` that allows for referencing a package via its name: +In addition to the traditional sources outlined above, there is also a special "Cluster" source available on `inspect` and `remove` that allows for referencing a deployed package via its name: - `zarf package inspect ` - `zarf package remove ` -Inspecting a package deployed to a cluster will not be able to show the package's SBOMs, as they are not currently persisted to the cluster. +Additionally, inspecting a package deployed to a cluster will not be able to show the package's SBOMs, as they are not currently persisted to the cluster. ::: diff --git a/docs/5-zarf-tutorials/0-creating-a-zarf-package.md b/docs/5-zarf-tutorials/0-creating-a-zarf-package.md index 4a85f87769..d0b53f65dd 100644 --- a/docs/5-zarf-tutorials/0-creating-a-zarf-package.md +++ b/docs/5-zarf-tutorials/0-creating-a-zarf-package.md @@ -230,7 +230,7 @@ To add this to our `zarf.yaml` we can simply specify it under our `wordpress` co Once you have followed the above you should now have a `zarf.yaml` file that matches the one found on the [WordPress example page](../../examples/wordpress/README.md). -Creating this package is as simple as running the `zarf package create` command with the directory containing our `zarf.yaml`. Zarf will show us the `zarf.yaml` one last time asking if we would like to build the package, and will ask us for a maximum package size (useful if you need to split a package across multiple [Compact Discs](https://en.wikipedia.org/wiki/Compact_disc)). Upon confirmation Zarf will pull down all of the resources and bundle them into a package tarball. +Creating this package is as simple as running the `zarf package create` command with the directory containing our `zarf.yaml`. Zarf will show us the `zarf.yaml` one last time asking if we would like to build the package, and upon confirmation Zarf will pull down all of the resources and bundle them into a package tarball. ```bash zarf package create . @@ -246,15 +246,11 @@ You can skip this confirmation by adding the `--confirm` flag when running the c ::: -After you confirm package creation, you have the option to specify a maximum file size for the package. To disable this feature, enter `0`. - - - This will create a zarf package in the current directory with a package name that looks something like `zarf-package-wordpress-amd64-16.0.4.tar.zst`, although it might be slightly different depending on your system architecture. :::tip -You can learn more about what is going on behind the scenes of this process on the [package create lifecycle page](../3-create-a-zarf-package/5-package-create-lifecycle.md), and can view other useful command flags like `--differential` and `--registry-override` on the [package create command flags page](../2-the-zarf-cli/100-cli-commands/zarf_package_create.md). +You can learn more about what is going on behind the scenes of this process on the [package create lifecycle page](../3-create-a-zarf-package/5-package-create-lifecycle.md), and can view other useful command flags like `--max-package-size`, `--differential` and `--registry-override` on the [package create command flags page](../2-the-zarf-cli/100-cli-commands/zarf_package_create.md). ::: diff --git a/docs/5-zarf-tutorials/8-custom-init-packages.md b/docs/5-zarf-tutorials/8-custom-init-packages.md index 6d9c485127..a8447c8cfd 100644 --- a/docs/5-zarf-tutorials/8-custom-init-packages.md +++ b/docs/5-zarf-tutorials/8-custom-init-packages.md @@ -56,11 +56,7 @@ You can skip this confirmation by adding the `--confirm` flag when running the c ::: -After you confirm package creation, you have the option to specify a maximum file size for the package. To disable this feature, enter `0`. - - - -Once you enter your response for the package size, Zarf will create the Zarf 'init' package in the current directory. In this case, the package name should look something like `zarf-init-amd64-vX.X.X.tar.zst`, although it might differ slightly depending on your system architecture. +After you confirm package creation, Zarf will create the Zarf 'init' package in the current directory. In this case, the package name should look something like `zarf-init-amd64-vX.X.X.tar.zst`, although it might differ slightly depending on your system architecture. ## Customizing the 'init' Package diff --git a/src/config/lang/english.go b/src/config/lang/english.go index d771aad344..7d1bd85688 100644 --- a/src/config/lang/english.go +++ b/src/config/lang/english.go @@ -252,7 +252,7 @@ const ( CmdPackageCreateFlagSbom = "View SBOM contents after creating the package" CmdPackageCreateFlagSbomOut = "Specify an output directory for the SBOMs from the created Zarf package" CmdPackageCreateFlagSkipSbom = "Skip generating SBOM for this package" - CmdPackageCreateFlagMaxPackageSize = "Specify the maximum size of the package in megabytes, packages larger than this will be split into multiple parts. Use 0 to disable splitting." + CmdPackageCreateFlagMaxPackageSize = "Specify the maximum size of the package in megabytes, packages larger than this will be split into multiple parts to be loaded onto smaller media (i.e. DVDs). Use 0 to disable splitting." CmdPackageCreateFlagSigningKey = "Path to private key file for signing packages" CmdPackageCreateFlagSigningKeyPassword = "Password to the private key file used for signing packages" CmdPackageCreateFlagDifferential = "[beta] Build a package that only contains the differential changes from local resources and differing remote resources from the specified previously built package" diff --git a/src/pkg/packager/interactive.go b/src/pkg/packager/interactive.go index b4bf207f35..f338b00b90 100644 --- a/src/pkg/packager/interactive.go +++ b/src/pkg/packager/interactive.go @@ -8,16 +8,13 @@ import ( "fmt" "os" "path/filepath" - "strconv" "github.com/AlecAivazis/survey/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/internal/packager/sbom" - "github.com/defenseunicorns/zarf/src/pkg/interactive" "github.com/defenseunicorns/zarf/src/pkg/layout" "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/types" "github.com/pterm/pterm" ) @@ -86,29 +83,6 @@ func (p *Packager) confirmAction(stage string) (confirm bool) { return false } - // On create in interactive mode, prompt for max package size if it is still the default value of 0 - // Note: it will not be 0 if the user has provided a value via the --max-package-size flag or Viper config - if stage == config.ZarfCreateStage && p.cfg.CreateOpts.MaxPackageSizeMB == 0 { - value, err := interactive.PromptVariable(types.ZarfPackageVariable{ - Name: "Maximum Package Size", - Description: "Specify a maximum file size for this package in Megabytes. Above this size, the package will be split into multiple files. 0 will disable this feature.", - Default: "0", - }) - if err != nil { - // User aborted, cancel the action - return false - } - - // Try to parse the value, on error warn and move on - maxPackageSize, err := strconv.Atoi(value) - if err != nil { - message.Warnf("Unable to parse \"%s\" as a number for the maximum file size. This package will not be split into multiple files.", value) - return true - } - - p.cfg.CreateOpts.MaxPackageSizeMB = maxPackageSize - } - return true } diff --git a/src/test/e2e/30_config_file_test.go b/src/test/e2e/30_config_file_test.go index 3c8189a146..a03844fa5a 100644 --- a/src/test/e2e/30_config_file_test.go +++ b/src/test/e2e/30_config_file_test.go @@ -126,7 +126,7 @@ func configFileDefaultTests(t *testing.T) { "create.output: 52d061d5", "Skip generating SBOM for this package (default true)", "[thing1=1a2b3c4d]", - "Specify the maximum size of the package in megabytes, packages larger than this will be split into multiple parts. Use 0 to disable splitting. (default 42)", + "Specify the maximum size of the package in megabytes, packages larger than this will be split into multiple parts to be loaded onto smaller media (i.e. DVDs). Use 0 to disable splitting. (default 42)", } packageDeployFlags := []string{ diff --git a/src/test/packages/05-multi-part/zarf.yaml b/src/test/packages/05-multi-part/zarf.yaml index 36b36d68d2..78b47ba606 100644 --- a/src/test/packages/05-multi-part/zarf.yaml +++ b/src/test/packages/05-multi-part/zarf.yaml @@ -1,7 +1,7 @@ kind: ZarfPackageConfig metadata: name: multi-part - description: Example to demonstrate how to create multi-part zarf packages. By default, packages will not be split into multiple parts. To produce a multi-part package, use the command "zarf package create --max-package-size=1" + description: Example to demonstrate how to create multi-part zarf packages. By default, packages will not be split into multiple parts to be loaded onto smaller media (i.e. DVDs). To produce a multi-part package, use the command "zarf package create --max-package-size=1" components: - name: big-ol-file