-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support for centralized DB / Solr Cloud, cca-operator stability impro…
…vements (#19) * added support for centralized DB * support for centralized DB and Solr Cloud * add solrcloud to travis * fixed for cca-operator ssh keys and centralized infra. * cca-operator create db scripts can only run once * solrcloud fixes * cca-operator: db init fixes * cca-operator: permission fixes to centralized datastore creation script * cca-operator: fix polling of traefik status, support central infra for create-instance, fix server keys * cca-operator fixes: delete-instance status polling, update-instance admin user creation
- Loading branch information
Showing
20 changed files
with
521 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
version: '3.2' | ||
|
||
services: | ||
ckan: | ||
environment: | ||
- INSTANCE_ID | ||
- CKAN_K8S_SECRETS=/etc/ckan-conf/secrets/secrets-centralized.sh | ||
volumes: | ||
- ./docker-compose/ckan-secrets-centralized.sh:/etc/ckan-conf/secrets/secrets-centralized.sh | ||
|
||
jobs: | ||
environment: | ||
- INSTANCE_ID | ||
- CKAN_K8S_SECRETS=/etc/ckan-conf/secrets/secrets-centralized.sh | ||
volumes: | ||
- ./docker-compose/ckan-secrets-centralized.sh:/etc/ckan-conf/secrets/secrets-centralized.sh | ||
|
||
solr: | ||
image: viderum/ckan-cloud-docker:solrcloud-latest | ||
build: | ||
context: solr | ||
dockerfile: solrcloud.Dockerfile | ||
args: | ||
SCHEMA_XML: ${SCHEMA_XML:-schema.xml} | ||
entrypoint: [docker-entrypoint.sh, solr, start, -c, -f] | ||
ports: | ||
- "8983:8983" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
CREATE OR REPLACE VIEW "_table_metadata" AS | ||
SELECT DISTINCT | ||
substr(md5(dependee.relname || COALESCE(dependent.relname, '')), 0, 17) AS "_id", | ||
dependee.relname AS name, | ||
dependee.oid AS oid, | ||
dependent.relname AS alias_of | ||
FROM | ||
pg_class AS dependee | ||
LEFT OUTER JOIN pg_rewrite AS r ON r.ev_class = dependee.oid | ||
LEFT OUTER JOIN pg_depend AS d ON d.objid = r.oid | ||
LEFT OUTER JOIN pg_class AS dependent ON d.refobjid = dependent.oid | ||
WHERE | ||
(dependee.oid != dependent.oid OR dependent.oid IS NULL) AND | ||
-- is a table (from pg_tables view definition) | ||
-- or is a view (from pg_views view definition) | ||
(dependee.relkind = 'r'::"char" OR dependee.relkind = 'v'::"char") | ||
AND dependee.relnamespace = ( | ||
SELECT oid FROM pg_namespace WHERE nspname='public') | ||
ORDER BY dependee.oid DESC; | ||
ALTER VIEW "_table_metadata" OWNER TO "{{SITE_USER}}"; | ||
GRANT SELECT ON "_table_metadata" TO "{{DS_RO_USER}}"; | ||
|
||
CREATE OR REPLACE FUNCTION populate_full_text_trigger() RETURNS trigger | ||
AS $body$ | ||
BEGIN | ||
IF NEW._full_text IS NOT NULL THEN | ||
RETURN NEW; | ||
END IF; | ||
NEW._full_text := ( | ||
SELECT to_tsvector(string_agg(value, ' ')) | ||
FROM json_each_text(row_to_json(NEW.*)) | ||
WHERE key NOT LIKE '\_%'); | ||
RETURN NEW; | ||
END; | ||
$body$ LANGUAGE plpgsql; | ||
ALTER FUNCTION populate_full_text_trigger() OWNER TO "{{SITE_USER}}"; | ||
|
||
DO $body$ | ||
BEGIN | ||
EXECUTE coalesce( | ||
(SELECT string_agg( | ||
'CREATE TRIGGER zfulltext BEFORE INSERT OR UPDATE ON ' || | ||
quote_ident(relname) || ' FOR EACH ROW EXECUTE PROCEDURE ' || | ||
'populate_full_text_trigger();', ' ') | ||
FROM pg_class | ||
LEFT OUTER JOIN pg_trigger AS t | ||
ON t.tgrelid = relname::regclass AND t.tgname = 'zfulltext' | ||
WHERE relkind = 'r'::"char" AND t.tgname IS NULL | ||
AND relnamespace = ( | ||
SELECT oid FROM pg_namespace WHERE nspname='public')), | ||
'SELECT 1;'); | ||
END; | ||
$body$; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.