Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
nomad-FAIR
Commits
e4263545
Commit
e4263545
authored
Dec 13, 2018
by
Markus Scheidgen
Browse files
Added additional configuration.
parent
cc88ac9b
Pipeline
#40899
passed with stages
in 14 minutes and 17 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nomad/config.py
View file @
e4263545
...
...
@@ -82,7 +82,7 @@ fs = FSConfig(
elastic
=
ElasticConfig
(
host
=
os
.
environ
.
get
(
'NOMAD_ELASTIC_HOST'
,
'localhost'
),
port
=
int
(
os
.
environ
.
get
(
'NOMAD_ELASTIC_PORT'
,
9200
)),
index_name
=
os
.
environ
.
get
(
'NOMAD_ELASTIC_INDEX_NAME'
,
'
nomad-fair
'
)
index_name
=
os
.
environ
.
get
(
'NOMAD_ELASTIC_INDEX_NAME'
,
'
calcs
'
)
)
repository_db
=
RepositoryDBConfig
(
host
=
os
.
environ
.
get
(
'NOMAD_COE_REPO_DB_HOST'
,
'localhost'
),
...
...
@@ -94,7 +94,7 @@ repository_db = RepositoryDBConfig(
mongo
=
MongoConfig
(
host
=
os
.
environ
.
get
(
'NOMAD_MONGO_HOST'
,
'localhost'
),
port
=
int
(
os
.
environ
.
get
(
'NOMAD_MONGO_PORT'
,
27017
)),
db_name
=
os
.
environ
.
get
(
'NOMAD_MONGO_DN_NAME'
,
'
nomad-fair
'
)
db_name
=
os
.
environ
.
get
(
'NOMAD_MONGO_DN_NAME'
,
'
users
'
)
)
logstash
=
LogstashConfig
(
enabled
=
True
,
...
...
nomad/infrastructure.py
View file @
e4263545
...
...
@@ -79,7 +79,7 @@ def setup_elastic():
""" Creates connection to elastic search. """
global
elastic_client
elastic_client
=
connections
.
create_connection
(
hosts
=
[
config
.
elastic
.
host
]
,
port
=
[
config
.
elastic
.
port
])
hosts
=
[
'%s:%d'
%
(
config
.
elastic
.
host
,
config
.
elastic
.
port
)
])
logger
.
info
(
'setup elastic connection'
)
try
:
...
...
@@ -130,10 +130,10 @@ def setup_repository_db():
def
reset
():
""" Resets the databases mongo, elastic/calcs, and repository db. Be careful. """
logger
.
info
(
'reset mongodb'
)
mongo_client
.
drop_database
(
config
.
mongo
.
users_db
)
mongo_client
.
drop_database
(
config
.
mongo
.
db_name
)
logger
.
info
(
'reset elastic search'
)
elastic_client
.
indices
.
delete
(
index
=
config
.
elastic
.
calc_
index
)
elastic_client
.
indices
.
delete
(
index
=
config
.
elastic
.
index
_name
)
from
nomad.repo
import
RepoCalc
RepoCalc
.
init
()
...
...
nomad/repo.py
View file @
e4263545
...
...
@@ -202,13 +202,13 @@ class RepoCalc(ElasticDocument):
@
staticmethod
def
es_search
(
body
):
""" Perform an elasticsearch and not elasticsearch_dsl search on the Calc index. """
return
infrastructure
.
elastic_client
.
search
(
index
=
config
.
elastic
.
calc_
index
,
body
=
body
)
return
infrastructure
.
elastic_client
.
search
(
index
=
config
.
elastic
.
index
_name
,
body
=
body
)
@
staticmethod
def
upload_exists
(
upload_hash
):
""" Returns true if there are already calcs from the given upload. """
# TODO this is deprecated and should be varified via repository files
search
=
Search
(
using
=
infrastructure
.
elastic_client
,
index
=
config
.
elastic
.
calc_
index
)
\
search
=
Search
(
using
=
infrastructure
.
elastic_client
,
index
=
config
.
elastic
.
index
_name
)
\
.
query
(
'match'
,
upload_hash
=
upload_hash
)
\
.
execute
()
...
...
@@ -217,7 +217,7 @@ class RepoCalc(ElasticDocument):
@
staticmethod
def
upload_calcs
(
upload_id
):
""" Returns an iterable over all entries for the given upload_id. """
return
Search
(
using
=
infrastructure
.
elastic_client
,
index
=
config
.
elastic
.
calc_
index
)
\
return
Search
(
using
=
infrastructure
.
elastic_client
,
index
=
config
.
elastic
.
index
_name
)
\
.
query
(
'match'
,
upload_id
=
upload_id
)
\
.
scan
()
...
...
ops/helm/nomad/values.yaml
View file @
e4263545
...
...
@@ -48,18 +48,18 @@ rabbitmq:
mongo
:
host
:
enc-preprocessing-nomad.esc
port
:
2
7017
port
:
3
7017
elastic
:
host
:
enc-preprocessing-nomad.esc
port
:
9200
port
:
1
9200
postgres
:
host
:
enc-preprocessing-nomad.esc
port
:
5432
logstash
:
port
:
5000
port
:
1
5000
host
:
enc-preprocessing-nomad.esc
## Everything concerning the data that is used by the service
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment