Skip to content

Commit 2d73dbb

Browse files
committed
change elastic and kibana names
1 parent dcdef27 commit 2d73dbb

34 files changed

Lines changed: 243 additions & 255 deletions

File tree

access-control-app/int-test/cmr/access_control/int_test/acl_search_test.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -794,8 +794,8 @@
794794

795795
;; Unindex acl1 directly through elastic to simulate an inconsistent state
796796
(client/delete (format "http://%s:%s/acls/_doc/%s"
797-
(elastic-config/elastic-host)
798-
(elastic-config/elastic-port)
797+
(elastic-config/gran-elastic-host)
798+
(elastic-config/gran-elastic-port)
799799
(:concept-id acl1))
800800
{:query-params {:refresh true}})
801801

access-control-app/src/cmr/access_control/api/routes.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@
258258
([ctx bootstrap-data]
259259
(cache/reset-caches ctx)
260260
(index/reset (-> ctx :system :gran-search-index))
261-
(index/reset (-> ctx :system :non-gran-search-index))
261+
(index/reset (-> ctx :system :search-index))
262262
(when bootstrap-data
263263
(bootstrap/bootstrap (:system ctx)))))
264264

@@ -272,7 +272,7 @@
272272
(POST "/db-migrate" {ctx :request-context}
273273
(acl/verify-ingest-management-permission ctx :update)
274274
;; TODO 10636 test me
275-
(index/create-index-or-update-mappings (-> ctx :system :non-gran-search-index))
275+
(index/create-index-or-update-mappings (-> ctx :system :search-index))
276276
{:status 204})))
277277

278278
;;; S3 routes

access-control-app/src/cmr/access_control/system.clj

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383

8484
(def ^:private component-order
8585
"Defines the order to start the components."
86-
[:log :caches :gran-search-index :non-gran-search-index :queue-broker :scheduler :web :nrepl])
86+
[:log :caches :gran-search-index :search-index :queue-broker :scheduler :web :nrepl])
8787

