Open yihming opened 3 months ago
Hi @yihming - thanks for providing the detail and log message. Please try removing the trailing /
from the network url. so use projects/gred-cumulus-sb-01-991a49c4/global/networks/vpc-cumulus-sb-01
instead.
Hi @dspeck1 ,
Thank you for your immediate help!
I checked the my-private-network
and my-private-subnetwork
labels in my project (by running gcloud projects describe
command), and neither of them has the trailing /
(please see attached screenshot).
And actually this same settings in virtual-private-config
stanza worked with Genomics API in the past 3 years. Then recently when I migrate to GCP Batch, it broke.
Thanks! Sorry I was looking at it incorrectly. The GCP Batch backend adds the trailing slash. The Genomics API backend added a trailing slash as well. Google must have change the validation of the format. We will push a change that fixes it. In the interim if setting the network via the literal option instead of the label should fix it.
Thanks! I did see the trailing /
is added by Cromwell: https://github.com/broadinstitute/cromwell/blob/develop/supportedBackends/google/batch/src/main/scala/cromwell/backend/google/batch/models/VpcAndSubnetworkProjectLabelValues.scala#L15.
I tried to set by literals as the following:
virtual-private-cloud {
network-name = "$NETWORK-NAME"
subnetwork-name = "$SUBNETWORK-NAME"
auth = "application-default"
}
where $NETWORK-NAME
and $SUBNETWORK-NAME
are replaced by the values of my-private-network
and my-private-subnetwork
labels, and hidden here.
but my server failed immediately when starting:
2024-08-20 21:43:02 main WARN - Failed to build GcpBatchConfigurationAttributes on attempt 1 of 3, retrying.
cromwell.backend.google.batch.models.GcpBatchConfigurationAttributes$$anon$1: Google Cloud Batch configuration is not valid: Errors:
Virtual Private Cloud configuration is invalid. Missing keys: `network-label-key`.
It looks like the GCP Batch config requires network-label-key
, which is not optional...
I then set network-label-key
to a non-existing label name, hoping that cromwell could fall back to using literals at runtime:
virtual-private-cloud {
network-name = "projects/.../global/networks/$NETWORK-NAME"
subnetwork-name = "regions/.../subnetworks/$SUBNETWORK-NAME"
network-label-key = "dummy",
auth = "application-default"
}
Then it did.
@dspeck1 Can I confirm with you if the subnetwork name specified in subnetwork-name
should follow regions/${region-name}/subnetworks/${subnetwork-name}
pattern? I just cannot find how Cromwell adds prefix for subnetwork name in the source code. Thanks!
I can confirm that using the literal approach instead of project labels works in this case. One just need to:
/
) in network-name
. It's in format projects/${project_id}/global/networks/${network_name}
./
) in subnetwork-name
. It's in format regions/${region_name}/subnetworks/${subnetwork_name}
.network-label-key
, as this is required for GCP Batch backend. Just give a non-existing project label here, and Cromwell will fall back to use the literals at runtime, if it cannot find such project label in your project.If the cromwell team can confirm that this is some inconsistency/bug corresponding to GCP Batch, I'd hope this issue could be fixed so that:
/
when cromwell automatically attaches prefixes.network-label-key
not required.Thanks!
We are working on updating the code to fix the bugs describe above and will provide an update when complete.
Thank you @dspeck1 so much for your help!
Adding notes to issue re: PAPIv2 behavior:
Hello,
I'm working on making our cromwell server work with GCP Batch and running in our private VPC network.
However, after following this tutorial, I encounter the following error:
It seems that Cromwell only accepts public VPC network with names starting as
global/networks/...
, while my actual network name was automatically attached by prefixprojects/${projectId}/global/networks/
(as shown in Line 1 of the error message above).I just wonder if this is because I have something wrong in my conf file, or I missed some setup at GCP Batch side. Thanks!
I'm using Cromwell v87. And my conf file is
where
my-private-network
andmy-private-subnetwork
are GCP project labels.