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

updates ckan version and adds xloader version control #139

Merged
merged 3 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
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
130 changes: 0 additions & 130 deletions .github/workflows/master_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,136 +219,6 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache-ubuntu-2-9
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-ubuntu-2-9

build-ckan-2-8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: |
/tmp/.buildx-cache-alpine-2-8
/tmp/.buildx-cache-ubuntu-2-8
key: ${{ runner.os }}-buildx-2-8-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-2-8

- name: Get docker tag for Alpine image
id: alpine
run: |
echo "IMAGE_TAG=$(awk -F '=' '/IMAGE_TAG/{print $2}' ./images/ckan/2.8/Dockerfile)" >> $GITHUB_OUTPUT

- name: Build and push CKAN 2.8 alpine
uses: docker/build-push-action@v5
with:
context: ./images/ckan/2.8
file: ./images/ckan/2.8/Dockerfile
push: true
tags: |
keitaro/ckan:${{ steps.alpine.outputs.IMAGE_TAG }}
ghcr.io/keitaroinc/ckan:${{ steps.alpine.outputs.IMAGE_TAG }}
cache-from: type=local,src=/tmp/.buildx-cache-alpine-2-8
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-alpine-2-8

- name: Get docker tag for Ubuntu image
id: ubuntu
run: |
echo "IMAGE_TAG=$(awk -F '=' '/IMAGE_TAG/{print $2}' ./images/ckan/2.8/Dockerfile.focal)" >> $GITHUB_OUTPUT

- name: Build and push CKAN 2.8 ubuntu
uses: docker/build-push-action@v5
with:
context: ./images/ckan/2.8
file: ./images/ckan/2.8/Dockerfile.focal
push: true
tags: |
keitaro/ckan:${{ steps.ubuntu.outputs.IMAGE_TAG }}
ghcr.io/keitaroinc/ckan:${{ steps.ubuntu.outputs.IMAGE_TAG }}
cache-from: type=local,src=/tmp/.buildx-cache-ubuntu-2-8
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-ubuntu-2-8

build-ckan-2-7:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: |
/tmp/.buildx-cache-alpine-2-7
/tmp/.buildx-cache-ubuntu-2-7
key: ${{ runner.os }}-buildx-2-7-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-2-7

- name: Get docker tag for Alpine image
id: alpine
run: |
echo "IMAGE_TAG=$(awk -F '=' '/IMAGE_TAG/{print $2}' ./images/ckan/2.7/Dockerfile)" >> $GITHUB_OUTPUT

- name: Build and push CKAN 2.7 alpine
uses: docker/build-push-action@v5
with:
context: ./images/ckan/2.7
file: ./images/ckan/2.7/Dockerfile
push: true
tags: |
keitaro/ckan:${{ steps.alpine.outputs.IMAGE_TAG }}
ghcr.io/keitaroinc/ckan:${{ steps.alpine.outputs.IMAGE_TAG }}
cache-from: type=local,src=/tmp/.buildx-cache-alpine-2-7
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-alpine-2-7

- name: Get docker tag for Ubuntu image
id: ubuntu
run: |
echo "IMAGE_TAG=$(awk -F '=' '/IMAGE_TAG/{print $2}' ./images/ckan/2.7/Dockerfile.focal)" >> $GITHUB_OUTPUT

- name: Build CKAN 2.7 ubuntu
uses: docker/build-push-action@v5
with:
context: ./images/ckan/2.7
file: ./images/ckan/2.7/Dockerfile.focal
push: true
tags: |
keitaro/ckan:${{ steps.ubuntu.outputs.IMAGE_TAG }}
ghcr.io/keitaroinc/ckan:${{ steps.ubuntu.outputs.IMAGE_TAG }}
cache-from: type=local,src=/tmp/.buildx-cache-ubuntu-2-7
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-ubuntu-2-7

build-ckan-datapusher:
runs-on: ubuntu-latest
steps:
Expand Down
96 changes: 0 additions & 96 deletions .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,102 +173,6 @@ jobs:
build-args: |
--progress=plain

build-ckan-2-8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: |
/tmp/.buildx-cache-alpine-2-8
/tmp/.buildx-cache-ubuntu-2-8
key: ${{ runner.os }}-buildx-2-8-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-2-8

- name: Get docker tag for Alpine image
id: alpine
run: |
echo "IMAGE_TAG=$(awk -F '=' '/IMAGE_TAG/{print $2}' ./images/ckan/2.8/Dockerfile)" >> $GITHUB_OUTPUT

- name: Build CKAN 2.8 alpine
uses: docker/build-push-action@v5
with:
context: ./images/ckan/2.8
file: ./images/ckan/2.8/Dockerfile
push: false
tags: keitaro/ckan:${{ steps.alpine.outputs.IMAGE_TAG }}
cache-from: type=local,src=/tmp/.buildx-cache-alpine-2-8
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-alpine-2-8