8888
(def system-holder
8989
"Required for jobs"
@@ -94,29 +94,29 @@
9494
(defn create-system
9595
"Returns a new instance of the whole application."
9696
[]
97-
(let [sys {:instance-name (common-sys/instance-name "access-control")
98-
:log (log/create-logger-with-log-level (log-level))
99-
:gran-search-index (search-index/create-elastic-search-index cmr.elastic-utils.config/gran-elastic-name)
100-
:non-gran-search-index (search-index/create-elastic-search-index cmr.elastic-utils.config/non-gran-elastic-name)
101-
:web (web-server/create-web-server (transmit-config/access-control-port) routes/handlers)
102-
:nrepl (nrepl/create-nrepl-if-configured (access-control-nrepl-port))
103-
:queue-broker (queue-broker/create-queue-broker (config/queue-config))
104-
:caches {af/acl-cache-key (af/create-acl-cache
105-
[:system-object :provider-object :single-instance-object])
106-
provider-cache/cache-key (provider-cache/create-cache)
107-
acl/collection-field-constraints-cache-key (acl/create-access-constraints-cache)
108-
common-enabled/write-enabled-cache-key (common-enabled/create-write-enabled-cache)
109-
common-health/health-cache-key (common-health/create-health-cache)
110-
launchpad-user-cache/launchpad-user-cache-key (launchpad-user-cache/create-launchpad-user-cache)
111-
urs/urs-cache-key (urs/create-urs-cache)}
112-
113-
:public-conf (public-conf)
114-
:relative-root-url (transmit-config/access-control-relative-root-url)
115-
:scheduler (jobs/create-scheduler
116-
`system-holder
117-
[(af/refresh-acl-cache-job "access-control-acl-cache-refresh")
118-
jvm-info/log-jvm-statistics-job
119-
(cache-info/create-log-cache-info-job "access-control")])}]
97+
(let [sys {:instance-name (common-sys/instance-name "access-control")
98+
:log (log/create-logger-with-log-level (log-level))
99+
:gran-search-index (search-index/create-elastic-search-index cmr.elastic-utils.config/gran-elastic-name)
100+
:search-index (search-index/create-elastic-search-index cmr.elastic-utils.config/elastic-name)
101+
:web (web-server/create-web-server (transmit-config/access-control-port) routes/handlers)
102+
:nrepl (nrepl/create-nrepl-if-configured (access-control-nrepl-port))
103+
:queue-broker (queue-broker/create-queue-broker (config/queue-config))
104+
:caches {af/acl-cache-key (af/create-acl-cache
105+
[:system-object :provider-object :single-instance-object])
106+
provider-cache/cache-key (provider-cache/create-cache)
107+
acl/collection-field-constraints-cache-key (acl/create-access-constraints-cache)
108+
common-enabled/write-enabled-cache-key (common-enabled/create-write-enabled-cache)
109+
common-health/health-cache-key (common-health/create-health-cache)
110+
launchpad-user-cache/launchpad-user-cache-key (launchpad-user-cache/create-launchpad-user-cache)
111+
urs/urs-cache-key (urs/create-urs-cache)}
112+
113+
:public-conf (public-conf)
114+
:relative-root-url (transmit-config/access-control-relative-root-url)
115+
:scheduler (jobs/create-scheduler
116+
`system-holder
117+
[(af/refresh-acl-cache-job "access-control-acl-cache-refresh")
118+
jvm-info/log-jvm-statistics-job
119+
(cache-info/create-log-cache-info-job "access-control")])}]
120120
(transmit-config/system-with-connections sys [:access-control :echo-rest :metadata-db :urs])))
121121

122122
(defn start
@@ -143,7 +143,7 @@
143143
(let [started-system (start system)]
144144
(try
145145
;; TODO 10636 - because the create-index-or-update-mappings only updates the groups and acls index, we only call it for the non-gran cluster, is there a better way though?
146-
(access-control-index/create-index-or-update-mappings (:non-gran-search-index started-system))
146+
(access-control-index/create-index-or-update-mappings (:search-index started-system))
147147
;; This is needed to bootstrap admin group for legacy services for integration tests
148148
(bootstrap/bootstrap started-system)
149149
(catch Exception e

access-control-app/src/cmr/access_control/test/util.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
(defn refresh-elastic-index
3636
[]
37-
(client/post (format "http://localhost:%s/_refresh" (es-config/elastic-port))
37+
(client/post (format "http://localhost:%s/_refresh" (es-config/gran-elastic-port))
3838
{:headers {:client-id config/cmr-client-id}}))
3939

4040
(defn unindex-all-groups
@@ -45,7 +45,7 @@
4545
[]
4646
(let [search-response (client/post
4747
(format "http://localhost:%s/%s/_search"
48-
(es-config/elastic-port)
48+
(es-config/gran-elastic-port)
4949
access-control-index/group-index-name)
5050
{:throw-exceptions true
5151
:content-type :json
@@ -61,7 +61,7 @@
6161
(get-in search-response [:body :hits :hits])))
6262
bulk-response (client/post
6363
(format "http://localhost:%s/%s/_bulk"
64-
(es-config/elastic-port)
64+
(es-config/gran-elastic-port)
6565
access-control-index/group-index-name)
6666
{:throw-exceptions false
6767
:content-type :json

access-control-app/src/cmr/db.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
(defn migrate
1111
[]
12-
(let [non-gran-elastic-store (l/start (search-index/create-elastic-search-index cmr.elastic-utils.config/non-gran-elastic-config) nil)
12+
(let [elastic-store (l/start (search-index/create-elastic-search-index cmr.elastic-utils.config/elastic-config) nil)
1313
gran-elastic-store (l/start (search-index/create-elastic-search-index cmr.elastic-utils.config/gran-elastic-config) nil)]
14-
(ac-index/create-index-or-update-mappings non-gran-elastic-store)
14+
(ac-index/create-index-or-update-mappings elastic-store)
1515
(ac-index/create-index-or-update-mappings gran-elastic-store)))
1616

1717
(defn -main

bootstrap-app/src/cmr/bootstrap/data/bulk_index.clj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
concept-batches (db/find-concepts-in-batches db provider params (:db-batch-size system))
118118
num-collections (index/bulk-index {:system (helper/get-indexer system)}
119119
concept-batches
120-
cmr.elastic-utils.config/non-gran-elastic-name
120+
cmr.elastic-utils.config/elastic-name
121121
{})]
122122
(info "Indexed" num-collections "collection(s) for provider" provider-id)
123123
num-collections))
@@ -161,7 +161,7 @@
161161
(:db-batch-size system))
162162
es-cluster-name (if (= concept-type :granule)
163163
cmr.elastic-utils.config/gran-elastic-name
164-
cmr.elastic-utils.config/non-gran-elastic-name)
164+
cmr.elastic-utils.config/elastic-name)
165165
num-concepts (bulk-index-concept-batches system concept-batches es-cluster-name)
166166
msg (format "Indexing of %s %s revisions for provider %s completed."
167167
num-concepts
@@ -188,7 +188,7 @@
188188
"Bulk index ACLs or access groups"
189189
[system concept-batches]
190190
(info "Indexing access control concepts")
191-
(ac-bulk-index/bulk-index-with-revision-date {:system (helper/get-indexer system)} concept-batches cmr.elastic-utils.config/non-gran-elastic-name))
191+
(ac-bulk-index/bulk-index-with-revision-date {:system (helper/get-indexer system)} concept-batches cmr.elastic-utils.config/elastic-name))
192192

193193
(defn- index-concepts
194194
"Bulk index the given concepts using the indexer-app"
@@ -213,7 +213,7 @@
213213
db provider params (:db-batch-size system))
214214
es-cluster-name (if (= concept-type :granule)
215215
cmr.elastic-utils.config/gran-elastic-name
216-
cmr.elastic-utils.config/non-gran-elastic-name)
216+
cmr.elastic-utils.config/elastic-name)
217217
_ (println "INSIDE fetch-and-index-new-concepts with concept-type = " concept-type " and concept batches = " concept-batches " and es-cluster-name = " es-cluster-name)
218218
{:keys [max-revision-date num-indexed]} (if (contains? #{:acl :access-group} concept-type)
219219
(index-access-control-concepts system concept-batches)
@@ -243,7 +243,7 @@
243243
(:db-batch-size system)
244244
start-index)]]
245245
(:num-indexed (if (= concept-type :tag)
246-
(index-concepts system concept-batches cmr.elastic-utils.config/non-gran-elastic-name)
246+
(index-concepts system concept-batches cmr.elastic-utils.config/elastic-name)
247247
(index-access-control-concepts system concept-batches)))))]
248248
(info "Indexed" total "system concepts.")
249249
total))
@@ -266,7 +266,7 @@
266266
concept-batch)
267267
es-cluster-name (if (= :granule concept-type)
268268
cmr.elastic-utils.config/gran-elastic-name
269-
cmr.elastic-utils.config/non-gran-elastic-name)
269+
cmr.elastic-utils.config/elastic-name)
270270
total (index/bulk-index {:system (helper/get-indexer system)} concept-batches es-cluster-name)]
271271

