ASSOCIATE-CLOUD-ENGINEER · Question #319
You need to extract text from audio files by using the Speech-to-Text API. The audio files are pushed to a Cloud Storage bucket. You need to implement a fully managed, serverless compute solution that
The correct answer is D. Create a Cloud Function triggered by Cloud Storage bucket events to submit the file URI to the. To automatically extract text from audio files in Cloud Storage using the Speech-to-Text API, implement a Cloud Function triggered by Cloud Storage bucket events to process each file as it arrives, providing a fully managed, serverless, and authenticated solution.
Question
Options
- ACreate an App Engine standard environment triggered by Cloud Storage bucket events to submit
- BRun a Kubernetes job to scan the bucket regularly for incoming files, and call the Speech-to-Text
- CRun a Python script by using a Linux cron job in Compute Engine to scan the bucket regularly for
- DCreate a Cloud Function triggered by Cloud Storage bucket events to submit the file URI to the
How the community answered
(30 responses)- A13% (4)
- B3% (1)
- C7% (2)
- D77% (23)
Why each option
To automatically extract text from audio files in Cloud Storage using the Speech-to-Text API, implement a Cloud Function triggered by Cloud Storage bucket events to process each file as it arrives, providing a fully managed, serverless, and authenticated solution.
While App Engine is serverless, setting up an App Engine service specifically for an event-driven trigger for each file arrival is generally overkill and less direct than a Cloud Function. Cloud Functions are designed for single-purpose, event-driven tasks, making them a more efficient and recommended solution for this specific scenario.
Running a Kubernetes job to scan regularly introduces management overhead (Kubernetes cluster, job scheduling) and isn't truly event-driven, as it relies on polling rather than immediate reaction to file uploads, also going against the fully managed and serverless preference.
A Linux cron job on a Compute Engine instance is not a fully managed or serverless solution; it requires managing a VM, operating system, and the cron scheduler, and it relies on polling rather than event-driven execution, which is less efficient.
Cloud Functions are fully managed, serverless, and can be directly triggered by Cloud Storage events (e.g., object finalization). This setup allows for immediate processing of each new audio file, submitting its URI to the Speech-to-Text API, and handles authentication automatically via its service account, aligning with Google-recommended practices for event-driven workflows.
Concept tested: Event-driven serverless processing with Cloud Functions
Source: https://cloud.google.com/functions/docs/calling/storage
Topics
Community Discussion
No community discussion yet for this question.