Skip to content

Commit

Permalink
refactor: pipeline trigger code + cloud function
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonny Browning committed Aug 7, 2023
1 parent 14ca843 commit b25aae5
Show file tree
Hide file tree
Showing 18 changed files with 388 additions and 553 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 Google LLC
# Copyright 2023 Google LLC

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,9 +27,9 @@ setup: ## Set up local environment for Python development on pipelines
@cd pipelines && \
poetry install --with dev

test-trigger: ## Runs unit tests for the pipeline trigger code
test-utils: ## Runs unit tests for the util scripts
@cd pipelines && \
poetry run python -m pytest tests/trigger
poetry run python -m pytest tests/utils

compile-pipeline: ## Compile the pipeline to pipeline.yaml. Must specify pipeline=<training|prediction>
@cd pipelines/src && \
Expand Down Expand Up @@ -72,11 +72,11 @@ test-all-components-coverage: ## Run tests with coverage
run: ## Compile pipeline and run pipeline in sandbox environment. Must specify pipeline=<training|prediction>. Optionally specify enable_pipeline_caching=<true|false> (defaults to default Vertex caching behaviour)
@ $(MAKE) compile-pipeline && \
cd pipelines/src && \
poetry run python -m pipelines.trigger --template_path=pipelines/${pipeline}/pipeline.yaml --enable_caching=$(enable_pipeline_caching)
poetry run python -m pipelines.utils.trigger_pipeline --template_path=pipelines/${pipeline}/pipeline.yaml

e2e-tests: ## Perform end-to-end (E2E) pipeline tests. Must specify pipeline=<training|prediction>. Optionally specify enable_pipeline_caching=<true|false> (defaults to default Vertex caching behaviour).
@ cd pipelines && \
poetry run pytest --log-cli-level=INFO tests/$(pipeline) --enable_caching=$(enable_pipeline_caching)
poetry run pytest --log-cli-level=INFO tests/$(pipeline)

env ?= dev
deploy-infra: ## Deploy the Terraform infrastructure to your project. Requires VERTEX_PROJECT_ID and VERTEX_LOCATION env variables to be set in env.sh. Optionally specify env=<dev|test|prod> (default = dev)
Expand Down
4 changes: 2 additions & 2 deletions cloudbuild/trigger-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 Google LLC
# Copyright 2023 Google LLC

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -20,7 +20,7 @@ steps:
curl -sSL https://install.python-poetry.org | python3 - && \
export PATH="/builder/home/.local/bin:$$PATH" && \
make setup && \
make test-trigger
make test-utils
entrypoint: /bin/sh

options:
Expand Down
64 changes: 0 additions & 64 deletions pipelines/src/pipelines/trigger/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions pipelines/src/pipelines/trigger/__main__.py

This file was deleted.

219 changes: 0 additions & 219 deletions pipelines/src/pipelines/trigger/main.py

This file was deleted.

Loading

0 comments on commit b25aae5

Please sign in to comment.