temporary `run` service process
The ability to ssh into an existing proccess is great, and let's you do some of the things that
heroku runlets you do. (And some things it doesn't, becuase heroku run doesn't actually let you connect to a current process).
But the main difference is that
heroku runwill start a
new"dyno" for your
runtask. Not use an existing web or worker process. It boots it up on demand, and charges you for the minutes of use.
This is useful becuase you can run things (or open an interactive console) in a separate environment from your actually running production web/worker, without worrying about interfering with their RAM or CPU resources -- to run a temporary one-off task, or an interactive console.
In terms of render's model, I could imagine this working by defining a new service type with it's own "build command"... but then I guess you'd still need some CLI way to launch one of those with a custom one-off "start command".
Just wanted to add another +1 for this, basically wanting to get to "heroku run rails console". I want to be able to do arbitrary, ad-hoc processing, without competing with a puma/sidekiq that is already running on the VM. Sometimes this is additionally motivated by wanting to spawn a VM of a different size than what the fleet is typically using.
Maybe I could kinda get there by putting my intended procesing behind a rake task or ruby CLI script that could be invoked as a one-off job, but the real power comes from having the REPL available to work through an issue or a task interactively.
Note: you can use Render One Off Jobs to run arbitrary commands in the context of your service using the REST API: https://render.com/docs/jobs
We will add the ability to run these jobs through a CLI as well.
Anurag Goel: Can I SSH into an One Off Jobs instance. I will need that for "rails console".
marked this post as
Merged in a post:
`heroku run` equivalent
Either via the API or the CLI. This would ssh to an existing server, or possibly launch a new one like heroku does. It'd then run the given command on the server.
I use it on Heroku for executing various batch scripts such as regenerating sitemaps, re-indexing Elastic search, running a database migration, or conveniently going right into a rails console. E.g.,
heroku run rails console.
The command spins up a server, runs, and then tears down the server when it exits.
^^ As well as an equivalent to
heroku run:detached-- to execute long-running commands and not worry about losing connection to the server while the command is running.