From a2b8d904a9db02cc3f31174d2d240df38d3516e4 Mon Sep 17 00:00:00 2001 From: Youth Innovations Date: Thu, 9 Oct 2025 21:34:15 +0200 Subject: [PATCH] owner refs updated --- .github/copilot-instructions.md | 54 +++++++++++++++++++++++++++++ .github/workflows/api-push.yaml | 4 +-- .github/workflows/package-pr.yaml | 6 ++-- .github/workflows/package-push.yaml | 6 ++-- .github/workflows/repo-push.yaml | 2 +- docker-compose.dev.yaml | 2 +- docs/configuration.md | 2 +- license | 2 +- readme.md | 20 +++++------ 9 files changed, 76 insertions(+), 22 deletions(-) create mode 100644 .github/copilot-instructions.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..0d12502 --- /dev/null +++ b/.github/copilot-instructions.md @@ -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. +- Don’t 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. \ No newline at end of file diff --git a/.github/workflows/api-push.yaml b/.github/workflows/api-push.yaml index 782554d..7a5758d 100644 --- a/.github/workflows/api-push.yaml +++ b/.github/workflows/api-push.yaml @@ -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 diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml index e0c5e12..dd910bf 100644 --- a/.github/workflows/package-pr.yaml +++ b/.github/workflows/package-pr.yaml @@ -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.. diff --git a/.github/workflows/package-push.yaml b/.github/workflows/package-push.yaml index 5dd30dc..52b3c79 100644 --- a/.github/workflows/package-push.yaml +++ b/.github/workflows/package-push.yaml @@ -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) diff --git a/.github/workflows/repo-push.yaml b/.github/workflows/repo-push.yaml index 107edfd..e8f46f2 100644 --- a/.github/workflows/repo-push.yaml +++ b/.github/workflows/repo-push.yaml @@ -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 diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml index 33f615d..898f7cd 100644 --- a/docker-compose.dev.yaml +++ b/docker-compose.dev.yaml @@ -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: diff --git a/docs/configuration.md b/docs/configuration.md index 163cd08..909bd16 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -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. diff --git a/license b/license index fd203f8..b86a213 100644 --- a/license +++ b/license @@ -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 diff --git a/readme.md b/readme.md index 7724fdb..1d30c73 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,5 @@

- + engineer-man piston @@ -12,14 +12,14 @@

- - + GitHub last commit - - + GitHub issues - - + GitHub pull requests

@@ -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