codalab / codabench

Codabench is a flexible, easy-to-use and reproducible benchmarking platform. Check our paper at Patterns Cell Press https://hubs.li/Q01fwRWB0
Apache License 2.0
76 stars 28 forks source link

Autorun collectstatic when django container starts #1522

Closed ihsaan-ullah closed 4 months ago

ihsaan-ullah commented 4 months ago

@ mention of reviewers

@Didayolo

A brief description of the purpose of the changes contained in this PR.

django container command updated to run collectstatic when it starts. Added caddy_data and caddy_config to gitignore

Issues this PR resolves

A checklist for hand testing

Checklist

Didayolo commented 4 months ago

@ihsaan-ullah

It seems that running the collect static command stills copy files after starting the service:

% docker compose up -d                                          
WARN[0000] The "RABBITMQ_HTTP_PROXY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "RABBITMQ_HTTPS_PROXY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "RABBITMQ_NO_PROXY" variable is not set. Defaulting to a blank string. 
[+] Running 12/12
 ⠿ Network codabench_default             Created                                                                                                                                                       0.0s
 ⠿ Container codabench-rabbit-1          Started                                                                                                                                                       3.1s
 ⠿ Container codabench-redis-1           Started                                                                                                                                                       0.7s
 ⠿ Container codabench-minio-1           Healthy                                                                                                                                                       8.6s
 ⠿ Container codabench-builder-1         Started                                                                                                                                                       3.2s
 ⠿ Container codabench-db-1              Started                                                                                                                                                       3.1s
 ⠿ Container codabench-flower-1          Started                                                                                                                                                       4.1s
 ⠿ Container codabench-createbuckets-1   Started                                                                                                                                                       9.3s
 ⠿ Container codabench-django-1          Started                                                                                                                                                       4.1s
 ⠿ Container codabench-site_worker-1     Started                                                                                                                                                       3.6s
 ⠿ Container codabench-compute_worker-1  Started                                                                                                                                                       5.1s
 ⠿ Container codabench-caddy-1           Started                                                                                                                                                       5.2s

% docker compose exec django ./manage.py collectstatic --noinput
WARN[0000] The "RABBITMQ_HTTP_PROXY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "RABBITMQ_HTTPS_PROXY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "RABBITMQ_NO_PROXY" variable is not set. Defaulting to a blank string. 

2 static files copied to '/app/src/staticfiles', 303 unmodified.

Maybe it is a question of timing.

ihsaan-ullah commented 4 months ago
2 static files copied to '/app/src/staticfiles', 303 unmodified.

If you remove the command from docker-compose.yaml. Do you still see 2 static files copied or 305 files copied when you run it manually?

Before checking this make sure to delete staticfiles folder

ihsaan-ullah commented 4 months ago

@Didayolo I have checked this and the number of collected files is the same before and after running collectstatic. It still shows 2 files modified but no new file is added.

Do we want to check which files are changed?