owner refs updated

This commit is contained in:
Youth Innovations 2025-10-09 21:34:15 +02:00
parent 1d55a41a2d
commit a2b8d904a9
9 changed files with 76 additions and 22 deletions

54
.github/copilot-instructions.md vendored Normal file
View file

@ -0,0 +1,54 @@
# Copilot instructions for the piston repo — concise reference
Purpose
- Help an AI coding agent become productive quickly by calling out the repository's runtime layout, common dev workflows, and code locations to edit or inspect.
Big picture (what to know first)
- Two main dev services (see docker-compose.dev.yaml):
- api — the HTTP service (built from the `api/` directory). Exposes port 2000 (host:container = 2000:2000). Uses env PISTON_REPO_URL to locate the package index.
- repo — local package repository (built from `repo/`). The API points at `http://repo:8000/index` inside docker-compose; open `repo/` and its Dockerfile to confirm exact listen port.
- Persistent packages are stored on the host at ./data/piston/packages and mounted into the api container at /piston/packages. Changes to packages on disk are visible to the running api container.
Quick actionable workflows (exact commands)
- Start dev environment:
- docker compose -f docker-compose.dev.yaml up --build
- or to run in background: docker compose -f docker-compose.dev.yaml up --build -d
- View logs:
- docker compose -f docker-compose.dev.yaml logs -f api
- docker compose -f docker-compose.dev.yaml logs -f repo
- Rebuild just the api:
- docker compose -f docker-compose.dev.yaml up --build api
- Exec into a running container:
- docker compose -f docker-compose.dev.yaml exec api sh
- or use container names: docker exec -it infoyouth_infoyouth_piston_api sh
- Where to look for CI/test commands:
- Check top-level files: README.md, Makefile, package.json, pyproject.toml, Dockerfiles, and .github/workflows/* for project-specific test/build commands before inventing them.
Project-specific patterns and conventions
- Docker-first dev flow: each major component has its own build context (api/, repo/). Prefer making changes in the corresponding directory and rebuilding that service.
- Environment linkage: services communicate by docker-compose service name (e.g., `repo`), not hostnames. Keep PISTON_REPO_URL updated when editing compose or integration tests.
- Packages persistence: local packages live under ./data/piston/packages — use this path in integration tests or when seeding sample packages for development.
Where changed code normally belongs
- http routes, handlers, and server code → api/
- package index and repository logic → repo/
- container configuration → api/Dockerfile, repo/Dockerfile, docker-compose.dev.yaml
Examples from this repo
- docker-compose.dev.yaml:
- api service maps host port 2000 to container 2000 and sets PISTON_REPO_URL=http://repo:8000/index
- repo service runs with command ['--no-build'] and mounts the full repo (.:/piston)
What to avoid changing blindly
- The api service is run privileged: true in dev compose — confirm why before removing.
- Dont move the packages volume (./data/piston/packages) without updating any scripts, tests, and PERSISTED paths that expect it.
Tasks an AI can do confidently
- Add or modify an API route: update code in api/, then rebuild only the api container.
- Update package repo behavior: change code in repo/, rebuild and verify with docker compose logs -f repo.
- Seed test packages: write files into ./data/piston/packages and restart api to pick them up.
When you need more info
- Search for project-specific commands and patterns in: README.md, Dockerfiles in api/ and repo/, and any .github/workflows/*. If something is missing or ambiguous, ask the maintainer which test runner or CI job to mirror.
If anything in these instructions is unclear or you need examples of a specific task (add endpoint, seed packages, run tests), tell me which area to expand.

View file

@ -34,5 +34,5 @@ jobs:
push: true
pull: true
tags: |
docker.pkg.github.com/engineer-man/piston/api
ghcr.io/engineer-man/piston
docker.pkg.github.com/infoyouth/piston/api
ghcr.io/infoyouth/piston

View file

@ -54,7 +54,7 @@ jobs:
run: |
PACKAGES=$(jq '.[]' -r ${HOME}/files*.json | awk -F/ '$1~/packages/ && $2 && $3{ print $2 "-" $3 }' | sort -u)
echo "Packages: $PACKAGES"
docker pull docker.pkg.github.com/engineer-man/piston/repo-builder:latest
docker pull docker.pkg.github.com/infoyouth/piston/repo-builder:latest
docker build -t repo-builder repo
docker run -v "${{ github.workspace }}:/piston" repo-builder --no-server $PACKAGES
ls -la packages
@ -89,8 +89,8 @@ jobs:
- name: Run tests
run: |
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 pull docker.pkg.github.com/engineer-man/piston/api
docker run -v $(pwd)'/repo:/piston/repo' -v $(pwd)'/packages:/piston/packages' -d --name repo docker.pkg.github.com/infoyouth/piston/repo-builder --no-build
docker pull docker.pkg.github.com/infoyouth/piston/api
docker build -t piston-api api
docker run --privileged --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..

View file

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

View file

@ -28,4 +28,4 @@ jobs:
pull: true
push: true
tags: |
docker.pkg.github.com/engineer-man/piston/repo-builder
docker.pkg.github.com/infoyouth/piston/repo-builder

View file

@ -3,7 +3,7 @@ version: '3.2'
services:
api:
build: api
container_name: piston_api
container_name: infoyouth_piston_api
privileged: true
restart: always
ports:

View file

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

View file

@ -1,4 +1,4 @@
Copyright (c) 2018-2021 Brian Seymour, Thomas Hobson, EMKC Contributors
Copyright (c) 2018-2021 Brian Seymour, Thomas Hobson, EMKC Contributors, Youth Innovations
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View file

@ -1,5 +1,5 @@
<h1 align="center">
<a href="https://github.com/engineer-man/piston">
<a href="https://github.com/infoyouth/piston">
<img src="var/docs/images/piston.svg" valign="middle" width="58" height="58" alt="engineer-man piston" />
</a>
<span valign="middle">
@ -12,14 +12,14 @@
<br>
<p align="center">
<a href="https://github.com/engineer-man/piston/commits/master">
<img src="https://img.shields.io/github/last-commit/engineer-man/piston.svg?style=for-the-badge&logo=github&logoColor=white"
<a href="https://github.com/infoyouth/piston/commits/master">
<img src="https://img.shields.io/github/last-commit/infoyouth/piston.svg?style=for-the-badge&logo=github&logoColor=white"
alt="GitHub last commit">
<a href="https://github.com/engineer-man/piston/issues">
<img src="https://img.shields.io/github/issues/engineer-man/piston.svg?style=for-the-badge&logo=github&logoColor=white"
<a href="https://github.com/infoyouth/piston/issues">
<img src="https://img.shields.io/github/issues/infoyouth/piston.svg?style=for-the-badge&logo=github&logoColor=white"
alt="GitHub issues">
<a href="https://github.com/engineer-man/piston/pulls">
<img src="https://img.shields.io/github/issues-pr-raw/engineer-man/piston.svg?style=for-the-badge&logo=github&logoColor=white"
<a href="https://github.com/infoyouth/piston/pulls">
<img src="https://img.shields.io/github/issues-pr-raw/infoyouth/piston.svg?style=for-the-badge&logo=github&logoColor=white"
alt="GitHub pull requests">
</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.
- [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/infoyouth/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.
- [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.
@ -111,7 +111,7 @@ POST https://emkc.org/api/v2/piston/execute
```sh
# clone and enter repo
git clone https://github.com/engineer-man/piston
git clone https://github.com/infoyouth/piston
```
> [!NOTE]
@ -145,7 +145,7 @@ docker run \
-dit \
-p 2000:2000 \
--name piston_api \
ghcr.io/engineer-man/piston
ghcr.io/infoyouth/piston
```
## Piston for testing packages locally