Skip to content

Commit e085b68

Browse files
committed
Add new docs
Changes to be committed: modified: README.md new file: docs/dockerDeployment.md new file: docs/faq.md new file: docs/localDeployment.md new file: docs/productionDeployment.md
1 parent 4ae1173 commit e085b68

File tree

5 files changed

+128
-120
lines changed

5 files changed

+128
-120
lines changed

README.md

Lines changed: 0 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -12,126 +12,6 @@ The service definitions are for deployment on a server exposed ot the internet.
1212
- [Docker deployment](docs/dockerDeployment.md) [WIP]
1313
- [FAQ and trouble shooting](docs/faq.md)
1414

15-
Clone the repository
16-
git clone https://github.com/biocompute-objects/bco_api
1715

18-
cd bco_api
19-
20-
Make sure you are on the desired branch (Check for latest branch):
21-
22-
git switch 22.05
23-
24-
Enter the repository, create a virtual environment, and install the required packages
25-
26-
pyenv local 3.10.6
27-
28-
python3 -m venv env
29-
30-
source env/bin/activate
31-
32-
python -m pip install -r requirements.txt
33-
34-
(You can use python3.9 if you’d like, but since you’re in the virtual environment you created python points to python3.9)
35-
36-
Modify the Config files:
37-
Check/Edit the server.conf file
38-
This is the main server configuration file for the BCO API. (most of these values will NOT need to be changed for local deployment)
39-
40-
vim bco_api/bco_api/server.conf
41-
42-
Production and publishing flags NOTE: Valid values are True or False (note the capitalization).
43-
44-
[PRODUCTION]
45-
production=False
46-
DB Version
47-
48-
[VERSION]
49-
version=22.01
50-
Is this a publish-only server?
51-
52-
[PUBLISHONLY]
53-
publishonly=False
54-
Security settings: Create a key for an anonymous public user.
55-
56-
[KEYS]
57-
anon=627626823549f787c3ec763ff687169206626149
58-
Which host names do you want to associate with the server? Note: the local hostname (i.e. 127.0.0.1) should come at the end.
59-
60-
[HOSTNAMES]
61-
prod_names=test.portal.biochemistry.gwu.edu,127.0.0.1
62-
names=127.0.0.1:8000,127.0.0.1
63-
Give the human-readable hostnames
64-
65-
[HRHOSTNAME]
66-
hrnames=BCO Server (Default)
67-
The public hostname of the server (i.e. the one to make requests to)
68-
69-
[PUBLICHOSTNAME]
70-
prod_name=https://test.portal.biochemistry.gwu.edu
71-
name=http://127.0.0.1:8000
72-
Who gets to make requests?
73-
74-
[REQUESTS_FROM]
75-
portal=https://test.portal.biochemistry.gwu.edu
76-
local_development_portal=http://127.0.0.1:3000,http://localhost:3000
77-
public=true
78-
Namings: How do you want to name your objects?
79-
80-
[OBJECT_NAMING]
81-
prod_root_uri=https://test.portal.biochemistry.gwu.edu
82-
root_uri=http://127.0.0.1:8000
83-
prod_uri_regex=root_uri/prefix_(\d+)/(\d+).(\d+)
84-
uri_regex=root_uri/prefix_(\d+)/(\d+).(\d+)
85-
**Requests ** Where are the request templates defined?
86-
87-
[REQUESTS]
88-
folder=../api/request_definitions/
89-
Where are the validation templates defined?
90-
91-
[VALIDATIONS]
92-
folder=../api/validation_definitions/
93-
Set up DB
94-
cd bco_api/bco_api
95-
96-
Option #1: Use existing DB
97-
Copy the dev db
98-
99-
cp ../admin_only/db.sqlite3.dev db.sqlite3
100-
101-
superusername: bco_api_user
102-
password: testing123
103-
Make Migrations
104-
105-
python3 manage.py migrate
106-
107-
Option #2: Create a new DB
108-
Make Migrations
109-
110-
python3 manage.py migrate
111-
112-
Create a super user for the API:
113-
114-
python3 manage.py createsuperuser
115-
116-
Then follow the prompts
117-
118-
Then: Do a quick check to make sure the server can run
119-
Start the server
120-
121-
python3 manage.py runserver 8000
122-
123-
Make sure API is accessible via web browser.
124-
125-
[YOU WEB HOST HERE]/api/admin/
126-
127-
EX: http://localhost:8000/api/admin/
128-
129-
If it worked you should be able to login using the SuperUser credentials you created above
130-
131-
Log in with the superuser credentials you created or imported
132-
133-
If you copied over the existing dbs you should be able to log in with any of the crednetials listed in /portal_userdb/server/admin/users.tsv
134-
135-
Otherwise you will have to register a new user.
13616

13717
## Issues and BCODB Development

docs/dockerDeployment.md

Whitespace-only changes.

docs/faq.md

Whitespace-only changes.

docs/localDeployment.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# BCODB Local Deployment
2+
3+
## Clone the repository
4+
```
5+
git clone https://github.com/biocompute-objects/bco_api
6+
```
7+
8+
**Make sure you are on the desired branch (Check for latest branch):**
9+
10+
```
11+
git switch [DESIRED BRANCH TAG]
12+
```
13+
14+
## Enter the repository, create a virtual environment, and install the required packages
15+
```
16+
cd bco_api
17+
18+
pyenv local 3.10.6
19+
20+
python3 -m venv env
21+
22+
source env/bin/activate
23+
24+
python -m pip install -r requirements.txt
25+
```
26+
27+
(You can use python3 if you’d like, but since you’re in the virtual environment you created python points to python3.10.6)
28+
29+
## Modify the Config files:
30+
Check/Edit the server.conf file
31+
This is the main server configuration file for the BCO API. (most of these values will NOT need to be changed for local deployment)
32+
33+
vim bco_api/bco_api/server.conf
34+
35+
Production and publishing flags NOTE: Valid values are True or False (note the capitalization).
36+
37+
[PRODUCTION]
38+
production=False
39+
DB Version
40+
41+
[VERSION]
42+
version=22.01
43+
Is this a publish-only server?
44+
45+
[PUBLISHONLY]
46+
publishonly=False
47+
Security settings: Create a key for an anonymous public user.
48+
49+
[KEYS]
50+
anon=627626823549f787c3ec763ff687169206626149
51+
Which host names do you want to associate with the server? Note: the local hostname (i.e. 127.0.0.1) should come at the end.
52+
53+
[HOSTNAMES]
54+
prod_names=test.portal.biochemistry.gwu.edu,127.0.0.1
55+
names=127.0.0.1:8000,127.0.0.1
56+
Give the human-readable hostnames
57+
58+
[HRHOSTNAME]
59+
hrnames=BCO Server (Default)
60+
The public hostname of the server (i.e. the one to make requests to)
61+
62+
[PUBLICHOSTNAME]
63+
prod_name=https://test.portal.biochemistry.gwu.edu
64+
name=http://127.0.0.1:8000
65+
Who gets to make requests?
66+
67+
[REQUESTS_FROM]
68+
portal=https://test.portal.biochemistry.gwu.edu
69+
local_development_portal=http://127.0.0.1:3000,http://localhost:3000
70+
public=true
71+
Namings: How do you want to name your objects?
72+
73+
[OBJECT_NAMING]
74+
prod_root_uri=https://test.portal.biochemistry.gwu.edu
75+
root_uri=http://127.0.0.1:8000
76+
prod_uri_regex=root_uri/prefix_(\d+)/(\d+).(\d+)
77+
uri_regex=root_uri/prefix_(\d+)/(\d+).(\d+)
78+
**Requests ** Where are the request templates defined?
79+
80+
[REQUESTS]
81+
folder=../api/request_definitions/
82+
Where are the validation templates defined?
83+
84+
[VALIDATIONS]
85+
folder=../api/validation_definitions/
86+
Set up DB
87+
cd bco_api/bco_api
88+
89+
Option #1: Use existing DB
90+
Copy the dev db
91+
92+
cp ../admin_only/db.sqlite3.dev db.sqlite3
93+
94+
superusername: bco_api_user
95+
password: testing123
96+
Make Migrations
97+
98+
python3 manage.py migrate
99+
100+
Option #2: Create a new DB
101+
Make Migrations
102+
103+
python3 manage.py migrate
104+
105+
Create a super user for the API:
106+
107+
python3 manage.py createsuperuser
108+
109+
Then follow the prompts
110+
111+
Then: Do a quick check to make sure the server can run
112+
Start the server
113+
114+
python3 manage.py runserver 8000
115+
116+
Make sure API is accessible via web browser.
117+
118+
[YOU WEB HOST HERE]/api/admin/
119+
120+
EX: http://localhost:8000/api/admin/
121+
122+
If it worked you should be able to login using the SuperUser credentials you created above
123+
124+
Log in with the superuser credentials you created or imported
125+
126+
If you copied over the existing dbs you should be able to log in with any of the crednetials listed in /portal_userdb/server/admin/users.tsv
127+
128+
Otherwise you will have to register a new user.

docs/productionDeployment.md

Whitespace-only changes.

0 commit comments

Comments
 (0)