CLIX Data Repository Setup for Production - ckan/ckan GitHub Wiki

Introduction

This page describes steps invovlved in setting up CLIX Data Repository using CKAN software.

Basic Installation

  1. Fork Github repo of CKAN into your personal github account
  2. Change to branch with tag - 2.8.2
  3. Create a new branch to make changes spcific to CLIX installation and maintanence
  4. Follow steps 1 to 4 from Installation Instructions
  5. For local deployment, change 'CKAN_SITE_URL' in .env file to anything of your choice like http://ckan-dev:5000
  6. Run 'docker-compose up -d --build' from inside /contrib/docker folder

Install and modify plugins

  1. Following are plugins required: ckan-geoview, ckan-ddi, ckan-harvester, ckan-pages
  2. Fork plugins into your personal github account
  3. Create a new branch to make changes specific to CLIX installation and maintenence
  4. For each container follow step 6 from Installation Instructions
  5. For each of the plugins, follow their individual configuration instructions on their github pages
  6. For ddi plugin:
    • replace path/to/my/config.yml (= ckanext.ddi.config_file) with config.yml file in examples folder (we may have to change this yml file in future to accomodate our custom ddi metadata fields)
    • after installing ddi plugin, we will not be able to see 'Dataset' page due to broken url link error. It is actually coming from broken code for 'Import Dataset from DDI/XML' button, which is used for importing DDI XML files into our repository. This is not an important feature for our purposes. So we discard this button. To do that go to this template file in ckanext installation files inside the container and delete this code snippet:
      <div class="page_primary_action">
       {% link_for _('Import Dataset from DDI/XML'), controller='ckanext.ddi.controllers:ImportFromXml', action='import_form', class_='btn btn-primary', icon='plus-sign-alt' %}</div>
  7. For harvest plugin:
    • Enter ckan plugin as root user - docker exec -it ckan -U 0 /bin/bash -c "export TERM=xterm; exec bash"
    • run 'apt update'
    • run 'apt install redis-server'
    • change config file accordingly - ckan.harvest.mq.type = redis

CLIX specifc changes to Base installation

Following are some of the changes to site for clix puposes apart from the one available through web interface intself (whenever code inside ckan container is changed, have to restart ckan container to reflect changes on site)

  1. Upload CLIX log file(Clix-logo-600x1401_ckan.png) from home directory of personal ckan github repo
  2. To change home page image and caption, make following changes to code snippet in template file
{% block home_image %}
  <section class="featured media-overlay hidden-xs">
    <h2 class="media-heading">{% block home_image_caption %}{{ _("CLIX Data Repository") }}{% endblock %}</h2>
    {% block home_image_content %}
      <a class="media-image" href="#">
        <img class="img-responsive" src="{{ h.url_for_static('/base/images/clix_datarepo_homeimage.png') }}" alt="Placeholder" width="420" height="220" />
      </a>
    {% endblock %}
  </section>
{% endblock %}
⚠️ **GitHub.com Fallback** ⚠️