How to run `google/fhir-data-pipes/pipelines/batch` uber JAR in Google Cloud Functions locally?

Open
#254 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Documentation
Clarity
Needs clarification
Activity status
Stale
Tech stack
google-cloud, java
Domain
backend, cloud

Research direction

Start with the pipelines/batch entry point com.google.fhir.analytics.FhirEtl and the java-function-invoker command shown in the issue. Check how this target is exposed to Google Cloud Functions, how arguments are configured, and whether parallel invocations support different values; document the supported local invocation and configuration steps.

Written by the indexing model from the issue text.

Description

P3 question

I tried the following command after building the uber JAR of google/fhir-data-pipes/pipelines/batch:

java -jar java-function-invoker-1.3.1.jar \
    --classpath /d/SourceCodes/google/fhir-data-pipes/pipelines/batch/target/batch-bundled.jar \
    --target com.google.fhir.analytics.FhirEtl

and here is the error logs:

2023-11-23 16:19:50.971:INFO::main: Logging initialized @96ms to org.eclipse.jetty.util.log.StdErrLog
Exception in thread "main" java.lang.RuntimeException: Could not determine function signature type from target com.google.fhir.analytics.FhirEtl. Either this should be a class implementing one of the interfaces in com.google.cloud.functions, or the environment variable FUNCTION_SIGNATURE_TYPE should be set to "http" or "event".
        at com.google.cloud.functions.invoker.runner.Invoker.servletForDeducedSignatureType(Invoker.java:393)
        at com.google.cloud.functions.invoker.runner.Invoker.startServer(Invoker.java:298)
        at com.google.cloud.functions.invoker.runner.Invoker.startServer(Invoker.java:244)
        at com.google.cloud.functions.invoker.runner.Invoker.main(Invoker.java:127)

Also, how to pass arguments to the uber JAR of the function in question? For example, if running the uber JAR directly, we can do it like this:

PATH_TO_THE_UBER_JAR=/d/SourceCodes/google/fhir-data-pipes/pipelines/batch/target/batch-bundled.jar && \
java -jar ${PATH_TO_THE_UBER_JAR} \
    --fhirServerUrl=http://fhir-server-bkkbn:8092/fhir \
    --resourceList=Patient,Practitioner \
    --fhirSinkPath=http://fhir-server-central:8098/fhir

More advanced, can we use Google Cloud Functions parallelism and supply different arguments values?

Dominant language
Java
Stars
154
Forks
63
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GoogleCloudPlatform/functions-framework-java

All issues in GoogleCloudPlatform/functions-framework-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.