opensearch-project / opensearch-project/data-prepper
[RFC] Vertex AI support in the ml_inference processor
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 374
- Forks
- 354
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 8
Description
[RFC] Vertex AI support in the ml_inference processor
Problem Statement
The ml_inference processor (data-prepper-plugins/ml-inference-processor) drives offline
batch inference by calling the ml-commons Batch Predict API and staging batch input/output in
object storage. It supports two AI services — SageMaker and Bedrock — and is wired to
AWS end to end:
- Service coverage is AWS-only.
ServiceNameis{sagemaker, bedrock}and
MLBatchJobCreatorFactoryswitches on exactly those two. There is no path for
GCP Vertex AI, even though ml-commons now ships agoogle_cloudconnector with Vertex
AI batch support (PR #4921 / RFC #4915). - Batch staging is S3-only.
SageMakerBatchJobCreatorbuilds an S3 manifest, uses an
S3Client, and templatess3://input/output URIs. There is no GCS-staging creator. - Auth to OpenSearch is SigV4-only.
MlCommonRequestersigns every request to the
ml-commons REST API with AWS SigV4 (Aws4Signer,signingName = "es", region from the
mandatoryaws:block). A self-managed or GCP-hosted OpenSearch cluster has no SigV4
identity, so the processor cannot authenticate to it at all.
The result: a pipeline running on GCP cannot use ml_inference for batch vectorization, even
once ml-commons and the GCS plugins (companion RFC #7067) are in place. This RFC closes the
processor-side gap.
Current state
configuration/ServiceName.java— enum{SAGEMAKER, BEDROCK}.common/MLBatchJobCreatorFactory.java— switch over the two AWS services;
SageMakerBatchJobCreator/BedrockBatchJobCreatorare S3-native.util/MlCommonRequester.java— SigV4 signing hard-wired viaAws4Signer.MLProcessorConfig.java—awsblock is@NotNull;aws_sigv4boolean;output_path
is ans3://URI.
Proposed Solution
Three additive changes, none altering existing AWS behavior:
1. New vertexai service
Add VERTEXAI("vertexai") to ServiceName and a VertexAiBatchJobCreator registered in
MLBatchJobCreatorFactory. It mirrors SageMakerBatchJobCreator but stages JSONL to GCS
and templates gs:// input/output URIs in the ml-commons _batch_predict request, matching
the Vertex AI batch blueprint that PR #4921 added.
The creator writes batch input to GCS and reads the batch-job output location using the
shared GCP auth module proposed in RFC #7067 (GcpCredentialsSupplier + google-cloud-storage
client). This RFC depends on that module rather than introducing its own GCS client.
2. Pluggable auth to OpenSearch
Generalize MlCommonRequester so authentication to the ml-commons REST endpoint is not
hard-wired to SigV4. Introduce an auth abstraction with (initially) two implementations:
aws_sigv4— the existing behavior, unchanged and still the default when anaws:
block is present, so current pipelines are unaffected.basic— HTTP Basic auth (username/password), the common case for self-managed and
non-AWS-hosted OpenSearch (including GCP deployments). Credentials sourced via Data
Prepper's existing secret-reference mechanism (${{...}}), e.g. the GCP Secret Manager
provider (RFC #7010) or environment.
This decouples how the processor talks to OpenSearch from which AI service runs the batch
job — they are independent axes today only because everything happened to be AWS.
3. Config changes
service_name: vertexaibecomes valid.- The
aws:block becomes conditionally required: mandatory forsagemaker/bedrock
and forauth_mode: aws_sigv4, not required otherwise. (Today it is unconditionally
@NotNull.) - A new
opensearch_authblock selects the to-OpenSearch auth mode. output_pathaccepts ags://URI for the Vertex path.
Example (GCP-native pipeline):
processor:
- ml_inference:
host: "https://my-opensearch:9200"
action_type: "batch_predict"
service_name: "vertexai"
model_id: "<vertex batch model id registered in ml-commons>"
output_path: "gs://my-bucket/batch-output/"
input_key: key
opensearch_auth:
mode: basic
username: "${{gcp_secrets:os-creds:username}}"
password: "${{gcp_secrets:os-creds:password}}"
gcp:
project_id: my-project
# auth_mode: adc # or service-account key fields
ml_when: /bucket == "offlinebatch"
Existing AWS pipeline (unchanged):
processor:
- ml_inference:
host: "<opensearch url>"
aws_sigv4: true
action_type: "batch_predict"
service_name: "bedrock"
model_id: "<model id>"
output_path: "s3://my-bucket/output/"
aws:
region: "us-east-1"
sts_role_arn: "<arn>"
Scope
In scope
vertexaiServiceName+VertexAiBatchJobCreator(GCS-staged).- Pluggable to-OpenSearch auth:
aws_sigv4(existing) +basic(new). - Conditional
aws:block requirement; newopensearch_authandgcp:blocks. - Reuse of the shared GCP auth module (RFC #7067) and secret providers (RFC #7010).
Out of scope
- The GCS source/sink plugins themselves (RFC #7067).
- The ml-commons
google_cloudconnector and Vertex batch terminal-state handling
(ml-commons PR #4921 — separate repo). - Real-time (non-batch)
ml_inferenceinvocation.
Dependencies
- ml-commons PR #4921 / RFC #4915 — the
google_cloudconnector and Vertex AI batch
submit/status/cancel this processor's_batch_predictcalls rely on. - RFC #7067 — GCS source/sink and the shared
gcp-pluginauth module
(GcpCredentialsSupplier) this processor reuses for GCS staging. - RFC #7010 — GCP Secret Manager provider, a natural source for the
basicauth
credentials and GCP service-account key.
Alternatives Considered
- Only add
vertexai, leave SigV4-only auth. Rejected — a GCP-hosted OpenSearch cluster
cannot be reached with SigV4, so the Vertex service would be unusable in exactly the
deployments that need it. The two changes must land together to be useful. - A generic HTTP connector in the processor instead of per-service creators. Rejected —
the existing design is per-service (SageMakerBatchJobCreator,BedrockBatchJobCreator);
a Vertex creator matching that pattern is lower risk than reworking the abstraction. - Token/bearer auth to OpenSearch instead of basic. Basic covers the majority of
self-managed clusters; a bearer/token mode can be added later behind the same
opensearch_auth.modeswitch if demand appears.
Open Questions
- Auth block shape. Introduce a unified
opensearch_auth: { mode: aws_sigv4 | basic }
and deprecate the standaloneaws_sigv4: trueboolean, or keep the boolean for
back-compat and only add the new block? Proposing: keep the boolean working, treat it as
sugar foropensearch_auth.mode: aws_sigv4. - Sequencing vs. #7067. This RFC's
VertexAiBatchJobCreatorneeds the shared GCP auth
module from #7067. Land #7067'sgcp-pluginmodule first, then this? - Bedrock/SageMaker with basic auth. The new
basicmode is independent of service — a
user could run Bedrock batch against a self-managed OpenSearch. Confirm we want to allow
any (service × auth-mode) combination rather than restricting pairs.
Request for Comments
Feedback sought on: the opensearch_auth block design and back-compat approach, the
conditional aws: requirement, and the dependency sequencing across #7067 / #7010 / this RFC.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading configuration/ServiceName.java, common/MLBatchJobCreatorFactory.java, util/MlCommonRequester.java, and MLProcessorConfig.java to trace service selection, authentication, and validation. Review the dependencies on RFC #7067, RFC #7010, and ml-commons PR #4921 before deciding the configuration shape. Done means Vertex AI GCS staging, basic and existing SigV4 authentication, conditional AWS configuration, and the proposed Vertex configuration are supported without changing existing AWS behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- google-cloud, java
- Domain
- ai, backend, cloud
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100