Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not sure if gmailr is compatible with googleCloudRunner #204

Open
sommerhd-royals opened this issue Nov 21, 2022 · 3 comments
Open

Not sure if gmailr is compatible with googleCloudRunner #204

sommerhd-royals opened this issue Nov 21, 2022 · 3 comments

Comments

@sommerhd-royals
Copy link

Hi Mark,

Your work with googleCloudRunner is remarkable, first of all. With that out of the way, I have successfully been able to run R scripts in Google Cloud with Cloud Build (using the checklist at https://medium.com/@damiencaillet/automate-r-code-in-the-cloud-89266910cc36) that do a range of operations (like read from GCP, write to GCP, data manipulation, etc), but I have been stuck on trying to send an email at the bottom of an R script using the gmailr package for a while now.

I created an issue for @jennybc over at r-lib/gmailr#174 last week, but I thought it may be worth a quick question as to whether gmailr and googleCloudRunner are compatible with each other. When you hear 403 error does that sound like something you'd expect if someone tried to send an email remotely using gmailr from an R script using googleCloudRunner?

@jennybc
Copy link

jennybc commented Nov 21, 2022

I think you're a bit off-base with the subject. I don't think the the compatibility of gmailr and googleCloudRunner is really the point. They have separate auth mechanisms and I think the default behaviour of googleCloudRunner is achieving what you want and the default for gmailr is not.

@sommerhd-royals
Copy link
Author

Thanks @jennybc for your feedback. Google Support directed me to reach out to R package authors that might know more, so I was following their advice. You're probably correct, I just thought it was worth a quick question as this may be a complex issue of package interaction.

@MarkEdmondson1234
Copy link
Owner

The gmailr authentication needs to be carried out within its own step, so your upload of any auth files made available in a Docker container or similar. But see also https://code.markedmondson.me/googleCloudRunner/reference/cr_buildstep_mailgun.html for a Mailgun implementation

I also used the great blastula package ( https://pkgs.rstudio.com/blastula ) which had an easy way to upload email authentication, there is an example using it with googleCloudRunner at the bottom of this blog post:

https://code.markedmondson.me/sending-ga4-events-pubsub/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants