google-cloud-platformgpugcloudgoogle-ai-platform

Can you start AI platform jobs from HTTP requests?


I have a web app (react + node.js) running on App Engine.
I would like to kick off (from this web app) a Machine Learning job that requires a GPU (running in a container on AI platform or running on GKE using a GPU node pool like in this tutorial, but we are open to other solutions).
I was thinking of trying what is described at the end of this answer, basically making an HTTP request to start the job using project.job.create API.

More details on the ML job in case this is useful: it generates an output every second that is stored on Cloud Storage and then read in the web app.

I am looking for examples of how to set this up? Where would the job configuration live and how should I set up the API call to kick off that job? Are the there other ways to achieve the same result?

Thank you in advance!


Solution

  • Thank you everyone for the input. This was useful to help me resolve my issue, but I wanted to also share the approach I ended up taking:

    I started by making sure I could kick off my job manually. I used this tutorial with a config.yaml file that looked like this:

    workerPoolSpecs:
      machineSpec:
        machineType: n1-standard-4
        acceleratorType: NVIDIA_TESLA_T4
        acceleratorCount: 1
      replicaCount: 1
      containerSpec:
        imageUri: <Replace this with your container image URI>
        args: ["--some=argument"]
    

    When I had a job that could be kicked off manually, I switched to using the Vertex AI Node.js API to start the job or cancel it. The API exists in other languages. I know my original question was about HTTP requests, but having an API in the language was a lot easier for me, in particular because I didn't have to worry about authentification.

    I hope that is useful, happy to provide mode details if needed.