This guide explains how to quickly and easily install Codabench, typically for local development and test. Details about online deployment are given in How to deploy Codabench on your server page.
Download the Codabench repository:
git clone https://github.com/codalab/codabenchThe .env file contains the settings of your instance.
On a fresh installation, you will need to use the following command to get your .env file:
cd codabench
cp .env_sample .env
cp my-postgres_sample.conf my-postgres.confThen edit the necessary settings inside. The most important are the database, storage, and Caddy/SSL settings in the .env. For a quick local setup, you should not need to edit these files. For a public server deployment, you will have to modify some settings.
!!! warning "It is important to change the default passwords if you intend for the instance to be public."
If you are using AWS_S3_ENDPOINT_URL=http://minio:9000/ in your .env, edit your /etc/hosts file by adding this line 127.0.0.1 minio.
In .env, replace:
AWS_S3_ENDPOINT_URL=http://minio:9000/by
AWS_S3_ENDPOINT_URL=http://docker.for.mac.localhost:9000/
WORKER_BUNDLE_URL_REWRITE=http://docker.for.mac.localhost:9000|http://minio:9000!!! note "If needed, some troubleshooting of this step is provided at the end of this page or in this page"
To deploy the platform, run:
docker compose up -dCreate the required tables in the database:
docker compose exec django ./manage.py migrateGenerate the required static resource files:
docker compose exec django ./manage.py collectstatic --noinputYou should be able to verify it is running correctly by looking at the logs with docker compose logs -f and by visiting localhost:80 (Depending on your configuration).
To run automated tests for your local instance, get inside the Django container with docker compose exec django bash then run py.test to start the automated tests.
To enable SSL:
- If you already have a DNS for your server that is appropriate, in the
.envsimply setDOMAIN_NAMEto your DNS. Remove any port designation like:80. This will have Caddy serve both HTTP and HTTPS.
!!! warning "For a public instance, HTTPS is strongly recomended"
When deploying a local instance, the email server is not configured by default, so you won't receive the confirmation email during signup.
To manually confirm your account:
- Find the confirmation link in the Django logs using
docker compose logs -f django - Replace
example.combylocalhoston the URL and open it in your browser.
Another way is to go inside the Django containers and use commands like in administrative procedures.
You may have to manually change the endpoint URL to have your local instance working. This may be an OS related issue. Here is a possible fix:
docker compose logs -f minio- Grab the first one of these IP addresses:
minio_1 | Browser Access:
minio_1 | http://172.27.0.5:9000 http://127.0.0.1:9000- Set
AWS_S3_ENDPOINT_URL=http://172.27.0.5:9000in your.envfile.
If static files are not loaded correctly, adding DEBUG=True to the .env file can help.
Add a compose.override.yml file with the following content:
services:
django:
platform: linux/arm64
site_worker:
platform: linux/arm64
command: ["celery -A celery_config worker -B -Q site-worker -l info -n site-worker@%n --concurrency=2"]
compute_worker:
platform: linux/arm64By default, Codabench uses a built-in MinIO container. Some users may want a different solution, such as S3 or Azure. The configuration will vary slightly for each different type of storage.
For all possible supported storage solutions, see: https://django-storages.readthedocs.io/en/latest/
To set up remote compute workers, you can follow the steps described in our Compute Worker Management page.
Read the following guide for troubleshooting: How to deploy Codabench.
Also, adding DEBUG=True to the .env file can help with troubleshooting the deployment.
Open a Github issue to find help with your installation
For information about online deployment of Codabench, go to the following page