272272
;; for concept types that have all revisions index, also index the all revisions index
@@ -303,7 +303,7 @@
303303
(map #(assoc % :deleted true) concept-batch))
304304
es-cluster-name (if (= concept-type :granule)
305305
cmr.elastic-utils.config/gran-elastic-name
306-
cmr.elastic-utils.config/non-gran-elastic-name)
306+
cmr.elastic-utils.config/elastic-name)
307307
total (index/bulk-index {:system (helper/get-indexer system)} concept-batches es-cluster-name)]
308308
(info "Deleted " total " concepts")
309309
total))

bootstrap-app/src/cmr/bootstrap/system.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
(def ^:private component-order
5353
"Defines the order to start the components."
54-
[:log :caches :gran-search-index :non-gran-search-index :db :queue-broker :scheduler :web :nrepl])
54+
[:log :caches :gran-search-index :search-index :db :queue-broker :scheduler :web :nrepl])
5555

5656
(def system-holder
5757
"Required for jobs"
@@ -148,14 +148,14 @@
148148
(mem-cache/create-in-memory-cache :lru {} {:threshold 2000}))
149149
;; Specify an Elasticsearch http retry handler
150150
(assoc-in [:gran-elastic :config :retry-handler] bi/elastic-retry-handler)
151-
(assoc-in [:non-gran-elastic :config :retry-handler] bi/elastic-retry-handler))
151+
(assoc-in [:elastic :config :retry-handler] bi/elastic-retry-handler))
152152
queue-broker (queue-broker/create-queue-broker (bootstrap-config/queue-config))
153153
sys {:instance-name (common-sys/instance-name "bootstrap")
154154
:log (log/create-logger-with-log-level (log-level))
155155
:embedded-systems {:metadata-db metadata-db
156156
:indexer indexer}
157157
:gran-search-index (search-index/create-elastic-search-index cmr.elastic-utils.config/gran-elastic-name)
158-
:non-gran-search-index (search-index/create-elastic-search-index cmr.elastic-utils.config/non-gran-elastic-name)
158+
:search-index (search-index/create-elastic-search-index cmr.elastic-utils.config/elastic-name)
159159
:db-batch-size (db-batch-size)
160160
:core-async-dispatcher (dispatch/create-backend :async)
161161
:synchronous-dispatcher (dispatch/create-backend :sync)

dev-system/src/cmr/dev_system/config.clj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@
2424
{:default 10000
2525
:type Long})
2626

