Krystian
03/18/2025, 1:12 PMMarvin
03/18/2025, 1:12 PMGitLabCredentials
block on a Docker worker, you need to follow these steps:
1. Create a GitLabCredentials
Block:
- Use the Prefect UI or CLI to create a GitLabCredentials
block. This block stores your GitLab credentials securely.
2. Define Your Deployment with `prefect.yaml`:
- In your prefect.yaml
file, define the deployment configuration. You can reference your GitLab repository and credentials block in the pull
step. Here's a basic structure:
yaml
pull:
- git_clone:
repository: "<https://gitlab.com/your-repo.git>"
branch: "main"
credentials: <your-gitlab-credentials-block-name>
3. Configure Docker Worker:
- Ensure a Docker worker is set up and ready. You can start it using the following command in your terminal:
bash
prefect worker start docker
- This command will start a Docker worker that polls for scheduled flow runs.
4. Deploy and Execute:
- Deploy your flow using Prefect CLI:
bash
prefect deploy
- Your flow will use the configuration in prefect.yaml
to pull from the GitLab repository and execute on the Docker worker.
For more detailed guidance, you can refer to the Prefect GitLab integration documentation and the Docker deployment examples.
If you encounter any challenges, feel free to consult the Prefect documentation for further assistance.