This commit is contained in:
Thomas Hobson 2021-03-29 21:33:54 +13:00
commit be47ab802c
No known key found for this signature in database
GPG key ID: 9F1FD9D87950DB6F
78 changed files with 304 additions and 168 deletions

View file

@ -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
```
<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:
```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 <git@hexf.me>",
"aliases": [
"sh"
]
@ -178,7 +177,6 @@ Content-Type: application/json
{
"language": "brainfuck",
"version": "2.7.3",
"author": "Thomas Hobson <git@hexf.me>",
"aliases": [
"bf"
]