diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml index 0a35c8c..928749c 100644 --- a/.github/workflows/package-pr.yaml +++ b/.github/workflows/package-pr.yaml @@ -64,7 +64,7 @@ jobs: path: data/config.yaml contents: | log_level: DEBUG - bind_address: 0.0.0.0:6969 + bind_address: 0.0.0.0:2000 data_directory: /piston runner_uid_min: 1100 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 --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.. - 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.. 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 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 Getting CLI ready @@ -114,7 +114,7 @@ jobs: PKG_VERSION=$(awk -F- '{ print $2 }' <<< $package) 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.* echo "Tests: $TEST_SCRIPTS" diff --git a/api/Dockerfile b/api/Dockerfile index 7b873ce..8f61d16 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,20 +1,26 @@ FROM node:15.8.0-buster-slim + +ENV DEBIAN_FRONTEND=noninteractive + RUN dpkg-reconfigure -p critical dash RUN for i in $(seq 1001 1500); do \ groupadd -g $i runner$i && \ useradd -M runner$i -g $i -u $i ; \ done 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/* RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen ENV NODE_ENV=production + WORKDIR /piston_api COPY ["package.json", "package-lock.json", "./"] RUN npm i COPY ./src ./src CMD [ "node", "src", "-m", "-c", "/piston/config.yaml"] -EXPOSE 6969/tcp +EXPOSE 2000/tcp diff --git a/api/src/config.js b/api/src/config.js index ade4a36..023cc8e 100644 --- a/api/src/config.js +++ b/api/src/config.js @@ -45,7 +45,7 @@ const options = [ { key: 'bind_address', 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: [] }, { diff --git a/api/src/index.js b/api/src/index.js index 63d1393..00b55b8 100644 --- a/api/src/index.js +++ b/api/src/index.js @@ -92,7 +92,6 @@ const app = express(); return { language: rt.language, version: rt.version.raw, - author: rt.author, aliases: rt.aliases }; }); diff --git a/api/src/runtime.js b/api/src/runtime.js index 2603835..8d0604e 100644 --- a/api/src/runtime.js +++ b/api/src/runtime.js @@ -14,12 +14,11 @@ class Runtime { 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.language = language; this.version = semver.parse(version); - this.author = author; this.aliases = aliases; if (build_platform !== globals.platform) { diff --git a/cli/index.js b/cli/index.js index 8bb17e0..415dbf3 100755 --- a/cli/index.js +++ b/cli/index.js @@ -13,7 +13,7 @@ const axios_instance = function(argv){ require('yargs')(process.argv.slice(2)) .option('piston-url', { alias: ['u'], - default: 'http://127.0.0.1:6969', + default: 'http://127.0.0.1:2000', desc: 'Piston API URL', string: true }) diff --git a/cli/package.json b/cli/package.json index 5d89dfd..6a998a4 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,13 +1,12 @@ { - "name": "piston-cli", - "version": "1.0.0", - "description": "Piston Execution Engine CLI tools", - "main": "index.js", - "author": "Thomas Hobson ", - "license": "MIT", - "dependencies": { - "axios": "^0.21.1", - "chalk": "^4.1.0", - "yargs": "^16.2.0" - } + "name": "piston-cli", + "version": "1.0.0", + "description": "Piston Execution Engine CLI tools", + "main": "index.js", + "license": "MIT", + "dependencies": { + "axios": "^0.21.1", + "chalk": "^4.1.0", + "yargs": "^16.2.0" + } } diff --git a/docker-compose.yaml b/docker-compose.yaml index 67e1253..ed67d43 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,19 +1,19 @@ version: '3.8' services: - piston_api: - build: api - privileged: true - restart: always - ports: - - 6969:6969 - volumes: - - ./data/piston:/piston - tmpfs: - - /piston/jobs:exec + piston_api: + build: api + privileged: true + restart: always + ports: + - 2000:2000 + volumes: + - ./data/piston:/piston + tmpfs: + - /piston/jobs:exec - piston_fs_repo: # Local testing of packages - build: repo - command: ['dart-2.12.1'] # Only build dart - volumes: - - .:/piston \ No newline at end of file + piston_fs_repo: # Local testing of packages + build: repo + command: ['dart-2.12.1'] # Only build dart + volumes: + - .:/piston diff --git a/packages/CONTRIBUTING.MD b/packages/CONTRIBUTING.MD index 499cff8..813f71e 100644 --- a/packages/CONTRIBUTING.MD +++ b/packages/CONTRIBUTING.MD @@ -16,7 +16,7 @@ See [deno/1.7.5/](deno/1.7.5/) or any other directory for examples. 3. Create a file named `build.sh`, adding a shebang for bash `#!/bin/bash` on the first line. In this file put any steps to compile the specified langauge. -This script should download sources, compile sources and output binaries. They should be dumped into the current working directory, removing any files which aren't required in the process. +This script should download sources, compile sources and output binaries. They should be dumped into the current working directory, removing any files which aren't required in the process. 4. Create a file named `run`, containing bash script to run the interpreter. The first argument given to this script (`$1`) is the name of the main file, with the remaining ones as program arguments. @@ -27,7 +27,7 @@ The first argument is always the main file, followed the names of the other file 6. Create a file named `environment`, containing `export` statements which edit the environment variables accordingly. The `$PWD` variable should be used, and is set inside the package directory when running on the target system. -7. Create a test script starting with test, with the file extension of the language. This script should simply output the phrase `OK`. For example, for mono we would create `test.cs` with the content: +7. Create a test script starting with test, with the file extension of the language. This script should simply output the phrase `OK`. For example, for mono we would create `test.cs` with the content: ```cs using System; @@ -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. ```json { "language": "deno", "version": "1.7.5", - "author": "Thomas Hobson ", "dependencies": {}, "aliases": ["deno-ts", "deno-js"] } diff --git a/packages/bash/5.1.0/metadata.json b/packages/bash/5.1.0/metadata.json index acd4c6b..9ac1250 100644 --- a/packages/bash/5.1.0/metadata.json +++ b/packages/bash/5.1.0/metadata.json @@ -1,6 +1,5 @@ { - "language": "bash", - "version": "5.1.0", - "aliases": ["sh"], - "author": "Thomas Hobson " + "language": "bash", + "version": "5.1.0", + "aliases": ["sh"] } diff --git a/packages/brainfuck/2.7.3/metadata.json b/packages/brainfuck/2.7.3/metadata.json index 5d9fc66..a9f3083 100644 --- a/packages/brainfuck/2.7.3/metadata.json +++ b/packages/brainfuck/2.7.3/metadata.json @@ -1,6 +1,5 @@ { - "language": "brainfuck", - "version": "2.7.3", - "aliases": ["bf"], - "author": "Thomas Hobson " + "language": "brainfuck", + "version": "2.7.3", + "aliases": ["bf"] } diff --git a/packages/clojure/1.10.3/metadata.json b/packages/clojure/1.10.3/metadata.json index 64f83fa..847ecb6 100644 --- a/packages/clojure/1.10.3/metadata.json +++ b/packages/clojure/1.10.3/metadata.json @@ -1,6 +1,5 @@ { - "language": "clojure", - "version": "1.10.3", - "aliases": ["clojure","clj"], - "author": "Dan Vargas " + "language": "clojure", + "version": "1.10.3", + "aliases": ["clojure", "clj"] } diff --git a/packages/coffeescript/2.5.1/build.sh b/packages/coffeescript/2.5.1/build.sh new file mode 100755 index 0000000..58d99b2 --- /dev/null +++ b/packages/coffeescript/2.5.1/build.sh @@ -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 diff --git a/packages/coffeescript/2.5.1/environment b/packages/coffeescript/2.5.1/environment new file mode 100644 index 0000000..bd0ff98 --- /dev/null +++ b/packages/coffeescript/2.5.1/environment @@ -0,0 +1 @@ +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/coffeescript/2.5.1/metadata.json b/packages/coffeescript/2.5.1/metadata.json new file mode 100644 index 0000000..23380d1 --- /dev/null +++ b/packages/coffeescript/2.5.1/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "coffeescript", + "version": "2.5.1", + "aliases": ["coffeescript", "coffee"] +} diff --git a/packages/coffeescript/2.5.1/run b/packages/coffeescript/2.5.1/run new file mode 100644 index 0000000..5d8cc03 --- /dev/null +++ b/packages/coffeescript/2.5.1/run @@ -0,0 +1,3 @@ +#!/bin/bash + +coffee "$@" diff --git a/packages/coffeescript/2.5.1/test.coffee b/packages/coffeescript/2.5.1/test.coffee new file mode 100644 index 0000000..b3a8f72 --- /dev/null +++ b/packages/coffeescript/2.5.1/test.coffee @@ -0,0 +1 @@ +console.log "OK" \ No newline at end of file diff --git a/packages/cow/1.0.0/build.sh b/packages/cow/1.0.0/build.sh new file mode 100755 index 0000000..3bf5938 --- /dev/null +++ b/packages/cow/1.0.0/build.sh @@ -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 diff --git a/packages/cow/1.0.0/environment b/packages/cow/1.0.0/environment new file mode 100644 index 0000000..f31a19f --- /dev/null +++ b/packages/cow/1.0.0/environment @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/cow/1.0.0/metadata.json b/packages/cow/1.0.0/metadata.json new file mode 100644 index 0000000..2dcca9f --- /dev/null +++ b/packages/cow/1.0.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "cow", + "version": "1.0.0", + "aliases": ["cow"] +} diff --git a/packages/cow/1.0.0/run b/packages/cow/1.0.0/run new file mode 100644 index 0000000..4cc2d92 --- /dev/null +++ b/packages/cow/1.0.0/run @@ -0,0 +1,2 @@ +#!/bin/bash +cow "$@" diff --git a/packages/cow/1.0.0/test.cow b/packages/cow/1.0.0/test.cow new file mode 100644 index 0000000..b4223ec --- /dev/null +++ b/packages/cow/1.0.0/test.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 \ No newline at end of file diff --git a/packages/crystal/0.36.1/metadata.json b/packages/crystal/0.36.1/metadata.json index ca2c062..ee995eb 100644 --- a/packages/crystal/0.36.1/metadata.json +++ b/packages/crystal/0.36.1/metadata.json @@ -1,6 +1,5 @@ { "language": "crystal", "version": "0.36.1", - "author": "Dan Vargas ", "aliases": ["crystal", "cr"] -} \ No newline at end of file +} diff --git a/packages/dart/2.12.1/metadata.json b/packages/dart/2.12.1/metadata.json index 388121e..cec3d77 100644 --- a/packages/dart/2.12.1/metadata.json +++ b/packages/dart/2.12.1/metadata.json @@ -1,6 +1,5 @@ { - "language": "dart", - "version": "2.12.1", - "aliases": [], - "author": "Thomas Hobson " + "language": "dart", + "version": "2.12.1", + "aliases": [] } diff --git a/packages/dash/0.5.11/metadata.json b/packages/dash/0.5.11/metadata.json index a07a67e..a2e5be5 100644 --- a/packages/dash/0.5.11/metadata.json +++ b/packages/dash/0.5.11/metadata.json @@ -1,6 +1,5 @@ { - "language": "dash", - "version": "0.5.11", - "aliases": ["dash"], - "author": "Dan Vargas " + "language": "dash", + "version": "0.5.11", + "aliases": ["dash"] } diff --git a/packages/deno/1.7.5/metadata.json b/packages/deno/1.7.5/metadata.json index a73d171..60b8a65 100644 --- a/packages/deno/1.7.5/metadata.json +++ b/packages/deno/1.7.5/metadata.json @@ -1,6 +1,5 @@ { "language": "deno", "version": "1.7.5", - "author": "Thomas Hobson ", "aliases": ["deno-ts", "deno-js"] -} \ No newline at end of file +} diff --git a/packages/dotnet/5.0.201/metadata.json b/packages/dotnet/5.0.201/metadata.json index 72f2e79..619265d 100644 --- a/packages/dotnet/5.0.201/metadata.json +++ b/packages/dotnet/5.0.201/metadata.json @@ -1,6 +1,5 @@ { - "language": "dotnet", - "version": "5.0.201", - "aliases": ["cs", "csharp"], - "author": "Thomas Hobson " + "language": "dotnet", + "version": "5.0.201", + "aliases": ["cs", "csharp"] } diff --git a/packages/elixir/1.11.3/metadata.json b/packages/elixir/1.11.3/metadata.json index 6349e0e..9c1a2fc 100644 --- a/packages/elixir/1.11.3/metadata.json +++ b/packages/elixir/1.11.3/metadata.json @@ -1,6 +1,5 @@ { "language": "elixir", "version": "1.11.3", - "author": "Dan Vargas ", "aliases": ["elixir", "exs"] -} \ No newline at end of file +} diff --git a/packages/emacs/27.1.0/metadata.json b/packages/emacs/27.1.0/metadata.json index bcd3d08..caa2fb4 100644 --- a/packages/emacs/27.1.0/metadata.json +++ b/packages/emacs/27.1.0/metadata.json @@ -1,6 +1,5 @@ { "language": "emacs", "version": "27.1.0", - "author": "Dan Vargas ", "aliases": ["emacs", "el", "elisp"] -} \ No newline at end of file +} diff --git a/packages/erlang/23.0.0/metadata.json b/packages/erlang/23.0.0/metadata.json index d035d40..e82b4b3 100644 --- a/packages/erlang/23.0.0/metadata.json +++ b/packages/erlang/23.0.0/metadata.json @@ -1,6 +1,5 @@ { "language": "erlang", "version": "23.0.0", - "author": "Dan Vargas ", "aliases": ["erlang", "erl", "escript"] -} \ No newline at end of file +} diff --git a/packages/gawk/5.1.0/metadata.json b/packages/gawk/5.1.0/metadata.json index a4f3ae2..e22b5d1 100644 --- a/packages/gawk/5.1.0/metadata.json +++ b/packages/gawk/5.1.0/metadata.json @@ -1,6 +1,5 @@ { - "language": "gawk", - "version": "5.1.0", - "aliases": ["awk"], - "author": "Thomas Hobson " + "language": "gawk", + "version": "5.1.0", + "aliases": ["awk"] } diff --git a/packages/gcc/10.2.0/metadata.json b/packages/gcc/10.2.0/metadata.json index 8f3e9b5..6e211f6 100644 --- a/packages/gcc/10.2.0/metadata.json +++ b/packages/gcc/10.2.0/metadata.json @@ -1,6 +1,5 @@ { - "language": "gcc", - "version": "10.2.0", - "aliases": ["c","g++","c++","cpp","gdc","d"], - "author": "Thomas Hobson " + "language": "gcc", + "version": "10.2.0", + "aliases": ["c", "g++", "c++", "cpp", "gdc", "d"] } diff --git a/packages/go/1.16.2/metadata.json b/packages/go/1.16.2/metadata.json index 7f9e443..0144808 100644 --- a/packages/go/1.16.2/metadata.json +++ b/packages/go/1.16.2/metadata.json @@ -1,6 +1,5 @@ { "language": "go", "version": "1.16.2", - "author": "Victor Frazao ", "aliases": ["go", "golang"] } diff --git a/packages/haskell/9.0.1/metadata.json b/packages/haskell/9.0.1/metadata.json index c6fae6d..d58d528 100644 --- a/packages/haskell/9.0.1/metadata.json +++ b/packages/haskell/9.0.1/metadata.json @@ -1,6 +1,5 @@ { "language": "haskell", "version": "9.0.1", - "author": "Dan Vargas ", "aliases": ["haskell", "hs"] -} \ No newline at end of file +} diff --git a/packages/init b/packages/init index 5a0c9b9..68a303b 100755 --- a/packages/init +++ b/packages/init @@ -9,7 +9,6 @@ fi NAME=$1 VERSION=$2 -AUTHOR="$(git config user.name) <$(git config user.email)>" SOURCE=$3 DIR=$NAME/$VERSION @@ -26,7 +25,7 @@ build_instructions(){ echo "curl \"$SOURCE\" -o $NAME.tar.gz" echo echo "tar xzf $NAME.tar.gz --strip-components=1" - echo + echo echo "# === autoconf based ===" echo './configure --prefix "$PREFIX"' @@ -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 -jq '.language = "'$NAME'" | .version = "'$VERSION'" | .aliases = [] | .author = "'"$AUTHOR"'"' <<< "{}" > metadata.json +jq '.language = "'$NAME'" | .version = "'$VERSION'" | .aliases = []' <<< "{}" > metadata.json cd - > /dev/null diff --git a/packages/java/15.0.2/metadata.json b/packages/java/15.0.2/metadata.json index 2f24706..9c3a298 100644 --- a/packages/java/15.0.2/metadata.json +++ b/packages/java/15.0.2/metadata.json @@ -1,6 +1,5 @@ { - "language": "java", - "version": "15.0.2", - "aliases": [], - "author": "Thomas Hobson " + "language": "java", + "version": "15.0.2", + "aliases": [] } diff --git a/packages/jelly/0.1.31/metadata.json b/packages/jelly/0.1.31/metadata.json index bf63814..905242e 100644 --- a/packages/jelly/0.1.31/metadata.json +++ b/packages/jelly/0.1.31/metadata.json @@ -1,6 +1,5 @@ { "language": "jelly", "version": "0.1.31", - "author": "Thomas Hobson ", "aliases": [] -} \ No newline at end of file +} diff --git a/packages/julia/1.5.4/metadata.json b/packages/julia/1.5.4/metadata.json index 3dfba09..f177ea8 100644 --- a/packages/julia/1.5.4/metadata.json +++ b/packages/julia/1.5.4/metadata.json @@ -1,6 +1,5 @@ { - "language": "julia", - "version": "1.5.4", - "aliases": ["jl"], - "author": "Victor Frazao " + "language": "julia", + "version": "1.5.4", + "aliases": ["jl"] } diff --git a/packages/kotlin/1.4.31/metadata.json b/packages/kotlin/1.4.31/metadata.json index 87ffdf8..304c5cd 100644 --- a/packages/kotlin/1.4.31/metadata.json +++ b/packages/kotlin/1.4.31/metadata.json @@ -1,6 +1,5 @@ { - "language": "kotlin", - "version": "1.4.31", - "aliases": ["kt"], - "author": "Thomas Hobson " + "language": "kotlin", + "version": "1.4.31", + "aliases": ["kt"] } diff --git a/packages/lisp/2.1.2/metadata.json b/packages/lisp/2.1.2/metadata.json index fd35513..185cf9e 100644 --- a/packages/lisp/2.1.2/metadata.json +++ b/packages/lisp/2.1.2/metadata.json @@ -1,6 +1,5 @@ { - "language": "lisp", - "version": "2.1.2", - "aliases": ["lisp","cl","sbcl","commonlisp"], - "author": "Dan Vargas " + "language": "lisp", + "version": "2.1.2", + "aliases": ["lisp", "cl", "sbcl", "commonlisp"] } diff --git a/packages/lolcode/0.11.2/metadata.json b/packages/lolcode/0.11.2/metadata.json index 80e46ea..1bd6bbf 100644 --- a/packages/lolcode/0.11.2/metadata.json +++ b/packages/lolcode/0.11.2/metadata.json @@ -1,6 +1,5 @@ { "language": "lolcode", "version": "0.11.2", - "author": "Shivansh-007 ", "aliases": ["lol", "lci"] } diff --git a/packages/lua/5.4.2/metadata.json b/packages/lua/5.4.2/metadata.json index 401c03a..f0396db 100644 --- a/packages/lua/5.4.2/metadata.json +++ b/packages/lua/5.4.2/metadata.json @@ -1,6 +1,5 @@ { "language": "lua", "version": "5.4.2", - "author": "Shivansh-007 ", "aliases": ["lua"] -} \ No newline at end of file +} diff --git a/packages/mono/6.12.0/metadata.json b/packages/mono/6.12.0/metadata.json index a7c979b..85679bf 100644 --- a/packages/mono/6.12.0/metadata.json +++ b/packages/mono/6.12.0/metadata.json @@ -1,6 +1,5 @@ { "language": "mono", "version": "6.12.0", - "author": "Thomas Hobson ", "aliases": ["csharp", "cs"] -} \ No newline at end of file +} diff --git a/packages/nasm/2.15.5/metadata.json b/packages/nasm/2.15.5/metadata.json index e9d1507..9f8a384 100644 --- a/packages/nasm/2.15.5/metadata.json +++ b/packages/nasm/2.15.5/metadata.json @@ -1,6 +1,5 @@ { - "language": "nasm", - "version": "2.15.5", - "aliases": ["nasm64"], - "author": "Thomas Hobson " + "language": "nasm", + "version": "2.15.5", + "aliases": ["nasm64"] } diff --git a/packages/nim/1.4.4/metadata.json b/packages/nim/1.4.4/metadata.json index 6f88382..f23eb0e 100644 --- a/packages/nim/1.4.4/metadata.json +++ b/packages/nim/1.4.4/metadata.json @@ -1,6 +1,5 @@ { "language": "nim", "version": "1.4.4", - "author": "Dan Vargas ", "aliases": ["nim"] -} \ No newline at end of file +} diff --git a/packages/node/15.10.0/metadata.json b/packages/node/15.10.0/metadata.json index 972f4f2..2f601d1 100644 --- a/packages/node/15.10.0/metadata.json +++ b/packages/node/15.10.0/metadata.json @@ -1,6 +1,5 @@ { "language": "node", "version": "15.10.0", - "author": "Martin Kos ", "aliases": ["node-javascript", "node-js", "javascript", "js"] -} \ No newline at end of file +} diff --git a/packages/osabie/1.0.1/metadata.json b/packages/osabie/1.0.1/metadata.json index 140965f..d4480d2 100644 --- a/packages/osabie/1.0.1/metadata.json +++ b/packages/osabie/1.0.1/metadata.json @@ -1,6 +1,5 @@ { "language": "osabie", "version": "1.0.1", - "author": "Dan Vargas ", "aliases": ["osabie", "05AB1E", "usable"] -} \ No newline at end of file +} diff --git a/packages/paradoc/0.6.0/metadata.json b/packages/paradoc/0.6.0/metadata.json index 8037f2a..cdbb30a 100644 --- a/packages/paradoc/0.6.0/metadata.json +++ b/packages/paradoc/0.6.0/metadata.json @@ -1,6 +1,5 @@ { "language": "paradoc", "version": "0.6.0", - "author": "Dan Vargas ", "aliases": ["paradoc"] -} \ No newline at end of file +} diff --git a/packages/pascal/3.2.0/build.sh b/packages/pascal/3.2.0/build.sh new file mode 100755 index 0000000..0d1a3b8 --- /dev/null +++ b/packages/pascal/3.2.0/build.sh @@ -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/ diff --git a/packages/pascal/3.2.0/compile b/packages/pascal/3.2.0/compile new file mode 100644 index 0000000..93855b7 --- /dev/null +++ b/packages/pascal/3.2.0/compile @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Compile pascal files +fpc -oout -v0 "$@" +chmod +x out diff --git a/packages/pascal/3.2.0/environment b/packages/pascal/3.2.0/environment new file mode 100644 index 0000000..bd0ff98 --- /dev/null +++ b/packages/pascal/3.2.0/environment @@ -0,0 +1 @@ +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/pascal/3.2.0/metadata.json b/packages/pascal/3.2.0/metadata.json new file mode 100644 index 0000000..daaca4f --- /dev/null +++ b/packages/pascal/3.2.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "pascal", + "version": "3.2.0", + "aliases": ["pascal", "freepascal", "pp", "pas"] +} diff --git a/packages/pascal/3.2.0/run b/packages/pascal/3.2.0/run new file mode 100644 index 0000000..6955ba9 --- /dev/null +++ b/packages/pascal/3.2.0/run @@ -0,0 +1,4 @@ +#!/bin/bash + +shift # Filename is only used to compile +./out "$@" diff --git a/packages/pascal/3.2.0/test.pp b/packages/pascal/3.2.0/test.pp new file mode 100644 index 0000000..3c5165d --- /dev/null +++ b/packages/pascal/3.2.0/test.pp @@ -0,0 +1,5 @@ +program test; + + begin + writeln('OK'); + end. \ No newline at end of file diff --git a/packages/perl/5.26.1/metadata.json b/packages/perl/5.26.1/metadata.json index e3267e4..67a6624 100644 --- a/packages/perl/5.26.1/metadata.json +++ b/packages/perl/5.26.1/metadata.json @@ -1,6 +1,5 @@ { "language": "perl", "version": "5.26.1", - "author": "Dan Vargas ", "aliases": ["perl", "pl"] -} \ No newline at end of file +} diff --git a/packages/php/8.0.2/metadata.json b/packages/php/8.0.2/metadata.json index 2da0ef9..14d3e11 100644 --- a/packages/php/8.0.2/metadata.json +++ b/packages/php/8.0.2/metadata.json @@ -1,6 +1,5 @@ { "language": "php", "version": "8.0.2", - "author": "Martin Kos ", - "aliases": ["php8","html"] -} \ No newline at end of file + "aliases": ["php8", "html"] +} diff --git a/packages/prolog/8.2.4/metadata.json b/packages/prolog/8.2.4/metadata.json index 8238856..d799d87 100644 --- a/packages/prolog/8.2.4/metadata.json +++ b/packages/prolog/8.2.4/metadata.json @@ -1,6 +1,5 @@ { - "language": "prolog", - "version": "8.2.4", - "aliases": ["prolog","plg"], - "author": "Dan Vargas " + "language": "prolog", + "version": "8.2.4", + "aliases": ["prolog", "plg"] } diff --git a/packages/pure/0.68.0/build.sh b/packages/pure/0.68.0/build.sh new file mode 100755 index 0000000..8acb9a2 --- /dev/null +++ b/packages/pure/0.68.0/build.sh @@ -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) diff --git a/packages/pure/0.68.0/environment b/packages/pure/0.68.0/environment new file mode 100644 index 0000000..73cb42f --- /dev/null +++ b/packages/pure/0.68.0/environment @@ -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 diff --git a/packages/pure/0.68.0/metadata.json b/packages/pure/0.68.0/metadata.json new file mode 100644 index 0000000..409df52 --- /dev/null +++ b/packages/pure/0.68.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "pure", + "version": "0.68.0", + "aliases": [] +} diff --git a/packages/pure/0.68.0/run b/packages/pure/0.68.0/run new file mode 100644 index 0000000..3b29e6a --- /dev/null +++ b/packages/pure/0.68.0/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put instructions to run the runtime +pure "$@" diff --git a/packages/pure/0.68.0/test.pure b/packages/pure/0.68.0/test.pure new file mode 100644 index 0000000..88aabf8 --- /dev/null +++ b/packages/pure/0.68.0/test.pure @@ -0,0 +1,2 @@ +using system; +puts "OK"; \ No newline at end of file diff --git a/packages/python/2.7.18/metadata.json b/packages/python/2.7.18/metadata.json index fb22add..7677ded 100644 --- a/packages/python/2.7.18/metadata.json +++ b/packages/python/2.7.18/metadata.json @@ -1,6 +1,5 @@ { "language": "python", "version": "2.7.18", - "author": "Shivansh-007 ", "aliases": ["py", "python2"] -} \ No newline at end of file +} diff --git a/packages/python/3.5.10/metadata.json b/packages/python/3.5.10/metadata.json index 6432f16..fca2ef6 100644 --- a/packages/python/3.5.10/metadata.json +++ b/packages/python/3.5.10/metadata.json @@ -1,6 +1,5 @@ { "language": "python", "version": "3.5.10", - "author": "Shivansh-007 ", "aliases": ["py", "python3"] -} \ No newline at end of file +} diff --git a/packages/python/3.9.1/metadata.json b/packages/python/3.9.1/metadata.json index 306c376..5537b3e 100644 --- a/packages/python/3.9.1/metadata.json +++ b/packages/python/3.9.1/metadata.json @@ -1,6 +1,5 @@ { "language": "python", "version": "3.9.1", - "author": "Thomas Hobson ", "aliases": ["py", "python3"] -} \ No newline at end of file +} diff --git a/packages/rockstar/1.0.0/build.sh b/packages/rockstar/1.0.0/build.sh new file mode 100755 index 0000000..baaa9f0 --- /dev/null +++ b/packages/rockstar/1.0.0/build.sh @@ -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 diff --git a/packages/rockstar/1.0.0/environment b/packages/rockstar/1.0.0/environment new file mode 100644 index 0000000..19eafb2 --- /dev/null +++ b/packages/rockstar/1.0.0/environment @@ -0,0 +1,2 @@ +export ROCKSTAR_PATH=$PWD/rockstar/satriani +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/rockstar/1.0.0/metadata.json b/packages/rockstar/1.0.0/metadata.json new file mode 100644 index 0000000..f65bfd6 --- /dev/null +++ b/packages/rockstar/1.0.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "rockstar", + "version": "1.0.0", + "aliases": ["rockstar", "rock"] +} diff --git a/packages/rockstar/1.0.0/run b/packages/rockstar/1.0.0/run new file mode 100644 index 0000000..7cac84f --- /dev/null +++ b/packages/rockstar/1.0.0/run @@ -0,0 +1,3 @@ +#!/bin/bash + +node $ROCKSTAR_PATH/rockstar "$@" \ No newline at end of file diff --git a/packages/rockstar/1.0.0/test.rock b/packages/rockstar/1.0.0/test.rock new file mode 100644 index 0000000..eebfa1c --- /dev/null +++ b/packages/rockstar/1.0.0/test.rock @@ -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 \ No newline at end of file diff --git a/packages/ruby/2.5.1/metadata.json b/packages/ruby/2.5.1/metadata.json index e22c78c..a483428 100644 --- a/packages/ruby/2.5.1/metadata.json +++ b/packages/ruby/2.5.1/metadata.json @@ -1,6 +1,5 @@ { "language": "ruby", "version": "2.5.1", - "author": "Dan Vargas ", "aliases": ["ruby", "rb"] -} \ No newline at end of file +} diff --git a/packages/rust/1.50.0/metadata.json b/packages/rust/1.50.0/metadata.json index 48dc091..57cefa0 100644 --- a/packages/rust/1.50.0/metadata.json +++ b/packages/rust/1.50.0/metadata.json @@ -1,6 +1,5 @@ { - "language": "rust", - "version": "1.50.0", - "aliases": ["rs"], - "author": "Victor Frazao " + "language": "rust", + "version": "1.50.0", + "aliases": ["rs"] } diff --git a/packages/scala/3.0.0/metadata.json b/packages/scala/3.0.0/metadata.json index 6227bb9..8c2e7b4 100644 --- a/packages/scala/3.0.0/metadata.json +++ b/packages/scala/3.0.0/metadata.json @@ -1,6 +1,5 @@ { - "language": "scala", - "version": "3.0.0", - "aliases": ["scala","sc"], - "author": "Dan Vargas " + "language": "scala", + "version": "3.0.0", + "aliases": ["scala", "sc"] } diff --git a/packages/swift/5.3.3/metadata.json b/packages/swift/5.3.3/metadata.json index 679b8da..ecc52ae 100644 --- a/packages/swift/5.3.3/metadata.json +++ b/packages/swift/5.3.3/metadata.json @@ -1,6 +1,5 @@ { - "language": "swift", - "version": "5.3.3", - "aliases": ["swift"], - "author": "Dan Vargas " + "language": "swift", + "version": "5.3.3", + "aliases": ["swift"] } diff --git a/packages/typescript/4.2.3/metadata.json b/packages/typescript/4.2.3/metadata.json index f4a54de..cc7669b 100644 --- a/packages/typescript/4.2.3/metadata.json +++ b/packages/typescript/4.2.3/metadata.json @@ -1,6 +1,5 @@ { - "language": "typescript", - "version": "4.2.3", - "aliases": ["ts","node-ts","tsc"], - "author": "Thomas Hobson " + "language": "typescript", + "version": "4.2.3", + "aliases": ["ts", "node-ts", "tsc"] } diff --git a/packages/vlang/0.1.13/metadata.json b/packages/vlang/0.1.13/metadata.json index 855f7bb..d136076 100644 --- a/packages/vlang/0.1.13/metadata.json +++ b/packages/vlang/0.1.13/metadata.json @@ -1,6 +1,5 @@ { "language": "vlang", "version": "0.1.13", - "author": "Shivansh-007 ", "aliases": ["v"] } diff --git a/packages/zig/0.7.1/metadata.json b/packages/zig/0.7.1/metadata.json index 3de611e..2712dc0 100644 --- a/packages/zig/0.7.1/metadata.json +++ b/packages/zig/0.7.1/metadata.json @@ -1,6 +1,5 @@ { - "language": "zig", - "version": "0.7.1", - "aliases": ["zig"], - "author": "Dan Vargas " + "language": "zig", + "version": "0.7.1", + "aliases": ["zig"] } diff --git a/readme.md b/readme.md index ce2a947..1f86d35 100644 --- a/readme.md +++ b/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 # 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 ```
@@ -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: ```sh -cli/index.js -u http://piston.server:6969 ppman list +cli/index.js -u http://piston.server:2000 ppman list ``` ### 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. #### Runtimes Endpoint `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 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. @@ -170,7 +170,6 @@ Content-Type: application/json { "language": "bash", "version": "5.1.0", - "author": "Thomas Hobson ", "aliases": [ "sh" ] @@ -178,7 +177,6 @@ Content-Type: application/json { "language": "brainfuck", "version": "2.7.3", - "author": "Thomas Hobson ", "aliases": [ "bf" ]