I stumbled on this nice write-up on OctoPrint, a service you can run on a system like an RPi to handle g-code for a 3D Printer. There is some chatter on the net using OctoPrint with a CNC (which would be great) but I haven’t seen anything running yet. The Adaftuit write-up includes a SD image for RPi for OctoPrint too.
https://learn.adafruit.com/octoprint-open-source-host-software