Sam Luen-English
12/01/2020, 1:03 PMfrom prefect import Flow, task
from prefect.environments.storage import Docker
import sqlalchemy
@task
def some_task():
print(sqlalchemy.__version__)
with Flow("test") as flow:
some_task()
if __name__ == "__main__":
flow.storage = Docker(
registry_url="<http://docker.io/atheon|docker.io/atheon>",
image_name="prefect-test",
base_image="atheon/prefect-test:base",
)
flow.register(project_name="Development")
Jim Crist-Harif
12/01/2020, 2:51 PMDocker
storage class currently builds the image and tags it as "{registry_url}/{image_name}:{image_tag}"
. It then checks that this image was created (there's likely a better way to do this).
It appears that when the registry_url
is something like atheon
then things work out fine, but if it's <http://docker.io/atheon|docker.io/atheon>
then the created image is just named atheon/{image_name}:{image_tag}
.
From reading, it looks like the current checks could be fixed by grabbing only the final segment in a registry_url
path as the local image will have that alone in its name, but a lot of this docker code looks more complicated than it probably needs to be.
For now, I believe switching to registry_url="atheon"
should work for you (but maybe not) - we'll try to get this fixed before the next weekly release.Marvin
12/01/2020, 2:52 PMSam Luen-English
12/01/2020, 3:43 PMJim Crist-Harif
12/01/2020, 3:51 PM<http://docker.io/|docker.io/>
prefix? (I have no experience with docker private repos). If not, dropping the prefix may work for you.
Either way, I think we want to change how we validate image builds to avoid this issue entirely (hence the open issue).Sam Luen-English
12/01/2020, 3:58 PM