mirror of
https://github.com/floci-io/floci.git
synced 2026-11-27 07:39:24 -05:00
test(emr): run steps and job runs through the Docker runner (#7349)
No EMR test ran a step or a job run through Floci's Docker runner: the runner's wrappers and settings were unit tested and run by hand in the images. EmrDockerRunnerDockerIntegrationTest, a Docker-gated @QuarkusTest on ContainerDataPlaneProfile (which now sets both runner modes to docker), runs them for real in the emr-7.5.0 image, reaching Floci's S3 from the container: - a hadoop-streaming word count step, its mapper and reducer from S3, writing its counts to S3; - the same word count as a custom JAR at EMR's streaming jar path; - s3-dist-cp from S3 into the cluster's HDFS and back; - a cluster's spark-env export, read by a Spark step's driver; - an EMR Serverless run on the user guide's virtual environment recipe, spark.archives with #environment and the driver's and executors' Python in it, from an archive that needs no package index. EmrRequests.awaitStep and EmrServerlessRequests' createSparkApplication, startJobRun and awaitJobRun are shared helpers, each wait checking that its call answered 200 before reading the state, and RetryingTarCopier.putEntry, pulled out of singleFileTar, writes the archive's entries. The CI prefetch queues the 3.5 GB image for the shard that runs the class, last, behind the Lambda runtimes, and the prefetch results step no longer warns about an EMR Serverless image on ECR Public, the only place AWS publishes them.
This commit is contained in:
1 parent
cfd7e83776
commit
b63e4a5bb9
7 files changed
+358
-15
No files matched your search
@@ -189,12 +189,7 @@ public final class RetryingTarCopier {
|
||||
try {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
try (TarArchiveOutputStream tar = newTarStream(out)) {
|
||||
TarArchiveEntry entry = new TarArchiveEntry(entryName);
|
||||
entry.setSize(content.length);
|
||||
entry.setMode(mode);
|
||||
tar.putArchiveEntry(entry);
|
||||
tar.write(content);
|
||||
tar.closeArchiveEntry();
|
||||
putEntry(tar, entryName, content, mode);
|
||||
}
|
||||
return out.toByteArray();
|
||||
} catch (IOException e) {
|
||||
@@ -202,6 +197,17 @@ public final class RetryingTarCopier {
|
||||
}
|
||||
}
|
||||
|
||||
/** Writes {@code content} as the file {@code entryName}, with {@code mode}, such as 0755 for a script. */
|
||||
public static void putEntry(TarArchiveOutputStream tar, String entryName, byte[] content, int mode)
|
||||
throws IOException {
|
||||
TarArchiveEntry entry = new TarArchiveEntry(entryName);
|
||||
entry.setSize(content.length);
|
||||
entry.setMode(mode);
|
||||
tar.putArchiveEntry(entry);
|
||||
tar.write(content);
|
||||
tar.closeArchiveEntry();
|
||||
}
|
||||
|
||||
/** GNU long names + star big numbers so any path length and file size survive the archive. */
|
||||
public static TarArchiveOutputStream newTarStream(OutputStream out) {
|
||||
TarArchiveOutputStream tar = new TarArchiveOutputStream(out);
|
||||
|
||||
Reference in new issue
Block a user