- name: Get docker tag for Ubuntu image
id: ubuntu
run: |
echo "IMAGE_TAG=$(awk -F '=' '/IMAGE_TAG/{print $2}' ./images/ckan/2.8/Dockerfile.focal)" >> $GITHUB_OUTPUT

- name: Build CKAN 2.8 ubuntu
uses: docker/build-push-action@v5
with:
context: ./images/ckan/2.8
file: ./images/ckan/2.8/Dockerfile.focal
push: false
tags: keitaro/ckan:${{ steps.ubuntu.outputs.IMAGE_TAG }}
cache-from: type=local,src=/tmp/.buildx-cache-ubuntu-2-8
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-ubuntu-2-8

build-ckan-2-7:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: |
/tmp/.buildx-cache-alpine-2-7
/tmp/.buildx-cache-ubuntu-2-7
key: ${{ runner.os }}-buildx-2-7-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-2-7

- name: Get docker tag for Alpine image
id: alpine
run: |
echo "IMAGE_TAG=$(awk -F '=' '/IMAGE_TAG/{print $2}' ./images/ckan/2.7/Dockerfile)" >> $GITHUB_OUTPUT

- name: Build CKAN 2.7 alpine
uses: docker/build-push-action@v5
with:
context: ./images/ckan/2.7
file: ./images/ckan/2.7/Dockerfile
push: false
tags: keitaro/ckan:${{ steps.alpine.outputs.IMAGE_TAG }}
cache-from: type=local,src=/tmp/.buildx-cache-alpine-2-7
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-alpine-2-7

- name: Get docker tag for Ubuntu image
id: ubuntu
run: |
echo "IMAGE_TAG=$(awk -F '=' '/IMAGE_TAG/{print $2}' ./images/ckan/2.7/Dockerfile.focal)" >> $GITHUB_OUTPUT

- name: Build CKAN 2.7 ubuntu
uses: docker/build-push-action@v5
with:
context: ./images/ckan/2.7
file: ./images/ckan/2.7/Dockerfile.focal
push: false
tags: keitaro/ckan:${{ steps.ubuntu.outputs.IMAGE_TAG }}
cache-from: type=local,src=/tmp/.buildx-cache-ubuntu-2-7
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-ubuntu-2-7

build-ckan-datapusher:
runs-on: ubuntu-latest
steps:
Expand Down
19 changes: 13 additions & 6 deletions images/ckan/2.10/Dockerfile.xloader
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
FROM alpine:3.17.2 as ckanbuild

# Used by Github Actions to tag the image with
ENV IMAGE_TAG=2.10.4-xloader
ENV IMAGE_TAG=2.10.5-xloader

# Set CKAN version to build
ENV GIT_URL=https://github.com/ckan/ckan.git
ENV GIT_BRANCH=ckan-2.10.4
ENV GIT_BRANCH=ckan-2.10.5

# Set src dirs
ENV SRC_DIR=/srv/app/src
Expand Down Expand Up @@ -100,6 +100,11 @@ FROM alpine:3.17.2
LABEL maintainer="Keitaro Inc <info@keitaro.com>"
LABEL org.opencontainers.image.source https://github.com/keitaroinc/docker-ckan

# Xloader version control

ENV XLOADER_URL=https://github.com/ckan/ckanext-xloader.git
ENV XLOADER_VERSION=1.1.2

ENV APP_DIR=/srv/app
ENV SRC_DIR=/srv/app/src
ENV CKAN_DIR=${SRC_DIR}/ckan
Expand Down Expand Up @@ -131,10 +136,10 @@ RUN apk add --no-cache \
RUN curl -o ${SRC_DIR}/get-pip.py https://bootstrap.pypa.io/get-pip.py && \
python ${SRC_DIR}/get-pip.py

### XLoader ###
RUN pip3 install -e 'git+https://github.com/keitaroinc/ckanext-xloader.git@master#egg=ckanext-xloader' && \
pip3 install -r ${SRC_DIR}/ckanext-xloader/requirements.txt && \
pip3 install -U requests[security]
### XLoader ###
RUN pip3 install -e git+${XLOADER_URL}@${XLOADER_VERSION}#egg=ckanext-xloader && \
pip3 install -r ${SRC_DIR}/ckanext-xloader/requirements.txt && \
pip3 install -U requests[security]

# Get artifacts from build stages
COPY --from=ckanbuild /wheels /srv/app/wheels
Expand All @@ -150,6 +155,8 @@ RUN addgroup -g 92 -S ckan && \

WORKDIR ${CKAN_DIR}

#Removes bugged package
RUN rm -rf /usr/lib/python3.10/site-packages/packaging*
# Install CKAN
RUN pip install -e /srv/app/src/ckan && \
cp who.ini ${APP_DIR} && \
Expand Down