Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Event-driven orchestration with Eventarc and Workflows

Event-driven orchestration with Eventarc and Workflows

Ce3e7802c882fca3f9160768f57ae116?s=128

Mete Atamel

November 03, 2021
Tweet

Transcript

  1. Event-driven orchestration with Eventarc and Workflows Mete Atamel Developer Advocate

    at Google @meteatamel atamel.dev speakerdeck.com/meteatamel
  2. github.com/priyankavergadia/GCPSketchnote

  3. Event-driven orchestration Orchestrated services communicating via events Orchestrated Services Message

    Broker Orchestrated Services Orchestrated Services
  4. Google Cloud GA Your own apps GA Cloud Run GA

    Cloud Functions Preview Workflows Preview Targets Sources Cloud Run for Anthos on GKE Preview Eventarc Triggers to filter events CloudEvents format
  5. New message in a Pub/Sub topic → Cloud Run gcloud

    eventarc triggers create trigger-pubsub \ --destination-run-service=$SERVICE_NAME \ --destination-run-region=$REGION \ --event-filters="type=google.cloud.pubsub.topic.v1.messagePublished" --transport-topic=projects/$PROJECT_ID/topics/$TOPIC_ID Pub/Sub Trigger
  6. New Compute Engine VM creation → Cloud Run gcloud eventarc

    triggers create trigger-auditlog \ --destination-run-service=$SERVICE_NAME \ --destination-run-region=$REGION --event-filters="type=google.cloud.audit.log.v1.written" \ --event-filters="serviceName=compute.googleapis.com" \ --event-filters="methodName=beta.compute.instances.insert" \ --service-account=$PROJECT_NO-compute@developer.gserviceaccount.com Audit Log Trigger
  7. Create a trigger for new object creation in Cloud Storage

    → Cloud Run gcloud eventarc triggers create trigger-gcs \ --destination-run-service=$SERVICE_NAME \ --destination-run-region=$REGION --event-filters="type=google.cloud.storage.object.v1.finalized" \ --event-filters="bucket=$BUCKET_NAME" \ --service-account=$PROJECT_NO-compute@developer.gserviceaccount.com Cloud Storage Trigger
  8. Serverless Compute External API’s Google API’s etc... Workflows - orchestrate

    & integrate SaaS API’s Private API’s Other Clouds Workflows
  9. - processPayment: call: http.post args: url: https://payment-processor.run.app/... body: input: ${paymentDetails}

    result: processResult - shipItems: call: http.post args: url: https://.../cloudfunctions.net/ship body: input: ${processResult.body} result: shipResult - notifyUser: call: http.post ... Payment Processor Cloud Run Authorize & charge CC Notifier Cloud Run Notify user Shipper Cloud Functions Prepare & ship items YAML or JSON syntax
  10. Deploy, execute, manage workflows # Deploy a workflow gcloud workflows

    deploy my-workflow --source=workflow.yaml # Execute a workflow gcloud workflows execute my-workflow # See the result gcloud workflows executions describe <your-execution-id> --workflow my-workflow
  11. None
  12. Image processing pipeline v1 - Eventarc (AuditLog-Cloud Storage) + Cloud

    Run End Users Images Input Cloud Storage Images Output Cloud Storage Filter Cloud Run Resizer Cloud Run Labeler Cloud Run Watermarker Cloud Run File uploaded Cloud Pub/Sub File resized Cloud Pub/Sub AuditLog Trigger Eventarc Pub/Sub Trigger Eventarc Pub/Sub Trigger Eventarc
  13. Image processing pipeline v2 - Eventarc (Cloud Storage) + Cloud

    Run +Workflows End Users Images Input Cloud Storage Images Output Cloud Storage Filter Cloud Run Cloud Storage Trigger Eventarc Image Processing Workflows Watermarker Cloud Functions Resizer Cloud Functions Labeler Cloud Functions
  14. Image processing pipeline v3 - Eventarc (Cloud Storage) + Workflows

    End Users Images Input Cloud Storage Images Output Cloud Storage Cloud Storage Trigger Eventarc Image Processing Workflows Watermarker Cloud Functions Resizer Cloud Functions Labeler Cloud Functions Filter Cloud Functions
  15. @meteatamel atamel.dev speakerdeck.com/meteatamel github.com/GoogleCloudPlatform/eventarc-samples Thank you!