-
Notifications
You must be signed in to change notification settings - Fork 31
Codabench Installation
Installing Codabench should be relatively easy since you no longer have to worry about special ways to setup SSL or storage. We include default solutions that should handle that for most basic uses.
Either:
a) Install docker via the install script: https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-using-the-convenience-script
b) Install manually following the steps at: https://docs.docker.com/install/
https://docs.docker.com/compose/install/
Download the Codabench repository:
git clone https://github.com/codalab/codabench
The .env
file contains the settings of your instance.
At first you don't have the .env
file. To create it, copy the .env_sample
as following:
cd codabench
cp .env_sample .env
Then edit the necessary settings inside. The most important are the database, storage, and Caddy/SSL settings. For a quick local setup, you should not need to edit this file.
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/
If needed, some troubleshooting of this step is provided at the end of this page or in this page.
Create the required tables in the database:
docker-compose exec django ./manage.py migrate
Generate the required static resource files:
docker-compose exec django ./manage.py collectstatic --noinput
To deploy the platform, run:
docker-compose up -d
You should be able to verify it is running correctly by looking at the logs with docker-compose logs -f
and by visting localhost:80
(Depending on your configuration).
To run automated tests for your local instance, get inside the Django constainer 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 .env simply set
DOMAIN_NAME
to your DNS. Remove any port designation like:80
. This will have Caddy serve both HTTP and HTTPS.
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.com
bylocalhost
on the URL and open it on the browser.
Another way is to go inside the Django containers and use commands like in administrator 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 first of these:
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:9000
in your.env
file.
In docker-compose.yml
, replace in the compute_worker
service:
command: bash -c "watchmedo auto-restart -p '*.py' --recursive -- celery -A compute_worker worker -l info -Q compute-worker -n compute-worker@%n"
by
command: bash -c "celery -A compute_worker worker -l info -Q compute-worker -n compute-worker@%n"
By default v2 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/
For setting up remote compute workers, please see this link to the wiki article on setting up compute workers: Compute Worker Management
Read the following guide for troubleshooting: How to deploy Codabench.