populationgenomics / metamist

Sample level metadata system
MIT License
1 stars 1 forks source link

Fixing custom audience attribute for cloud run service. #748

Closed milo-hyben closed 4 months ago

milo-hyben commented 4 months ago

Background notes: To be able to have custom domain linked to a cloud run, property 'custom_audiences' needs to be set. However there is an issue with pulumi and gcp. After trial and error I have found they don't support this field when cloud function gets created via gcp.cloudfunctionsv2.Function and gcp.cloudfunctionsv2.FunctionServiceConfigArg.

Solution is to create cloud service separately via gcp.cloudrunv2.Service, which has property 'custom_audiences'. The only ugly bit is cloud function creates cloud run service by default and there seems to be no way to skip it. So we would have 2 cloud runs linked to a one function, which is not a problem, just unnescessary extra cloud run service. It would not cost anything extra as both services have cpu set to idle.

if custom_audience_list is present for the function in the etl configuration, it creates a new custom service with postfix '-external'.