Merge branch 'v3' of https://github.com/engineer-man/piston into v3
This commit is contained in:
commit
be47ab802c
|
@ -64,7 +64,7 @@ jobs:
|
||||||
path: data/config.yaml
|
path: data/config.yaml
|
||||||
contents: |
|
contents: |
|
||||||
log_level: DEBUG
|
log_level: DEBUG
|
||||||
bind_address: 0.0.0.0:6969
|
bind_address: 0.0.0.0:2000
|
||||||
data_directory: /piston
|
data_directory: /piston
|
||||||
runner_uid_min: 1100
|
runner_uid_min: 1100
|
||||||
runner_uid_max: 1500
|
runner_uid_max: 1500
|
||||||
|
@ -91,7 +91,7 @@ jobs:
|
||||||
docker run -v $(pwd)'/repo:/piston/repo' -v $(pwd)'/packages:/piston/packages' -d --name piston_fs_repo docker.pkg.github.com/engineer-man/piston/repo-builder --no-build
|
docker run -v $(pwd)'/repo:/piston/repo' -v $(pwd)'/packages:/piston/packages' -d --name piston_fs_repo docker.pkg.github.com/engineer-man/piston/repo-builder --no-build
|
||||||
docker run --network container:piston_fs_repo -v $(pwd)'/data:/piston' -d --name api docker.pkg.github.com/engineer-man/piston/api
|
docker run --network container:piston_fs_repo -v $(pwd)'/data:/piston' -d --name api docker.pkg.github.com/engineer-man/piston/api
|
||||||
echo Waiting for API to start..
|
echo Waiting for API to start..
|
||||||
docker run --network container:api appropriate/curl -s --retry 10 --retry-connrefused http://localhost:6969/runtimes
|
docker run --network container:api appropriate/curl -s --retry 10 --retry-connrefused http://localhost:2000/runtimes
|
||||||
|
|
||||||
echo Waiting for Index to start..
|
echo Waiting for Index to start..
|
||||||
docker run --network container:piston_fs_repo appropriate/curl -s --retry 10 --retry-connrefused http://localhost:8000/index
|
docker run --network container:piston_fs_repo appropriate/curl -s --retry 10 --retry-connrefused http://localhost:8000/index
|
||||||
|
@ -100,7 +100,7 @@ jobs:
|
||||||
sed -i 's/piston_fs_repo/localhost/g' repo/index
|
sed -i 's/piston_fs_repo/localhost/g' repo/index
|
||||||
|
|
||||||
echo Listing Packages
|
echo Listing Packages
|
||||||
PACKAGES_JSON=$(docker run --network container:api appropriate/curl -s http://localhost:6969/packages)
|
PACKAGES_JSON=$(docker run --network container:api appropriate/curl -s http://localhost:2000/packages)
|
||||||
echo $PACKAGES_JSON
|
echo $PACKAGES_JSON
|
||||||
|
|
||||||
echo Getting CLI ready
|
echo Getting CLI ready
|
||||||
|
@ -114,7 +114,7 @@ jobs:
|
||||||
PKG_VERSION=$(awk -F- '{ print $2 }' <<< $package)
|
PKG_VERSION=$(awk -F- '{ print $2 }' <<< $package)
|
||||||
|
|
||||||
echo "Installing..."
|
echo "Installing..."
|
||||||
docker run --network container:api appropriate/curl -sXPOST http://localhost:6969/packages/$PKG_PATH
|
docker run --network container:api appropriate/curl -sXPOST http://localhost:2000/packages/$PKG_PATH
|
||||||
|
|
||||||
TEST_SCRIPTS=packages/$PKG_PATH/test.*
|
TEST_SCRIPTS=packages/$PKG_PATH/test.*
|
||||||
echo "Tests: $TEST_SCRIPTS"
|
echo "Tests: $TEST_SCRIPTS"
|
||||||
|
|
|
@ -1,20 +1,26 @@
|
||||||
FROM node:15.8.0-buster-slim
|
FROM node:15.8.0-buster-slim
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
RUN dpkg-reconfigure -p critical dash
|
RUN dpkg-reconfigure -p critical dash
|
||||||
RUN for i in $(seq 1001 1500); do \
|
RUN for i in $(seq 1001 1500); do \
|
||||||
groupadd -g $i runner$i && \
|
groupadd -g $i runner$i && \
|
||||||
useradd -M runner$i -g $i -u $i ; \
|
useradd -M runner$i -g $i -u $i ; \
|
||||||
done
|
done
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y libxml2 gnupg tar coreutils util-linux libc6-dev binutils build-essential locales libpcre3-dev libevent-dev libgmp3-dev libncurses6 libncurses5 libedit-dev && \
|
apt-get install -y libxml2 gnupg tar coreutils util-linux libc6-dev \
|
||||||
|
binutils build-essential locales libpcre3-dev libevent-dev libgmp3-dev \
|
||||||
|
libncurses6 libncurses5 libedit-dev && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
|
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
|
|
||||||
WORKDIR /piston_api
|
WORKDIR /piston_api
|
||||||
COPY ["package.json", "package-lock.json", "./"]
|
COPY ["package.json", "package-lock.json", "./"]
|
||||||
RUN npm i
|
RUN npm i
|
||||||
COPY ./src ./src
|
COPY ./src ./src
|
||||||
|
|
||||||
CMD [ "node", "src", "-m", "-c", "/piston/config.yaml"]
|
CMD [ "node", "src", "-m", "-c", "/piston/config.yaml"]
|
||||||
EXPOSE 6969/tcp
|
EXPOSE 2000/tcp
|
||||||
|
|
|
@ -45,7 +45,7 @@ const options = [
|
||||||
{
|
{
|
||||||
key: 'bind_address',
|
key: 'bind_address',
|
||||||
desc: 'Address to bind REST API on\nThank @Bones for the number',
|
desc: 'Address to bind REST API on\nThank @Bones for the number',
|
||||||
default: '0.0.0.0:6969',
|
default: '0.0.0.0:2000',
|
||||||
validators: []
|
validators: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -92,7 +92,6 @@ const app = express();
|
||||||
return {
|
return {
|
||||||
language: rt.language,
|
language: rt.language,
|
||||||
version: rt.version.raw,
|
version: rt.version.raw,
|
||||||
author: rt.author,
|
|
||||||
aliases: rt.aliases
|
aliases: rt.aliases
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -14,12 +14,11 @@ class Runtime {
|
||||||
fss.read_file_sync(path.join(package_dir, 'pkg-info.json'))
|
fss.read_file_sync(path.join(package_dir, 'pkg-info.json'))
|
||||||
);
|
);
|
||||||
|
|
||||||
const { language, version, author, build_platform, aliases } = info;
|
const { language, version, build_platform, aliases } = info;
|
||||||
|
|
||||||
this.pkgdir = package_dir;
|
this.pkgdir = package_dir;
|
||||||
this.language = language;
|
this.language = language;
|
||||||
this.version = semver.parse(version);
|
this.version = semver.parse(version);
|
||||||
this.author = author;
|
|
||||||
this.aliases = aliases;
|
this.aliases = aliases;
|
||||||
|
|
||||||
if (build_platform !== globals.platform) {
|
if (build_platform !== globals.platform) {
|
||||||
|
|
|
@ -13,7 +13,7 @@ const axios_instance = function(argv){
|
||||||
require('yargs')(process.argv.slice(2))
|
require('yargs')(process.argv.slice(2))
|
||||||
.option('piston-url', {
|
.option('piston-url', {
|
||||||
alias: ['u'],
|
alias: ['u'],
|
||||||
default: 'http://127.0.0.1:6969',
|
default: 'http://127.0.0.1:2000',
|
||||||
desc: 'Piston API URL',
|
desc: 'Piston API URL',
|
||||||
string: true
|
string: true
|
||||||
})
|
})
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "Piston Execution Engine CLI tools",
|
"description": "Piston Execution Engine CLI tools",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"author": "Thomas Hobson <thomas@hexf.me>",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.21.1",
|
"axios": "^0.21.1",
|
||||||
|
|
|
@ -6,7 +6,7 @@ services:
|
||||||
privileged: true
|
privileged: true
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- 6969:6969
|
- 2000:2000
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/piston:/piston
|
- ./data/piston:/piston
|
||||||
tmpfs:
|
tmpfs:
|
||||||
|
|
|
@ -40,13 +40,12 @@ public class Test
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
8. Create a `metadata.json` file which contains metadata about the language and interpreter. This simply contains the language name, as in the folder name, the version as in the folder name, the author's name and email address, aliases that can be used to call this package, and finally a dependencies map.
|
8. Create a `metadata.json` file which contains metadata about the language and interpreter. This simply contains the language name, as in the folder name, the version as in the folder name, aliases that can be used to call this package, and finally a dependencies map.
|
||||||
The dependencies map contains the keys as language names, and the values as semver selectors for packages.
|
The dependencies map contains the keys as language names, and the values as semver selectors for packages.
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"language": "deno",
|
"language": "deno",
|
||||||
"version": "1.7.5",
|
"version": "1.7.5",
|
||||||
"author": "Thomas Hobson <thomas@hexf.me>",
|
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"aliases": ["deno-ts", "deno-js"]
|
"aliases": ["deno-ts", "deno-js"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "bash",
|
"language": "bash",
|
||||||
"version": "5.1.0",
|
"version": "5.1.0",
|
||||||
"aliases": ["sh"],
|
"aliases": ["sh"]
|
||||||
"author": "Thomas Hobson <git@hexf.me>"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "brainfuck",
|
"language": "brainfuck",
|
||||||
"version": "2.7.3",
|
"version": "2.7.3",
|
||||||
"aliases": ["bf"],
|
"aliases": ["bf"]
|
||||||
"author": "Thomas Hobson <git@hexf.me>"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "clojure",
|
"language": "clojure",
|
||||||
"version": "1.10.3",
|
"version": "1.10.3",
|
||||||
"aliases": ["clojure","clj"],
|
"aliases": ["clojure", "clj"]
|
||||||
"author": "Dan Vargas <danvargas46@gmail.com>"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Download and install NodeJS
|
||||||
|
curl "https://nodejs.org/dist/v15.10.0/node-v15.10.0-linux-x64.tar.xz" -o node.tar.xz
|
||||||
|
tar xf node.tar.xz --strip-components=1
|
||||||
|
rm node.tar.xz
|
||||||
|
export PATH=$PWD/bin:$PATH
|
||||||
|
|
||||||
|
# Install CoffeeScript via npm and done
|
||||||
|
npm install --global coffeescript@2.5.1
|
|
@ -0,0 +1 @@
|
||||||
|
export PATH=$PWD/bin:$PATH
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"language": "coffeescript",
|
||||||
|
"version": "2.5.1",
|
||||||
|
"aliases": ["coffeescript", "coffee"]
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
coffee "$@"
|
|
@ -0,0 +1 @@
|
||||||
|
console.log "OK"
|
|
@ -0,0 +1,12 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Grab the latest cow source from github
|
||||||
|
git clone -q https://github.com/BigZaphod/COW.git cow
|
||||||
|
|
||||||
|
# Generate the cow binary into bin
|
||||||
|
mkdir -p bin
|
||||||
|
sed -i '1i#define NO_GREETINGS' cow/source/cow.cpp
|
||||||
|
g++ -o bin/cow cow/source/cow.cpp
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
rm -rf cow
|
|
@ -0,0 +1,2 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
export PATH=$PWD/bin:$PATH
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"language": "cow",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"aliases": ["cow"]
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/bash
|
||||||
|
cow "$@"
|
|
@ -0,0 +1,4 @@
|
||||||
|
MoO MoO MoO MoO MoO MoO MoO MoO
|
||||||
|
MOO moO MoO MoO MoO MoO MoO MoO MoO MoO MoO mOo MOo moo
|
||||||
|
moO MoO MoO MoO MoO MoO MoO MoO Moo
|
||||||
|
MOo MOo MOo MOo Moo
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "crystal",
|
"language": "crystal",
|
||||||
"version": "0.36.1",
|
"version": "0.36.1",
|
||||||
"author": "Dan Vargas <danvargas46@gmail.com>",
|
|
||||||
"aliases": ["crystal", "cr"]
|
"aliases": ["crystal", "cr"]
|
||||||
}
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "dart",
|
"language": "dart",
|
||||||
"version": "2.12.1",
|
"version": "2.12.1",
|
||||||
"aliases": [],
|
"aliases": []
|
||||||
"author": "Thomas Hobson <git@hexf.me>"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "dash",
|
"language": "dash",
|
||||||
"version": "0.5.11",
|
"version": "0.5.11",
|
||||||
"aliases": ["dash"],
|
"aliases": ["dash"]
|
||||||
"author": "Dan Vargas <danvargas46@gmail.com>"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "deno",
|
"language": "deno",
|
||||||
"version": "1.7.5",
|
"version": "1.7.5",
|
||||||
"author": "Thomas Hobson <thomas@hexf.me>",
|
|
||||||
"aliases": ["deno-ts", "deno-js"]
|
"aliases": ["deno-ts", "deno-js"]
|
||||||
}
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "dotnet",
|
"language": "dotnet",
|
||||||
"version": "5.0.201",
|
"version": "5.0.201",
|
||||||
"aliases": ["cs", "csharp"],
|
"aliases": ["cs", "csharp"]
|
||||||
"author": "Thomas Hobson <git@hexf.me>"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "elixir",
|
"language": "elixir",
|
||||||
"version": "1.11.3",
|
"version": "1.11.3",
|
||||||
"author": "Dan Vargas <danvargas46@gmail.com>",
|
|
||||||
"aliases": ["elixir", "exs"]
|
"aliases": ["elixir", "exs"]
|
||||||
}
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "emacs",
|
"language": "emacs",
|
||||||
"version": "27.1.0",
|
"version": "27.1.0",
|
||||||
"author": "Dan Vargas <danvargas46@gmail.com>",
|
|
||||||
"aliases": ["emacs", "el", "elisp"]
|
"aliases": ["emacs", "el", "elisp"]
|
||||||
}
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "erlang",
|
"language": "erlang",
|
||||||
"version": "23.0.0",
|
"version": "23.0.0",
|
||||||
"author": "Dan Vargas <danvargas46@gmail.com>",
|
|
||||||
"aliases": ["erlang", "erl", "escript"]
|
"aliases": ["erlang", "erl", "escript"]
|
||||||
}
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "gawk",
|
"language": "gawk",
|
||||||
"version": "5.1.0",
|
"version": "5.1.0",
|
||||||
"aliases": ["awk"],
|
"aliases": ["awk"]
|
||||||
"author": "Thomas Hobson <git@hexf.me>"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "gcc",
|
"language": "gcc",
|
||||||
"version": "10.2.0",
|
"version": "10.2.0",
|
||||||
"aliases": ["c","g++","c++","cpp","gdc","d"],
|
"aliases": ["c", "g++", "c++", "cpp", "gdc", "d"]
|
||||||
"author": "Thomas Hobson <git@hexf.me>"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "go",
|
"language": "go",
|
||||||
"version": "1.16.2",
|
"version": "1.16.2",
|
||||||
"author": "Victor Frazao <luiz_victor_frazao@hotmail.com>",
|
|
||||||
"aliases": ["go", "golang"]
|
"aliases": ["go", "golang"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "haskell",
|
"language": "haskell",
|
||||||
"version": "9.0.1",
|
"version": "9.0.1",
|
||||||
"author": "Dan Vargas <danvargas46@gmail.com>",
|
|
||||||
"aliases": ["haskell", "hs"]
|
"aliases": ["haskell", "hs"]
|
||||||
}
|
}
|
|
@ -9,7 +9,6 @@ fi
|
||||||
|
|
||||||
NAME=$1
|
NAME=$1
|
||||||
VERSION=$2
|
VERSION=$2
|
||||||
AUTHOR="$(git config user.name) <$(git config user.email)>"
|
|
||||||
SOURCE=$3
|
SOURCE=$3
|
||||||
|
|
||||||
DIR=$NAME/$VERSION
|
DIR=$NAME/$VERSION
|
||||||
|
@ -58,7 +57,7 @@ echo "$NAME-$VERSION \"\$@\"" >> run
|
||||||
|
|
||||||
echo "# Put instructions to compile source code, remove this file if the language does not require this stage" >> compile
|
echo "# Put instructions to compile source code, remove this file if the language does not require this stage" >> compile
|
||||||
|
|
||||||
jq '.language = "'$NAME'" | .version = "'$VERSION'" | .aliases = [] | .author = "'"$AUTHOR"'"' <<< "{}" > metadata.json
|
jq '.language = "'$NAME'" | .version = "'$VERSION'" | .aliases = []' <<< "{}" > metadata.json
|
||||||
|
|
||||||
cd - > /dev/null
|
cd - > /dev/null
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "java",
|
"language": "java",
|
||||||
"version": "15.0.2",
|
"version": "15.0.2",
|
||||||
"aliases": [],
|
"aliases": []
|
||||||
"author": "Thomas Hobson <git@hexf.me>"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "jelly",
|
"language": "jelly",
|
||||||
"version": "0.1.31",
|
"version": "0.1.31",
|
||||||
"author": "Thomas Hobson <thomas@hexf.me>",
|
|
||||||
"aliases": []
|
"aliases": []
|
||||||
}
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "julia",
|
"language": "julia",
|
||||||
"version": "1.5.4",
|
"version": "1.5.4",
|
||||||
"aliases": ["jl"],
|
"aliases": ["jl"]
|
||||||
"author": "Victor Frazao <luiz_victor_frazao@hotmail.com>"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "kotlin",
|
"language": "kotlin",
|
||||||
"version": "1.4.31",
|
"version": "1.4.31",
|
||||||
"aliases": ["kt"],
|
"aliases": ["kt"]
|
||||||
"author": "Thomas Hobson <git@hexf.me>"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "lisp",
|
"language": "lisp",
|
||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
"aliases": ["lisp","cl","sbcl","commonlisp"],
|
"aliases": ["lisp", "cl", "sbcl", "commonlisp"]
|
||||||
"author": "Dan Vargas <danvargas46@gmail.com>"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "lolcode",
|
"language": "lolcode",
|
||||||
"version": "0.11.2",
|
"version": "0.11.2",
|
||||||
"author": "Shivansh-007 <Shivansh-007@users.noreply.github.com>",
|
|
||||||
"aliases": ["lol", "lci"]
|
"aliases": ["lol", "lci"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "lua",
|
"language": "lua",
|
||||||
"version": "5.4.2",
|
"version": "5.4.2",
|
||||||
"author": "Shivansh-007 <Shivansh-007@users.noreply.github.com>",
|
|
||||||
"aliases": ["lua"]
|
"aliases": ["lua"]
|
||||||
}
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "mono",
|
"language": "mono",
|
||||||
"version": "6.12.0",
|
"version": "6.12.0",
|
||||||
"author": "Thomas Hobson <thomas@hexf.me>",
|
|
||||||
"aliases": ["csharp", "cs"]
|
"aliases": ["csharp", "cs"]
|
||||||
}
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "nasm",
|
"language": "nasm",
|
||||||
"version": "2.15.5",
|
"version": "2.15.5",
|
||||||
"aliases": ["nasm64"],
|
"aliases": ["nasm64"]
|
||||||
"author": "Thomas Hobson <git@hexf.me>"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "nim",
|
"language": "nim",
|
||||||
"version": "1.4.4",
|
"version": "1.4.4",
|
||||||
"author": "Dan Vargas <danvargas46@gmail.com>",
|
|
||||||
"aliases": ["nim"]
|
"aliases": ["nim"]
|
||||||
}
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "node",
|
"language": "node",
|
||||||
"version": "15.10.0",
|
"version": "15.10.0",
|
||||||
"author": "Martin Kos <martinkos007@gmail.com>",
|
|
||||||
"aliases": ["node-javascript", "node-js", "javascript", "js"]
|
"aliases": ["node-javascript", "node-js", "javascript", "js"]
|
||||||
}
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "osabie",
|
"language": "osabie",
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"author": "Dan Vargas <danvargas46@gmail.com>",
|
|
||||||
"aliases": ["osabie", "05AB1E", "usable"]
|
"aliases": ["osabie", "05AB1E", "usable"]
|
||||||
}
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "paradoc",
|
"language": "paradoc",
|
||||||
"version": "0.6.0",
|
"version": "0.6.0",
|
||||||
"author": "Dan Vargas <danvargas46@gmail.com>",
|
|
||||||
"aliases": ["paradoc"]
|
"aliases": ["paradoc"]
|
||||||
}
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
PREFIX=$(realpath $(dirname $0))
|
||||||
|
|
||||||
|
mkdir -p build
|
||||||
|
|
||||||
|
cd build
|
||||||
|
curl -L "https://sourceforge.net/projects/freepascal/files/Linux/3.2.0/fpc-3.2.0-x86_64-linux.tar/download" -o pascal.tar
|
||||||
|
tar xf pascal.tar --strip-components=1
|
||||||
|
|
||||||
|
# FreePascal uses an interactive installer
|
||||||
|
./install.sh << ANSWERS
|
||||||
|
$PREFIX
|
||||||
|
n
|
||||||
|
n
|
||||||
|
n
|
||||||
|
ANSWERS
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
rm -rf build
|
||||||
|
|
||||||
|
# A sample config (needed for each "project") is written to /etc
|
||||||
|
# We'll copy that into the local lib dir (fpc searches there too on compile)
|
||||||
|
mkdir lib/fpc/etc
|
||||||
|
cp -r /etc/fp* lib/fpc/etc/
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Compile pascal files
|
||||||
|
fpc -oout -v0 "$@"
|
||||||
|
chmod +x out
|
|
@ -0,0 +1 @@
|
||||||
|
export PATH=$PWD/bin:$PATH
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"language": "pascal",
|
||||||
|
"version": "3.2.0",
|
||||||
|
"aliases": ["pascal", "freepascal", "pp", "pas"]
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
shift # Filename is only used to compile
|
||||||
|
./out "$@"
|
|
@ -0,0 +1,5 @@
|
||||||
|
program test;
|
||||||
|
|
||||||
|
begin
|
||||||
|
writeln('OK');
|
||||||
|
end.
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "perl",
|
"language": "perl",
|
||||||
"version": "5.26.1",
|
"version": "5.26.1",
|
||||||
"author": "Dan Vargas <danvargas46@gmail.com>",
|
|
||||||
"aliases": ["perl", "pl"]
|
"aliases": ["perl", "pl"]
|
||||||
}
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "php",
|
"language": "php",
|
||||||
"version": "8.0.2",
|
"version": "8.0.2",
|
||||||
"author": "Martin Kos <martinkos007@gmail.com>",
|
|
||||||
"aliases": ["php8", "html"]
|
"aliases": ["php8", "html"]
|
||||||
}
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "prolog",
|
"language": "prolog",
|
||||||
"version": "8.2.4",
|
"version": "8.2.4",
|
||||||
"aliases": ["prolog","plg"],
|
"aliases": ["prolog", "plg"]
|
||||||
"author": "Dan Vargas <danvargas46@gmail.com>"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
PREFIX=$(realpath $(dirname $0))
|
||||||
|
|
||||||
|
# Python is available in the container as 'python3' and 'python2', not as 'python'
|
||||||
|
alias python=python3
|
||||||
|
|
||||||
|
# Installing LLVM and clang (the latter is optional but recommended)
|
||||||
|
curl -OL "http://llvm.org/releases/3.4/llvm-3.4.src.tar.gz"
|
||||||
|
curl -OL "http://llvm.org/releases/3.4/clang-3.4.src.tar.gz"
|
||||||
|
tar xfz llvm-3.4.src.tar.gz
|
||||||
|
tar xfz clang-3.4.src.tar.gz
|
||||||
|
|
||||||
|
mv clang-3.4 llvm-3.4/tools/clang
|
||||||
|
# Cleaning up gzip files.
|
||||||
|
rm llvm-3.4.src.tar.gz && rm clang-3.4.src.tar.gz
|
||||||
|
cd llvm-3.4
|
||||||
|
|
||||||
|
# Building and installing - LLVM and clang
|
||||||
|
./configure --prefix="$PREFIX" --enable-optimized --enable-targets=host-only --enable-docs="no" --enable-assertions="no"
|
||||||
|
make -j$(nproc)
|
||||||
|
make install -j$(nproc)
|
||||||
|
|
||||||
|
# Installing Pure
|
||||||
|
curl -sSLO "https://github.com/agraef/pure-lang/releases/download/pure-0.68/pure-0.68.tar.gz"
|
||||||
|
tar xfz pure-0.68.tar.gz
|
||||||
|
rm pure-0.68.tar.gz
|
||||||
|
cd pure-0.68
|
||||||
|
|
||||||
|
# Building and installing pure-lang
|
||||||
|
./configure --prefix="$PREFIX" --enable-release --with-tool-prefix="$PREFIX/bin" --with-static-llvm
|
||||||
|
make -j$(nproc)
|
||||||
|
make install -j$(nproc)
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Put 'export' statements here for environment variables
|
||||||
|
export PATH=$PWD/bin:$PATH
|
||||||
|
export LD_LIBRARY_PATH=$PWD/lib
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"language": "pure",
|
||||||
|
"version": "0.68.0",
|
||||||
|
"aliases": []
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Put instructions to run the runtime
|
||||||
|
pure "$@"
|
|
@ -0,0 +1,2 @@
|
||||||
|
using system;
|
||||||
|
puts "OK";
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "python",
|
"language": "python",
|
||||||
"version": "2.7.18",
|
"version": "2.7.18",
|
||||||
"author": "Shivansh-007 <Shivansh-007@users.noreply.github.com>",
|
|
||||||
"aliases": ["py", "python2"]
|
"aliases": ["py", "python2"]
|
||||||
}
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "python",
|
"language": "python",
|
||||||
"version": "3.5.10",
|
"version": "3.5.10",
|
||||||
"author": "Shivansh-007 <Shivansh-007@users.noreply.github.com>",
|
|
||||||
"aliases": ["py", "python3"]
|
"aliases": ["py", "python3"]
|
||||||
}
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "python",
|
"language": "python",
|
||||||
"version": "3.9.1",
|
"version": "3.9.1",
|
||||||
"author": "Thomas Hobson <thomas@hexf.me>",
|
|
||||||
"aliases": ["py", "python3"]
|
"aliases": ["py", "python3"]
|
||||||
}
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Download and install NodeJS
|
||||||
|
curl "https://nodejs.org/dist/v15.10.0/node-v15.10.0-linux-x64.tar.xz" -o node.tar.xz
|
||||||
|
tar xf node.tar.xz --strip-components=1
|
||||||
|
rm node.tar.xz
|
||||||
|
export PATH=$PWD/bin:$PATH
|
||||||
|
|
||||||
|
# Pull Rockstar reference implementation project
|
||||||
|
git clone -q "https://github.com/RockstarLang/rockstar.git" rockstar
|
||||||
|
cd rockstar
|
||||||
|
git reset --hard bc9eedc6acb7c0f31a425cc204dcd93cb3e68936
|
||||||
|
|
||||||
|
# Install Satriani dependencies
|
||||||
|
cd satriani
|
||||||
|
npm install
|
||||||
|
cd ../..
|
||||||
|
|
||||||
|
# Suppress "(program returned no output)" output at the end of each program
|
||||||
|
sed -i 's/console.log(result ? result : "(program returned no output)");/if (result) console.log(result);/g' rockstar/satriani/rockstar.js
|
|
@ -0,0 +1,2 @@
|
||||||
|
export ROCKSTAR_PATH=$PWD/rockstar/satriani
|
||||||
|
export PATH=$PWD/bin:$PATH
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"language": "rockstar",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"aliases": ["rockstar", "rock"]
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
node $ROCKSTAR_PATH/rockstar "$@"
|
|
@ -0,0 +1,9 @@
|
||||||
|
My heart is burning powerless
|
||||||
|
My mind is failing right
|
||||||
|
Cast my heart
|
||||||
|
Cast my mind
|
||||||
|
|
||||||
|
My feelings are empty
|
||||||
|
Let my feelings be with my heart
|
||||||
|
Let my feelings be with my mind
|
||||||
|
Shout my feelings
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "ruby",
|
"language": "ruby",
|
||||||
"version": "2.5.1",
|
"version": "2.5.1",
|
||||||
"author": "Dan Vargas <danvargas46@gmail.com>",
|
|
||||||
"aliases": ["ruby", "rb"]
|
"aliases": ["ruby", "rb"]
|
||||||
}
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "rust",
|
"language": "rust",
|
||||||
"version": "1.50.0",
|
"version": "1.50.0",
|
||||||
"aliases": ["rs"],
|
"aliases": ["rs"]
|
||||||
"author": "Victor Frazao <luiz_victor_frazao@hotmail.com>"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "scala",
|
"language": "scala",
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"aliases": ["scala","sc"],
|
"aliases": ["scala", "sc"]
|
||||||
"author": "Dan Vargas <danvargas46@gmail.com>"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "swift",
|
"language": "swift",
|
||||||
"version": "5.3.3",
|
"version": "5.3.3",
|
||||||
"aliases": ["swift"],
|
"aliases": ["swift"]
|
||||||
"author": "Dan Vargas <danvargas46@gmail.com>"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "typescript",
|
"language": "typescript",
|
||||||
"version": "4.2.3",
|
"version": "4.2.3",
|
||||||
"aliases": ["ts","node-ts","tsc"],
|
"aliases": ["ts", "node-ts", "tsc"]
|
||||||
"author": "Thomas Hobson <git@hexf.me>"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "vlang",
|
"language": "vlang",
|
||||||
"version": "0.1.13",
|
"version": "0.1.13",
|
||||||
"author": "Shivansh-007 <shivansh-007@outlook.com>",
|
|
||||||
"aliases": ["v"]
|
"aliases": ["v"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"language": "zig",
|
"language": "zig",
|
||||||
"version": "0.7.1",
|
"version": "0.7.1",
|
||||||
"aliases": ["zig"],
|
"aliases": ["zig"]
|
||||||
"author": "Dan Vargas <danvargas46@gmail.com>"
|
|
||||||
}
|
}
|
||||||
|
|
10
readme.md
10
readme.md
|
@ -120,7 +120,7 @@ cd cli && npm i && cd -
|
||||||
echo "$GITHUB_TOKEN" | docker login https://docker.pkg.github.com -u "$GITHUB_USERNAME" --password-stdin
|
echo "$GITHUB_TOKEN" | docker login https://docker.pkg.github.com -u "$GITHUB_USERNAME" --password-stdin
|
||||||
# Change out the $GITHUB_TOKEN and $GITHUB_USERNAME with appropritate values
|
# Change out the $GITHUB_TOKEN and $GITHUB_USERNAME with appropritate values
|
||||||
|
|
||||||
docker run -v $PWD:'/piston' --tmpfs /piston/jobs -dit -p 6969:6969 --privileged --name piston_api docker.pkg.github.com/engineer-man/piston/api:latest
|
docker run -v $PWD:'/piston' --tmpfs /piston/jobs -dit -p 2000:2000 --privileged --name piston_api docker.pkg.github.com/engineer-man/piston/api:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
@ -148,17 +148,17 @@ cli/index.js run python 3.9.1 test.py
|
||||||
If you are operating on a remote machine, add the `-u` flag like so:
|
If you are operating on a remote machine, add the `-u` flag like so:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cli/index.js -u http://piston.server:6969 ppman list
|
cli/index.js -u http://piston.server:2000 ppman list
|
||||||
```
|
```
|
||||||
|
|
||||||
### API
|
### API
|
||||||
|
|
||||||
The container exposes an API on port 6969 by default.
|
The container exposes an API on port 2000 by default.
|
||||||
This is used by the CLI to carry out running jobs and package managment.
|
This is used by the CLI to carry out running jobs and package managment.
|
||||||
|
|
||||||
#### Runtimes Endpoint
|
#### Runtimes Endpoint
|
||||||
`GET /runtimes`
|
`GET /runtimes`
|
||||||
This endpoint will return the supported languages along with the current version, author and aliases. To execute
|
This endpoint will return the supported languages along with the current version and aliases. To execute
|
||||||
code for a particular language using the `/jobs` endpoint, either the name or one of the aliases must
|
code for a particular language using the `/jobs` endpoint, either the name or one of the aliases must
|
||||||
be provided, along with the version.
|
be provided, along with the version.
|
||||||
Multiple versions of the same language may be present at the same time, and may be selected when running a job.
|
Multiple versions of the same language may be present at the same time, and may be selected when running a job.
|
||||||
|
@ -170,7 +170,6 @@ Content-Type: application/json
|
||||||
{
|
{
|
||||||
"language": "bash",
|
"language": "bash",
|
||||||
"version": "5.1.0",
|
"version": "5.1.0",
|
||||||
"author": "Thomas Hobson <git@hexf.me>",
|
|
||||||
"aliases": [
|
"aliases": [
|
||||||
"sh"
|
"sh"
|
||||||
]
|
]
|
||||||
|
@ -178,7 +177,6 @@ Content-Type: application/json
|
||||||
{
|
{
|
||||||
"language": "brainfuck",
|
"language": "brainfuck",
|
||||||
"version": "2.7.3",
|
"version": "2.7.3",
|
||||||
"author": "Thomas Hobson <git@hexf.me>",
|
|
||||||
"aliases": [
|
"aliases": [
|
||||||
"bf"
|
"bf"
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue