mirror of
https://github.com/floci-io/floci.git
synced 2026-11-25 14:57:54 -05:00
In the docker runner mode an s3-dist-cp step, the Release Guide's way of
moving data "from Amazon S3 into HDFS where it can be processed by
subsequent steps", between buckets or back to S3, was FAILED without
running, and on the default TERMINATE_CLUSTER it ended its cluster with
errors. The EMR Serverless image steps run in has neither s3-dist-cp nor
the MapReduce it runs on.
Now a command-runner.jar step whose first argument is s3-dist-cp runs
Floci's own S3DistCp: a Python program, emr/s3-dist-cp.py, which the step's
command writes into the container and runs through spark-submit, copying
through Hadoop's file systems in Spark's JVM. The command wrapper gives it
what a Spark step gets: S3 paths in Floci's S3 and hdfs:// paths, and
those without a scheme, in the cluster's HDFS. It takes the options of
the Release Guide's table, --name=value or --name value, and -D
property=value:
- --src and --dest, a source folder's files keeping their folders;
- --srcPattern and --groupBy matched against the whole path; --groupBy
concatenates the files whose groups give the same name into one file
named by them, and refuses an expression with no group, as the guide
says S3DistCp does; --targetSize breaks a larger group into parts
numbered before the extension ("myfile0.gz, myfile1.gz"); without
--outputCodec a group keeps the compression its files share, named
with that codec's extension, or has none when they differ, each file
decompressed so the group is one stream;
- --outputCodec (gzip, gz, lzo, lzop, snappy, none) through Hadoop's
codecs, each source decompressed by its own extension;
- --deleteOnSuccess, deleting the files but not their folders, as AWS's
"Seven tips for using S3DistCp" says;
- --outputManifest, --previousManifest, --requirePreviousManifest and
--copyFromManifest, the manifest gzipped JSON lines of path, baseName,
srcDir and size, as that post shows them;
- --s3ServerSideEncryption, --storageClass, --disableMultipartUpload and
--multipartUploadChunkSize as S3A's settings; --numberFiles,
--startingIndex, --srcPrefixesFile and --appendToLastFile, the last
through a copy renamed over the file, as neither S3 nor the cluster's
HDFS appends in place. The copy has a name of its own and goes if the
writing fails, and the file steps aside, under a name of its own too,
until the copy has taken its place, coming back if it cannot, so a
failed append leaves it as it was. --s3Endpoint is ignored, S3 being
Floci's.
--requirePreviousManifest takes true or false, after = or as the next
argument, and alone is true, its default. A --srcPrefixesFile line ending
in / names that folder alone, its slash kept though Hadoop's Path drops
it; any other is a prefix as S3 lists one, logs/day taking in
logs/day-old/.
A bucket name with an underscore fails the step, as S3DistCp "does not
support" one, and so does a copy Hadoop fails, leaving what was copied.
A copy that would write two files to the same path, the manifest
included (a.log and a.log.gz with --outputCodec=gzip), a file over one
of its own sources, as with the same --src and --dest, or a file outside
--dest, through a .. in a manifest's baseName or in --outputManifest
(Hadoop's paths resolve it), or a file with no name, from a --groupBy
whose groups matched nothing say, fails before it writes anything. emr.md
says what is Floci's own reading: the grouped file's folder,
--numberFiles' naming, a group's compression without --outputCodec and
that refusal.