A simple queue implementation using GitHub issues as the backend storage mechanism.
Octoqueue provides a queue interface backed by GitHub issues. It allows you to:
- Enqueue jobs as GitHub issues with data stored in JSON
- Dequeue and process jobs by managing issue labels
- Track job status (queued, processing, completed, failed)
- Add comments and metadata to jobs
- Requeue failed jobs
You get the web interface
Octoqueue is appropriate when you need:
- A simple, persistent job queue with a nice GUI interface (you can GitHub's issue management on the web/app).
- Queue visibility and job history through GitHub's UI
- The ability to manually inspect, modify and restart queued jobs
- Integration with GitHub-based workflows
- No additional infrastructure beyond GitHub
Octoqueue is not suitable when you need:
- Production-grade workflows
- High-performance job processing (GitHub API has rate limits)
- Real-time job processing (usually, it takes 1-3 seconds to create an issue)
- Complex queue operations like priorities or dependencies
- Processing of sensitive data (issues are visible in a GitHub repo, even if the repo is private, it could be exposed by making it public)
To install octoqueue
from GitHub repository:
git clone [email protected]:ping13/octoqueue.git
cd octoqueue
python -m pip install .
or if you use uv
in your project:
uv add "octoqueue @ git+https://github.com/ping13/octoqueue"
from octoqueue import GithubQueue
# Initialize queue with your repo details
queue = GithubQueue(
owner="username",
repo="myrepo",
token="github_pat_token"
)
# Enqueue a job
job_id = queue.enqueue({"data": "example"})
# Dequeue and process jobs
job = queue.dequeue()
if job:
job_id, data = job
try:
# Process the job
process_data(data)
queue.complete(job_id)
except Exception as e:
queue.fail(job_id, str(e))
OctoQueue provides a command-line interface for running the API server:
# Basic usage
octoqueue serve
# With options
octoqueue serve --host 127.0.0.1 --port 5000 --repo owner/repo --reload
--host
: Host to bind the server to (default: 0.0.0.0)--port
: Port to bind the server to (default: 8080)--repo
: GitHub repository in the format 'owner/repo'--allowed-origin
: Allowed origin for CORS--api-key
: API key for authentication--log-level
: Logging level (default: info)--reload
: Enable auto-reload for development
The OctoQueue API provides a simple interface to create jobs in the GitHub-based queue.
Creates a new job in the queue.
Headers:
Content-Type: application/json
(required)X-API-Key: your_api_key
(required if API key is configured)
Request Body:
{
"data": {
"your_key": "your_value",
"another_key": 123
},
"title": "Optional job title",
"additional_labels": ["optional", "labels"]
}
Response:
{
"job_id": 123,
"status": "pending"
}
Sets a JSON schema for validating job data. All subsequent job creation requests will be validated against this schema, you need to have an API key to
Headers:
Content-Type: application/json
(required)X-API-Key: your_api_key
(required)
Request Body:
{
"schema": {
"type": "object",
"properties": {
"your_key": { "type": "string" },
"another_key": { "type": "number" }
},
"required": ["your_key"]
}
}
Response:
{
"status": "success",
"message": "Schema updated successfully"
}
Retrieves the current JSON schema used for job validation.
Headers:
X-API-Key: your_api_key
(required)
Response:
{
"schema": {
"type": "object",
"properties": {
"your_key": { "type": "string" },
"another_key": { "type": "number" }
},
"required": ["your_key"]
}
}
Health check endpoint.
Response:
{
"status": "healthy",
"timestamp": 1621234567.89
}
- Set up environment variables (see
.env.example
) - Run the deployment script:
./deploy.sh
-
Copy
.env.example
to.env
and fill in the values -
Run the server with auto-reload enabled:
octoqueue serve --reload
Alternatively, you can use uvicorn directly:
uvicorn octoqueue.api:app --reload
Not ready yet.