Nimble Programming Hackathon
- Ubuntu 22.04+
- Python 3.10+
- numpy
- openCV
- aiortc
- Extract the compressed file. The structure should look like this:
├─ client
│ ├── client.py
│ ├── test_client.py
├─ server
│ ├── server.py
│ ├── test_server.py <br
├─ requirements.txt
├─ requirements.test.txt
├─ Dockerfile.client
├─ Dockerfile.server
├─ docker-compose.yml
├─ server-deployment.yaml
├─ client-deployment.yaml
├─ ballaction.mov
├─ README.md
- Navigate to the project directory and install the required dependencies.
pip install -r requirements.txt
It is a better practice to install OpenCV from source to run GUI applications. Link here
-
To run the application, start the server using
cd server; python3 server.py
. This will start the server on localhost and default port 8080. Next start the client ->cd client; python3 client.py
. The client will attempt to connect to the server using TCP connection and will start receiving the images of a bouncing ball across the screen. -
To run the unit tests, there are additional dependencies that need to be installed using
pip install -r requirements.tests.txt
. The tests can be then be run on command line usingpytest -vv
from the root directory.
- Docker - Build the images for client and server using
docker build -t myserver:latest -f Dockerfile.server .
docker build -t myclient:latest -f Dockerfile.client .
Once the Docker image is built, run it in a container using the following commands:
docker run --name myserver-container --network host myserver:latest
docker run --name myclient-container --network host myclient:latest
- Kubernetes - Make sure you have a Kubernetes cluster set up and the kubectl command-line tool installed and configured to access your cluster. Deploy the Kubernetes resources by running the following commands:
minikube start
kubectl apply -f server-deployment.yaml
kubectl apply -f client-deployment.yaml
Verify that the resources have been created successfully by running the following command:
kubectl get deployments