Upload to AWS S3¶
Usually run for you
run_together uploads each packaged sample (and, for joint runs, multi-catalog.yaml with the shared files) with its own --s3-upload stage, to <s3-prefix>/batch=<YYYY_MM>/<collection>/<dir>. Use upload_aws to upload a packaged directory directly, to any S3 path.
Overview¶
Use upload_aws to publish CartLoader outputs (PMTiles, factor files, and the catalog) to Amazon S3 for sharing or deployment. It supports single‑dataset uploads and collection uploads (multiple dataset directories via --in-list). File lists are taken from catalog.yaml and split into three groups:
- basics: every file the catalog references, except the two groups below (includes the SGE basemaps and AI alias files recorded as
alias_ai); - optional: UMAP files (
umap.tsv,umap.png,umap.ind_png,umap.pmtiles) and manualaliasfiles; - basemaps: non-SGE basemaps, such as histology images.
Requirements¶
- A packaged directory with a
catalog.yaml, fromrun_cartload2(or each sample directory ofrun_cartload2_multi). Every file the catalog references must exist locally. - AWS CLI installed and configured (e.g.,
aws configure).
Actions¶
Writes a Makefile (--makefn, inside --in-dir) with one upload target per group and runs it:
- basics: all basic files plus
catalog.yamlin one target, flagged by<in-dir>/cartload.aws.done; - optional and basemap files: one target per file, each followed by a re-upload of
catalog.yaml, flagged by<file>.aws.done.
catalog.yaml is always uploaded as <s3-dir>/catalog.yaml. Existing flags make reruns skip completed uploads; use --restart to upload again.
Example Usage¶
1 2 3 4 5 6 7 | |
1 2 3 4 5 6 7 8 | |
Collection Structure
Input Collection
--in-diris a parent directory containing one subdirectory per dataset;--in-listnames those subdirectories (first column).- Each subdirectory must include its own
catalog.yaml. - For a
run_cartload2_multioutput, the subdirectories are named<multi_id>-<sample_id>; list those names. Collection mode uploads only the subdirectories, not the rootmulti-catalog.yamlor the shared factor files next to it.
1 2 3 4 5 6 7 8 9 10 11 | |
Output S3 Collection
- Each dataset uploads to
<s3-dir>/<s3_id>/, where<s3_id>is the catalog'sid, or, without one, the listed name lowercased with underscores replaced by hyphens.
1 2 3 4 5 6 7 8 | |
Parameters¶
Input/Output¶
--in-dir(str, required): Input directory (single) or parent directory with per-dataset subdirectories (collection).--s3-dir(str, required): S3 destination (single) or parent prefix for per-dataset outputs (collection).--catalog-yaml(str): Catalog to read (single mode only; default:<in-dir>/catalog.yaml).
Upload Selection¶
--upload-basics-only(flag): Upload only the basic files and the catalog.--upload-optional-only(flag): Upload only the optional files (UMAP, alias).--upload-basemap-only(flag): Upload only the additional basemaps.
Use at most one of these flags: combining two or more uploads nothing.
Collection Parameters¶
--in-list(str): TSV of subdirectory names under--in-dir(first column; no header); enables collection mode. Cannot be combined with--catalog-yaml.
AWS Configuration¶
--aws(str): AWS CLI executable (default:aws).--profile(str): AWS CLI profile passed to everyaws s3 cp(default: the CLI's default profile).
Run Parameters¶
--dry-run(flag): Write the Makefile and print the commands (make -n) without uploading.--restart(flag): Ignore existing.aws.doneflags and upload everything again.--n-jobs(int): Number of parallel jobs (default:2).--makefn(str): Makefile name, written inside--in-dir(default:upload_aws.mk).
Output¶
- Files uploaded under
--s3-dir(per-dataset subdirectories in collection mode). <in-dir>/upload_aws.mk(always written, also in dry-run mode).- Flag files:
cartload.aws.donein each dataset directory and<file>.aws.donenext to each uploaded optional or basemap file.