| Marc Kupietz | d96aa5a | 2025-10-26 16:09:23 +0100 | [diff] [blame] | 1 | stages: |
| 2 | - test |
| 3 | - build |
| 4 | |
| Rebecca Wilm | afbcd7f | 2022-11-09 16:46:48 +0100 | [diff] [blame] | 5 | default: |
| Marc Kupietz | b1c30b2 | 2024-02-05 07:03:51 +0100 | [diff] [blame] | 6 | image: python:3.12-bookworm |
| Rebecca Wilm | afbcd7f | 2022-11-09 16:46:48 +0100 | [diff] [blame] | 7 | |
| 8 | variables: |
| 9 | PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" |
| 10 | |
| 11 | cache: |
| 12 | paths: |
| 13 | - .cache/pip |
| 14 | - venv/ |
| 15 | |
| 16 | before_script: |
| Marc Kupietz | 5936096 | 2024-02-01 15:51:56 +0100 | [diff] [blame] | 17 | - perl -v |
| Rebecca Wilm | afbcd7f | 2022-11-09 16:46:48 +0100 | [diff] [blame] | 18 | - python -m venv venv |
| 19 | - source venv/bin/activate |
| 20 | - export PYTHONPATH=PYTHONPATH:. |
| Marc Kupietz | 1f7dd6e | 2024-02-05 06:45:01 +0100 | [diff] [blame] | 21 | - venv/bin/pip install --upgrade pip |
| 22 | - pip install -r requirements.txt |
| Rebecca Wilm | afbcd7f | 2022-11-09 16:46:48 +0100 | [diff] [blame] | 23 | - python -m spacy download de_core_news_lg |
| 24 | - apt update -y |
| Marc Kupietz | b1c30b2 | 2024-02-05 07:03:51 +0100 | [diff] [blame] | 25 | - apt-get install -y cpanminus git |
| Rebecca Wilm | afbcd7f | 2022-11-09 16:46:48 +0100 | [diff] [blame] | 26 | - cpanm https://github.com/KorAP/KorAP-XML-CoNLL-U.git |
| 27 | |
| 28 | test-job: |
| 29 | stage: test |
| Marc Kupietz | fc34de6 | 2024-02-01 12:04:27 +0100 | [diff] [blame] | 30 | artifacts: |
| 31 | paths: |
| 32 | - rei.spacy.zip |
| Marc Kupietz | 13f40bb | 2024-02-01 15:51:37 +0100 | [diff] [blame] | 33 | - rei.spacy.conllu |
| Rebecca Wilm | afbcd7f | 2022-11-09 16:46:48 +0100 | [diff] [blame] | 34 | script: |
| 35 | - mkdir logs |
| Marc Kupietz | 13f40bb | 2024-02-01 15:51:37 +0100 | [diff] [blame] | 36 | - korapxml2conllu rei.zip | python ./systems/parse_spacy_pipe.py | tee rei.spacy.conllu | conllu2korapxml > rei.spacy.zip |
| Marc Kupietz | 0e6c546 | 2024-02-01 16:33:57 +0100 | [diff] [blame] | 37 | - (! grep -E '^0' ./rei.spacy.conllu) |
| Marc Kupietz | d96aa5a | 2025-10-26 16:09:23 +0100 | [diff] [blame] | 38 | |
| 39 | # Build Docker image with morphological features and dependency parsing |
| 40 | build-docker: |
| 41 | stage: build |
| 42 | image: docker:24.0.5 |
| 43 | services: |
| 44 | - docker:24.0.5-dind |
| 45 | variables: |
| 46 | DOCKER_TLS_CERTDIR: "/certs" |
| 47 | before_script: |
| 48 | - docker info |
| 49 | # Determine image tag based on git ref |
| 50 | - | |
| 51 | if [ -n "$CI_COMMIT_TAG" ]; then |
| 52 | export IMAGE_TAG="$CI_COMMIT_TAG" |
| 53 | export IMAGE_NAME="conllu2spacy-$CI_COMMIT_TAG" |
| 54 | else |
| 55 | export IMAGE_TAG="$CI_COMMIT_SHORT_SHA" |
| 56 | export IMAGE_NAME="conllu2spacy-$CI_COMMIT_SHORT_SHA" |
| 57 | fi |
| 58 | - echo "Building image with tag $IMAGE_TAG" |
| 59 | - echo "Image name will be $IMAGE_NAME" |
| 60 | script: |
| 61 | - docker build -t korap/conllu2spacy:$IMAGE_TAG . |
| 62 | - docker save korap/conllu2spacy:$IMAGE_TAG | xz > $IMAGE_NAME.tar.xz |
| 63 | - ls -lh $IMAGE_NAME.tar.xz |
| 64 | artifacts: |
| 65 | paths: |
| 66 | - "*.tar.xz" |
| 67 | expire_in: 1 week |
| 68 | name: "docker-image-$IMAGE_TAG" |
| 69 | rules: |
| 70 | - if: $CI_COMMIT_TAG |
| 71 | when: always |
| 72 | - when: manual |
| 73 | allow_failure: true |