1
1
# Noctua App Stack
2
2
3
- Install app stack using ansible on a single machine
3
+ - Deploy app stack using ansible playbooks on a single machine:
4
+ - build_images.yaml
5
+ - builds all docker images on local machine.
6
+ - push_images.yaml
7
+ - pushes images to dockerhub if planning on staging to a remote machine.
8
+ - stage.yaml
9
+ - Tasks are executed on staging machine which can be local or remote.
10
+
4
11
5
12
## Requirements
6
13
@@ -13,71 +20,133 @@ Install app stack using ansible on a single machine
13
20
- Notes:
14
21
- Docker was given 3 CPUs and 8G RAM. (on mac see Docker Preferences | Resources)
15
22
- python 2.7 should work as well.
23
+
24
+ ## Fast Install using miniconda
25
+
26
+ To install miniconda go to [ url] ( https://docs.conda.io/en/latest/miniconda.html )
27
+
28
+ This will install ansible, docker ansible module, docker-compose, and terraform.
29
+ See dependencies/bare-metal.yml
30
+
31
+ ```
32
+ conda env create --file dependencies/bare-metal.yml
33
+ conda activate noctua_app_stack
34
+
35
+ # when done
36
+ conda deactivate
37
+
38
+ # delete a conda environment:
39
+ conda env remove -n noctua_app_stack
40
+
41
+ ```
16
42
17
- ## Installing ansible and ansible docker plugin
43
+ ## Installing ansible and ansible docker plugin using Pip.
44
+
18
45
19
46
The ansible docker plugin is used to buid docker images.
20
47
21
48
``` sh
22
49
pip install ansible
23
50
pip install docker
24
51
```
25
- ## Deploying app stack:
26
52
27
- #### Clone this repo.
53
+ ## Clone this repo.
28
54
29
55
``` sh
30
56
git clone https://github.com/abessiari/noctua_app_stack.git
31
57
cd noctua_app_stack
32
58
```
33
59
34
- #### Modify ` vars.yaml ` as needed. Minimally you need to modify the following variables:
35
- - uri
36
- - username
37
- - password
38
- - barista_lookup_host
39
- - On mac if using wireless, you can use ` ipconfig getifaddr en0 `
60
+ ## Building Docker Images:
61
+ The playbook <i >build_images.yaml</i > clones minerva, noctua and amigo git repositories
62
+ and builds corresponding docker images. The default branch used is <i >master</i >.
63
+ To change the branch being cloned, see <i >repo_map</i > in docker-vars.yaml
64
+
65
+ In order to stage the app stack to a remote machine, Create an account on dockerhub if you do not have one
66
+ and a public dockerhub repository named <i >minerva</i >, <i >noctua</i > and <i >golr</i >.
67
+ Then set <i >docker_hub_user</i > in docker-vars.yaml or simply
68
+ use the -e option when using ansible-playbook command.
69
+
70
+
71
+ #### Build images.
40
72
41
- #### Build noctua and minerva docker images.
73
+ ``` sh
74
+ ansible-playbook -e docker_hub_user=xxxx build_images.yaml
75
+ docker image list | egrep ' minerva|noctua|golr'
76
+ ```
77
+
78
+ #### Push images.
79
+ - Skip this step if planning on staging locally.
42
80
43
81
``` sh
44
- ansible-playbook build_images.yaml
45
- docker image list | grep minerva
46
- docker image list | grep noctua
82
+ ansible-playbook -e docker_hub_user=xxxx push_images.yaml
47
83
```
48
84
49
- #### Stage artifacts.
50
- - Create and stage blazegraph journal.
51
- - Stage repos
85
+ #### Provision machine and stage app stack on the cloud:
86
+ - Skip this step if planning on staging locally.
87
+ - Refer to [ this document] ( ./docs/AWS_README.md ) on provisionning an instance on AWS.
88
+
89
+ ## Staging app stack:
90
+
91
+ #### Staging tasks at a glance:
92
+ - Creates blazegraph journal.
93
+ - Creates Solr Index
94
+ - Clones repos
95
+ - noctua-form, noctua-landing-page, noctua-models, go-site
96
+ - Creates docker-compose and configuration files from templates.
97
+
98
+ #### Modify ` vars.yaml ` .
99
+ - These can also be set on command line using the -e flag.
100
+ - Barista:
101
+ - uri
102
+ - username
103
+ - password
104
+
105
+ #### Stage Artifacts.
106
+ - Staging tasks at a glance:
107
+ - Creates blazegraph journal.
108
+ - Creates Solr Index
109
+ - Clones repos
52
110
- noctua-form, noctua-landing-page, noctua-models, go-site
53
- - Note: Stage the journals below to speed up minerva start up time.
54
- - Create stage_dir if it does not exist
55
- - Copy` blazegraph.jnl ` to stage_dir
56
- - Copy` blazegraph-go-lego-reacto-neo.jnl ` to stage_dir
111
+ - Creates docker-compose and configuration files from templates.
112
+ - Staging to a remote machine:
113
+ - Refer to [ this document] ( ./docs/AWS_README.md ) on provisionning an AWS.
57
114
58
115
``` sh
59
- ansible-playbook stage.yaml
116
+ # on Mac:
117
+ export HOST=` ipconfig getifaddr en0`
118
+ ansible-playbook -e " host=$HOST " -i " localhost," stage.yaml
60
119
```
61
120
#### Bring up stack using docker-compose.
121
+ Two docker-compose files are staged:
122
+ - docker-compose-golr.yaml
123
+ - Uses a lightweight solr image for golr
124
+ - docker-compose-amigo.yaml
125
+ - Uses the official geneontology/amigo-standalone for golr
62
126
63
127
``` sh
64
- # assuming stage_dir is in current directory
65
- docker-compose -f stage_dir/docker-compose.yaml up -d
128
+ # assuming stage_dir is in current directory and docker-compose-golr.yaml is used:
129
+ docker-compose -f stage_dir/docker-compose-golr .yaml up -d
66
130
67
131
# minerva takes a long time to start up the first time
68
132
# Tail minerva logs to see its progress
69
- docker-compose -f stage_dir/docker-compose.yaml logs -f minerva
133
+ docker-compose -f stage_dir/docker-compose-golr.yaml logs -f minerva
134
+ # Or tail all logs
135
+ docker-compose -f stage_dir/docker-compose-golr.yaml logs -f
70
136
71
137
# When minerva is ready all other services should be up
72
- docker-compose -f stage_dir/docker-compose.yaml ps
138
+ docker-compose -f stage_dir/docker-compose-golr .yaml ps
73
139
```
74
140
75
141
#### Access noctua from a browser using ` http://localhost:{{ noctua_proxy_port }} `
76
142
- Use ` http://localhost:8080 ` if default ` noctua_proxy_port ` was used
77
143
78
- #### Bring down stack using docker-compose.
144
+ #### Bring down stack using docker-compose.
79
145
80
146
``` sh
81
- # assuming stage_dir is in current directory
82
- docker-compose -f stage_dir/docker-compose.yaml down
147
+ docker-compose -f stage_dir/docker-compose-golr.yaml down
148
+ # kill works faster ...
149
+ docker-compose -f stage_dir/docker-compose-golr.yaml kill
150
+ # delete containers:
151
+ docker-compose -f stage_dir/docker-compose-golr.yaml rm -f
83
152
```
0 commit comments