How to enable TIER_1 networking with GVNIC in a batch job specified by yaml

Hi all,

I have been looking at the docs but unable to find this one. My yaml usually looks like:

taskGroups:
  - taskSpec:
      runnables:
        - container:
            imageUri: ... #Docker image Debian/bookworm
            entrypoint: /bin/bash
            commands:
              - ...
          environment:
            variables:
              ...
      volumes:
        - gcs:
            remotePath: ...
          mountPath: ...
      computeResource:
        cpuMilli: ...
        memoryMib: ...
      maxRetryCount: ...
      maxRunDuration: "...s"
allocationPolicy:
  instances:
    - policy:
        bootDisk:
          sizeGb: ...
        machineType: ...
  network:
    networkInterfaces:
        nicType: GVNIC
    network-performance-config:
      totalEgressBandwidthTier: TIER_1
      totalIngressBandwidthTier: TIER_1
      totalNetworkPerformanceTier: TIER_1
  palcement:
      collocation: COLLOCATED

Unfortunately the networkInterface options don’ work:

- description: "Invalid JSON payload received. Unknown name \"nicType\" at 'job.allocation_policy.network.network_interfaces[0]':\
      \ Cannot find field."
    field: job.allocation_policy.network.network_interfaces[0]

It would be great if someone could help me. I don’t know if I have to also specify the diskimage. Ideally I want a resource that can run my docker but comes pre enabled with Tier_1 bandwidth. It would be great if you could also check the placement policy entry.
Thank you!
@bolianyin @wenyhu

Hi @abhinavsns ,

Batch has not supported GVNIC and Tier_1 Networking from job requests as the NetworkInterface option yet. https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#NetworkInterface has the options we support now.

To unblock, you can try to create an instance template with the network config you want and create Batch job from instance template: https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate.

Thanks,

Wenyan

Thank you so much!

I think I am still blocked because I am also mounting a local ssd using batch. What device name I should be using for mounting it in the script when using the instance template with a local ssd?

In the instance template creation, I don’t see a way to setup the ssd like in the batch job with a device name. Is it possible to mount the ssd specified in the instance template using batch mount?

Thank you!
@wenyhu

Hi @abhinavsns ,

You can follow https://cloud.google.com/batch/docs/create-run-job-storage#use-local-ssd which has guidance on how to using use local SSD with instance template.

You need to create the instance template with local SSD, and use that local SSD name created from the instance template in the mount volumes fields.

Thanks,

Wenyan