cargoship

module
v0.45.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2026 License: Apache-2.0

README ΒΆ

CargoShip Logo

CargoShip

High-performance S3 data archiving

Go Version Go Reference License GitHub Release Go Report Card codecov Security Build Status GitHub Issues GitHub Pull Requests

CargoShip's goal is to be the fastest and most efficient β€” in both S3 operations and dollars β€” way to move data into and out of Amazon S3. It packs large directory trees into compressed, verifiable, portable archives streamed directly to S3, for research and technical datasets with many files, where ordinary copy tools create excessive S3 requests, give weak recovery guarantees, or make storage costs hard to predict.

That goal is an explicit aim, not a blanket claim: where it has been measured against aws s3 cp / s5cmd / rclone is recorded honestly in the capability matrix and benchmarks β€” today, fastest and cheapest on many-small-file workloads, competitive on few-large.

Why not plain aws s3 cp or rclone?

Those tools copy files one-to-one, which turns a million-file dataset into a million S3 requests with no packaging, manifest, or cost model. CargoShip packs files into compressed archives, shards uploads across S3 prefixes for throughput, records a verifiable manifest, and can estimate cost before you commit. See the feature comparison for a side-by-side breakdown.

Installation

# Homebrew (macOS/Linux)
brew tap scttfrdmn/tap && brew trust scttfrdmn/tap
brew install scttfrdmn/tap/cargoship

# Scoop (Windows)
scoop bucket add scttfrdmn https://github.com/scttfrdmn/scoop-bucket
scoop install cargoship

# Go install
go install github.com/scttfrdmn/cargoship/cmd/cargoship@latest

Pre-built binaries for macOS, Linux, and Windows are on the releases page. CargoShip reads AWS credentials from the standard SDK chain (environment, shared config, or IAM role); see AWS setup for the minimal IAM policy and the installation guide for more options.

Example

A complete round trip: estimate, upload, inspect, verify, and restore a single file.

# 1. Estimate cost before uploading
cargoship estimate /data/project-2024 --storage-class deep-archive

# 2. Upload a directory to S3 (canonical command)
cargoship upload /data/project-2024 s3://my-bucket/project-2024 \
  --storage-class INTELLIGENT_TIERING

# 🚒 Uploading: 1234 files | 5.67 GB | 89 chunks | 123.4 MB/s | 1m30s elapsed
# βœ… Upload Complete!  Upload ID: 20260721-123456-abcd1234

# Steps 3–5 address the upload by its ID (printed above), as
#   s3://<bucket>/<prefix>/uploads/<upload-id>

# 3. Inspect what was uploaded, straight from the manifest (no download)
cargoship info s3://my-bucket/project-2024/uploads/20260721-123456-abcd1234

# 4. Verify the archive against its manifest checksums
cargoship verify s3://my-bucket/project-2024/uploads/20260721-123456-abcd1234

# 5. Restore a single file (OUTPUT_DIR is positional) without pulling the whole archive
cargoship restore s3://my-bucket/project-2024/uploads/20260721-123456-abcd1234 ./restored/ \
  --file results/summary.csv

See the quick start for a guided walkthrough and the command reference for every command and flag.

Sharding is chosen automatically from the workload, but you can override it:

cargoship upload /data/project-2024 s3://my-bucket/project-2024 --shard-count 16

Common commands

Command Purpose
cargoship estimate Model storage cost before uploading
cargoship upload Pack, compress, and stream a directory to S3
cargoship info Inspect an archive from its manifest, no download
cargoship verify Check archive contents against manifest checksums
cargoship restore Restore all or selected files from an archive
cargoship budget Set and monitor per-project cost and volume budgets
cargoship lifecycle Manage S3 lifecycle policies for stored archives

