diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index 64284b9..fd89895 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -1,7 +1,7 @@ --- version: 2 updates: - - package-ecosystem: "github-actions" - directory: "/" + - package-ecosystem: github-actions + directory: / schedule: - interval: "monthly" + interval: monthly diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 0000000..8d3dc47 --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,8 @@ +--- +extends: default + +rules: + comments: + min-spaces-from-content: 1 + document-start: disable + line-length: disable diff --git a/README.md b/README.md index d3bcde4..ca7ecec 100644 --- a/README.md +++ b/README.md @@ -2,18 +2,17 @@ ## Details -A Github Action to deploy one or more Prefect deployments with a [`prefect.yaml` file](https://docs.prefect.io/latest/guides/prefect-deploy/)). Note - all configuration must be defined in your `prefect.yaml` file, which will be inferred at run time. This means you **cannot** pass any additional CLI arguments. For example, your `prefect.yaml` should have the following configuration in place: +A Github Action to deploy one or more Prefect deployments with a [`prefect.yaml` file](https://docs.prefect.io/latest/guides/prefect-deploy/)). Note - all configuration must be defined in your `prefect.yaml` file, which will be inferred at run time. This means you **cannot** pass any additional CLI arguments. For example, your `prefect.yaml` should have the following configuration in place: ```yaml deployments: - name: Simple - description: null - entrypoint: examples/simple/flow.py:call_api - flow_name: null + description: A simple example + entrypoint: flow.py:call_api parameters: {} - schedule: null - tags: [] - version: null + schedule: {} work_pool: + job_variables: + image: prefecthq/prefect:3-latest name: simple-pool ``` @@ -60,13 +59,13 @@ jobs: python-version: '3.10' - name: Prefect Auth - uses: PrefectHQ/actions-prefect-auth@v1 + uses: PrefectHQ/actions-prefect-auth@v2 with: prefect-api-key: ${{ secrets.PREFECT_API_KEY }} prefect-workspace: ${{ secrets.PREFECT_WORKSPACE }} - name: Run Prefect Deploy - uses: PrefectHQ/actions-prefect-deploy@v3 + uses: PrefectHQ/actions-prefect-deploy@v4 with: deployment-names: Simple requirements-file-paths: ./examples/simple/requirements.txt @@ -89,7 +88,7 @@ jobs: - ... - name: Run Prefect Deploy - uses: PrefectHQ/actions-prefect-deploy@v3 + uses: PrefectHQ/actions-prefect-deploy@v4 with: deployment-names: Simple_Deployment_1,Simple_Deployment_2 requirements-file-paths: ./examples/multi-deployment/deployment-1/requirements.txt,./examples/multi-deployment/deployment-2/requirements.txt @@ -112,7 +111,7 @@ jobs: - ... - name: Run Prefect Deploy - uses: PrefectHQ/actions-prefect-deploy@v3 + uses: PrefectHQ/actions-prefect-deploy@v4 with: all-deployments: "true" requirements-file-paths: ./examples/multi-deployment/deployment-1/requirements.txt,./examples/multi-deployment/deployment-2/requirements.txt @@ -144,13 +143,13 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Prefect Auth - uses: PrefectHQ/actions-prefect-auth@v1 + uses: PrefectHQ/actions-prefect-auth@v2 with: prefect-api-key: ${{ secrets.PREFECT_API_KEY }} prefect-workspace: ${{ secrets.PREFECT_WORKSPACE }} - name: Run Prefect Deploy - uses: PrefectHQ/actions-prefect-deploy@v3 + uses: PrefectHQ/actions-prefect-deploy@v4 with: deployment-names: Docker requirements-file-paths: ./examples/docker/requirements.txt @@ -187,13 +186,13 @@ jobs: python-version: '3.10' - name: Prefect Auth - uses: PrefectHQ/actions-prefect-auth@v1 + uses: PrefectHQ/actions-prefect-auth@v2 with: prefect-api-key: ${{ secrets.PREFECT_API_KEY }} prefect-workspace: ${{ secrets.PREFECT_WORKSPACE }} - name: Run Prefect Deploy - uses: PrefectHQ/actions-prefect-deploy@v3 + uses: PrefectHQ/actions-prefect-deploy@v4 with: deployment-names: Docker requirements-file-paths: ./examples/docker/requirements.txt diff --git a/action.yaml b/action.yaml index d9a4e6d..a6440bd 100644 --- a/action.yaml +++ b/action.yaml @@ -66,13 +66,7 @@ runs: - id: prefect-deploy run: | - PREFECT_VERSION=$(prefect --version) - PREFECT_SHORT_VERSION="$(cut -d "." -f 2 <<< "$PREFECT_VERSION")"."$(cut -d "." -f 3 <<< "$PREFECT_VERSION")" - if [ $(echo $PREFECT_SHORT_VERSION'<'10.14 | bc -l) -eq 1 ]; - then - echo "The currently installed Prefect version (2.$PREFECT_SHORT_VERSION) will be updated to the latest to ensure compatibility with this action." - pip install prefect -U "prefect>=2.10.14,<3" - fi + pip install prefect -U "prefect>=3,<4" if [ ${{ inputs.all-deployments }} == "true" ]; then prefect --no-prompt deploy --all --prefect-file "${{ inputs.deployment-file-path }}" diff --git a/examples/actions/install-deps-via-pyproject.yaml b/examples/actions/install-deps-via-pyproject.yaml index b60ff52..9d8d15f 100644 --- a/examples/actions/install-deps-via-pyproject.yaml +++ b/examples/actions/install-deps-via-pyproject.yaml @@ -14,13 +14,13 @@ jobs: python-version: '3.10' - name: Prefect Auth - uses: PrefectHQ/actions-prefect-auth@v1 + uses: PrefectHQ/actions-prefect-auth@v2 with: prefect-api-key: ${{ secrets.PREFECT_API_KEY }} prefect-workspace: ${{ secrets.PREFECT_WORKSPACE }} - name: Run Prefect Deploy - uses: PrefectHQ/actions-prefect-deploy + uses: PrefectHQ/actions-prefect-deploy@v4 with: deployment-names: Simple pyproject-toml-path: ./path/to/pyproject.toml diff --git a/examples/docker/Dockerfile b/examples/docker/Dockerfile index 9b33393..ffb152f 100644 --- a/examples/docker/Dockerfile +++ b/examples/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=linux/amd64 prefecthq/prefect:2-latest +FROM --platform=linux/amd64 prefecthq/prefect:3-latest COPY ./examples/docker/requirements.txt requirements.txt RUN pip install -r requirements.txt diff --git a/examples/docker/flow.py b/examples/docker/flow.py index 6e5abb1..129977f 100755 --- a/examples/docker/flow.py +++ b/examples/docker/flow.py @@ -1,5 +1,3 @@ -import json - import requests from prefect import flow diff --git a/examples/docker/prefect.yaml b/examples/docker/prefect.yaml index 008be89..bfd4527 100644 --- a/examples/docker/prefect.yaml +++ b/examples/docker/prefect.yaml @@ -1,38 +1,28 @@ -# File for configuring project / deployment build, push and pull steps - -# Generic metadata about this project name: docker -prefect-version: 2.11.0 +prefect-version: 3.0.0 -# build section allows you to manage and build docker images build: - - prefect_docker.projects.steps.build_docker_image: - requires: prefect-docker>0.1.0 + - prefect_docker.deployments.steps.build_docker_image: + requires: prefect-docker>0.6.0 image_name: EXAMPLE_IMAGE_REGISTRY tag: latest dockerfile: auto -# push section allows you to manage if -# and how this project is uploaded to remote locations push: null -# pull section allows you to provide instructions -# for cloning this project in remote locations pull: - - prefect.projects.steps.git_clone_project: + - prefect.deployments.steps.git_clone: repository: git@github.com:PrefectHQ/actions-prefect-deploy.git branch: main access_token: "{{ prefect.blocks.secret.docker-github-pat }}" deployments: - name: Docker - description: null + description: An example Prefect deployment entrypoint: ./flow.py:call_api - flow_name: null parameters: {} - schedule: null + schedule: {} work_pool: job_variables: - image: prefecthq/prefect:2-latest + image: prefecthq/prefect:3-latest name: docker-pool - work_queue_name: null diff --git a/examples/docker/requirements.txt b/examples/docker/requirements.txt index 1dd1a67..e28b620 100644 --- a/examples/docker/requirements.txt +++ b/examples/docker/requirements.txt @@ -1 +1 @@ -prefect==2.16.5 +prefect==3.* diff --git a/examples/multi-deployment/deployment-1/flow.py b/examples/multi-deployment/deployment-1/flow.py index de2d336..489749c 100755 --- a/examples/multi-deployment/deployment-1/flow.py +++ b/examples/multi-deployment/deployment-1/flow.py @@ -1,5 +1,3 @@ -import json - import requests from prefect import flow diff --git a/examples/multi-deployment/deployment-1/requirements.txt b/examples/multi-deployment/deployment-1/requirements.txt index 1dd1a67..e28b620 100644 --- a/examples/multi-deployment/deployment-1/requirements.txt +++ b/examples/multi-deployment/deployment-1/requirements.txt @@ -1 +1 @@ -prefect==2.16.5 +prefect==3.* diff --git a/examples/multi-deployment/deployment-2/flow.py b/examples/multi-deployment/deployment-2/flow.py index de2d336..489749c 100755 --- a/examples/multi-deployment/deployment-2/flow.py +++ b/examples/multi-deployment/deployment-2/flow.py @@ -1,5 +1,3 @@ -import json - import requests from prefect import flow diff --git a/examples/multi-deployment/deployment-2/requirements.txt b/examples/multi-deployment/deployment-2/requirements.txt index 1dd1a67..e28b620 100644 --- a/examples/multi-deployment/deployment-2/requirements.txt +++ b/examples/multi-deployment/deployment-2/requirements.txt @@ -1 +1 @@ -prefect==2.16.5 +prefect==3.* diff --git a/examples/multi-deployment/prefect.yaml b/examples/multi-deployment/prefect.yaml index 779ddfd..5205f1b 100644 --- a/examples/multi-deployment/prefect.yaml +++ b/examples/multi-deployment/prefect.yaml @@ -1,48 +1,34 @@ -# File for configuring project / deployment build, push and pull steps - -# Generic metadata about this project name: multi-deployment -prefect-version: 2.11.0 +prefect-version: 3.0.0 -# build section allows you to manage and build docker images build: null -# push section allows you to manage if -# and how this project is uploaded to remote locations push: null -# pull section allows you to provide instructions -# for cloning this project in remote locations + pull: - - prefect.projects.steps.git_clone_project: + - prefect.deployments.steps.git_clone: repository: git@github.com:PrefectHQ/actions-prefect-deploy.git branch: main access_token: "{{ prefect.blocks.secret.simple-github-pat }}" deployments: - name: Simple_Deployment_1 - description: null + description: Example deployment 1 entrypoint: ./deployment-1/flow.py:call_api - flow_name: null parameters: {} - schedule: null - tags: [] - version: null + schedule: {} work_pool: job_variables: - image: prefecthq/prefect:2-latest + image: prefecthq/prefect:3-latest name: simple-pool - work_queue_name: null + - name: Simple_Deployment_2 - description: null + description: Example deployment 2 entrypoint: ./deployment-2/flow.py:call_api - flow_name: null parameters: {} - schedule: null - tags: [] - version: null + schedule: {} work_pool: job_variables: - image: prefecthq/prefect:2-latest + image: prefecthq/prefect:3-latest name: simple-pool - work_queue_name: null diff --git a/examples/simple/flow.py b/examples/simple/flow.py index 7f528dc..f7cfd01 100755 --- a/examples/simple/flow.py +++ b/examples/simple/flow.py @@ -1,5 +1,3 @@ -import json - import requests from prefect import flow diff --git a/examples/simple/prefect.yaml b/examples/simple/prefect.yaml index 89e9983..8cb5342 100644 --- a/examples/simple/prefect.yaml +++ b/examples/simple/prefect.yaml @@ -1,35 +1,23 @@ -# File for configuring project / deployment build, push and pull steps - -# Generic metadata about this project name: simple -prefect-version: 2.11.0 +prefect-version: 3.0.0 -# build section allows you to manage and build docker images build: null -# push section allows you to manage if -# and how this project is uploaded to remote locations push: null -# pull section allows you to provide instructions -# for cloning this project in remote locations pull: - - prefect.projects.steps.git_clone_project: + - prefect.deployments.steps.git_clone: repository: git@github.com:PrefectHQ/actions-prefect-deploy.git branch: main access_token: "{{ prefect.blocks.secret.simple-github-pat }}" deployments: - name: Simple - description: null + description: A simple example entrypoint: flow.py:call_api - flow_name: null parameters: {} - schedule: null - tags: [] - version: null + schedule: {} work_pool: job_variables: - image: prefecthq/prefect:2-latest + image: prefecthq/prefect:3-latest name: simple-pool - work_queue_name: null diff --git a/examples/simple/requirements.txt b/examples/simple/requirements.txt index 1dd1a67..e28b620 100644 --- a/examples/simple/requirements.txt +++ b/examples/simple/requirements.txt @@ -1 +1 @@ -prefect==2.16.5 +prefect==3.*