Hi (-:
I am trying to write my own infrastructure block to run the flow inside a new Render instance. It’s very similar to what is happening in the ECSTask block.
So I have this piece of code:
Sorry for that, by I am totally missing this (-:
This PREFECT_EXTRA_ENTRYPOINTS env should be set at which stage? which part of the code?
I really could not understand it from the PR.
The code for your custom block needs to be available on the agent so that it can use that block to submit flow runs to Render. Current infrastructure blocks that Prefect offers are all installed via a PyPI package and the entrypoint configured for the package allows Prefect to discover those blocks and store them in an internal registry so that they are available for use within Prefect.
Practically, this means that you could have your infra block in a .py file (like render.py) on your agent and set PREFECT_EXTRA_ENTRYPOINTS to a command that will load that module when starting the agent.
Here’s an example: PREFECT_EXTRA_ENTRYPOINTS=render
After that’s set, you should be able to run prefect agent start and that agent should be able to submit flow runs to Render.
So this actually works! So you are setting the env variable and than calling python with a -c parameter which will just execute “import prefect”.
And the “import prefect” causes the render_job_infrastructure to be loaded at runtime - meaning if you put a print() inside the render_job_infrastructure.py, you’ll see it.
thanks, I’d submit a bug report on GitHub for it with full minimal reproducible example code, perhaps pointing to your sample repository to also show folder structure for imports?