August 15, 2022, 9:27pm
I am new to some of the web technologies so i may be approaching this incorrectly.
I’m trying to use
google cloud functions to deploy custom python scripts on the web. The goal is to have these python function resources and use Hops to send data to them and have them return results. 2 benefits I am looking to achieve; access to Cpython libraries; offload complex operations.
Currently Running flask locally and I am able to connect Hops to it and execute the python script. It’s not clear to me what needs to be adapted to move the python operation to the cloud service.
Any examples or alternatives would be welcome. I could be missing something simple.
August 15, 2022, 10:00pm
Google has a platform called AppEngine which would allow uploading and executing of flask based python apps.
Another alternative is Heroku. Here’s some steps that one developer took to get the ghhops python server running on Heroku
This file has been truncated.
# Deploying the Flask app to Heroku
This tutorial summarizes the steps required to deploy your Flask app to Heroku, taking the post [**"Create and Deploy a Simple Web Application with Flask and Heroku"**](https://towardsdatascience.com/create-and-deploy-a-simple-web-application-with-flask-and-heroku-103d867298eb) by [Naveen Venkatesan](https://naveenvenkatesan.medium.com/?source=post_page-----103d867298eb--------------------------------) as a reference.
It assumes you already have [Git](https://git-scm.com/) installed on your machine, a [Github](https://github.com/) account and [Heroku](https://www.heroku.com/) account.
Deploying your Flask app to Heroku can be done in a simple way, following the steps below:
You will start by setting up the basis for your app to be developed:
1. Create a [Github](https://github.com/) repository for your application;
2. Clone your newly created repository using `git clone https://github.com/your_name/repo_name` and cd into the folder `repo_name`;
3. Create a virtual environment for your application with `python3 -m venv venv` (for example) and activate it.
4. pip install the following modules:
4. [rhino3dm](https://www.rhino3d.com/features/rhino3dm/) (this is optional)
August 16, 2022, 5:02pm
@stevebaer, gave it a try and was able to get it connected!
I have some additional issues as i need to allow the upload of a file, process it, and then return it.
i was exploring Flask’s upload methods using http requests but i’m running into what looks like a similar issue to
this post where i cannot access any other @app.routes other than the hops component.