google / visionai

BSD 3-Clause "New" or "Revised" License
43 stars 12 forks source link

Vertex Vision AI Input change? #14

Closed brendan-Wursta closed 1 year ago

brendan-Wursta commented 1 year ago

I deployed an application about a month ago, and tried to recreate it within the past week. Instead of being able to access 'streams' and 'source' from the template (first image is of example similar to the original application), any time I make changes to the outputs the ('stream' and 'source') somehow changes to 'universal input' (2nd image) automatically in the app UI.

Old application Layout example (pulled from another example online):

Screenshot 2023-05-22 at 1 23 36 AM

New layout that I'm forced to use when the app is automatically updated by the google UI to 'universal input':

Screenshot 2023-05-22 at 1 25 41 AM

The app is set up the same way as a month ago (at least I believe so). Error message when I go to deploy (happens with and without model output to vision warehouse, and without the 'universal input' connected to the 'warehouse'). Also there is only one stream connected to the 'universal input':

Application deployment fails
java.lang.IllegalArgumentException: Currently App Platform only supports one input node per application: [name: "builtin-input-stream" display_name: "Streams" node_config { video_stream_input_config { } } processor: "builtin:stream-input" output_all_output_channels_to_stream: false , name: "builtin-universal-input" display_name: "Universal input" node_config { universal_input_config { } } processor: "builtin:universal-input" output_all_output_channels_to_stream: false ]

Any thoughts on:

  1. Where did this 'universal input' came from?
  2. How do I resolve this error so I can deploy the application?
  3. Is there documentation that explains the 'universal input'? I can't find anything in the google docs.

Thanks for your help!

dchao34 commented 1 year ago

Thanks for reporting, we are looking into it.

milannic-google commented 1 year ago

Thanks for reporting, the team is actively fixing it, in the meanwhile, could you use api

curl -X POST \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "Content-Type: application/json; charset=utf-8" \
    -d @request.json \
   "https://visionai.googleapis.com/v1/projects/PROJECT/locations/LOCATION_ID/applications/APPLICATION_ID"

to remove universal input related nodes from your app graph and use

curl -X POST \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "Content-Type: application/json; charset=utf-8" \
    -d @request.json \
   "https://visionai.googleapis.com/v1/projects/PROJECT/locations/LOCATION_ID/applications/APPLICATION_ID:deploy"

to deploy it with API?

Thanks.

pkim-inmotion commented 1 year ago

Hi Brendan, Did this work for you?

Thanks.

brendan-Wursta commented 1 year ago

Hi @pkim-inmotion, tried the command mentioned but I got this error:

Warning: Couldn't read data from file "request.json", this makes an empty 
Warning: POST.

I assume it's a problem with the following: what do I fill in for this info?

-d @request.json \

Also, since I can only see the universal input (instead of stream, etc.), how do I know how the application is set up? I can't seem to find an 'export JSON' or something where i can see the layout of the app in an object to deploy...

Tried going back into the UI today and remaking the app. Still get the same errors as before when I tried to deploy.

milannic-google commented 1 year ago

Hi Brendan, you can use

curl -X GET \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "Content-Type: application/json; charset=utf-8" \
   "https://visionai.googleapis.com/v1/projects/PROJECT/locations/LOCATION_ID/applications/APPLICATION_ID"

to get your application in data format, modify the data as your wish, then put the json data into request.json file, and use the command in previous comment.

More details can be found in https://cloud.google.com/vision-ai/docs/build-app

By the way, the team should have already fixed the UI problem, would you mind trying that again?

brendan-Wursta commented 1 year ago

@pkim-inmotion Thanks for the heads up! I'll try the CLI again.

As far as the UI, here's the layout and error:

Screenshot 2023-05-30 at 2 15 41 PM
Error type: Invalid argument
Instance Deployment Step 1 failed, step: projects/PROJECT/locations/LOCATION/applications/APPLICATION/instances/STREAM-DeployInstance. Detailed App Platform Error: Invalid application instance graph, it cannot be deployed: Node builtin-universal-input not found in the application.

It looks like it deploys, but it fails.

Screenshot 2023-05-30 at 2 16 35 PM
pkim-inmotion commented 1 year ago

Hi Brendan, Google team just released a fix for deployment problem last week. I could deploy my application and it is working. However, I am not using warehouse neither bigquery.

image

In order to test API, I think it is much better using psotman perhaps. If you have installed GCP SDK in your machine, just set your project to the appropiate project and get token using gcloud auth print-access-token.

Copy the token as Bearer token in your postman query.

Regards.

brendan-Wursta commented 1 year ago

Hi @dchao34 @pkim-inmotion ,

Getting the application JSON:

@cloudshell: $ curl -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json; charset=utf-8" "https://visionai.googleapis.com/v1/projects/redacted/locations/us-central1/applications/redacted"

Returns the App JSON:

