[BUG] ImageSpec.is_container returns True during fast registration
- Dominant language
- Go
- Stars
- 7.5k
- Forks
- 886
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 120
Description
### Flyte & Flytekit version
flytekit==1.16.1
### Describe the bug
The `ImageSpec` method `is_container()` returns True during fast registration with `pyflyte run --remote` or `pyflyte register`.
### Expected behavior
The `ImageSpec` method `is_container()` should return True only during execution in the corresponding container or during local execution.
### Additional context to reproduce
1. Implement the following workflow
```
from flytekit import ImageSpec, workflow, task
image_spec = ImageSpec(
packages=["pandas"],
registry=...
)
if image_spec.is_container():
import pandas as pd
@task(container_image=image_spec)
def task1():
df = pd.DataFrame()
@workflow
def wf1():
task1()
```
2. Create and activate a virtual environment with only `flytekit==1.16.1`
3. `pyflyte run --remote` or `pyflyte register` will try to execute the pandas import locally.
### Screenshots
_No response_
### Are you sure this issue hasn't been raised already?
- [x] Yes
### Have you read the Code of Conduct?
- [x] Yes
Contributor guide
Assessment
This issue has not been assessed yet.