Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a VM in a GCP project that serves the Langflow app #169

Merged
merged 34 commits into from
Apr 21, 2023

Conversation

genome21
Copy link
Contributor

By running the script in GCP cloudshell, the project will be configured and a VM setup for serving the Langflow app.

Copy link
Contributor

@ogabrielluiz ogabrielluiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. Would 100GB of boot disk size incur charges?

@genome21
Copy link
Contributor Author

Yes, I found that the langflow app was a pretty good size when installing from the Python package. This can be adjusted, but 100 GB gives enough space to install all of the components and dependencies from what I've seen.

The 100 GB disk is about $10/month.

Cloud NAT is about $7/month depending if the user needs it. If they don't mind the VM having an external IP and being open to the world, they can delete the Cloud NAT appliance and save that cost.

The VM itself only costs $0.15/hr; so I spin up my VM when I'm about to start working with Langflow and shut it down when I'm done. The VM, disk, and Cloud NAT all together is around $160/month if the VM is kept running 24/7 for an entire month.

There are ways to adjust the script to provision a Spot or Preemptible VM which brings the compute and disk pricing down to $40/month. However, the script would need to be rerun if the Spot/Preemptible VM is deleted.

@ogabrielluiz
Copy link
Contributor

@genome21 That was an awesome write-up. Would you be willing to format that into the doc? Maybe add comments where the person could change to set a Spot instance.

@genome21
Copy link
Contributor Author

genome21 commented Apr 20, 2023

@ogabrielluiz

Summary of Changes

  • Added steps to provision a GCP VM for serving Langflow
  • Adjusted firewall rules to allow port 8080
  • Added comments for code clarification
  • Implemented checks and creation of VPC and subnet
  • Added machine type to VM creation
  • Fixed apt confirmations, heredoc variables, and added conditional statements
  • Created setup files and GCP tutorial
  • Configured Cloud Shell to run the walkthrough
  • Removed scripted steps and comments from the walkthrough
  • Fixed bash command launch and matched it to the walkthrough
  • Forced GCP login in ephemeral Cloud Shell
  • Added Cloud Shell repo trust advisory
  • Removed login prompt for ephemeral Cloud Shell and set project config
  • Tested variable expansion
  • Provided user with a link to the Langflow server
  • Made adjustments to variables and trophies
  • Removed input tags and clarified notes for connecting to the VM
  • Moved trophies toward the end of the walkthrough and improved readability
  • Added styling and removed redundant wording
  • Added spot instance support and pricing information
  • Improved grammar and removed NAT-related content
  • Implemented layout changes

@genome21
Copy link
Contributor Author

genome21 commented Apr 20, 2023

I think it looks a bit better now. The only confusing part that I wasn't able to eliminate was that it takes about 30 minutes to do updates/upgrades and full install then run langflow.

More intuitive.

Copy link
Contributor

@ogabrielluiz ogabrielluiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ogabrielluiz ogabrielluiz merged commit b9a9892 into langflow-ai:dev Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants