# Deployment Guide for OmniSealBench This guide provides detailed instructions for deploying OmniSealBench to different environments. ## 1. HuggingFace Spaces Deployment ### Prerequisites - A HuggingFace account - Git installed on your local machine ### Steps 1. **Prepare your application for deployment** ```bash ./prepare_deploy.sh ``` This script will: - Set the environment to production - Test the frontend build - Validate the Docker configuration 2. **Create a new Space on HuggingFace** - Go to https://huggingface.co/spaces - Click "Create new Space" - Set a name for your Space (e.g., "omnisealbench") - Select "Docker" as the SDK - Set the hardware tier according to your needs (CPU recommended) - Click "Create Space" 3. **Clone the HuggingFace repository** ```bash git clone https://huggingface.co/spaces/YOUR_USERNAME/omnisealbench cd omnisealbench ``` 4. **Copy your project files to the HuggingFace repository** ```bash # From your project directory cp -R * /path/to/huggingface/repo/ ``` 5. **Commit and push to HuggingFace** ```bash cd /path/to/huggingface/repo git add . git commit -m "Initial deployment of OmniSealBench" git push ``` 6. **Monitor the deployment** - Go to your Space on HuggingFace - Click on the "Settings" tab - Check the "Container logs" to see the build and deployment progress ## 2. Manual Docker Deployment ### Prerequisites - Docker installed on the host machine ### Steps 1. **Build the Docker image** ```bash docker build -t omnisealbench:latest . ``` 2. **Run the container** ```bash docker run -d --name omnisealbench -p 5000:5000 omnisealbench:latest ``` 3. **Access the application** - Open a web browser and navigate to http://localhost:5000 - If deploying on a remote server, replace "localhost" with the server's IP or domain 4. **Monitor the application** ```bash # View logs docker logs -f omnisealbench # Check container status docker ps -a | grep omnisealbench ``` ## 3. Cloud Deployment Options ### AWS Elastic Container Service (ECS) 1. **Push your Docker image to Amazon ECR** ```bash # Authenticate Docker to your ECR registry aws ecr get-login-password --region your-region | docker login --username AWS --password-stdin your-account-id.dkr.ecr.your-region.amazonaws.com # Create a repository aws ecr create-repository --repository-name omnisealbench # Tag your image docker tag omnisealbench:latest your-account-id.dkr.ecr.your-region.amazonaws.com/omnisealbench:latest # Push the image docker push your-account-id.dkr.ecr.your-region.amazonaws.com/omnisealbench:latest ``` 2. **Create an ECS cluster and service** using the AWS Management Console or AWS CLI ### Google Cloud Run 1. **Push your Docker image to Google Container Registry** ```bash # Tag your image for GCR docker tag omnisealbench:latest gcr.io/your-project-id/omnisealbench:latest # Push the image docker push gcr.io/your-project-id/omnisealbench:latest ``` 2. **Deploy to Cloud Run** using the Google Cloud Console or gcloud CLI ```bash gcloud run deploy omnisealbench --image gcr.io/your-project-id/omnisealbench:latest --platform managed ``` ### Azure Container Instances 1. **Push your Docker image to Azure Container Registry** ```bash # Log in to Azure az login # Create a resource group if needed az group create --name myResourceGroup --location eastus # Create a container registry az acr create --resource-group myResourceGroup --name myacr --sku Basic # Log in to the registry az acr login --name myacr # Tag your image docker tag omnisealbench:latest myacr.azurecr.io/omnisealbench:latest # Push the image docker push myacr.azurecr.io/omnisealbench:latest ``` 2. **Deploy to Azure Container Instances** using the Azure Portal or Azure CLI ## Troubleshooting ### Common Issues 1. **Container fails to start** - Check logs: `docker logs omnisealbench` - Verify port mappings: `docker port omnisealbench` - Check if the healthcheck is passing: `docker inspect --format='{{.State.Health.Status}}' omnisealbench` 2. **Application is not accessible** - Check if the container is running: `docker ps | grep omnisealbench` - Verify the host's firewall settings to ensure port 5000 is open - Try accessing the application from inside the container: `docker exec -it omnisealbench curl localhost:5000` 3. **Data or examples not showing up** - Verify the data and examples directories were properly copied into the container - Check file permissions: `docker exec -it omnisealbench ls -la /app/data /app/examples` For more help, please open an issue on the GitHub repository.