diff --git a/nomad/config.py b/nomad/config.py index 2b871c1044fdabc0bfedd7069c33da74a92cf87f..05a9ff727382c759cb1e4f3b3ac9c84ec23509c6 100644 --- a/nomad/config.py +++ b/nomad/config.py @@ -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, diff --git a/nomad/infrastructure.py b/nomad/infrastructure.py index a91c3a4375cd7b19745aedaf1e74354aa5b094b3..c4ad7b849dfc4396432a8858d571706925699d71 100644 --- a/nomad/infrastructure.py +++ b/nomad/infrastructure.py @@ -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() diff --git a/nomad/repo.py b/nomad/repo.py index 7d88e9455c8f17d669b5b71a4a427d67838ba111..50737e791246fc1229e3425c3c57c06fe28e4e3a 100644 --- a/nomad/repo.py +++ b/nomad/repo.py @@ -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() diff --git a/ops/helm/nomad/values.yaml b/ops/helm/nomad/values.yaml index 9da020d7f9da4a0d0e01a89a223632e376aad094..04af83ea77688f53fcec557ccbc37c9eb10077e7 100644 --- a/ops/helm/nomad/values.yaml +++ b/ops/helm/nomad/values.yaml @@ -48,18 +48,18 @@ rabbitmq: mongo: host: enc-preprocessing-nomad.esc - port: 27017 + port: 37017 elastic: host: enc-preprocessing-nomad.esc - port: 9200 + port: 19200 postgres: host: enc-preprocessing-nomad.esc port: 5432 logstash: - port: 5000 + port: 15000 host: enc-preprocessing-nomad.esc ## Everything concerning the data that is used by the service