The flow run names (e.g. `daffy-wolf`) already loo...
# ask-community
j
The flow run names (e.g.
daffy-wolf
) already look very docker-name like It seems like it'd be pretty slick if the
DockerAgent
then also used the same name for launching containerized flows. Not strictly needed, and maybe only relevant for our setup where our log aggregator shows the container name that the logs came from
n
That sounds like a good feature request @Jonathan Chu! Feel free to open a ticket or discussion in the Core repo 😄
z
Hmm. Unfortunately the container names need to be unique so at best we could do
<flow-name>-<flow-run-id>
j
michael, that's because the same
flow-run-id
might get generated for different flows running on the same docker agent?
n
I think it's the opposite - flow run names aren't guaranteed to be unique but flow run ids are
j
oh sorry, ignore that, i misread that completely
ok, so a name like
sticky-bandicoot
looks pretty unique, but isn't guaranteed, so we'd need something like
sticky-bandicoot-8cbe3e22-d0e3-4576-9207-2babc3845bfe
(i assume flow-run-id is what's in the url)
z
Yeah otherwise the agent may run into errors spawning containers. We could do a more complex patch that appends
-{index}
by checking for existing containers first
I might implement that because it sounds kind of nice.
j
and i'd figure that containers would probably also tend not to be long-lived, so most of the time you wouldn't need to append the index, just need it to ensure no whammies
z
Exactly yeah we just wouldn't want it to break things 🙂
Sketched this out at https://github.com/PrefectHQ/prefect/pull/4485 -- lmk if you can give it a try! I'm really not sure if it'll work haha
j
hah, i was still writing up the github issue for this
we run the agent just with
docker run prefecthq/prefect:latest
, is there a tag you'd want me to try?
z
Unfortunately we don't build images for non-master builds so to test this with docker-in-docker you'd have to build a new image or clone prefect in a docker container and checkout the branch.
I can definitely just test it myself soon 😄
j
restarted our agents to pick up the new version
beautiful and you can search by name in the UI as well
thanks for the quick feature!
j
@Wai Kiat Tan