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

Update workers to respect default command from configuration class #216

Merged
merged 3 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
strategy:
matrix:
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
fail-fast: false
steps:
- uses: actions/checkout@v4
Expand All @@ -33,8 +33,7 @@ jobs:
env:
PREFECT_SERVER_DATABASE_CONNECTION_URL: "sqlite+aiosqlite:///./collection-tests.db"
run: |
coverage run --branch -m pytest tests -vv
coverage report
pytest --cov=prefect_gcp --no-cov-on-fail --cov-report=term-missing --cov-branch tests -n auto -vv

- name: Run mkdocs build
run: |
Expand Down
6 changes: 1 addition & 5 deletions prefect_gcp/workers/cloud_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,7 @@ def _populate_or_format_command(self):
if command is None:
self.job_body["spec"]["template"]["spec"]["template"]["spec"][
"containers"
][0]["command"] = [
"python",
"-m",
"prefect.engine",
]
][0]["command"] = shlex.split(self._base_flow_run_command())
elif isinstance(command, str):
self.job_body["spec"]["template"]["spec"]["template"]["spec"][
"containers"
Expand Down
8 changes: 3 additions & 5 deletions prefect_gcp/workers/vertex.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,9 @@ def _inject_formatted_command(self):

existing_command = worker_pool_specs[0]["container_spec"].get("command")
if existing_command is None:
worker_pool_specs[0]["container_spec"]["command"] = [
"python",
"-m",
"prefect.engine",
]
worker_pool_specs[0]["container_spec"]["command"] = shlex.split(
self._base_flow_run_command()
)
elif isinstance(existing_command, str):
worker_pool_specs[0]["container_spec"]["command"] = shlex.split(
existing_command
Expand Down
22 changes: 12 additions & 10 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
pandas
pyarrow
pytest
black
coverage
flake8
mypy
interrogate
isort
mkdocs
mkdocs-gen-files
mkdocs-material
mkdocstrings[python]
isort
pre-commit
pytest-asyncio
mock; python_version < '3.8'
mkdocs-gen-files
interrogate
coverage
mypy
pandas
pillow
pre-commit
pyarrow
pytest
pytest-asyncio
pytest-cov
pytest-xdist