cuddly-jelly-27016
07/31/2025, 2:12 PM/tmp/secret1 and mount it to the`/run/secrets/secret1` for apt-install
2. Read the secret from env var AWS_ID or /etc/secrets/aws_id (if env var not found) and mount it as env AWS_ACCESS_KEY_ID
import flyte
image = (
flyte.Image.from_debian_base(install_flyte=False)
.with_apt_packages("vim", secret_mount=["/tmp/secret1"])
.with_pip_packages(
"mypy", secret_mount=[flyte.Secret(group="aws", key="id", as_env_var="AWS_ACCESS_KEY_ID"])
)
.with_local_v2()
)
env = flyte.TaskEnvironment(name="image_secret", image=image)
@env.task
async def t1(data: str = "hello") -> str:
return f"Hello {data}"
if name == "__main__":
flyte.init_from_config("../../config.yaml")
run = flyte.run(t1, data="world")
print(run.name)
print(run.url)
flyteorg/flyte-sdkcuddly-jelly-27016
07/31/2025, 3:47 PMcuddly-jelly-27016
08/04/2025, 5:23 AM