eandualem / karaoke_client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

karaoke_client

Overview 🌐

The karaoke_client is designed to interact with the AIProcessingService of the Karaoke Scoring System, simulating real-time karaoke performance scoring. This client helps in testing the system by sending audio chunks and receiving scores.

Getting Started πŸš€

Prerequisites πŸ“‹

  • Docker installed on your machine.
  • Access to the AWS EC2 instance with the Karaoke Scoring System deployed.
  • .pem file for secure connection to the AWS EC2 instance.

Installation and Setup πŸ› οΈ

1. Clone the Repository:

git clone [repository-url](https://github.com/eandualem/karaoke_client)
cd karaoke_client

2. Certificate Setup:

  • Place your certificate.pem file in the root directory of karaoke_client.
  • Ensure the certificate file name matches the one specified in your .env file.

3. Building Protocol Files:

  1. Clean the Generated Folder (if necessary):

    Remove the existing Generated directory within the proto folder to ensure fresh generation of protocol files:

    rm -r ./proto/Generated
  2. Build the Docker Image for gRPC Generation:

    Build the grpc-builder image using the Dockerfile.grpcgen:

    docker build -t grpc-builder -f Dockerfile.grpcgen .
  3. Generate Protocol Files:

    Run a temporary container to generate the protocol files and copy them back to the host:

    docker run --name grpc-temp grpc-builder /bin/true
    docker cp grpc-temp:/app/Generated ./proto
    docker rm grpc-temp

4. Build the Docker Image for the Client:

docker build -t karaoke-client -f Dockerfile.client .

5. Configure Environment Variables:

Update the .env file with the appropriate values, especially the SERVER_ADDRESS.

Example .env content:

USER_LOCALE = "en"
AUTH_TOKEN = "token_placeholder"
CERT_FILE_PATH = "certificate.pem"
SERVER_ADDRESS = "ec2-16-171-36-141.eu-north-1.compute.amazonaws.com:50051"

Running the Client πŸ”¨

To run the client and connect it to the AIProcessingService:

docker run -it --rm --name karaoke-client karaoke-client

The client will start sending audio chunks and display the scoring results in real-time.

Folder Structure πŸ“‚

karaoke_client/
β”œβ”€β”€ Dockerfile.client
β”œβ”€β”€ Dockerfile.grpcgen
β”œβ”€β”€ README.md
β”œβ”€β”€ certificate.pem
β”œβ”€β”€ proto/
β”‚   β”œβ”€β”€ Declarations/
β”‚   β”œβ”€β”€ Generated/
β”‚   β”œβ”€β”€ generate.sh
β”‚   └── requirements_grpcgen.txt
β”œβ”€β”€ requirements.txt
└── src/
    β”œβ”€β”€ __init__.py
    β”œβ”€β”€ ai_processing_service_client.py
    β”œβ”€β”€ client.py
    β”œβ”€β”€ logger.py
    └── request_builder.py

About


Languages

Language:Python 90.9%Language:Shell 9.1%