Does anyone know if theres a tutorial to setup a d...
# ask-community
g
Does anyone know if theres a tutorial to setup a docker agent to use Google Cloud Run for running flows?
k
Hey @Greg Adams, I don’t think Google Cloud Run is meant for running Flows because Flows are batch jobs whereas Cloud Run is meant to run a service. Think like an API. From me experience in using it, it shuts down the container if certain ports around open for listening.
g
Hmmm, could a new agent type be made for Google cloud run, like a
GCRAgent
similar to the ecragent? If so, I might try taking that one on.
k
There was a Google Vertex agent that was merged into master that may give you what you want? Check this
g
Ooooo, I check it out!
s
@Kevin Kho I get this error when i use Vertex-AI agent.
Copy code
google.api_core.exceptions.MethodNotImplemented: 501 Received http2 header with status: 404
Copy code
Traceback (most recent call last):
  File "pipelines/lib/python3.9/site-packages/google/api_core/grpc_helpers.py", line 66, in error_remapped_callable
    return callable_(*args, **kwargs)
  File "pipelines/lib/python3.9/site-packages/grpc/_channel.py", line 946, in __call__
    return _end_unary_response_blocking(state, call, False, None)
  File "pipelines/lib/python3.9/site-packages/grpc/_channel.py", line 849, in _end_unary_response_blocking
    raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
        status = StatusCode.UNIMPLEMENTED
        details = "Received http2 header with status: 404"
        debug_error_string = "{"created":"@1638101249.601756000","description":"Received http2 :status header with non-200 OK status","file":"src/core/ext/filters/http/client/http_client_filter.cc","file_line":132,"grpc_message":"Received http2 header with status: 404","grpc_status":12,"value":"404"}"
>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "pipelines/lib/python3.9/site-packages/prefect/agent/agent.py", line 391, in _deploy_flow_run
    deployment_info = self.deploy_flow(flow_run)
  File "pipelines/lib/python3.9/site-packages/prefect/agent/vertex/agent.py", line 115, in deploy_flow
    resp = self.vertex_client.create_custom_job(parent=parent, custom_job=taskdef)
  File "pipelines/lib/python3.9/site-packages/google/cloud/aiplatform_v1/services/job_service/client.py", line 624, in create_custom_job
    response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
  File "pipelines/lib/python3.9/site-packages/google/api_core/gapic_v1/method.py", line 154, in __call__
    return wrapped_func(*args, **kwargs)
  File "pipelines/lib/python3.9/site-packages/google/api_core/grpc_helpers.py", line 68, in error_remapped_callable
    raise exceptions.from_grpc_error(exc) from exc
k
What region are you using? Did you see this ? Are you using a service account?
s
@Kevin Kho thanks a ton.
this solved the issue
I was using the region
europe-west1-b
instead of
europe-west1
k
Ah ok. Thanks for letting me know that worked!