Echo fastapi is a minimal Cloud Deployer called by subscriptions of all cloud
deploy message types and echoing back the details of that message and the
configurations passed to the execute()
method.
As an engineer, I want an example extension demonstrating usage of the python-extension library. It would also be useful if this example extension emitted pubsub message contents I can better understand the attribute conditions needed to build other extensions.
enabled
- a boolean that enables or disables the extension. If not present the extension is disabled.
-
Install python and pip if necessary. Use
pip
to installpoetry
.pip install poetry
-
Create your virtual env and install all dependencies via
poetry
poetry install
-
Launch the service locally:
poetry run uvicorn src.main:app --host 0.0.0.0 --port 8080 --reload
-
Verify the healthcheck endpoint and send a test payload:
http localhost:8080
-
authenticate to GCP:
# follow URL and paste the secret gcloud auth login --update-adc # set a terraform recognized env var export GOOGLE_OAUTH_ACCESS_TOKEN=$(gcloud auth print-access-token)
-
build the deployer container image using cloud build:
gcloud builds submit \ --project=${PROJECT_ID} \ --region=us-central1 \ --tag us-docker.pkg.dev/${PROJECT_ID}/cloud-deploy-extensions/echo-fastapi:latest .
-
deploy all dependent infrastructure using resources in the
terraform/cloud-deploy-extension
directory at the repo root. Using the terragrunt-based demo at the repo root as an example:cd demo/terragrunt/echo-fastapi terragrunt apply