27-
(defconfig embedded-kibana-port
27+
(defconfig embedded-kibana-gran-port
2828
"Specifies port to run an embedded kibana on."
2929
{:default 5601
3030
:type Long})
3131

32-
(defconfig embedded-kibana-port-non-gran
32+
;; TODO CMR-10636 -- I believe kibana ports also need to be updated in AWS param store
33+
(defconfig embedded-kibana-non-gran-port
3334
"Specifies port to run an embedded kibana on."
3435
{:default 5602
3536
:type Long})

dev-system/src/cmr/dev_system/control.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
(reset-fn (app-context system service-name)))
121121
;; After reset some elasticsearch indexes may not be initialized yet. We will check the status here
122122
(elastic-conn/wait-for-healthy-elastic (get-in system [:apps :indexer :gran-elastic]))
123-
(elastic-conn/wait-for-healthy-elastic (get-in system [:apps :indexer :non-gran-elastic]))
123+
(elastic-conn/wait-for-healthy-elastic (get-in system [:apps :indexer :elastic]))
124124
(debug "dev system /reset complete")
125125
{:status 200})
126126

dev-system/src/cmr/dev_system/system.clj

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@
108108

109109
(defmethod create-gran-elastic-server :in-memory
110110
[_]
111-
(let [http-port (elastic-config/elastic-port)]
111+
(let [http-port (elastic-config/gran-elastic-port)]
112112
(elastic-server/create-server http-port
113113
{:log-level (name @in-memory-elastic-log-level-atom)
114-
:kibana-port (dev-config/embedded-kibana-port)
114+
:kibana-port (dev-config/embedded-kibana-gran-port)
115115
:image-cfg {"Dockerfile" "elasticsearch/Dockerfile.elasticsearch"
116116
"es_libs" "elasticsearch/es_libs"
117117
"embedded-security.policy" "elasticsearch/embedded-security.policy"
@@ -121,24 +121,24 @@
121121
[_]
122122
nil)
123123

124-
(defmulti create-non-gran-elastic-server
124+
(defmulti create-elastic-server
125125
"Sets elastic configuration values and returns an instance of an Elasticsearch component to run
126126
in memory if applicable."
127127
(fn [type]
128128
type))
129129

130-
(defmethod create-non-gran-elastic-server :in-memory
130+
(defmethod create-elastic-server :in-memory
131131
[_]
132-
(let [http-port (elastic-config/elastic-port-non-gran)]
132+
(let [http-port (elastic-config/elastic-port)]
133133
(elastic-server/create-server http-port
134134
{:log-level (name @in-memory-elastic-log-level-atom)
135-
:kibana-port (dev-config/embedded-kibana-port-non-gran)
135+
:kibana-port (dev-config/embedded-kibana-non-gran-port)
136136
:image-cfg {"Dockerfile" "elasticsearch/Dockerfile.elasticsearch"
137137
"es_libs" "elasticsearch/es_libs"
138138
"embedded-security.policy" "elasticsearch/embedded-security.policy"
139139
"plugins" "elasticsearch/plugins"}})))
140140

141-
(defmethod create-non-gran-elastic-server :external
141+
(defmethod create-elastic-server :external
142142
[_]
143143
nil)
144144

@@ -308,7 +308,7 @@
308308
echo-component (create-echo echo)
309309
queue-broker (create-queue-broker message-queue)
310310
gran-elastic-server (create-gran-elastic-server elastic)
311-
non-gran-elastic-server (create-non-gran-elastic-server elastic)
311+
elastic-server (create-elastic-server elastic)
312312
redis-server (create-redis redis)
313313
sqs-server (create-sqs-server sqs-server)
314314
control-server (control/create-server)]
@@ -324,10 +324,10 @@
324324
:virtual-product (create-virtual-product-app queue-broker)})
325325
:pre-components (u/remove-nil-keys
326326
{:gran-elastic-server gran-elastic-server
327-
:non-gran-elastic-server non-gran-elastic-server
328-
:broker-wrapper queue-broker
329-
:redis-server redis-server
330-
:sqs-server sqs-server})
327+
:elastic-server elastic-server
328+
:broker-wrapper queue-broker
329+
:redis-server redis-server
330+
:sqs-server sqs-server})
331331
:post-components {:control-server control-server}}))
332332

333333
(defn- stop-components

0 commit comments

Comments
 (0)