Skip to content

Latest commit

 

History

History
78 lines (49 loc) · 2.07 KB

challenge_submission_guide.md

File metadata and controls

78 lines (49 loc) · 2.07 KB

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:
    {
        "status": "ok"
    }

2. /solve Route

  • Method: POST
  • Input: Receives a MinerInput object. This object represents the challenge sent by the validator.
  • Output: Returns a MinerOutput object. This object contains your response to the challenge.

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:

fastapi
uvicorn
transformers
accelerate

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.9-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"]

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.