Skip to content

Commit

Permalink
Dev ops fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkStarStrix committed Nov 15, 2024
1 parent c277667 commit 83a463e
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[flake8]
max-line-length = 88
extend-ignore = E203, W503
exclude = .git,__pycache__,build,dist,.venv
per-file-ignores =
# Ignore imported but unused in __init__.py files
__init__.py: F401
max-complexity = 10
22 changes: 22 additions & 0 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use slim base image
FROM python:3.9-slim

# Set working directory
WORKDIR /app

# Install only required system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*

# Copy only necessary files
COPY requirements.txt .

# Install minimal dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Expose port
EXPOSE 8000

# Run app
CMD ["uvicorn", "automl.app:app", "--host", "0.0.0.0", "--port", "8000"]
36 changes: 36 additions & 0 deletions .github/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: '3.9'

services:
api:
build: .
image: yourusername/automl-api:latest
ports:
- "8000:8000"
environment:
- JWT_SECRET_KEY=${JWT_SECRET_KEY}
- VALID_API_KEY=${VALID_API_KEY}
- REDIS_URL=redis://redis:6379/0
depends_on:
- redis
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3

redis:
image: redis:alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3

volumes:
redis_data:
18 changes: 18 additions & 0 deletions .github/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
torch==2.4.1
pytorch-lightning==2.4.0
transformers==4.45.2
numpy==1.24.4
pandas==2.0.3
matplotlib==3.7.1
fastapi==0.109.1
uvicorn==0.15.0
requests==2.31.0
setuptools>=70.0.0
scikit-learn==1.3.0
seaborn==0.11.2
pydantic==1.10.18
python-jose==3.3.0
python-dotenv==1.0.0
pytest==7.4.3
rich==13.9.0
click==8.1.7
1 change: 1 addition & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 83a463e

Please sign in to comment.