willghatch / racket-rash

The Reckless Racket Shell
http://rash-lang.org
Other
551 stars 31 forks source link

Feature: Docker integration #56

Open pmatos opened 5 years ago

pmatos commented 5 years ago

This is an idea I have been thinking about but I am still not sure if should be part of Rash or a sort of plugin to rash. However, the idea is to integrate docker into Rash so that pipelines can be run inside a container.

I can imagine something like:

(with-pipeline-in-docker 'ubuntu:latest
  { sudo apt-get update
    sudo apt-get upgrade -y  })

There are problem lots of issues to solve here but something like this would be awesome. If you don't get to it, probably I will. However, if would be interesting, given you know the internals of Rash, if this is feasible at the moment.

willghatch commented 5 years ago

On Wed, Jun 26, 2019 at 01:24:29AM -0700, Paulo Matos wrote:

This is an idea I have been thinking about but I am still not sure if should be part of Rash or a sort of plugin to rash. However, the idea is to integrate docker into Rash so that pipelines can be run inside a container.

Well, I know very little about Docker. Once I spun up a container to try it out, but I haven't had any real reason to use Docker yet.

I can imagine something like:

(with-pipeline-in-docker 'ubuntu:latest
 { sudo apt-get update
   sudo apt-get upgrade -y  })

So are you thinking this starts the ubuntu:latest docker image and sends that body to Racket/Rash inside the container? I'm not entirely sure how that would work. Perhaps the body would be put inside a submodule that could be sent to be evaluated? Or would you want a Rash top-level REPL that it would be sent to? Also, this example only includes subprocess commands. If you just want to send subprocess commands to the container, I imagine that would be pretty easy. But if we allow pipelines or blocks including Racket code it gets much more difficult.

There are problem lots of issues to solve here but something like this would be awesome. If you don't get to it, probably I will. However, if would be interesting, given you know the internals of Rash, if this is feasible at the moment.

I'm certainly willing to answer any questions and help you understand Rash's internals so you can implement it. But while I think this sounds cool, I don't think this is something I'll get around to doing.