Nathan13888 / CodeRunnerBot

Smart Discord Bot that runs almost any code of any supported language. Powered by Go and engineer-man/piston. Runs on Docker and code execution network could be distributed.
GNU General Public License v3.0
5 stars 2 forks source link

Fix Local Piston Server #5

Closed Nathan13888 closed 2 years ago

Nathan13888 commented 2 years ago

Locally hosted piston server doesn't have any runtimes... no helpful information in docs. Refer to docker-compose.yml

wozeparrot commented 2 years ago

According to the piston readme, you need to manually install "packages" into the piston runtime using a cli tool.

https://github.com/engineer-man/piston#cli

wozeparrot commented 2 years ago

There doesn't seem to be a easy way to instruct it just to install all runtimes.

vidhanio commented 2 years ago

Wouldn't be too hard to just iterate through runtimes and just install each one.

wozeparrot commented 2 years ago

Yea it doesn't seem very hard, maybe it will get easier if https://github.com/engineer-man/piston/issues/374 gets accepted, which switches piston to use nix for package management.

I'll take a stab at this with a bash script.

wozeparrot commented 2 years ago

So it seems it doesn't quite work how i thought it works.

wozeparrot commented 2 years ago

You have to manually build a container with the required packages contained. https://github.com/engineer-man/piston/commit/2c5ec5f7ec2434592166a4806c5605289047a8e0

wozeparrot commented 2 years ago
# Public Piston Packages
# Defines packages to be installed on the public piston installation

# All packages, latest version
* *

# Except python
!python *

# Install python 3.* and 2.*
python 3.*
python 2.*

by throwing this in a .pps file then using the piston cli tool with piston ppman spec $file should install all runtimes at their latest versions.

Nathan13888 commented 2 years ago

smh... this is so inconvenient. I just wrote a script which installs all the languages and versions available in cli/index.js ppman list.

Nathan13888 commented 2 years ago

Runtimes could now be installed through a script. Issues with the wrapper have been resolved by writing my own...

HexF commented 2 years ago
# Public Piston Packages
# Defines packages to be installed on the public piston installation

# All packages, latest version
* *

# Except python
!python *

# Install python 3.* and 2.*
python 3.*
python 2.*

by throwing this in a .pps file then using the piston cli tool with piston ppman spec $file should install all runtimes at their latest versions.

this is the intended way

Nathan13888 commented 2 years ago

This is an interesting way to package these runtimes. I wanted to install everything possible which ended up being like 27GB.

HexF commented 2 years ago

Yeah it was more of a short-term work around, I plan to move it over to nix in the coming weeks, as in the linked PR.