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

Use cloud functions #4

Open
putty182 opened this issue Nov 1, 2018 · 8 comments
Open

Use cloud functions #4

putty182 opened this issue Nov 1, 2018 · 8 comments
Assignees
Labels
enhancement New feature or request
Projects
Milestone

Comments

@putty182
Copy link
Member

putty182 commented Nov 1, 2018

This would allow users to setup/start/stop rigs from a wider range of clients, without needing to launch a bash shell, e.g.

  • webhook from a discord bot, IFTTT button, google-oauth'd webpage
  • pub/sub handlers to deal with preemption and maintainence reported by Add watcher for maintainence metadata changes #32 not nessessary, boot disks persist just fine when terminated/stopped, providing you don't delete/replace the instance.
@putty182 putty182 added the enhancement New feature or request label Nov 8, 2018
@putty182 putty182 changed the title Call scale-down.sh steps on instance shutdown to support preemptible instances Automativally invoke scale-down steps on instance shutdown Nov 17, 2018
@putty182 putty182 changed the title Automativally invoke scale-down steps on instance shutdown Automatically invoke scale-down steps on instance shutdown Nov 22, 2018
@putty182 putty182 added this to the v0.2.0 milestone Nov 22, 2018
@putty182 putty182 changed the title Automatically invoke scale-down steps on instance shutdown Use Cloud Functions to perform scale-up / scale-down procedures Mar 2, 2019
@putty182 putty182 changed the title Use Cloud Functions to perform scale-up / scale-down procedures Use cloud functions Mar 2, 2019
@deekue
Copy link
Collaborator

deekue commented Mar 9, 2019

do you have language in mind for this?

@putty182
Copy link
Member Author

putty182 commented Mar 10, 2019

Probably nodejs, but I'm not sure when I'll get a chance to dig into this.

Open to suggestions :)

@juzkev
Copy link

juzkev commented Oct 30, 2020

Just curious, instead of using cloud functions to cleanup upon shutdown, how about using gcloud alpha cloud-shell + nohup as an alternative to run the cleanup script(snapshots and so on).

This can help avoid the cloud function compute cost, although it would have the other benefits stated in op.

@putty182
Copy link
Member Author

putty182 commented Dec 2, 2020

The idea of using cloud functions was to start handling each of the stateless activities that gcloudrig currently provides (setup, launch, shutdown, snapshot), ultimately leading way for a cloud-native port that once setup, you could trigger from your web browser. The cost of compute for cloud functions would be negligible (especially when weighed against the cost of running the rig itself).

But that's a lot of work... so until then I'll do exactly what you just said, over in #32 👍

@SwiftWinds
Copy link
Contributor

Maybe instead of cloud functions, we could use Google Cloud Run with a custom docker image that incorporates the gcloud cli and node docker images. Whenever the node server gets hit, it simply executes the respective shell scripts, so we don't have to rewrite all the bash scripts in javascript

@oschwartz10612
Copy link

I know this is old, but I agree with @SwiftWinds. I think it is easiest to build off of the already good bash scripts you have and just wrap it in an express server that calls the scripts. It could serve a simple webpage to login and pipe the output over sockets to monitor from the frontend?

I could get started if you think this is something to pursue? I have some experience with Cloud Run and things like this.

@oschwartz10612
Copy link

I think this is an interesting approach so I am getting started here: https://github.com/oschwartz10612/gcloudrig/tree/cloud-run/api

Feel free to contribute or tell me what I am doing wrong.

@SwiftWinds
Copy link
Contributor

SwiftWinds commented Feb 16, 2021

Nice work, @oschwartz10612! Unfortunately, I currently have little time in my schedule to contribute, but best of luck getting the server working!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Road to v1
  
To do
Development

No branches or pull requests

5 participants