Key differentiators

  • Zero-disk streaming pipeline β€” files stream from disk through compression to S3 with no local staging; memory stays bounded to chunk_size Γ— workers.
  • Multi-prefix sharding β€” chunks are distributed across S3 prefixes, each with its own upload workers, so the shard count sets upload concurrency. CargoShip automatically selects between 4 and 32 shards when --shard-count is 0 (the default); if automatic selection fails, it falls back to 8. See sharding.
  • Content-aware compression β€” zstd compresses text and code well and skips already-compressed data. See compression.
  • Cost and budget controls β€” estimate spend before uploading and enforce per-project cost and volume budgets. See budgets.
  • Open, portable format β€” archives are tar.zst with a JSON manifest, both readable with standard tools. See the format spec.

CargoShip suits research data, analytics output, long-term backup and compliance retention, and cold-tier data-lake migration β€” anywhere a large file count and predictable cost matter more than one-to-one file copies.

Safety and portability

CargoShip never modifies source files; it only reads them. Archives use the open tar.zst format alongside a plain JSON manifest, so your data stays recoverable with standard tools (tar, zstd, jq) even without CargoShip installed. The manifest records per-file checksums, letting cargoship verify confirm integrity after upload and letting cargoship restore pull a single file without downloading the whole archive. The format spec documents the layout in full.

Documentation

Full documentation lives at cargoship.app.

Getting started

Guides & tutorials

Cost & format

Project

Project status and license

CargoShip is at v0.45.0 and is a community-maintained v0.x project β€” the CLI and archive format are usable in production, with compatibility caveats tracked on the maturity page. To report a security issue, see SECURITY.md.

Licensed under the Apache License 2.0; see LICENSE. Originally inspired by Duke University's SuitcaseCTL research project, now an independent project.

Support

Directories ΒΆ

