Spaces:
Running
Running
Upload 83 files
#1
by angvine - opened
- Dockerfile +52 -52
- README.md +0 -1
- requirements-test.txt +1 -1
- requirements.txt +1 -1
Dockerfile
CHANGED
|
@@ -1,52 +1,52 @@
|
|
| 1 |
-
# Use an official Python runtime as a parent image
|
| 2 |
-
FROM python:3.11-slim
|
| 3 |
-
|
| 4 |
-
# Set environment variables for Python
|
| 5 |
-
ENV PYTHONDONTWRITEBYTECODE 1
|
| 6 |
-
ENV PYTHONUNBUFFERED 1
|
| 7 |
-
|
| 8 |
-
# Set the working directory in the container
|
| 9 |
-
WORKDIR /app
|
| 10 |
-
|
| 11 |
-
# Install system dependencies that might be needed by Python packages
|
| 12 |
-
# Example: build-essential for some packages, libpq-dev for psycopg2 from source (though -binary avoids this)
|
| 13 |
-
# For psycopg2-binary, typically no extra system deps are needed for common platforms if using a compatible wheel.
|
| 14 |
-
# RUN apt-get update && apt-get install -y --no-install-recommends build-essential libpq-dev && rm -rf /var/lib/apt/lists/*
|
| 15 |
-
|
| 16 |
-
# Copy the requirements file into the container
|
| 17 |
-
COPY requirements.txt .
|
| 18 |
-
|
| 19 |
-
# Install Python dependencies
|
| 20 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 21 |
-
|
| 22 |
-
# Copy the application source code into the container
|
| 23 |
-
# This structure assumes your main application code is within the 'tensorus' directory.
|
| 24 |
-
COPY ./tensorus ./tensorus
|
| 25 |
-
# If your app.py or main.py is at the root alongside Dockerfile, you'd copy it too:
|
| 26 |
-
# COPY app.py . # Or specific main file if it's at the root.
|
| 27 |
-
# Based on `CMD ["uvicorn", "tensorus.api.main:app"...]`, main:app is in tensorus/api/main.py.
|
| 28 |
-
|
| 29 |
-
# Set default environment variables for the application
|
| 30 |
-
# These can be overridden when running the container (e.g., via docker run -e or docker-compose.yml)
|
| 31 |
-
ENV TENSORUS_STORAGE_BACKEND="in_memory"
|
| 32 |
-
ENV TENSORUS_POSTGRES_HOST="db"
|
| 33 |
-
ENV TENSORUS_POSTGRES_PORT="5432"
|
| 34 |
-
ENV TENSORUS_POSTGRES_USER="tensorus_user_dockerfile"
|
| 35 |
-
ENV TENSORUS_POSTGRES_PASSWORD="tensorus_pass_dockerfile"
|
| 36 |
-
ENV TENSORUS_POSTGRES_DB="tensorus_db_dockerfile"
|
| 37 |
-
ENV TENSORUS_POSTGRES_DSN=""
|
| 38 |
-
ENV TENSORUS_API_KEY_HEADER_NAME="X-API-KEY"
|
| 39 |
-
ENV TENSORUS_VALID_API_KEYS=""
|
| 40 |
-
ENV TENSORUS_AUTH_JWT_ENABLED="False"
|
| 41 |
-
ENV TENSORUS_AUTH_JWT_ISSUER=""
|
| 42 |
-
ENV TENSORUS_AUTH_JWT_AUDIENCE=""
|
| 43 |
-
ENV TENSORUS_AUTH_JWT_ALGORITHM="RS256"
|
| 44 |
-
ENV TENSORUS_AUTH_JWT_JWKS_URI=""
|
| 45 |
-
ENV TENSORUS_AUTH_DEV_MODE_ALLOW_DUMMY_JWT="False"
|
| 46 |
-
|
| 47 |
-
# Expose the port the app runs on
|
| 48 |
-
EXPOSE 7860
|
| 49 |
-
|
| 50 |
-
# Define the command to run the application
|
| 51 |
-
# This assumes your FastAPI app instance is named 'app' in 'tensorus.api.main'
|
| 52 |
-
CMD ["uvicorn", "tensorus.api.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
# Use an official Python runtime as a parent image
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# Set environment variables for Python
|
| 5 |
+
ENV PYTHONDONTWRITEBYTECODE 1
|
| 6 |
+
ENV PYTHONUNBUFFERED 1
|
| 7 |
+
|
| 8 |
+
# Set the working directory in the container
|
| 9 |
+
WORKDIR /app
|
| 10 |
+
|
| 11 |
+
# Install system dependencies that might be needed by Python packages
|
| 12 |
+
# Example: build-essential for some packages, libpq-dev for psycopg2 from source (though -binary avoids this)
|
| 13 |
+
# For psycopg2-binary, typically no extra system deps are needed for common platforms if using a compatible wheel.
|
| 14 |
+
# RUN apt-get update && apt-get install -y --no-install-recommends build-essential libpq-dev && rm -rf /var/lib/apt/lists/*
|
| 15 |
+
|
| 16 |
+
# Copy the requirements file into the container
|
| 17 |
+
COPY requirements.txt .
|
| 18 |
+
|
| 19 |
+
# Install Python dependencies
|
| 20 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 21 |
+
|
| 22 |
+
# Copy the application source code into the container
|
| 23 |
+
# This structure assumes your main application code is within the 'tensorus' directory.
|
| 24 |
+
COPY ./tensorus ./tensorus
|
| 25 |
+
# If your app.py or main.py is at the root alongside Dockerfile, you'd copy it too:
|
| 26 |
+
# COPY app.py . # Or specific main file if it's at the root.
|
| 27 |
+
# Based on `CMD ["uvicorn", "tensorus.api.main:app"...]`, main:app is in tensorus/api/main.py.
|
| 28 |
+
|
| 29 |
+
# Set default environment variables for the application
|
| 30 |
+
# These can be overridden when running the container (e.g., via docker run -e or docker-compose.yml)
|
| 31 |
+
ENV TENSORUS_STORAGE_BACKEND="in_memory"
|
| 32 |
+
ENV TENSORUS_POSTGRES_HOST="db" # Default for docker-compose setup
|
| 33 |
+
ENV TENSORUS_POSTGRES_PORT="5432"
|
| 34 |
+
ENV TENSORUS_POSTGRES_USER="tensorus_user_dockerfile"
|
| 35 |
+
ENV TENSORUS_POSTGRES_PASSWORD="tensorus_pass_dockerfile"
|
| 36 |
+
ENV TENSORUS_POSTGRES_DB="tensorus_db_dockerfile"
|
| 37 |
+
ENV TENSORUS_POSTGRES_DSN=""
|
| 38 |
+
ENV TENSORUS_API_KEY_HEADER_NAME="X-API-KEY"
|
| 39 |
+
ENV TENSORUS_VALID_API_KEYS="" # Example: "key1,key2" - Must be set at runtime for security
|
| 40 |
+
ENV TENSORUS_AUTH_JWT_ENABLED="False" # Default JWT auth to disabled
|
| 41 |
+
ENV TENSORUS_AUTH_JWT_ISSUER=""
|
| 42 |
+
ENV TENSORUS_AUTH_JWT_AUDIENCE=""
|
| 43 |
+
ENV TENSORUS_AUTH_JWT_ALGORITHM="RS256"
|
| 44 |
+
ENV TENSORUS_AUTH_JWT_JWKS_URI=""
|
| 45 |
+
ENV TENSORUS_AUTH_DEV_MODE_ALLOW_DUMMY_JWT="False"
|
| 46 |
+
|
| 47 |
+
# Expose the port the app runs on
|
| 48 |
+
EXPOSE 7860
|
| 49 |
+
|
| 50 |
+
# Define the command to run the application
|
| 51 |
+
# This assumes your FastAPI app instance is named 'app' in 'tensorus.api.main'
|
| 52 |
+
CMD ["uvicorn", "tensorus.api.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
README.md
CHANGED
|
@@ -356,7 +356,6 @@ Tensorus includes a detailed metadata subsystem for describing tensors beyond th
|
|
| 356 |
|
| 357 |
### Streamlit UI
|
| 358 |
|
| 359 |
-
### Streamlit UI
|
| 360 |
|
| 361 |
The Streamlit UI provides a user-friendly interface for:
|
| 362 |
|
|
|
|
| 356 |
|
| 357 |
### Streamlit UI
|
| 358 |
|
|
|
|
| 359 |
|
| 360 |
The Streamlit UI provides a user-friendly interface for:
|
| 361 |
|
requirements-test.txt
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
|
| 4 |
pytest
|
| 5 |
pytest-asyncio
|
| 6 |
-
httpx=
|
| 7 |
scipy
|
| 8 |
semopy>=2.3
|
| 9 |
pydantic-settings>=2.0
|
|
|
|
| 3 |
|
| 4 |
pytest
|
| 5 |
pytest-asyncio
|
| 6 |
+
httpx>=0.28.1
|
| 7 |
scipy
|
| 8 |
semopy>=2.3
|
| 9 |
pydantic-settings>=2.0
|
requirements.txt
CHANGED
|
@@ -37,7 +37,7 @@ plotly>=5.10.0
|
|
| 37 |
|
| 38 |
# --- Testing Dependencies ---
|
| 39 |
pytest>=7.0.0
|
| 40 |
-
httpx>=0.
|
| 41 |
|
| 42 |
# --- Data Analysis & Modeling ---
|
| 43 |
# Optional: For plotting example in rl_agent.py
|
|
|
|
| 37 |
|
| 38 |
# --- Testing Dependencies ---
|
| 39 |
pytest>=7.0.0
|
| 40 |
+
httpx>=0.28.1 # For FastAPI TestClient
|
| 41 |
|
| 42 |
# --- Data Analysis & Modeling ---
|
| 43 |
# Optional: For plotting example in rl_agent.py
|