---
# System prepended metadata

title: 'OD-1248: Preliminary work for CKAN 2.9 Upgrade in the Test Env'

---

# OD-1248: Preliminary work for CKAN 2.9 Upgrade in the Test Env

## Running Ed-testing docker image locally

1. Clone the repo containing the dockerfile for the testing site and checkout the `ckan-2.9.4-upgrade` branch:
    ```shell=
    git clone https://github.com/datopian/dx-helm-ed-dev
    cd dx-helm-ed-dev
    git checkout ckan-2.9.4-upgrade
    ```
2. Build the testing site image from the Dockerfile:
    ```shell=
    docker build -t local/ckan:ed-testing-base ckan
    ```
    The `local/ckan:ed-testing` tag is arbitrary and can be anything.
3. Navigate to your local instance or `docker-ckan-ed` or clone it:
    ```shell=
    git clone https://github.com/CivicActions/docker-ckan-ed
    cd docker-ckan-ed
    ```
4. Checkout a new branch from docker-ckan-ed ***upgrade-ckan*** branch to avoid editing the original:
    ```shell=
    git checkout upgrade-ckan
    git checkout -b local-testing
    ```
5. Build a second image to install ckanext-ed:
    ```Dockerfile
    FROM local/ckan:ed-testing-base

    RUN mkdir /ckanext-ed

    RUN mkdir -p /var/lib/ckan
    RUN chown -R ckan:ckan /var/lib/ckan
    RUN pip2 install beautifulsoup4==4.5.1 openpyxl

    COPY src/ckanext-ed/bin /ckanext-ed/bin
    COPY src/ckanext-ed/ckanext /ckanext-ed/ckanext
    COPY src/ckanext-ed/deploy /ckanext-ed/deploy
    COPY src/ckanext-ed/requirements.txt /ckanext-ed/requirements.txt
    COPY src/ckanext-ed/setup.py /ckanext-ed/setup.py
    COPY src/ckanext-ed/test.ini /ckanext-ed/test.ini
    COPY src/ckanext-ed/setup.cfg /ckanext-ed/setup.cfg
    COPY src/ckanext-ed/README.md /ckanext-ed/README.md

    RUN pip2 install -e file:///ckanext-ed#egg=ckanext-ed
    ```
6. 

5. Replace the `docker-compose.dev.yml` with:

    ```yml=
    version: "3"

    services:
      ckan-dev:
        image: local/ckan:ed-testing
        env_file:
          - .dev.env
        links:
          - db
          - solr
          - redis
          - datapusher
        ports:
          - "0.0.0.0:5000:5000"
        volumes:
          - ckan_storage:/var/lib/ckan
          - ./src:/srv/app/src_extensions

      datapusher:
        container_name: datapusher
        build:
          context: datapusher/
        ports:
          - "8800:8800"

      db:
        container_name: db
        env_file:
          - .dev.env
        build:
          context: postgresql/
        volumes:
          - pg_data:/var/lib/postgresql/data

      solr:
        container_name: solr
        build:
          context: solr/

      redis:
        container_name: redis
        image: redis:alpine

    volumes:
      ckan_storage:
      pg_data:
    ```
    The **`services.ckan-dev.image`** value is the image name and tag used when building the image in the second step.
    
6. Run docker-compose:
    ```shell=
    docker-compose -f docker-compose.dev.yml up --build
    ```