Commit cbe4296d authored by Matt Pryor's avatar Matt Pryor
Browse files

Use volume to preserve cache in Ansible deployment

parent 50481060
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ Vagrant.configure(2) do |config|
      "data" => ["default"],
      "data:vars" => {
        "hostname" => "192.168.100.100.nip.io",
        "image_tag" => "issue-112-nginx-data-node",
        "image_tag" => "issue-123-existing-catalogs",
        "data_mounts" => "#{data_mounts.to_json}",
        "data_datasets" => "#{data_datasets.to_json}"
      }
+3 −0
Original line number Diff line number Diff line
@@ -43,6 +43,9 @@ data_datasets: []
  #   path: esg_dataroot
  #   location: /badc/cmip5/data

# If specified, catalogs from this directory are used instead of the generated catalogs
# thredds_catalog_host_path:

# Security parameters required to run Nginx and serve data
#
# If a special user or groups are required to access data, they can be set here, which
+20 −6
Original line number Diff line number Diff line
@@ -16,11 +16,22 @@

- name: Configure THREDDS
  block:
    - name: Write THREDDS configuration
    - name: Generate THREDDS catalogs
      block:
        - name: Write THREDDS catalog
          template:
            src: catalog.xml.j2
            dest: /esg/config/thredds/catalog.xml

        - name: Set thredds_catalog_host_path for generated catalogs
          set_fact:
            thredds_catalog_host_path: /esg/config/thredds
      when: thredds_catalog_host_path is not defined

    - name: Create THREDDS cache volume
      docker_volume:
        name: thredds-cache

    - name: Start THREDDS container
      docker_container:
        name: thredds
@@ -35,10 +46,13 @@
        networks_cli_compatible: yes
        user: "{{ data_security_context_user }}"
        groups: "{{ data_security_context_groups }}"
        # Append the catalog volume to the data mounts
        volumes: >-
          [
            "/esg/config/thredds:/opt/tomcat/content/thredds/esgcet:ro",
            # First the catalog volume
            "{{ thredds_catalog_host_path }}:/opt/tomcat/content/thredds/esgcet:ro",
            # Then the cache volume
            "thredds-cache:/opt/tomcat/content/thredds/cache:rw",
            # Then finally the data mounts
            {% for mount in data_mounts %}
            "{{ mount.host_path }}:{{ mount.mount_path }}:ro",
            {% endfor %}