Submission Guide
Step 1: Create an app.py
Ensure your API server includes the following two routes:
1. /health Route
- Method:
GET -
Response: Return a JSON object with the following structure:
2. /solve Route
- Method:
POST - Input: Receives a
MinerInputobject. This object represents the challenge sent by the validator. - Output: Returns a
MinerOutputobject. This object contains your response to the challenge.
Data Types
Both MinerInput and MinerOutput are defined in:
readteam_core/challenge_pool/<challenge_name>/data_types.py
Step 2: Package Your Submission Using Docker
To package your submission using Docker, follow these steps:
1. Create a requirements.txt file
Make sure to include a requirements.txt file in the root directory with all necessary dependencies for your project. For example:
You can generate a requirements.txt file using pip freeze > requirements.txt if you have a virtual environment set up.
2. Create a Dockerfile
Create a Dockerfile in the root directory of your project to define the container image. Below is an example template for the Dockerfile:
# Use a base image
FROM python:3.10-slim
# Set the working directory in the container
WORKDIR /app
# Copy the requirements file into the container
COPY requirements.txt .
# Install the dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy all necessary files into the container
COPY . .
# Expose the port the app runs on (must be 10002)
EXPOSE 10002
# Run the app using the command (adjust accordingly if using Flask or FastAPI)
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "10002"]
Port Requirement
Your application must run on port 10002. This is a strict requirement for the validation process.
3. Build and Test Your Docker Image
After creating the Dockerfile and requirements.txt, you can build, tag your Docker image and push it to Docker Hub. Refer to the documentation for Docker.
You can view the tutorial for text detection submission here.