forked from ncbo/ontoportal_docker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
dip.yml
101 lines (88 loc) · 3.29 KB
/
dip.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
version: '7.5'
# Define default environment variables to pass
# to Docker Compose
#environment:
# RAILS_ENV: development
compose:
name: ontoportal
files:
- docker-compose.yml
# uncomment docker-compose.dev.yml for active development; it will mount local project directory in the container
# - docker-compose.dev.yml
project_name: ontoportal
interaction:
api:
# This command spins up a ontologies_api container with the required dependencies (solr, 4store, etc),
# and opens a terminal within it.
description: Run an arbitrary script within an api container (or open a shell with dependencies up)
service: api
command: /bin/bash
subcommands:
rackup:
description: Run onotlogies_api service via rack up commands
service: api
command: bundle exec rackup -o 0.0.0.0 --port 9393
compose:
run_options: [ service-ports ]
bash:
# Run a api container without any dependent services
description: Start shell on the API container (or open a shell without deps)
service: api
command: /bin/bash
compose_run_options: [ no-deps ]
# A shortcut to run Bundler commands
bundle:
description: Run Bundler commands on API (without depenencies up)
service: api
command: bundle
compose_run_options: [ no-deps ]
# A shortcut to run unit tests
test:
description: Run API unit tests with 4store backend
service: api
command: bundle exec rake test
cron:
description: Start shell on ncbo_cron container
service: ncbo_cron
command: /bin/bash
subcommands:
bundle:
description: Run Bundler commands on ncbo_cron
service: ncbo_cron
command: bundle
redis-cli:
description: Run Redis console
service: redis-ut
command: redis-cli -h redis-ut
ag-create-repo:
description: Create AG database and set up permissions
service: agraph
command: sh -c "agraph-control --config /agraph/etc/agraph.cfg start && agtool repos create ontoportal && agtool users add anonymous && agtool users grant anonymous root:ontoportal:rw"
compose_run_options: [ no-deps ]
4store-create-kb:
description: Create 4store KB
service: 4store
command: 4s-backend-setup ontoportal_kb
compose_run_options: [ no-deps ]
solr-term-init:
description: Create solr term core
service: solr-term
command: precreate-core term_search_core1 /configsets/term_search
compose_run_options: [ no-deps ]
solr-prop-init:
description: Create solr prop core
service: solr-prop
command: precreate-core prop_search_core1 /configsets/property_search
compose_run_options: [ no-deps ]
provision:
# example on how to provision API. It requires OP_APIKEY env variable
- dip compose down --volumes
- dip 4store-create-kb
# - dip solr-term-init
# - dip solr-prop-init
- dip cron bundle exec rake user:create[admin,[email protected]]
- dip cron bundle exec 'bin/ncbo_ontology_import --admin-user admin --ontologies ${STARTER_ONTOLOGY} --from-apikey ${OP_APIKEY} --from ${OP_API_URL}'
- dip cron bundle exec 'bin/ncbo_ontology_pull -o ${STARTER_ONTOLOGY}'
- dip cron bundle exec 'bin/ncbo_ontology_process -o ${STARTER_ONTOLOGY}'
#- dip cron bundle install
#- dip api bundle install