You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there is no way to execute remote tasks when the identity aware proxy is on. The task will simply fail when trying to poll the status over the newly deployed app engine version.
As a workaround, I've monkey patched the code in order to be able to supply a service account key file and a client id:
classAppEngine::Exec# PATCH - Memoize authorizer that will be used when polling the statusdefauthorizerauthorizer ||= beginkey_path=ENV['GAE_SERVICE_ACCOUNT_KEY_PATH']client_id=ENV['GAE_IAM_CLIENT_ID']ifclient && key_pathputs"Using IAM authorizer with GAE_SERVICE_ACCOUNT_KEY_PATH: #{key_path} and GAE_IAM_CLIENT_ID: #{client_id}"Google::Auth::ServiceAccountCredentials.make_creds(json_key_io: File.open(key_path),target_audience: client_id)endendenddeftrack_statustemp_version,secrethost="#{temp_version}.#{@service}.#{@project}.appspot.com"
::Net::HTTP.starthostdo |http|
outpos=errpos=0delay=0.0loopdosleepdelayuri=URI("http://#{host}/#{secret}")uri.query= ::URI.encode_www_formoutpos: outpos,errpos: errpos# BEGIN PATCH - Adding authorizer while polling the statusreq=Net::HTTP::Get.new(uri)authorizer&.apply!(req)response=http.request(req)# END PATCH - Adding authorizer while polling the statusdata= ::JSON.parseresponse.bodydata["outlines"].each{ |line| puts"[STDOUT] #{line}"}data["errlines"].each{ |line| puts"[STDERR] #{line}"}outpos=data["outpos"]errpos=data["errpos"]returndata["status"]ifdata["status"]ifdata["time"] > @timeout_seconds# BEGIN PATCH - Adding authorizer while polling the statusreq=Net::HTTP::Post.new("/#{secret}/kill")authorizer&.apply!(req)http.request(req)# END PATCH - Adding authorizer while polling the statusreturn"timeout"endifdata["outlines"].empty? && data["errlines"].empty?delay += 0.1delay=1.0ifdelay > 1.0elsedelay=0.0endendendendend
Currently there is no way to execute remote tasks when the identity aware proxy is on. The task will simply fail when trying to poll the status over the newly deployed app engine version.
As a workaround, I've monkey patched the code in order to be able to supply a service account key file and a client id: