Merge remote-tracking branch 'fork/production' into Gleam

This commit is contained in:
Lunarmagpie 2023-03-08 03:19:58 -05:00
commit 4bb58bac57
19 changed files with 106 additions and 37 deletions

View File

@ -1,9 +1,9 @@
name: Publish API image name: Publish API image
on: on:
workflow_dispatch:
push: push:
branches: branches:
- master - production
- v3
paths: paths:
- api/** - api/**
@ -34,5 +34,5 @@ jobs:
push: true push: true
pull: true pull: true
tags: | tags: |
docker.pkg.github.com/engineer-man/piston/api docker.pkg.github.com/endercheif/piston/api
ghcr.io/engineer-man/piston ghcr.io/endercheif/piston

View File

@ -8,6 +8,7 @@ on:
- synchronize - synchronize
paths: paths:
- 'packages/**' - 'packages/**'
workflow_dispatch:
jobs: jobs:
check-pkg: check-pkg:
@ -54,7 +55,7 @@ jobs:
run: | run: |
PACKAGES=$(jq '.[]' -r ${HOME}/files*.json | awk -F/ '$1~/packages/ && $2 && $3{ print $2 "-" $3 }' | sort -u) PACKAGES=$(jq '.[]' -r ${HOME}/files*.json | awk -F/ '$1~/packages/ && $2 && $3{ print $2 "-" $3 }' | sort -u)
echo "Packages: $PACKAGES" echo "Packages: $PACKAGES"
docker pull docker.pkg.github.com/engineer-man/piston/repo-builder:latest docker pull docker.pkg.github.com/endercheif/piston/repo-builder:latest
docker build -t repo-builder repo docker build -t repo-builder repo
docker run -v "${{ github.workspace }}:/piston" repo-builder --no-server $PACKAGES docker run -v "${{ github.workspace }}:/piston" repo-builder --no-server $PACKAGES
ls -la packages ls -la packages
@ -89,8 +90,8 @@ jobs:
- name: Run tests - name: Run tests
run: | run: |
ls -la ls -la
docker run -v $(pwd)'/repo:/piston/repo' -v $(pwd)'/packages:/piston/packages' -d --name 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 repo docker.pkg.github.com/endercheif/piston/repo-builder --no-build
docker pull docker.pkg.github.com/engineer-man/piston/api docker pull docker.pkg.github.com/endercheif/piston/api
docker build -t piston-api api docker build -t piston-api api
docker run --network container:repo -v $(pwd)'/data:/piston' -e PISTON_LOG_LEVEL=DEBUG -e 'PISTON_REPO_URL=http://localhost:8000/index' -d --name api piston-api docker run --network container:repo -v $(pwd)'/data:/piston' -e PISTON_LOG_LEVEL=DEBUG -e 'PISTON_REPO_URL=http://localhost:8000/index' -d --name api piston-api
echo Waiting for API to start.. echo Waiting for API to start..

View File

@ -7,6 +7,7 @@ on:
- v3 - v3
paths: paths:
- packages/** - packages/**
workflow_dispatch:
jobs: jobs:
build-pkg: build-pkg:
@ -32,7 +33,7 @@ jobs:
run: | run: |
PACKAGES=$(jq '.[]' -r ${HOME}/files*.json | awk -F/ '$1~/packages/ && $2 && $3{ print $2 "-" $3 }' | sort -u) PACKAGES=$(jq '.[]' -r ${HOME}/files*.json | awk -F/ '$1~/packages/ && $2 && $3{ print $2 "-" $3 }' | sort -u)
echo "Packages: $PACKAGES" echo "Packages: $PACKAGES"
docker pull docker.pkg.github.com/engineer-man/piston/repo-builder:latest docker pull docker.pkg.github.com/endercheif/piston/repo-builder:latest
docker build -t repo-builder repo docker build -t repo-builder repo
docker run -v "${{ github.workspace }}:/piston" repo-builder --no-server $PACKAGES docker run -v "${{ github.workspace }}:/piston" repo-builder --no-server $PACKAGES
ls -la packages ls -la packages
@ -51,11 +52,11 @@ jobs:
needs: build-pkg needs: build-pkg
steps: steps:
- name: 'Download all release assets' - name: 'Download all release assets'
run: curl -s https://api.github.com/repos/engineer-man/piston/releases/latest | jq '.assets[].browser_download_url' -r | xargs -L 1 curl -sLO run: curl -s https://api.github.com/repos/endercheif/piston/releases/latest | jq '.assets[].browser_download_url' -r | xargs -L 1 curl -sLO
- name: 'Generate index file' - name: 'Generate index file'
run: | run: |
echo "" > index echo "" > index
BASEURL=https://github.com/engineer-man/piston/releases/download/pkgs/ BASEURL=https://github.com/endercheif/piston/releases/download/pkgs/
for pkg in *.pkg.tar.gz for pkg in *.pkg.tar.gz
do do
PKGFILE=$(basename $pkg) PKGFILE=$(basename $pkg)

View File

@ -6,6 +6,7 @@ on:
- v3 - v3
paths: paths:
- repo/** - repo/**
workflow_dispatch:
jobs: jobs:
push_to_registry: push_to_registry:
@ -28,4 +29,4 @@ jobs:
pull: true pull: true
push: true push: true
tags: | tags: |
docker.pkg.github.com/engineer-man/piston/repo-builder docker.pkg.github.com/endercheif/piston/repo-builder

66
api/package-lock.json generated
View File

@ -16,7 +16,7 @@
"is-docker": "^2.1.1", "is-docker": "^2.1.1",
"logplease": "^1.2.15", "logplease": "^1.2.15",
"nocamel": "HexF/nocamel#patch-1", "nocamel": "HexF/nocamel#patch-1",
"node-fetch": "^2.6.1", "node-fetch": "^2.6.7",
"semver": "^7.3.4", "semver": "^7.3.4",
"uuid": "^8.3.2", "uuid": "^8.3.2",
"waitpid": "git+https://github.com/HexF/node-waitpid.git" "waitpid": "git+https://github.com/HexF/node-waitpid.git"
@ -375,11 +375,22 @@
"resolved": "git+ssh://git@github.com/HexF/nocamel.git#89a5bfbbd07c72c302d968b967d0f4fe54846544" "resolved": "git+ssh://git@github.com/HexF/nocamel.git#89a5bfbbd07c72c302d968b967d0f4fe54846544"
}, },
"node_modules/node-fetch": { "node_modules/node-fetch": {
"version": "2.6.1", "version": "2.6.7",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
"dependencies": {
"whatwg-url": "^5.0.0"
},
"engines": { "engines": {
"node": "4.x || >=6.0.0" "node": "4.x || >=6.0.0"
},
"peerDependencies": {
"encoding": "^0.1.0"
},
"peerDependenciesMeta": {
"encoding": {
"optional": true
}
} }
}, },
"node_modules/on-finished": { "node_modules/on-finished": {
@ -535,6 +546,11 @@
"node": ">=0.6" "node": ">=0.6"
} }
}, },
"node_modules/tr46": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
},
"node_modules/type-is": { "node_modules/type-is": {
"version": "1.6.18", "version": "1.6.18",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
@ -583,6 +599,20 @@
"resolved": "git+ssh://git@github.com/HexF/node-waitpid.git#a08d116a5d993a747624fe72ff890167be8c34aa", "resolved": "git+ssh://git@github.com/HexF/node-waitpid.git#a08d116a5d993a747624fe72ff890167be8c34aa",
"hasInstallScript": true "hasInstallScript": true
}, },
"node_modules/webidl-conversions": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
},
"node_modules/whatwg-url": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
"dependencies": {
"tr46": "~0.0.3",
"webidl-conversions": "^3.0.0"
}
},
"node_modules/ws": { "node_modules/ws": {
"version": "7.5.3", "version": "7.5.3",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.3.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.3.tgz",
@ -877,9 +907,12 @@
"from": "nocamel@HexF/nocamel#patch-1" "from": "nocamel@HexF/nocamel#patch-1"
}, },
"node-fetch": { "node-fetch": {
"version": "2.6.1", "version": "2.6.7",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
"requires": {
"whatwg-url": "^5.0.0"
}
}, },
"on-finished": { "on-finished": {
"version": "2.3.0", "version": "2.3.0",
@ -1000,6 +1033,11 @@
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
"integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw=="
}, },
"tr46": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
},
"type-is": { "type-is": {
"version": "1.6.18", "version": "1.6.18",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
@ -1033,6 +1071,20 @@
"version": "git+ssh://git@github.com/HexF/node-waitpid.git#a08d116a5d993a747624fe72ff890167be8c34aa", "version": "git+ssh://git@github.com/HexF/node-waitpid.git#a08d116a5d993a747624fe72ff890167be8c34aa",
"from": "waitpid@git+https://github.com/HexF/node-waitpid.git" "from": "waitpid@git+https://github.com/HexF/node-waitpid.git"
}, },
"webidl-conversions": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
},
"whatwg-url": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
"requires": {
"tr46": "~0.0.3",
"webidl-conversions": "^3.0.0"
}
},
"ws": { "ws": {
"version": "7.5.3", "version": "7.5.3",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.3.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.3.tgz",

View File

@ -11,7 +11,7 @@
"is-docker": "^2.1.1", "is-docker": "^2.1.1",
"logplease": "^1.2.15", "logplease": "^1.2.15",
"nocamel": "HexF/nocamel#patch-1", "nocamel": "HexF/nocamel#patch-1",
"node-fetch": "^2.6.1", "node-fetch": "^2.6.7",
"semver": "^7.3.4", "semver": "^7.3.4",
"uuid": "^8.3.2", "uuid": "^8.3.2",
"waitpid": "git+https://github.com/HexF/node-waitpid.git" "waitpid": "git+https://github.com/HexF/node-waitpid.git"

View File

@ -105,7 +105,7 @@ const options = {
repo_url: { repo_url: {
desc: 'URL of repo index', desc: 'URL of repo index',
default: default:
'https://github.com/engineer-man/piston/releases/download/pkgs/index', 'https://github.com/endercheif/piston/releases/download/pkgs/index',
validators: [], validators: [],
}, },
max_concurrent_jobs: { max_concurrent_jobs: {

View File

@ -1,2 +1,2 @@
FROM ghcr.io/engineer-man/piston:latest FROM ghcr.io/endercheif/piston:latest
ADD . /piston/packages/ ADD . /piston/packages/

View File

@ -28,7 +28,7 @@ fetch_packages(){
-dit \ -dit \
-p $port:2000 \ -p $port:2000 \
--name builder_piston_instance \ --name builder_piston_instance \
ghcr.io/engineer-man/piston ghcr.io/endercheif/piston
# Ensure the CLI is installed # Ensure the CLI is installed
cd ../cli cd ../cli

View File

@ -2,7 +2,7 @@ version: '3.2'
services: services:
api: api:
image: ghcr.io/engineer-man/piston image: ghcr.io/endercheif/piston
container_name: piston_api container_name: piston_api
restart: always restart: always
ports: ports:

View File

@ -156,7 +156,7 @@ Useful for running memory-limited contests.
```yaml ```yaml
key: PISTON_REPO_URL key: PISTON_REPO_URL
default: https://github.com/engineer-man/piston/releases/download/pkgs/index default: https://github.com/endercheif/piston/releases/download/pkgs/index
``` ```
URL for repository index, where packages will be downloaded from. URL for repository index, where packages will be downloaded from.

View File

@ -10,7 +10,7 @@ In the example of NodeJS, we would call this `node`, after the main binary.
See [deno/1.7.5/](deno/1.7.5/) or any other directory for examples. See [deno/1.7.5/](deno/1.7.5/) or any other directory for examples.
1. Create a new branch on your fork of engineer-man/piston 1. Create a new branch on your fork of endercheif/piston
2. Create directories named `[language]/[version]`. See Naming Languages for how to determine the name for your language 2. Create directories named `[language]/[version]`. See Naming Languages for how to determine the name for your language

View File

@ -1 +1 @@
python3 -m samarium $1 python3 -m samarium $1

3
packages/samarium/0.4.0/build.sh vendored Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
source ../../python/3.10.0/build.sh
bin/pip3 install https://github.com/samarium-lang/Samarium/archive/refs/tags/0.4.0.zip

2
packages/samarium/0.4.0/environment vendored Normal file
View File

@ -0,0 +1,2 @@
#!/bin/bash
export PATH=$PWD/bin:$PATH

5
packages/samarium/0.4.0/metadata.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"language": "samarium",
"version": "0.4.0",
"aliases": ["sm"]
}

1
packages/samarium/0.4.0/run vendored Normal file
View File

@ -0,0 +1 @@
python3 -m samarium $1

3
packages/samarium/0.4.0/test.sm vendored Normal file
View File

@ -0,0 +1,3 @@
=> * {
"OK"!;
}

View File

@ -1,6 +1,6 @@
<h1 align="center"> <h1 align="center">
<a href="https://github.com/engineer-man/piston"> <a href="https://github.com/endercheif/piston">
<img src="var/docs/images/piston.svg" valign="middle" width="58" height="58" alt="engineer-man piston" /> <img src="var/docs/images/piston.svg" valign="middle" width="58" height="58" alt="endercheif piston" />
</a> </a>
<span valign="middle"> <span valign="middle">
Piston Piston
@ -12,14 +12,14 @@
<br> <br>
<p align="center"> <p align="center">
<a href="https://github.com/engineer-man/piston/commits/master"> <a href="https://github.com/endercheif/piston/commits/master">
<img src="https://img.shields.io/github/last-commit/engineer-man/piston.svg?style=for-the-badge&logo=github&logoColor=white" <img src="https://img.shields.io/github/last-commit/endercheif/piston.svg?style=for-the-badge&logo=github&logoColor=white"
alt="GitHub last commit"> alt="GitHub last commit">
<a href="https://github.com/engineer-man/piston/issues"> <a href="https://github.com/endercheif/piston/issues">
<img src="https://img.shields.io/github/issues/engineer-man/piston.svg?style=for-the-badge&logo=github&logoColor=white" <img src="https://img.shields.io/github/issues/endercheif/piston.svg?style=for-the-badge&logo=github&logoColor=white"
alt="GitHub issues"> alt="GitHub issues">
<a href="https://github.com/engineer-man/piston/pulls"> <a href="https://github.com/endercheif/piston/pulls">
<img src="https://img.shields.io/github/issues-pr-raw/engineer-man/piston.svg?style=for-the-badge&logo=github&logoColor=white" <img src="https://img.shields.io/github/issues-pr-raw/endercheif/piston.svg?style=for-the-badge&logo=github&logoColor=white"
alt="GitHub pull requests"> alt="GitHub pull requests">
</p> </p>
@ -64,7 +64,7 @@ It's used in numerous places including:
The following are approved and endorsed extensions/utilities to the core Piston offering. The following are approved and endorsed extensions/utilities to the core Piston offering.
- [I Run Code](https://github.com/engineer-man/piston-bot), a Discord bot used in 4100+ servers to handle arbitrary code evaluation in Discord. To get this bot in your own server, go here: https://emkc.org/run. - [I Run Code](https://github.com/endercheif/piston-bot), a Discord bot used in 4100+ servers to handle arbitrary code evaluation in Discord. To get this bot in your own server, go here: https://emkc.org/run.
- [Piston CLI](https://github.com/Shivansh-007/piston-cli), a universal shell supporting code highlighting, files, and interpretation without the need to download a language. - [Piston CLI](https://github.com/Shivansh-007/piston-cli), a universal shell supporting code highlighting, files, and interpretation without the need to download a language.
- [Node Piston Client](https://github.com/dthree/node-piston), a Node.js wrapper for accessing the Piston API. - [Node Piston Client](https://github.com/dthree/node-piston), a Node.js wrapper for accessing the Piston API.
- [Piston4J](https://github.com/the-codeboy/Piston4J), a Java wrapper for accessing the Piston API. - [Piston4J](https://github.com/the-codeboy/Piston4J), a Java wrapper for accessing the Piston API.
@ -111,7 +111,7 @@ POST https://emkc.org/api/v2/piston/execute
```sh ```sh
# clone and enter repo # clone and enter repo
git clone https://github.com/engineer-man/piston git clone https://github.com/endercheif/piston
``` ```
### Installation ### Installation
@ -141,7 +141,7 @@ docker run \
-dit \ -dit \
-p 2000:2000 \ -p 2000:2000 \
--name piston_api \ --name piston_api \
ghcr.io/engineer-man/piston ghcr.io/endercheif/piston
``` ```
## Piston for testing packages locally ## Piston for testing packages locally