proud-answer-87162
01/24/2024, 12:31 AMContainerTask
. can i inject credentials directly into flyte-copilot-downloader
(or any other initContainer)? i tried adding to the task PodTemplate
but that creates a conflict: failed to execute handle for plugin [container]: [Invalid] failed to create resource, caused by: Pod "{podname}" is invalid: spec.initContainers[1].name: Duplicate value: "flyte-copilot-downloader"
tall-lock-23197
proud-answer-87162
01/24/2024, 2:54 PMContainerTask
defined that is used by a workflow:
transforminput = ContainerTask(
name="flowtest",
input_data_dir="/app/data/inputs",
output_data_dir="/app/data/outputs",
inputs=kwtypes(inputpath=str, outputpath=str),
image="{imagelocation}/flowtest:latest",
pod_template_name="default-pod-template",
command=[{stuff}],
)
proud-answer-87162
01/24/2024, 2:54 PMContainerTask
in a remote wf appears to also create an `InitContainer`: flyte-copilot-downloader
proud-answer-87162
01/24/2024, 2:56 PMInit Containers:
flyte-copilot-downloader:
Container ID: <containerd://561fe38310bb2f5af11e8e145816d9d4a983613924beea4223c6e237780a667>9
Image: <http://cr.flyte.org/flyteorg/flytecopilot-release:v1.10.0|cr.flyte.org/flyteorg/flytecopilot-release:v1.10.0>
Image ID: <http://cr.flyte.org/flyteorg/flytecopilot-release@sha256:8f1ae57f51c5c0f68c0a6ddf4986967d106c596497b86c8eb333cca27203ed52|cr.flyte.org/flyteorg/flytecopilot-release@sha256:8f1ae57f51c5c0f68c0a6ddf4986967d106c596497b86c8eb333cca27203ed52>
Args:
download
--from-remote
s3://{containerName}/n0/data/inputs.pb
proud-answer-87162
01/24/2024, 2:57 PMproud-answer-87162
01/24/2024, 2:57 PMproud-answer-87162
01/24/2024, 2:59 PMPodTemplate
, but then a name collision pops:
initContainers:
- envFrom:
- secretRef:
name: default-aws-creds
name: flyte-copilot-downloader
image: <http://cr.flyte.org/flyteorg/flytecopilot-release:v1.10.0|cr.flyte.org/flyteorg/flytecopilot-release:v1.10.0>
apparently some mechanism is trying to create the initContainer twice rather than merge the podtemplate config.
failed to execute handle for plugin [container]: [Invalid] failed to create resource, caused by: Pod "fcaf1c64bb68945f7b67-n0-0" is invalid: spec.initContainers[1].name: Duplicate value: "flyte-copilot-downloader"
tall-lock-23197
proud-answer-87162
01/25/2024, 1:42 PMPodTemplate
to the ContainerTask
, and that template contains a reference to the secret. but i don't know how to pass credentials specifically. can you point me towards documentation for that use case?tall-lock-23197
secret_requests
directly to the ContainerTask
https://docs.flyte.org/en/latest/flytesnacks/examples/productionizing/use_secrets.html#secretsproud-answer-87162
01/29/2024, 3:31 PMsecret_requests
a few different ways but ran into a couple problems
1. the secrets get injected into the InitContainer
but have a prepended FLYTE_SECRETS_ENV_PREFIX
which is set to _FSEC_
.
a. The init for the stow container doesn't seem to be configurable to look for envvars with a specific prefix
2. the documentation suggests I can set FLYTE_SECRETS_ENV_PREFIX
to customize the behavior - that is true for Containers
but that configuration doesn't seem to get propagated to InitContainers
proud-answer-87162
01/29/2024, 3:31 PMtall-lock-23197
proud-answer-87162
01/30/2024, 1:33 PMtall-lock-23197
proud-answer-87162
01/30/2024, 3:25 PM_FSEC_
prefix) into the InitContainer
. that would be helpful for the future but we are not currently blocked