Path Synopsis
cmd
cargoship command
Packaged main defines the top level CLI module
Packaged main defines the top level CLI module
cargoship-bench command
Command cargoship-bench runs the Phase-1 (CargoShip-only) speed + cost benchmark: for each reproducible corpus profile it uploads and restores through the real pipeline, measuring throughput and the exact S3 request bill from a counting middleware.
Command cargoship-bench runs the Phase-1 (CargoShip-only) speed + cost benchmark: for each reproducible corpus profile it uploads and restores through the real pipeline, measuring throughput and the exact S3 request bill from a counting middleware.
cargoship-cost command
Package main provides a CLI tool for CargoShip cost management
Package main provides a CLI tool for CargoShip cost management
cargoship-test command
cargoship/cmd
Package cmd is the command line utility
Package cmd is the command line utility
ghost-ship command
examples
basic-upload command
Package main demonstrates basic usage of CargoShip as a library for optimized S3 uploads.
Package main demonstrates basic usage of CargoShip as a library for optimized S3 uploads.
internal
fixtures
Package fixtures provides shared, deterministic test fixtures for CargoShip: a fluent builder for manifests and on-disk file trees, plus golden-file helpers with output normalization.
Package fixtures provides shared, deterministic test fixtures for CargoShip: a fluent builder for manifests and on-disk file trees, plus golden-file helpers with output normalization.
testenv
Package testenv isolates a test binary from the developer's real home directory and AWS configuration (#1048).
Package testenv isolates a test binary from the developer's real home directory and AWS configuration (#1048).
testutil
Package testutil provides testing utilities for CargoShip
Package testutil provides testing utilities for CargoShip
version
Package version is the single source of truth for CargoShip's version.
Package version is the single source of truth for CargoShip's version.
pkg
archivefs
Package archivefs provides a virtual filesystem view over a CargoShip manifest, enabling navigation and inspection of archived files without extraction.
Package archivefs provides a virtual filesystem view over a CargoShip manifest, enabling navigation and inspection of archived files without extraction.
aws/access
Package access implements read-only access-control posture checks for the S3 buckets CargoShip writes to and reads from (Issue #529).
Package access implements read-only access-control posture checks for the S3 buckets CargoShip writes to and reads from (Issue #529).
aws/config
Package config provides AWS configuration management for CargoShip
Package config provides AWS configuration management for CargoShip
aws/cost
Package cost provides budget alert notification system
Package cost provides budget alert notification system
aws/costs
Package costs provides cost estimation and optimization for CargoShip AWS operations
Package costs provides cost estimation and optimization for CargoShip AWS operations
aws/lifecycle
Package lifecycle provides S3 lifecycle policy management for CargoShip
Package lifecycle provides S3 lifecycle policy management for CargoShip
aws/metrics
Package metrics provides CloudWatch integration for CargoShip observability
Package metrics provides CloudWatch integration for CargoShip observability
aws/pricing
Package pricing provides real-time AWS pricing integration for CargoShip
Package pricing provides real-time AWS pricing integration for CargoShip
aws/pricingfallback
Package pricingfallback holds the single canonical table of S3 fallback prices used when the live AWS Price List API is unavailable or disabled.
Package pricingfallback holds the single canonical table of S3 fallback prices used when the live AWS Price List API is unavailable or disabled.
aws/s3
Package s3 provides adaptive multipart upload optimization for CargoShip
Package s3 provides adaptive multipart upload optimization for CargoShip
benchharness
Package benchharness runs a CargoShip upload+restore of a reproducible corpus and measures its speed and full S3 cost from EXACT, middleware-counted requests β€” the Phase-1 (CargoShip-only) benchmark.
Package benchharness runs a CargoShip upload+restore of a reproducible corpus and measures its speed and full S3 cost from EXACT, middleware-counted requests β€” the Phase-1 (CargoShip-only) benchmark.
benchmarks
Package benchmarks provides a comprehensive benchmarking framework for CargoShip with automated regression detection and performance tracking.
Package benchmarks provides a comprehensive benchmarking framework for CargoShip with automated regression detection and performance tracking.
chunking
Package chunking provides intelligent file chunking and sharding for CargoShip
Package chunking provides intelligent file chunking and sharding for CargoShip
compression
Package compression provides advanced compression algorithms for CargoShip
Package compression provides advanced compression algorithms for CargoShip
config
Package config provides centralized configuration management for CargoShip
Package config provides centralized configuration management for CargoShip
context
Package context provides command filtering utilities
Package context provides command filtering utilities
corpus
Package corpus generates reproducible synthetic file corpora for the benchmark harness.
Package corpus generates reproducible synthetic file corpora for the benchmark harness.
detection
Package detection provides AI-powered file type detection using Magika (Issue #30)
Package detection provides AI-powered file type detection using Magika (Issue #30)
encryption
Package encryption provides KMS envelope encryption for CargoShip manifests (Issue #163)
Package encryption provides KMS envelope encryption for CargoShip manifests (Issue #163)
errors
Package errors provides production-grade error handling for CargoShip
Package errors provides production-grade error handling for CargoShip
extraction
Package extraction provides streaming decompression and extraction from S3 archives
Package extraction provides streaming decompression and extraction from S3 archives
fleet
Package fleet holds provisioning and control-plane helpers for running CargoShip as a fleet of writer-isolated agents ("ghostships", #604).
Package fleet holds provisioning and control-plane helpers for running CargoShip as a fleet of writer-isolated agents ("ghostships", #604).
gpg
Package gpg provides encrypted files
Package gpg provides encrypted files
ioutils
Package ioutils provides memory-mapped file I/O optimizations for large file operations.
Package ioutils provides memory-mapped file I/O optimizations for large file operations.
launch
Package launch provides autonomous archival for CargoShip deployed on a remote host such as a NAS.
Package launch provides autonomous archival for CargoShip deployed on a remote host such as a NAS.
manifest
Package manifest provides selective file restoration from CargoShip archives using hash-based addressing and LRU chunk caching (Issue #189).
Package manifest provides selective file restoration from CargoShip archives using hash-based addressing and LRU chunk caching (Issue #189).
manifestcache
Package manifestcache persists the manifest of a completed upload locally so a later incremental sync can compute a delta without reading the previous manifest back from S3.
Package manifestcache persists the manifest of a completed upload locally so a later incremental sync can compute a delta without reading the previous manifest back from S3.
multiregion
Package multiregion provides multi-region pipeline distribution and coordination for CargoShip
Package multiregion provides multi-region pipeline distribution and coordination for CargoShip
observability/bindguard
Package bindguard decides whether an observability listener address (pprof, Prometheus metrics) may be bound, refusing a non-loopback bind unless the operator explicitly opts in.
Package bindguard decides whether an observability listener address (pprof, Prometheus metrics) may be bound, refusing a non-loopback bind unless the operator explicitly opts in.
observability/metrics
Package metrics provides Prometheus metrics for CargoShip observability.
Package metrics provides Prometheus metrics for CargoShip observability.
observability/tracing
Package tracing provides OpenTelemetry distributed tracing for CargoShip
Package tracing provides OpenTelemetry distributed tracing for CargoShip
pipeline
Package pipeline provides streaming pipeline for CargoShip v0.5.0
Package pipeline provides streaming pipeline for CargoShip v0.5.0
profiling
Package profiling provides integrated profiling capabilities for CargoShip performance analysis and optimization.
Package profiling provides integrated profiling capabilities for CargoShip performance analysis and optimization.
progress
Package progress provides upload progress tracking with ETA for CargoShip
Package progress provides upload progress tracking with ETA for CargoShip
repl
Package repl provides an interactive shell environment for CargoShip
Package repl provides an interactive shell environment for CargoShip
restore
Package restore provides restore job persistence for tracking long-running S3 Glacier/Deep Archive restoration requests across sessions (Issue #202).
Package restore provides restore job persistence for tracking long-running S3 Glacier/Deep Archive restoration requests across sessions (Issue #202).
s3cost
Package s3cost turns a measured S3 workload β€” request counts by operation, bytes stored, bytes transferred out β€” into an itemized dollar cost, using the canonical fallback price table (pkg/aws/pricingfallback).
Package s3cost turns a measured S3 workload β€” request counts by operation, bytes stored, bytes transferred out β€” into an itemized dollar cost, using the canonical fallback price table (pkg/aws/pricingfallback).
s3count
Package s3count counts the S3 API operations an aws-sdk-go-v2 client issues, via a smithy middleware.
Package s3count counts the S3 API operations an aws-sdk-go-v2 client issues, via a smithy middleware.
s3metrics
Package s3metrics reads a mover's SERVER-SIDE S3 request counts from CloudWatch S3 request metrics, so the benchmark harness can score any black-box competitor (aws s3 cp / s5cmd / rclone / mc) with the same pkg/s3cost model as CargoShip β€” whose counts come from client-side middleware (pkg/s3count) that a competitor binary doesn't expose.
Package s3metrics reads a mover's SERVER-SIDE S3 request counts from CloudWatch S3 request metrics, so the benchmark harness can score any black-box competitor (aws s3 cp / s5cmd / rclone / mc) with the same pkg/s3cost model as CargoShip β€” whose counts come from client-side middleware (pkg/s3count) that a competitor binary doesn't expose.
s3optimization
Package s3optimization provides S3 optimization components extracted from CargoShip for ObjectFS integration
Package s3optimization provides S3 optimization components extracted from CargoShip for ObjectFS integration
staging
Package staging implements predictive chunk staging for optimal transfer performance.
Package staging implements predictive chunk staging for optimal transfer performance.
testutils
Package testutils provides utilities for testing, including goroutine leak detection
Package testutils provides utilities for testing, including goroutine leak detection
tui
Package tui provides terminal user interface components for CargoShip.
Package tui provides terminal user interface components for CargoShip.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL