How to Publish your Weewx Website to an AWS S3 bucket

329 views
Skip to first unread message

Mike Revitt

unread,
Apr 29, 2018, 7:03:03 AM4/29/18
to weewx-user
All,

I got this working a couple of months ago and have finally gotten around to documenting how I did it.

The guide is published here and you can see the Weewx website running at my domain, which is hosted on S3 or at the S3 address, both of which are shown below.



enjoy

Thomas Keffer

unread,
Apr 29, 2018, 11:05:07 AM4/29/18
to weewx-user
Thanks, Mike! Very interesting.

A suggestion: rather than modify reportengine.py, with all the maintenance headaches that implies, you could put your new class AWS_Sync in a new file, say, user/aws_sync.py. Then subclass service StdReport, overriding its method launch_report_thread() to launch AWS_Sync instead of StdReportEngine.

This would make you more upgrade-proof.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

vince

unread,
Apr 29, 2018, 12:52:57 PM4/29/18
to weewx-user
On Sunday, April 29, 2018 at 4:03:03 AM UTC-7, Mike Revitt wrote:

I got this working a couple of months ago and have finally gotten around to documenting how I did it.

The guide is published here and you can see the Weewx website running at my domain, which is hosted on S3 or at the S3 address, both of which are shown below.


Very cool.......takes the risk of running an Internet site to about as low as you can get, assuming you keep the access permissions world-read to the bucket.  Awesome.

A few thoughts.....
  • organizing this as an installable extension would be nice, along the lines of Tom's suggestion re: packaging the .py file into a new file
  • the name 'AWSCLI is perhaps a little broad as AWS has a zillion services etc.   Maybe AWS-S3 or the like ?
  • the AWS docs for that side of the fun are at https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html - might be worth adding to your docs
This one is pretty cool to me since it applies the sometimes difficult maze of Amazon docs above to a real-world problem, as well as of course the weewx tweaks to connect the dots end-to-end.  Really great stuff !

Mike Revitt

unread,
Apr 30, 2018, 3:05:37 AM4/30/18
to weewx-user
Thanks for your suggestions Tom, Vince.

I was also worried about the maintainability of the modification to StdReportEngine, so will look into how to create a new report engine as suggested. And the suggestion to rename from AWSCLI to AWS-S3 make a huge amount of sense az Vince points out AWSCLI does a lot.

No promises on timelines though, this desk thing called work keeps getting in the way.

And in answer to your query on World-Read to the bucket, that is what the Bucket Policy PublicReadGetObject does and why we didn't set the permissions when the bucket was created

Mike Revitt

unread,
May 27, 2018, 4:36:47 AM5/27/18
to weewx...@googlegroups.com, vince
Hi Thomas,

I have been looking at this today and it looks like I can copy  engine.py to a new program and then  call that from  the [Engine] section for weewx.conf.


Any thoughts


report_services = weewx.engine.StdPrint, weewx.engine.StdReport, weewx.AWSengine.S3_Sync

Mike Revitt

Global Database Cloud Migration Specialist


You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/fYg-cmVXAh0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

Mike Revitt

unread,
May 27, 2018, 8:41:20 AM5/27/18
to weewx...@googlegroups.com
Hi Tom,
awscli.py
Reply all
Reply to author
Forward
0 new messages