The following commands allow you to download and upload a Bundle from your terminal.
To use these commands, you may need to download the latest apollo-cli version from Quick Actions > Download Apollo CLI on your Apollo Hub homepage. The minimum required apollo-cli version is 0.425.0. You can use the ./apollo-cli version command to check which apollo-cli version you are running.
The same apollo-cli commands are used for Bundles and Bundle chunks. For help with the commands, you can add the -h flag.
For more information about getting started with the Apollo CLI, see the public documentation.
By default, the Apollo CLI will download the entire Bundle by downloading all chunks and assembling the Bundle. However, if the Bundle is not chunked, the CLI will download the entire Bundle directly.
--chunks-only flag to your command.--index-only flag.--generate-urls flag.Download the Bundle with the apollo-cli bundle download command. You can find the bundle-rid in the URL path of a Bundle page in its Pipeline inbox, it should follow the format workspace/apollo/export/app/pipelines/{pipeline-id}/bundles/{bundle-rid}. If an output file is not specified, The Bundle will be downloaded into the default tar file pipeline_id-bundle_version.tar.
Copied!1 2 3$ ./apollo-cli bundle download [bundle-rid]\ --apollo-token "$APOLLO_TOKEN" \ --apollo-url "$APOLLO_URL"
The downloaded Bundle will be an uncompressed archive in .tar format. To compress the Bundle using gzip (i.e., as a .tar.gz file), you can add the --gzip-compressed flag to your command. Be aware that this might significantly increase the time it takes to assemble the Bundle.
When downloading non-chunked Bundles, you can use the --retry flag to specify the maximum number of retries for a failed download. When downloading chunked Bundles, retrying failed chunks is not supported, but the chunk numbers not downloaded are included in the error message.
Copied!1Error: failed to download all chunks, chunk numbers not downloaded: 1,8,9,10,11,12, downloaded: 2,3,4,5,6,7,13,14,15,16,17,18: http2: client connection lost
Retry downloading the failed chunks by providing the list via the--chunk-ids parameter.
Copied!1 2 3 4$ ./apollo-cli bundle download [bundle-rid]\ --apollo-token "$APOLLO_TOKEN" \ --apollo-url "$APOLLO_URL" \ --chunk-ids 2,3,4,5,6,7,13,14,15,16,17,18
The CLI also supports layer-deduplicated Bundle transfer by using the --transfer-target flag. This can potentially decrease the amount of data transferred to a specific destination Hub. Learn more about layer deduplication using Apollo CLI.
You can use the apollo-cli bundle upload command for both uploading a Bundle and bulk uploading all Bundle chunks. Use the --bundle-path flag to specify the path to the Bundle you want to upload. This could be a single tar file or a directory of chunks.
Copied!1 2 3 4$ ./apollo-cli bundle upload \ --apollo-token "$APOLLO_TOKEN" \ --apollo-url "$APOLLO_URL" \ --bundle-path $PIPELINE_ID-$BUNDLE_VERSION
By default, apollo-cli bundle download downloads and assembles an entire Bundle from chunks when possible. This approach uses a small disk footprint since each downloaded chunk is streamed directly into the output Bundle archive and written to disk only once. However, if any single chunk fails to download, the entire command will fail. This makes it prone to failure when a Bundle has many chunks or when a single chunk is too large.
To reliably download a whole Bundle from chunks, you can:
Download all chunks with a base Bundle archive required for assembling.
Copied!1 2 3 4$ ./apollo-cli bundle download [bundle-rid] \ --apollo-token "$APOLLO_TOKEN" \ --apollo-url "$APOLLO_URL" \ --chunks-only
Download the index and referrers.
Copied!1 2 3 4$ ./apollo-cli bundle download [bundle-rid] \ --apollo-token "$APOLLO_TOKEN" \ --apollo-url "$APOLLO_URL" \ --index-only
Assemble all Bundle chunk archives and the index into a Bundle saved at pipeline_id-bundle_version-index.tar.
Copied!1 2 3$ ./apollo-cli bundle assemble \ --archive-dir $PIPELINE_ID-$BUNDLE_VERSION \ --base-bundle-archive $PIPELINE_ID-$BUNDLE_VERSION-index.tar
If you prefer to transfer a smaller amount of data to the Target Hub at a time, you can first upload the chunks and index and referrers downloaded in step 1 and 2 to the Target Hub, then run apollo-cli bundle assemble at the Target Hub.
The apollo-cli bundle assemble command will assemble the Bundle in an uncompressed archive format, a .tar file. To compress the Bundle using gzip, which will create a .tar.gz file, you can add this flag to your command: --gzip-compressed true. Beware that this might significantly increase the time it takes to assemble the Bundle.