Efficiently update AWS elastic beanstalk app with new version - amazon-elastic-beanstalk

I have a python flask web app on elastic beanstalk. My app includes a photo album which takes up a decent amount of space on the server. I'm wondering if it possible to make changes to my website and only upload the changes, in a similar way to github, instead of having to reupload all of the files at once. Currently the only way I know of uploading new files is to choose a folder with all of the files in the web app during the "upload and deploy" step. When I have a large amount of files, this seems like an step for small changes.
The other option I can think of would be to store the photos on s3 and use both services, but I wanted to see if there was another option before refactoring everything.

Related

Running python script on database file located in google drive

I have a database file which is located on my own google drive (private) and it's updated on a daily basis.
I wrote a python script in order to track the data from the database file, however I need to download the DB file to my pc, and then running my script locally, every single day.
I am wondering if there are any better options, so I wouldn't have to download the DB file and move it manually.
From a slight searching on the web I found that there is no way to run the script in the google drive folder (obviously due to security issues), and using google cloud platform is not a real option since it's not a free service (and as I understood there is no free trial).
Anyways, any method that would make my life easier would be happily accepted.
Sorry
That's not possible AFAIK. At least in the way you have asked the question.
It may be that you are looking for a Database hosting service, which, as a rule, are not free. I remember seeing a SQL viewer around, I don't know if it is still available and I don't think it was accessible via a local Python script.
Google Cloud Platform, as other services, do however offer a free tier of services - though this depends on how much use you need to give it and also on your location. Though this can get quite involved quite quickly. There are also various options to choose from. For example Big Query may be something you are interested in.
A Possible Workaround
I assume that the reason you don't want to download it is because it is tedious, and not because your network connection or hard drive can't handle it, if so:
The simple workaround may just be to find a way to automatically download the database via the (Google Drive API)[https://developers.google.com/drive] with your Python Script, modify it, or read it, and then upload it again if you need to. This can be done all within one script using the API. So all you would need to do is run the Python script and you wouldn't need to manually download and move it into a folder. You would also not need to worry about running over the free tier and getting billed for it.
You could even use the Google Drive Desktop software to keep the database file synced locally. Since it is local, I doubt the software would be able to block a Python script on the file system.
If you don't even want to think about it, you could set up the Python script with a CRON job or a Scheduled task if you are on Windows.

Heroku via Github, where is my JSON files updated?

This isn't exactly a question in need of help, however, I am curious as to which file is updated, when updated, when I use Heroku via Github. Would it be the one within my Github or does Heroku save those files and update them somewhere else?
All I'm trying to accomplish is edit a JSON file so I can store an integer to each player (I'm using a worker, for a discord bot). Also, yes, that seems like what I am trying to do. Anything that saves the information, doesn't require money and isn't too complex
EDIT:
This issue has been solved with the answer that Heroku simply cannot update JSON files. I have resolved it myself by moving my host onto a Raspberry Pi 3 Model B+. Thank you for all the answers.
When you use Heroku's GitHub Sync feature, a deployment will retrieve your code directly from GitHub.
Those files aren't saved anywhere else. A new deployment from master will take the code fresh from GitHub.
All I'm trying to accomplish is edit a JSON file so I can store an integer to each player (I'm using a worker, for a discord bot). Also, yes, that seems like what I am trying to do. Anything that saves the information, doesn't require money and isn't too complex
Heroku's filesystem is ephemeral. Any changes you save to the local filesystem will be lost when your dyno restarts, which happens frequently. If you scale your application to multiple dynos you'll also run into trouble since the ephemeral filesystems are dyno-local.
Your best bet is to use a proper client-server datastore, like PostgreSQL. Heroku provides its own Postgres service, which has a free tier. If Postgres isn't to your liking, feel free to choose something else.

Publishing NopCommerce Issue

I've got a nopCommerce project. I could publish it successfully to a server from my local but it took about 1,5 hours to upload complete ( depending my upload speed ).
Question: Is there a way to sync or update files which i only modify inside VS than uploading whole published project? (cause I told above it took much time for me)
You have to publish whole project on deployment server at the very first time, afterwords there is no need of publish a whole project again and again.
Is there a way to sync or update files which i only modify inside VS than uploading whole published project?
There are many version control tools available to track your file changes. You can use it and update only required files and DLLs.

how to sync files from mysql hosting site to google drive

We are creating a web application using MySQL as our database, is there a way that some files from the hosting site of our application can be sync to the user's google drive?
There's no direct way of synchronizing your local data with Drive.
However, you can pseudo-sync with little load on your server by using Changes. Basically, you can get list of file changes since the time you specify. If I were you, I make a cron job of checking file changes from Drive and Files.get specific files that have changed.
Besides what JunYoung Gwak suggests -> to ask google by polling them you will also have to keep a last edited date in your app and there might be cases when the local file is newer. will have to keep the same time zone as google to make it work for <24 hour changes.
So both sides will need to have a give changes since -date-time-in-timezone and a way to take a file for one place and update to the other.
Might have conflicts that need to be resolved by a diff tool.

Looking for a webserver as an alternative to my localhost?

I have an android app which successfully reads .json files from my localsever, however when the application runs on a mobile it is unable to read the files. I have had a nightmare trying to resolve the issue so I've given up.
I figured that perhaps uploading the .json files to an online web server would be an easier option. I have no previous experience with online web servers and wondered if someone could recommend a website?
I would only be using it to upload 5 .json files that are no more than 5KB and would probably only need it to be hosted online for about a month, I'm not sure if there is an alternative to a monthly subscription.
There are a lot of free web services. However, if you want to make it fast and easiest, try google sites. It gives you an evaluation time of about a month and it should be enough for you.
However, if you just want few files, you can go with any cheap web host such as bluehost and if you just want subscription on monthly basis.
You can also use amazon EC2 which provide you services on hourly basis so if you do not want to use it, just turn it off.
http://aws.amazon.com/ec2/pricing/