Comments (10)
i am going to delete venv folder from data-magic github repo (https://github.com/climate-tech-handbook/data-magic/tree/main/venv) . i think it is not really used and make the project heavy, in an effort to make it easier to deploy
from climate-tech-handbook.
I don't imagine switching to Docusaurus (Node / React) changes anything when it comes to Flask, but if it does let me know, as I am not a developer.
I also don't know if Flask has limitations as the project scales. If so, please share those opinions.
I don't think the Docusaurus switch will affect anything. Flask itself has a reputation as best for side projects and smaller web apps. But, I think it should work at least in the immediate future. There are alternatives that are still Python based like Django and FastAPI that are meant for more production sites and larger websites. But, I think we should be able to make that switch in the future if needed. FastAPI in particular looks very similar to Flask/
from climate-tech-handbook.
Thinking ahead to deployment and for discussion purposes, here is one article I was reading about a possible way to do it
https://testdriven.io/blog/flask-render-deployment/
There probably is a way to do it with our current host (Netlify I'm pretty sure), but the generalities in the article are still true
There's also this slightly different approach which is in the context of Netlify https://testdriven.io/blog/static-site-flask-and-netlify/
from climate-tech-handbook.
@ArLough very helpful thanks!
I'm also open to alternatives to using something besides Flask or Netlify for this project if you or anyone else wants to propose anything.
The Flask decision was based on it's "non-opiniated" simplicity and the fact that the site started with MKDocs (Python) and it involves AI/ML (Python) so it made sense to use Python for everything.
I don't imagine switching to Docusaurus (Node / React) changes anything when it comes to Flask, but if it does let me know, as I am not a developer.
I also don't know if Flask has limitations as the project scales. If so, please share those opinions.
As for Netlify - I happen to like working with it because it's so easy to administer and has some great features that would be a pain to do with AWS. But it does cost money compared to GitHub pages, and is probably more expensive than AWS.
from climate-tech-handbook.
@shreeup has been playing around with deploying "Data Magic" to Vercel.
If it's a better fit than another host, that's awesome.
My main concern is price - would I have to pay for both Netlify & Vercel? That starts to add up on top of the other project costs.
I suppose whatever we use to host this thing will have a cost to it beyond Netlify? Or can we consolidate?
from climate-tech-handbook.
this is the error i received when deploying to vercel. I am trying to make use of free tier
No framework detected. Default Project Settings:
- Build Command:
npm run vercel-build
ornpm run build
- Development Command: None
- Install Command:
yarn install
,pnpm install
, ornpm install
- Output Directory:
public
if it exists, or.
? Want to modify these settings? [y/N] y
? Which settings would you like to overwrite (select multiple)? None
🔗 Linked to shreeupadhyaya/y (created .vercel and added it to .gitignore)
🔍 Inspect: https://vercel.com/shreeupadhyaya/y/4cb5SJB8z8LnfBnRk6AbwA9zxX3L [2s]
Error: A Serverless Function has exceeded the unzipped maximum size of 250 MB.
shree@rahuls-mac-mini ClimateTech-data-magic % vercel
Vercel CLI 30.1.2
🔍 Inspect: https://vercel.com/shreeupadhyaya/y/HJeM4KBgJNEAD14jbYBrfuNHUqf7 [2s]
Error: A Serverless Function has exceeded the unzipped maximum size of 250 MB.
I am trying to find alternatives
from climate-tech-handbook.
My main concern is price - would I have to pay for both Netlify & Vercel? That starts to add up on top of the other project costs.
I suppose whatever we use to host this thing will have a cost to it beyond Netlify? Or can we consolidate?
Netlify does have serverless functions as an offering, but I'll have to look into it and see if it fits our use case.
from climate-tech-handbook.
I was able to deploy docker image to render platform,
https://climatetechdatamagic.onrender.com/hello
but post endpoints are not really working.. will have to figure this out
Error
Traceback (most recent call last):
Jun 14 09:47:31 PM File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2528, in wsgi_app
Jun 14 09:47:31 PM response = self.full_dispatch_request()
Jun 14 09:47:31 PM File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1825, in full_dispatch_request
Jun 14 09:47:31 PM rv = self.handle_user_exception(e)
Jun 14 09:47:31 PM File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1823, in full_dispatch_request
Jun 14 09:47:31 PM rv = self.dispatch_request()
Jun 14 09:47:31 PM File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1799, in dispatch_request
Jun 14 09:47:31 PM return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
Jun 14 09:47:31 PM File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1890, in ensure_sync
Jun 14 09:47:31 PM return self.async_to_sync(func)
Jun 14 09:47:31 PM File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1911, in async_to_sync
Jun 14 09:47:31 PM raise RuntimeError(
Jun 14 09:47:31 PM RuntimeError: Install Flask with the 'async' extra in order to use async views.
Steps:
Build docker image push to docker hub
docker image build -t datamagic_docker .
docker run --platform linux/amd64 -p 5000:5000 -d datamagic_docker
docker login
docker tag datamagic_docker shreeupadhyaya/datamagic_docker
docker push shreeupadhyaya/datamagic_docker
deploy image from docker hub to render
https://render.com/docs/deploy-an-image
from climate-tech-handbook.
I experienced the same async issue on my local machine. It was resolved by doing 'pip install asgiref' for me
from climate-tech-handbook.
Ok now I am able to invoke post methods in hosted platform.
This is image from docker logs which show that post endpoints invocation was successful and returned 200.
I am also attaching screenshot of postman returning 200 for one of endpoint
from climate-tech-handbook.
Related Issues (20)
- Call out box ("Admonitions") color fix - Question Box
- Alternative Refrigerant Page & content HOT 1
- Test hackmd.io as a potential writing and collaboration tool
- Mobile view for new design - fit items in the clock
- Homepage upgrade - new footer, cards, mobile view
- [EPIC] Update minicourse content
- Get Podcast Pagination working HOT 3
- Explore Notion API with our Data Magic Flask App
- Fix jump link to only scroll effect so it doesn't happen on page urls, only jump link urls HOT 1
- Fix broken links! HOT 1
- Implement React Icons in the Sidebar - potentially other parts of the site as well HOT 4
- Image captions HOT 2
- Swap out drop shadow for hero text on mobile, change to overlay
- Remove H3 headers from Table of Contents
- Make image cards fit 3 in a row on laptop
- Incorrect information showing on the Countdown Counter before loading correct info HOT 1
- Make a filter for image cards on the Sector Pages, so that solutions cards can be filtered
- Design image cards filter
- Add code to repo with documentation and workflow instructions
- Background on mobile changes from grey to white, make breakpoint CSS fix HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from climate-tech-handbook.