|
83 | 83 |
|
84 | 84 | (def ^:private component-order |
85 | 85 | "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]) |
87 | 87 |
|
88 | 88 | (def system-holder |
89 | 89 | "Required for jobs" |
|
94 | 94 | (defn create-system |
95 | 95 | "Returns a new instance of the whole application." |
96 | 96 | [] |
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")])}] |
120 | 120 | (transmit-config/system-with-connections sys [:access-control :echo-rest :metadata-db :urs]))) |
121 | 121 |
|
122 | 122 | (defn start |
|
143 | 143 | (let [started-system (start system)] |
144 | 144 | (try |
145 | 145 | ;; 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)) |
147 | 147 | ;; This is needed to bootstrap admin group for legacy services for integration tests |
148 | 148 | (bootstrap/bootstrap started-system) |
149 | 149 | (catch Exception e |
|
0 commit comments