https://flyte.org logo
#ask-the-community
Title
# ask-the-community
d

Devin McCabe

02/21/2024, 6:59 PM
Hi, everyone. I'm evaluating Flyte for a project and most of the tasks we'd need are already containerized. I'm using the local sandbox/demo cluster and a task like this:
Copy code
crosscheck_fingerprints_task = ContainerTask(
    name="crosscheck-fingerprints",
    input_data_dir="/var/inputs",
    output_data_dir="/var/outputs",
    inputs=kwtypes(haplotype_map=FlyteFile, vcf1=FlyteFile, vcf2=FlyteFile),
    outputs=kwtypes(crosscheck=FlyteFile),
    image="broadinstitute/picard:latest",
    command=[
        "/bin/sh",
        "-c",
        " ".join(
            [
                "java",
                '"-Xmx2g"',
                "-jar /usr/picard/picard.jar",
                "CrosscheckFingerprints",
                "--HAPLOTYPE_MAP /var/inputs/haplotype_map",
                "--CALCULATE_TUMOR_AWARE_RESULTS false",
                "--INPUT /var/inputs/vcf1.vcf",
                "--SECOND_INPUT /var/inputs/vcf2.vcf",
                "--CROSSCHECK_BY FILE",
                "--CROSSCHECK_MODE CHECK_ALL_OTHERS",
                "--OUTPUT /var/outputs/crosscheck",
            ]
        ),
    ],
)
You'll notice two things not observed in the examples (The note "Raw containers cannot be run locally at the moment" seems to be incorrect, thankfully): 1. I have to run
/bin/sh -c java ...
instead of just
java
, otherwise Flyte says it can't find
java
even though it's on the PATH. 2. The actual
java ...
command needs to be transmitted all on one line, probably as a result of (1). Is there a better way of calling
ContainerTask
?
I also tried using
args
in addition to
command
but as far as I can tell looking at the pod in the local k8s dashboard, that doesn't actually get applied?
s

Samhita Alla

02/22/2024, 6:06 AM
have you tried
arguments
? @Kevin Su is it possible to run raw containers locally now? has the functionality been added?
k

Kevin Su

02/22/2024, 6:13 AM
not support it yet
d

Devin McCabe

02/22/2024, 2:19 PM
Hmm maybe it works locally because I made the task
@dynamic
? I'm testing my setup on GKE soon, so maybe that will reveal other functionality.