Add ocr-doc-api scaffold (Rust API + GCP Terraform/Terragrunt) - #17
Draft
pollenjp wants to merge 1 commit into
Draft
Add ocr-doc-api scaffold (Rust API + GCP Terraform/Terragrunt)#17pollenjp wants to merge 1 commit into
pollenjp wants to merge 1 commit into
Conversation
Scaffold a document OCR REST API: a Rust/axum service on Cloud Run accepts image/PDF uploads, persists them to GCS, and publishes jobs to Pub/Sub for yomitoku or tesseract Cloud Run Job workers to render json/csv/html/md/pdf results back to GCS. Infra is split into reusable Terraform modules wired by Terragrunt envs. https://claude.ai/code/session_01EioxbNVnmj9q3se6vUT1Z5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Scaffolds a document OCR REST API under
ocr-doc-api-2026-05-07/.api/) — Rust + axum on Cloud Run. Endpoints:POST /v1/jobs(multipart:file,engine,formats)GET /v1/jobs/{id}(status JSON)GET /v1/jobs/{id}/{format}(json|csv|html|md|pdf, streamed from GCS)GET /healthzinitial
status.jsonto the output bucket, and publishes aJobMessageto Pub/Sub.
workers/) — Cloud Run Job containers per OCR engine:yomitoku/shells out to the yomitoku CLI.tesseract/runs tesseract and renders json/csv/md/html(hOCR)/searchable-pdf.infra/) — Terraform modules + Terragrunt envs (GCP):storage,pubsub,artifact_registry,iam,api_service,worker_job.live/dev/wires storage → pubsub → IAM → AR → API/workers with explicitdependencyblocks.Architecture
Test plan
cargo check/cargo build --releaseinapi/terragrunt run-all init && planininfra/live/dev/against a real projectapi,worker-yomitoku,worker-tesseractimages to Artifact RegistryPOST /v1/jobswith a sample PDF, poll status,GETeach formatinfra/README.md"Notes / TODO" (Eventarc-to-Job needs a shim or the GAcloud_run_jobdestination)https://claude.ai/code/session_01EioxbNVnmj9q3se6vUT1Z5
Generated by Claude Code