<@U06RKAMK0UC> How do I identify whether I am runn...
# ask-ai
s
@ancient-wolf-19325 How do I identify whether I am running in a container or locally? I have seen something like
is_container
or something in the documentation
j
You can use the
ImageSpec.is_container()
method to check if the current environment is the container built from the given ImageSpec. This method returns True if running inside the container, and False otherwise. For details, see the Flytekit ImageSpec API reference. Note: There is a known issue where
is_container()
may return True during fast registration (e.g.,
pyflyte run --remote
or
pyflyte register
), not just during actual container execution. This is acknowledged as a bug in the Flyte community (GitHub issue). Would you like more detail on the technical cause or workarounds? Sources: - Flytekit ImageSpec API reference - GitHub issue: ImageSpec.is_container returns True during fast registration 👍 1 button 👎 0 button 💡 Hint: Mention @ancient-wolf-19325 in the thread for followups.
f
Why do you want this
s
I thought of setting my AWS-credentials locally different from when I run it remotely. But I then chose to install AWS CLI and log in that way. This way I don't need to supply the
storage_options
in my S3-connections at all