Skip to content
Snippets Groups Projects
Verified Commit 8bfcfaec authored by Erwan Rouchet's avatar Erwan Rouchet
Browse files

Remove Ponos git clone from build system

parent 094cccbf
No related branches found
No related tags found
1 merge request!1902Vore Ponos server-side code
......@@ -19,7 +19,6 @@ include:
before_script:
# Custom line to install our own deps from Git using GitLab CI credentials
- "pip install -e git+https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/teklia/arkindex/ponos#egg=ponos-server"
- "pip install -e git+https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/teklia/arkindex/transkribus#egg=transkribus-client"
- pip install -r tests-requirements.txt codecov
- "echo 'database: {host: postgres, port: 5432}\npublic_hostname: http://ci.arkindex.localhost' > $CONFIG_PATH"
......
......@@ -5,20 +5,10 @@ ADD . build
RUN cd build && python3 setup.py sdist
FROM registry.gitlab.com/teklia/arkindex/backend/base:django-4.1.5
ARG PONOS_BRANCH=master
ARG PONOS_ID=10017043
ARG TRANSKRIBUS_BRANCH=master
ARG TRANSKRIBUS_ID=11180199
ARG GITLAB_TOKEN="gaFM7LRa9zy9QMowcUhx"
# Install arkindex-ponos from private repo
RUN \
mkdir /tmp/ponos && \
wget --header "PRIVATE-TOKEN: $GITLAB_TOKEN" https://gitlab.com/api/v4/projects/$PONOS_ID/repository/archive.tar.gz?sha=$PONOS_BRANCH -O /tmp/ponos/archive.tar.gz && \
tar --strip-components=1 -xvf /tmp/ponos/archive.tar.gz -C /tmp/ponos && \
cd /tmp/ponos && pip install --disable-pip-version-check --no-cache-dir --quiet . && \
rm -rf /tmp/ponos
# Install transkribus-client from private repo
RUN \
mkdir /tmp/transkribus && \
......
......@@ -4,8 +4,6 @@ RUN apt-get update && apt-get install --no-install-recommends -y build-essential
RUN pip install nuitka
ARG PONOS_BRANCH=master
ARG PONOS_ID=10017043
ARG TRANSKRIBUS_BRANCH=master
ARG TRANSKRIBUS_ID=11180199
ARG GITLAB_TOKEN="gaFM7LRa9zy9QMowcUhx"
......@@ -19,12 +17,6 @@ ADD arkindex /usr/share/arkindex
ADD base/requirements.txt /tmp/requirements-base-arkindex.txt
ADD requirements.txt /tmp/requirements-arkindex.txt
# Retrieve ponos source code
RUN mkdir /tmp/ponos && \
wget --header "PRIVATE-TOKEN: $GITLAB_TOKEN" https://gitlab.com/api/v4/projects/$PONOS_ID/repository/archive.tar.gz?sha=$PONOS_BRANCH -O /tmp/ponos.tar.gz && \
tar --strip-components=1 -xvf /tmp/ponos.tar.gz -C /tmp/ponos && \
mv /tmp/ponos/ponos /usr/share
# Install transkribus-client from private repo
RUN \
mkdir /tmp/transkribus && \
......@@ -33,14 +25,13 @@ RUN \
mv /tmp/transkribus/transkribus /usr/share
# Build full requirements, removing relative or remote references to arkindex projects
# Special case for approximate requirements from ponos, where we want to keep the versions specified from this repo
RUN cat /tmp/ponos/requirements-server.txt /tmp/requirements-*arkindex.txt | sort | uniq | grep -v -E '^arkindex|^#|^Django~=|^boto3~=|^cryptography~=|^django-enumfields~=|^djangorestframework~=|^pyyaml~=|transkribus-client' > /requirements.txt
RUN cat /tmp/requirements-*arkindex.txt | sort | uniq | grep -v -E '^arkindex|^#|transkribus-client' > /requirements.txt
# List all management commands
RUN find /usr/share/arkindex/*/management -name '*.py' -not -name '__init__.py' > /commands.txt
# Remove arkindex & ponos unit tests
RUN find /usr/share/arkindex /usr/share/ponos -type d -name tests | xargs rm -rf
# Remove arkindex unit tests
RUN find /usr/share/arkindex -type d -name tests | xargs rm -rf
# This configuration is needed to avoid a compilation crash at linking stage
# It only seems to happen on recent gcc
......@@ -50,9 +41,8 @@ ENV NUITKA_RESOURCE_MODE=linker
# Compile all our python source code
# Do not use the -O or -OO python flags here as it removes assert statements (see backend#432)
RUN python -m nuitka \
--nofollow-imports \
--include-package=arkindex \
--include-package=ponos \
--nofollow-imports \
--include-package=arkindex \
--include-package=transkribus \
--show-progress \
--lto=yes \
......
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
PONOS_BRANCH=master
IMAGE_TAG=registry.gitlab.com/teklia/arkindex/backend
.PHONY: all release
......@@ -14,10 +13,10 @@ clean:
find . -name '*.pyc' -exec rm {} \;
build:
CI_PROJECT_DIR=$(ROOT_DIR) CI_REGISTRY_IMAGE=$(IMAGE_TAG) PONOS_BRANCH=$(PONOS_BRANCH) $(ROOT_DIR)/ci/build.sh Dockerfile
CI_PROJECT_DIR=$(ROOT_DIR) CI_REGISTRY_IMAGE=$(IMAGE_TAG) $(ROOT_DIR)/ci/build.sh Dockerfile
binary:
CI_PROJECT_DIR=$(ROOT_DIR) CI_REGISTRY_IMAGE=$(IMAGE_TAG) PONOS_BRANCH=$(PONOS_BRANCH) $(ROOT_DIR)/ci/build.sh Dockerfile.binary -binary
CI_PROJECT_DIR=$(ROOT_DIR) CI_REGISTRY_IMAGE=$(IMAGE_TAG) $(ROOT_DIR)/ci/build.sh Dockerfile.binary -binary
worker:
arkindex/manage.py rqworker -v 2 default high
......
......@@ -37,12 +37,11 @@ if [ -n "$CI_REGISTRY" -a -n "$CI_REGISTRY_USER" -a -n "$CI_REGISTRY_PASSWORD" ]
echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
fi
PONOS_BRANCH=${PONOS_BRANCH:-master}
IMAGE_TAG="$CI_REGISTRY_IMAGE:$VERSION"
cd $CI_PROJECT_DIR
docker pull "$CI_REGISTRY_IMAGE/base:latest"
docker build . -f $DOCKERFILE -t "$IMAGE_TAG" --build-arg "PONOS_BRANCH=$PONOS_BRANCH"
docker build . -f $DOCKERFILE -t "$IMAGE_TAG"
if [ -n "$CI_REGISTRY" ]; then
docker push "$IMAGE_TAG"
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment