Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
morganekmefjord authored Dec 12, 2024
2 parents d435ffe + 4b18f24 commit a8e24c0
Show file tree
Hide file tree
Showing 55 changed files with 199 additions and 60,344 deletions.
37 changes: 37 additions & 0 deletions docker-compose-single.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: '3.8'

services:
p2p:
container_name: ptp
image: ghcr.io/pharmbio/ptp:latest
build:
context: ./ptp/
dockerfile: Dockerfile
#command: sh -c /app/run.sh
#command: >
# sh -c "python manage.py migrate &&
# python manage.py collectstatic --noinput &&
# python manage.py runserver 0.0.0.0:8000"

#gunicorn p2p.wsgi:application --bind 0.0.0.0:8000"
volumes:
- ./ptp/:/app # Mount the current directory to the container for live development
ports:
- "8000:8000"
environment:
- MODEL_DIR=/app/tmp/models
- MAX_MODELS=5
- STAGE=True
#- DATABASE_URL=postgres://postgres:postgres@postgres:5432/postgres
#- REDIS_URL=redis://redis:6379/0
#- CELERY_BROKER_URL=redis://redis:6379/0
#- DEBUG=True
#- EMAIL_HOST=smtp.your-email-provider.com
#- EMAIL_PORT="587"
#- EMAIL_USE_TLS="True"
#- [email protected]
#- EMAIL_HOST_PASSWORD=your-email-password
- SITE_URL=http://localhost:8000

#volumes:
# postgres_data:
6 changes: 5 additions & 1 deletion ptp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ RUN mkdir /app
WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y gcc git-lfs python3-dev redis-server supervisor \
RUN apt-get update && apt-get install -y gcc git-lfs python3-dev redis-server supervisor nginx \
&& apt-get clean

# Install Java (OpenJDK)
RUN apt-get update && apt-get install -y openjdk-17-jre-headless \
&& apt-get clean

RUN mkdir -p /var/lib/nginx/body
RUN chown -R www-data:www-data /var/lib/nginx
# Set JAVA_HOME environment variable (optional)
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
ENV PATH=$JAVA_HOME/bin:$PATH
Expand Down Expand Up @@ -41,6 +43,8 @@ RUN useradd -u 1000 $USER
RUN chown -R $USER:$USER /etc/supervisor/conf.d/supervisord.conf
RUN chown -R $USER:$USER /app/
RUN chown -R $USER:$USER /var/log/supervisor/
RUN chown -R $USER:$USER /var/lib/nginx/
RUN chown -R $USER:$USER /var/log/nginx/
RUN chmod +x /app/start-script.sh
RUN chmod +x /app/start-django.sh

Expand Down
5 changes: 4 additions & 1 deletion ptp/inference/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ def run_inference(job_id):
"""

print("Concatenating results...", flush=True)
result_file_path = f"resultfilepath-{job_id}.csv"

BASE_DIR = os.environ.get("BASE_DIR", "/app/")
os.makedirs(f"{BASE_DIR}/interim", exist_ok=True)
result_file_path = f"{BASE_DIR}/interim/resultfilepath-{job_id}.csv"

try:
# Paths for input and output
Expand Down
Loading

0 comments on commit a8e24c0

Please sign in to comment.