Clemens

    Clemens

    1 year ago
    Hi Prefect Team, We have a prefect-server running on a Kubernetes cluster and just updated to
    0.13.19.
    . As environments are being deprecated I am trying to move the flows over to run_config setup. I am using the Docker storage and KubernetesRun for run_config. I noticed that the container that is built with
    KubernetesRun()
    is configured with:
    command: /bin/sh -c
    command arguments: prefect execute flow-run
    but when I inject a job spec file withKubernetesRun(job_template_path="job_specs.yaml") (as I need to to access the Kubernetes secrets that I need for the flow to run) only the
    command arguments
    are written by the prefect build and the
    command
    is left blank. That leads to the container failing with an
    "executable not found"
    A workaround is to specifically include the
    command
    section in the job specs file
    command: ["/bin/sh", "-c"]
    . That doesn’t seem to be expected behaviour, or am I missing something?
    j

    josh

    1 year ago
    Hey @Clemens I believe this is actually intentional (although it could probably be improved) in the default job template it sets the
    command
    and I think that by using a custom job template it is assuming you have the command set. I’m going to open an issue on the repo to verify if that is intended behavior and if it is I think we might be able to make the experience better 🙂
    @Marvin open “executable not found when not setting
    command
    in KubernetesRun job template”
    Marvin

    Marvin

    1 year ago
    Clemens

    Clemens

    1 year ago
    I think a link in the docs to the default specs would already help a lot
    j

    josh

    1 year ago
    Awesome this is actually already included in a new set of enhancements coming to the docs (for agent related stuff, perhaps it could be added to the KubernetesRun as well) https://github.com/PrefectHQ/prefect/pull/3786 that has an open PR now!