{
  "name": "projects/redacted/locations/us-central1/applications/redacted",
  "createTime": "2023-05-19T16:11:24.470575376Z",
  "updateTime": "2023-06-02T16:31:48.076239842Z",
  "displayName": "redacted",
  "applicationConfigs": {
    "nodes": [
      {
        "name": "builtin-input-stream",
        "displayName": "Streams",
        "nodeConfig": {
          "videoStreamInputConfig": {}
        },
        "processor": "builtin:stream-input",
        "outputAllOutputChannelsToStream": false
      },
      {
        "name": "builtin-person-vehicle-detection",
        "displayName": "Person/vehicle detector",
        "nodeConfig": {
          "personVehicleDetectionConfig": {
            "enablePeopleCounting": true,
            "enableVehicleCounting": true
          }
        },
        "processor": "builtin:person-vehicle-detection",
        "parents": [
          {
            "parentNode": "builtin-input-stream"
          }
        ],
        "outputAllOutputChannelsToStream": true
      },
      {
        "name": "builtin-media-warehouse",
        "displayName": "Vision AI Warehouse",
        "nodeConfig": {
          "mediaWarehouseConfig": {
            "corpus": "projects/redacted/locations/us-central1/corpora/redacted"
          }
        },
        "processor": "builtin:media-warehouse",
        "parents": [
          {
            "parentNode": "builtin-input-stream"
          },
          {
            "parentNode": "builtin-person-vehicle-detection"
          }
        ],
        "outputAllOutputChannelsToStream": false
      },
      {
        "name": "builtin-big-query",
        "displayName": "BigQuery",
        "nodeConfig": {
          "bigQueryConfig": {
            "table": "projects/redacted/datasets/redacted/tables/redacted",
            "createDefaultTableIfNotExists": true
          }
        },
        "processor": "builtin:big-query",
        "parents": [
          {
            "parentNode": "builtin-person-vehicle-detection"
          }
        ],
        "outputAllOutputChannelsToStream": false
      }
    ]
  },
  "runtimeInfo": {},
  "state": "CREATED"
}

Deploying the app and showing results:

@cloudshell: $ curl -X POST     -H "Authorization: Bearer $(gcloud auth print-access-token)"     -H "Content-Type: application/json; charset=utf-8"    "https://visionai.googleapis.com/v1/projects/redacted/locations/us-central1/applications/redacted:deploy"

{
  "name": "projects/redacted/locations/us-central1/operations/redacted",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.visionai.v1.OperationMetadata",
    "createTime": "2023-06-02T16:39:35.120723259Z",
    "target": "projects/redacted/locations/us-central1/applications/redacted",
    "verb": "update",
    "requestedCancellation": false,
    "apiVersion": "v1"
  },
  "done": false
}

Get the operation of the deploy above:

@cloudshell: $ curl -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json; charset=utf-8" "https://visionai.googleapis.com/v1/projects/redacted/locations/us-central1/operations"
{
      "name": "projects/redacted/locations/us-central1/operations/operation-redacted-...9e8",
      "metadata": {
        "@type": "type.googleapis.com/google.cloud.visionai.v1.OperationMetadata",
        "createTime": "2023-06-02T16:31:47.503950448Z",
        "endTime": "2023-06-02T16:31:48.036101548Z",
        "target": "projects/redacted/locations/us-central1/applications/redacted",
        "verb": "update",
        "requestedCancellation": false,
        "apiVersion": "v1"
      },
      "done": true,
      "error": {
        "code": 3,
        "message": "Instance Deployment Step 1 failed, step: projects/redacted/locations/us-central1/applications/redacted/instances/stream1-DeployInstance. Detailed App Platform Error: Invalid application instance graph, it cannot be deployed: Node builtin-universal-input not found in the application."
      }
    }

The Error reports no builtin-universal-input node in the application, but this should never exist according to the application JSON above.

Looks to us like the API may be broken, and is referring to incorrect instances for the applications. Any thoughts?

brendan-Wursta commented 1 year ago

@dchao34 @pkim-inmotion Any word on this?

I tried using the /v1alpha1 version of the endpoint, and no success.

Is there a way to query which streamInput you have? I see /addStreamInput and /removeStreamInput, but I don't see a GET /streamInput where I can see the details of the stream. It would be useful since this is where the application is failing, and building a applicationStreamInput requires a bunch of fields if we don't start with a reference.

dchao34 commented 1 year ago

@milannic-google @yxue any idea on this?

brendan-Wursta commented 1 year ago

@milannic-google @yxue @dchao34 @pkim-inmotion

It's been several weeks now that the UI deployment has been failing for these vertex AI vision applications. Can anyone confirm any issues in the API or UI? This is holding up a large google partner development project for us (Wursta).

yxue commented 1 year ago

Hi @brendan-Wursta, sorry for the late response. Could you recreate the application and have another try? Our fix has been released, it could be that the current application is corrupted. Please let us know if you encounter any other questions. Thanks!

brendan-Wursta commented 1 year ago

@yxue We now have a working deployment after several failed attempts today. After deleting the app and recreating it a few times, it finally worked. It would be awesome if there was a GET endpoint to view the current streamInput settings. I think that would have helped us a lot to diagnose the issues.

Closing the issue for now, thanks for your help