How to update a firebase server after making a change? - python

I've set up a Flask server which is hosted on Firebase integrated with Cloud Run, I'm only making changes to html at the moment and using the command "firebase serve" with my localhost, however when I refresh the window and when I stop the server and restart it, my changes are still not showing up. I must be googling wrong because I can't find what I'm looking for: is there some sort of an update command, or do I need to re-build and re-deploy every time?

If the Firebase emulator suite isn't proxying the request to Cloud Run in the way you expect, you should open an issue on the firebase-tools GitHub and provide reproduction steps so they can diagnose. You should make sure that your installation of firebase-tools is fully up to date.
Note that the CLI will not deploy any new code to Cloud Run. You still have to run gcloud to update the backend.

Related

Host a python script on web server and get its output for further use

I have a unity AR application that needs to run a python script on some event. What I want to do is to host the script on a cloud server, run the script on event from my AR app and use the results generated by python script for future use. I have seen people recommend Ironpython but its not what I need. And according to this answer the best way to do this by a cloud hosting.
I have researched it a lot and have found that it is done by making a docker container and then hosting the container to web server. Is this the right way? or can it be done in some other easier work around? The most important part is to trigger that python script from and unity app event and its results should be returned to the app so that it can be used further. Is this doable?
I have never run (or even hosted) a python script over any server and have no basic knowledge of doing it. It would be of great help if anyone could tell me how to do this. Which cloud server would be the best for it and would that server be paid?
This is for my Final year project purpose, any sort of help will be great. Thanks
Cloud hosting, probably digitalocean? Cheap and efficient, definetly paid server however check in if you can use Heroku somehow?.

Flask and auto-reloading in new CLI

I have a web application in flask that uses rest-plus for some CRUD operations. I'm using Swagger to test endpoints.
Recently i migrated my project to use new Flask CLI instead of Flask-Script (using Manager instance to add commands).
However there is a big change I've witnessed w.r.t. reloader...
Previously every time I made a change in code, after server was already running there was information about reloading, and traceback in case of error in terminal. I think whole application was restarted each time?
Now, after migrating to CLI there is no such thing (at least not visible in terminal) and in order to see error I have to open up my server in browser or refresh browser, and the traceback is visible both in browser and terminal afterwards also there is no information about reloading in terminal.
I'd like to know whether it's caused by this new CLI or maybe I messed something else up in the meantime.
Which behavior is the correct one and is there any way I can get back auto-reloading in terminal without having to refresh web browser each time?
Thanks in advance,
Cheers
Make sure you run your flask server in development mode. For example:
export FLASK_ENV=development
export FLASK_APP=app.py
flask run
The log should say something like:
* Environment: development
* Debugger is active!

Getting push to deploy to work, configuring "release pipeline"

So since last week suddenly git push origin master doesn't work anymore to "push to deploy". It sure pushes the sources to remote repository at Google, and the code is there but it never deploys. Read about it here: GAE: Trouble with push to deploy
It seems things are changing over at Google and this week there is new stuff in the Google Developer Console, in the "Cloud Development/Releases" section; "Configure Release Pipeline"
There are three settings: the pipeline name, pipeline tasks, and then an optional setting to have deploy notifications sent by email.
I just enter a random name like "mydevpipeline", select "Deploy source only", and check the email box. But I just get this error: "Failed to create the pipeline.". I also tried unchecking the email box, still same error. Tried it over and over.
No where to go from there...
Anyone been able to create this pipeline and get it all working?
It seems that this pipeline configuration must go through in order for push to deploy from now. I haven't seen any news or notification about this change...
Fwiw, the documentation https://developers.google.com/appengine/docs/push-to-deploy states nothing about pipelines. It's just outdated I guess.
Update:
What do you know... I went on trying to configure this pipeline on the live GAE project (the one described above is the dev GAE project I'm using)... and it worked. I could configure a pipeline ok. After that, I could once more push-to-deploy, alas only on the live version so far. I might try creating a new dev project, it seems existing projects "break" from time to time... I have had similar problems before and creating a new project DOES solve things from time to time.....
Google App Engine pipelines do not like .gitignore file. Try if it works without that file. It fixed the problem for me.
It took me a long time to get this working for PHP, after a lot of communication with Google it was finally revealed to me that in your app.yaml file you need to have a line that reads:
threadsafe: false
In order for the pipeline to successfully pick up and deploy your git push (I use sourcetree, but command line git has the same end result) that line must be present. If it's omitted or set to true the pipeline won't be able to deploy it.
I wanted to throw this answer on here in case anyone stumbled on this thread looking for help. One of my projects has "randomly broken" and after 3 months of successfully using my release pipeline for multiple commits per day it suddenly no longer deploys when I push. Ultimately giving the extremely helpful error message of "Unable to get deployment status" - and now none of my changes can be applied to the live site. Copying the entire source code, changing the app name, and pushing to a new GAE project with release pipeline works fine, but I need the original site to start working again.

Google App Engine trying to access dev data

I'm running my app on my local machine and using the remote API to access a datastore on my production side. Everything was working great until I tried adding a second app in google app engine launcher (I believe this is what caused the issue) because I had to merge what I was working on with some more up to date code and wanted to test as I went along. Suddenly I can't even access the remote datastore anymore. I get the error
app s~buybottandrew cannot access app dev~buybottandrew's data
I tried clearing the local datastore which allows me to access the remote datastore once, then the problem comes up again.
I read suggestions on the default_partition flag and I've tried passing that as well, with a muitiplicity of different things including nothing and an empty string.
--default_partition=s~buybottandrew
It gives me the same error no matter the argument
dev_appserver.py: error: unrecognized arguments: --default_partition=s~buybottandrew
If I remove all my remote api code and deploy it when I test it on the production server everything works perfectly. I can't seem to narrow down what is going on for the life of me.
Any input would be greatly appreciated.
--default_partition was removed in the new SDK. If you want to use the legacy SDK function, you can use old_dev_appserver.py --default_partition

Creating a KhanAcademy clone via Google App Engine - issues with application name in app.yaml

I'm trying to create a KhanAcademy (KA) clone on Google App Engine (GAE). I downloaded the offline version of KA (http://code.google.com/p/khanacademy/downloads/list) for Mac, and set it up with GoogleAppEngineLauncher (https://developers.google.com/appengine/). Because KA was produced on Python 2.5, I have the setup running through the Python 2.5 included in the KA offline version download, and I added these extra flags to the app (to essentially duplicate the functionality of the included Run file):
--datastore_path=/Users/Tadas/KhanAcademy/code/datastore --use_sqlite
As is, GAELauncher is able to get that up and running perfectly fine on a localhost. However, to get it up on my Google appspot domain, I need to change the application name in app.yaml. When I change "application: khan-academy" in app.yaml to a new name and try to run the local version via GAELauncher (or the included Run file), the site comes up but all the content (exercises, etc.) has disappeared (essentially, the site loses most of its functionality). If I try to "Deploy" the app in this state, I received a 500 Server Error when I try to go on the appspot website. Any ideas as to what could be going wrong?
Thanks.
The problem is that your 'clone' application does not have access to Khans Academy's AppEngine datastore so there is no content to display. Even if you do use all of the code for their application, you are still going to have to generate all of your own content.
Even if you are planning to 'clone' their content, too, you are going to have to do a lot of probably manual work to get it in to your application's datastore.

Categories

Resources