Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
Fix prefect workflow (#117)
Browse files Browse the repository at this point in the history
This PR fixes the prefect worker.

---------

Co-authored-by: Haris Angelidakis <[email protected]>
  • Loading branch information
bram-vdberg and harisang authored Oct 25, 2024
1 parent e3224ff commit 3b2ea60
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,11 @@ jobs:
with:
python-version: '3.12'

- env:
PREFECT_API_URL: ${{ secrets.PREFECT_API_URL }}
- run: |
python -m pip install --upgrade pip
pip install -r requirements/prefect.txt
- env:
PREFECT_API_URL: ${{ secrets.PREFECT_API_URL }}
run: |
pip install -r requirements/prod.txt
prefect config set PREFECT_API_URL=$PREFECT_API_URL
- run: python src/deploy_prefect/deployment.py
python -m src.deploy_prefect.deployment
20 changes: 11 additions & 9 deletions src/deploy_prefect/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
# pylint: disable=import-error
from prefect import flow, task, get_run_logger # type: ignore

# pylint: disable=import-error
from prefect_github.repository import GitHubRepository # type: ignore
from prefect.runner.storage import GitRepository # type: ignore

from src.models.block_range import BlockRange
from src.fetch.orderbook import OrderbookFetcher
Expand Down Expand Up @@ -151,14 +150,17 @@ def order_rewards() -> None:


if __name__ == "__main__":
github_repository_block = GitHubRepository.load("dune-sync")
deployment = order_rewards.deploy(
flow=order_rewards,
name="dune-sync-order-rewards",
cron="0 */3 * * *", # Once every 3 hours
storage=github_repository_block,
git_source = GitRepository(
url="https://github.com/cowprotocol/dune-sync.git",
)
flow.from_source(
source=git_source,
entrypoint="src/deploy_prefect/deployment.py:order_rewards",
).deploy(
name="dune-sync-prod-order-rewards",
work_pool_name="cowbarn",
cron="*/30 * * * *", # Every 30 minutes
tags=["solver", "dune-sync"],
description="Run the dune sync order_rewards query",
version="0.0.1",
)
deployment.apply()

0 comments on commit 3b2ea60

Please sign in to comment.