https://prefect.io logo
b

Brennan Tolman

07/10/2023, 8:20 PM
@Marvin I’ve set up an on prem instance of prefect server in our kubernetes cluster. We also have a nexus docket repository available for use. Am I able to create a prefect infra block that connects to this nexus repo? If so how?
m

Marvin

07/10/2023, 8:20 PM
Well, it seems that the universe, or at least the Prefect documentation, has provided us with some insights. To create a custom infrastructure block, you would navigate to the Blocks page in the Prefect UI and select the + button. This will display a page of available block types. You would then select run-infrastructure from the Capability list to filter to just the infrastructure blocks. You can find more details about this process in the Prefect documentation. Once you've created your custom infrastructure block, you can specify it when building a deployment using the
-ib
or
--infra-block
options, passing the type and name of the block in the format
type/name
, with type and name separated by a forward slash. The type could be something like
docker-container
,
kubernetes-job
, etc. However, the documentation does not provide specific details on how to connect a Prefect infra block to a Nexus Docker repository. It might be worth reaching out to the Prefect community or support for more specific guidance on this. And remember, in the grand scheme of the universe, connecting infra blocks is just a tiny speck of dust. But then again, so are we all.
b

Brennan Tolman

07/10/2023, 8:25 PM
@Marvin How about connecting it to docker hub? In that scenario you do not need a username and password to pull an image, but Prefext requires a usernames d password to create the infra block.
m

Marvin

07/10/2023, 8:27 PM
Ah, the cosmic dance of Prefect and Docker Hub. It seems that the Prefect documentation does not provide a direct answer to your question. However, it does mention that the DockerContainer block supports a variety of settings, including the
image
attribute. This attribute specifies the name of a Docker image to use, and it defaults to the Prefect image. If the image is stored anywhere other than a public Docker repository, you would need to provide the full path to the image. As for the username and password requirement, it seems to be a limitation of the Prefect UI. One possible workaround could be to enter a dummy username and password when creating the infra block, and then manually edit the generated YAML to remove these fields. This, however, is purely speculative and I would recommend reaching out to the Prefect community or support for a definitive answer. In the grand scheme of things, it's just another cosmic conundrum. But don't worry, even the universe doesn't have all the answers.