Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WAC-42: Improve datapusher deployment. #11

Merged
merged 5 commits into from
Jun 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
roles/gantsign.minikube
roles/geerlingguy.helm
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ botocore = "*"
openshift = "*"
docker = "*"
awscli = "*"
psycopg2 = "*"

[requires]
python_version = "3.8"
1,630 changes: 892 additions & 738 deletions Pipfile.lock

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions roles/ckan/tasks/deploy.yml
Original file line number Diff line number Diff line change
@@ -81,12 +81,13 @@
login_host: "{{ ckan_fqdn }}"
login_user: "{{ rds_admin_username }}"
login_password: "{{ ckan_postgres_password }}"
when: (fjelltopp_env_type == 'local') and (ckan_datapusher_enable)
when: (fjelltopp_env_type == 'local')
register: db_ping_result
retries: 10
delay: 5
until: db_ping_result.is_available
failed_when: not db_ping_result.is_available
until: db_ping_result is defined and db_ping_result.get('is_available')
failed_when: db_ping_result is not defined or not db_ping_result.is_available
# For this check to work psycopg2 must be installed for the venv python referenced from your inventory

- name: Setup database parameters
set_fact:
@@ -106,7 +107,7 @@
become: false
with_items:
- ckandb_job.yaml
when: fjelltopp_env_type != 'local'
when: (fjelltopp_env_type != 'local') or (ckan_datapusher_enable == 'true')

- name: Deploy CKAN
kubernetes.core.k8s:
4 changes: 2 additions & 2 deletions roles/ckan/templates/ckan/ckan_bootstrap.sh
Original file line number Diff line number Diff line change
@@ -12,6 +12,6 @@ echo "Create API token:"
psql "${CKAN_SQLALCHEMY_URL}" -c "INSERT INTO api_token VALUES ('{{ ckan_default_api_token }}', 'Default Token', '{{ ckan_admin_user_id }}', now()) ON CONFLICT DO NOTHING;"
echo "make admin superuser"
ckan -c "$CONFIG" sysadmin add admin
echo "Set datastore permissions"
ckan -c "$CONFIG" datastore set-permissions | psql "${CKAN_SQLALCHEMY_URL}"
echo bootstrap finished


1 change: 1 addition & 0 deletions roles/ckan/templates/ckan/ckan_production.ini
Original file line number Diff line number Diff line change
@@ -195,6 +195,7 @@ ckan.datapusher.url = {{ ckan_datapusher_url }}
{% if ckan_datapusher_api_token %}
ckan.datapusher.api_token = {{ ckan_datapusher_api_token }}
{% endif %}
ckan.datapusher.callback_url_base = http://ckan:5000/
jonathansberry marked this conversation as resolved.
Show resolved Hide resolved
ckan.datapusher.assume_task_stale_after = 3600
{% endif %}

2 changes: 1 addition & 1 deletion roles/requirements.yml
Original file line number Diff line number Diff line change
@@ -21,4 +21,4 @@ collections:
version: 2.10.0
- name: community.postgresql
accept_hostkey: true
version: 3.4.0
version: 3.4.1