Skip to content

Commit 83cdd2b

Browse files
authored
Merge pull request #1979 from codalab/wikiUpdate
Added the recent changes from the wiki into the new wiki
2 parents df2eb18 + f109801 commit 83cdd2b

3 files changed

Lines changed: 88 additions & 27 deletions

File tree

documentation/docs/Developers_and_Administrators/Codabench-Installation.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ cd codabench
2323
cp .env_sample .env
2424
```
2525

26-
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.
26+
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. For a [public server deployment](How-to-deploy-Codabench-on-your-server.md), you will have to modify some settings.
27+
28+
!!! warning "It is important to change the default passwords if you intend for the instance to be public"
2729

2830
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`
2931

@@ -79,6 +81,8 @@ To enable SSL:
7981

8082
- 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.
8183

84+
!!! warning "For a public instance, HTTPS is strongly recomended"
85+
8286
### Validate user account on local instance
8387

8488
When deploying a local instance, the email server is not configured by default, so you won't receive the confirmation email during signup.
@@ -135,6 +139,12 @@ To set up remote compute workers, you can follow the steps described in our
135139
136140
## Troubleshooting
137141
138-
Read the following guide for troubleshooting: [How to deploy Codabench](How-to-deploy-Codabench-on-your-server.md).
142+
Read the following guide for troubleshooting: [How to deploy Codabench](How-to-deploy-Codabench-on-your-server.md#frequently-asked-questions-faqs).
143+
144+
Also, adding `DEBUG=True` to the `.env` file can help with troubleshooting the deployment.
145+
146+
Open a [Github issue](https://github.com/codalab/codabench/issues) to find help with your installation
147+
148+
## Online Deployement
139149

140-
Also, adding `DEBUG=True` to the `.env` file can help with troubleshooting the deployment.
150+
For information about online deployment of Codabench, go to the [following page](How-to-deploy-Codabench-on-your-server.md)

documentation/docs/Developers_and_Administrators/How-to-deploy-Codabench-on-your-server.md

Lines changed: 75 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,35 @@
11
## Overview
22
This document focuses on how to deploy the current project to the local machine or server you are on.
33

4-
## Pull codabench develop branch code locally
4+
## Preliminary steps
55

6-
You need to complete the following steps
6+
As for the [minimal local installation](Codabench-Installation.md), you first need to:
77

8-
- Generate ssh keys on your machine.
9-
- Add the ssh key into the Github account.
10-
- Cloning the repository locally.
11-
- git clone [https://github.com/codalab/codabench.git](https://github.com/codalab/codabench.git)
8+
1. Install docker and docker-compose (see [instructions](Codabench-Installation.md#pre-requisites))
129

13-
## Installing docker and common docker commands
10+
2. Clone Codabench repository:
11+
12+
```sh
13+
git clone https://github.com/codalab/codabench
14+
```
1415

15-
- Install the [official](https://docs.docker.com/engine/install/ubuntu/) version of docker (preferably not the `snap` version)
1616

1717
## Modify .env file configuration
1818

19-
- Go to the folder where codabench is located then run the following command to generate an `.env` file to set the environment variables required by the service
19+
Then you need to modify the `.env` file with the relevant settings. This step is critical to have a working and secure deployment.
20+
21+
- Go to the folder where codabench is located (`cd codabench`)
2022
```bash
2123
cp .env_sample .env
2224
```
2325

2426

25-
In the `.env` file, edit the following variables.
27+
Then edit the variables inside the `.env` file.
2628

27-
a) For a local deployment it looks like this:
29+
### Submissions endpoint
30+
For an online deployment, you'll need to fill in the IP address or domain name in some environment variables.
2831

29-
```ini title=".env"
30-
SUBMISSIONS_API_URL=localhost
31-
#SUBMISSIONS_API_URL=http://django:8000/api
32-
DOMAIN_NAME=localhost:80
33-
AWS_S3_ENDPOINT_URL=http://minio:9000
34-
```
32+
#### Using an IP address
3533

3634
b) For an online deployment using IP address:
3735
!!! note
@@ -51,16 +49,41 @@ DOMAIN_NAME=<IP ADDRESS>:80
5149
AWS_S3_ENDPOINT_URL=http://<IP ADDRESS>/
5250
```
5351

54-
c) For an online deployment using domain name:
52+
#### Using a domain name (DNS)
5553

5654
```ini title=".env"
57-
SUBMISSIONS_API_URL=https://codabench-test.yourdomain.com/api
58-
DOMAIN_NAME=codabench-test.yourdomain.com
59-
AWS_S3_ENDPOINT_URL=https://minio-test.yourdomain.com
55+
SUBMISSIONS_API_URL=https://yourdomain.com/api
56+
DOMAIN_NAME=yourdomain.com
57+
AWS_S3_ENDPOINT_URL=https://yourdomain.com
6058
```
6159

6260
!!! tip "If you are deploying on an azure machine, then AWS_S3_ENDPOINT_URL needs to be set to an IP address that is accessible on the external network"
6361

62+
63+
### Change default usernames and passwords
64+
65+
Set up new usernames and passwords:
66+
67+
```
68+
DB_USERNAME=postgres
69+
DB_PASSWORD=postgres
70+
[...]
71+
RABBITMQ_DEFAULT_USER=rabbit-username
72+
RABBITMQ_DEFAULT_PASS=rabbit-password-you-should-change
73+
[...]
74+
FLOWER_BASIC_AUTH=root:password-you-should-change
75+
[...]
76+
#EMAIL_HOST_USER=user
77+
#EMAIL_HOST_PASSWORD=pass
78+
[...]
79+
MINIO_ACCESS_KEY=testkey
80+
MINIO_SECRET_KEY=testsecret
81+
# or
82+
AWS_ACCESS_KEY_ID=testkey
83+
AWS_SECRET_ACCESS_KEY=testsecret
84+
```
85+
!!! warning "It is very important to set up an SSL certificate for Public deployement"
86+
6487
## Open Access Permissions for following port number
6588

6689
If you are deploying on a Linux server, which usually has a firewall, you need to open access permissions to the following port numbers
@@ -79,9 +102,37 @@ If you are deploying on a Linux server, which usually has a firewall, you need t
79102
- `DEBUG = os.environ.get("DEBUG", True)`
80103
!!! note "If DEBUG is not set to true, then you will not be able to load to the static resource file"
81104
- Comment out the following code
82-
83-
![image](../_attachments/112937133-b59cc880-9159-11eb-8bc8-06a11e63b293_17528513110527873.png)
84-
105+
```py
106+
# =============================================================================
107+
# Debug
108+
# =============================================================================
109+
#if DEBUG:
110+
# INSTALLED_APPS += ('debug_toolbar',)
111+
# MIDDLEWARE = ('debug_toolbar.middleware.DebugToolbarMiddleware',
112+
# 'querycount.middleware.QueryCountMiddleware',
113+
# ) + MIDDLEWARE # we want Debug Middleware at the top
114+
# # tricks to have debug toolbar when developing with docker
115+
#
116+
# INTERNAL_IPS = ['127.0.0.1']
117+
#
118+
# import socket
119+
#
120+
# try:
121+
# INTERNAL_IPS.append(socket.gethostbyname(socket.gethostname())[:-1])
122+
# except socket.gaierror:
123+
# pass
124+
#
125+
# QUERYCOUNT = {
126+
# 'IGNORE_REQUEST_PATTERNS': [
127+
# r'^/admin/',
128+
# r'^/static/',
129+
# ]
130+
# }
131+
#
132+
# DEBUG_TOOLBAR_CONFIG = {
133+
# "SHOW_TOOLBAR_CALLBACK": lambda request: True
134+
# }
135+
```
85136
## Start service
86137

87138
- Execute command `docker compose up -d`

0 commit comments

Comments
 (0)