Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Backend
Commits
8bfcfaec
Verified
Commit
8bfcfaec
authored
2 years ago
by
Erwan Rouchet
Browse files
Options
Downloads
Patches
Plain Diff
Remove Ponos git clone from build system
parent
094cccbf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1902
Vore Ponos server-side code
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
.gitlab-ci.yml
+0
-1
0 additions, 1 deletion
.gitlab-ci.yml
Dockerfile
+0
-10
0 additions, 10 deletions
Dockerfile
Dockerfile.binary
+5
-15
5 additions, 15 deletions
Dockerfile.binary
Makefile
+2
-3
2 additions, 3 deletions
Makefile
ci/build.sh
+1
-2
1 addition, 2 deletions
ci/build.sh
with
8 additions
and
31 deletions
.gitlab-ci.yml
+
0
−
1
View file @
8bfcfaec
...
...
@@ -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}
\n
public_hostname:
http://ci.arkindex.localhost'
>
$CONFIG_PATH"
...
...
This diff is collapsed.
Click to expand it.
Dockerfile
+
0
−
10
View file @
8bfcfaec
...
...
@@ -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
&&
\
...
...
This diff is collapsed.
Click to expand it.
Dockerfile.binary
+
5
−
15
View file @
8bfcfaec
...
...
@@ -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 \
...
...
This diff is collapsed.
Click to expand it.
Makefile
+
2
−
3
View file @
8bfcfaec
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
...
...
This diff is collapsed.
Click to expand it.
ci/build.sh
+
1
−
2
View file @
8bfcfaec
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment