blob: 1c238b9ca4f237def5d0eee712c1d3c68c619719 [file] [log] [blame]
Marc Kupietz3d82f562024-03-16 10:19:03 +01001
2stages:
3 - test
4 - build
5 - deploy
6
7variables:
8 VID: $VID
9 DEBIAN_FRONTEND: noninteractive
10 APT_CACHE_DIR: apt-cache
Marc Kupietzd320f992024-04-19 12:30:04 +020011 SRC_DIR: test/resources/DNB
Marc Kupietzfddbb512024-04-26 16:49:02 +020012 YEARS: "13 18"
Marc Kupietz82e5b7b2025-09-25 09:58:29 +020013 SAXON_HOME: "$CI_PROJECT_DIR/lib"
Marc Kupietz3d82f562024-03-16 10:19:03 +010014
15build-and-test-i5:
16 stage: test
17 image: rocker/verse
18 artifacts:
19 paths:
Marc Kupietz5b734ce2024-04-26 17:20:09 +020020 - "target/dnb??.i5.xml"
Marc Kupietz3d82f562024-03-16 10:19:03 +010021 - "target/*.zip"
22 cache:
23 - key: DNB4KorAP
24 paths:
25 - apt-cache/
26
27 before_script:
28 - source `find .. -name section_helper.sh`
Marc Kupietz82e5b7b2025-09-25 09:58:29 +020029 - mkdir -p "$SAXON_HOME"
30 - |
31 if [ -n "$SAXON_LICENSE" ] && [ -f "$SAXON_LICENSE" ]; then
32 cp "$SAXON_LICENSE" "$SAXON_HOME/saxon-license.lic"
33 fi
Marc Kupietz3d82f562024-03-16 10:19:03 +010034 - start_section install_linux_packages "Installing missing Linux packages"
35 - apt-get -o dir::cache::archives="$APT_CACHE_DIR" update
Marc Kupietzab0a7332024-04-26 13:25:16 +020036 - apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y libxml2-utils curl openjdk-17-jre-headless xmlstarlet
Marc Kupietz3d82f562024-03-16 10:19:03 +010037 - end_section install_linux_packages
Marc Kupietzec784c82024-04-21 17:41:00 +020038 - start_section install_models "Installing models"
39 - make models/dereko_domains_s.classifier
40 - end_section install_models
Marc Kupietz3d82f562024-03-16 10:19:03 +010041
42 script:
43 - start_section checking_i5 "Building and testing I5 files"
Marc Kupietzedce85c2024-04-26 17:17:25 +020044 - make -j $(nproc) test
Marc Kupietz3d82f562024-03-16 10:19:03 +010045 - end_section checking_i5
46
47
Marc Kupietz6d534882024-03-17 16:25:26 +010048build-index:
Marc Kupietz3d82f562024-03-16 10:19:03 +010049 image: perl:5.38
Marc Kupietzb169c272024-03-16 12:07:54 +010050 services:
51 - docker:dind
Marc Kupietz3d82f562024-03-16 10:19:03 +010052 stage: build
53 rules:
Marc Kupietzdf3aacd2024-05-09 21:55:54 +020054 - if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $CI_JOB_MANUAL == "true"'
Marc Kupietzf9a703b2024-05-09 21:53:32 +020055 variables:
56 VID: $CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA
57 PERL_LOCAL_LIB_ROOT: ./perl5
58 PERL5LIB: ./perl5/lib/perl5
Marc Kupietz3d82f562024-03-16 10:19:03 +010059 cache:
60 - key: DNB4KorAP
61 paths:
62 - $PERL_LOCAL_LIB_ROOT
63 - perl5/
64 - apt-cache/
65 - key:
66 files:
Marc Kupietz94bbe6b2024-04-10 20:35:48 +020067 - target/dnb18.i5.xml
Marc Kupietz3d82f562024-03-16 10:19:03 +010068 paths:
Marc Kupietz94bbe6b2024-04-10 20:35:48 +020069 - target/dnb18.zip
70 - target/dnb18.tree_tagger.zip
71 - target/dnb18.marmot-malt.zip
72 - target/dnb18.spacy.zip
73 - target/dnb18.krill.tar
Marc Kupietz13e28582024-04-19 11:26:01 +020074
Marc Kupietz3d82f562024-03-16 10:19:03 +010075 before_script:
76 - source `find .. -name section_helper.sh`
Marc Kupietz82e5b7b2025-09-25 09:58:29 +020077 - mkdir -p "$SAXON_HOME"
78 - |
79 if [ -n "$SAXON_LICENSE" ] && [ -f "$SAXON_LICENSE" ]; then
80 cp "$SAXON_LICENSE" "$SAXON_HOME/saxon-license.lic"
81 fi
Marc Kupietz3d82f562024-03-16 10:19:03 +010082 - start_section install_linux_packages "Installing missing Linux packages"
83 - mkdir -pv $APT_CACHE_DIR
84 - apt-get -o dir::cache::archives="$APT_CACHE_DIR" update
Marc Kupietzb169c272024-03-16 12:07:54 +010085 - apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y rsync pv jq curl openjdk-17-jre-headless docker.io
Marc Kupietz3d82f562024-03-16 10:19:03 +010086 - end_section install_linux_packages
87
Marc Kupietzb169c272024-03-16 12:07:54 +010088 - start_section install_tree_tagger "Installing TreeTagger"
Marc Kupietz420260d2024-03-17 19:14:10 +010089 - docker image inspect korap/conllu2treetagger:latest >/dev/null 2>&1 || curl -Ls 'https://gitlab.ids-mannheim.de/KorAP/CoNLL-U-Treetagger/-/jobs/artifacts/master/raw/conllu2treetagger.xz?job=build-docker-image' | docker load
Marc Kupietzb169c272024-03-16 12:07:54 +010090 - end_section install_tree_tagger
91
Marc Kupietz6d534882024-03-17 16:25:26 +010092 - start_section install_spacy "Installing spaCy"
Marc Kupietz420260d2024-03-17 19:14:10 +010093 - docker image inspect korap/conllu2spacy:latest >/dev/null 2>&1 || curl -Ls https://corpora.ids-mannheim.de/tools/conllu2spacy.tar.xz | docker load
Marc Kupietz6d534882024-03-17 16:25:26 +010094 - end_section install_spacy
95
Marc Kupietz3d82f562024-03-16 10:19:03 +010096 - start_section install_perl_packages "Installing missing Perl packages"
97 - curl -L https://cpanmin.us | perl - App::cpanminus
98 - cpanm -n -l $PERL_LOCAL_LIB_ROOT File::ShareDir::Install https://github.com/KorAP/KorAP-XML-TEI.git
Marc Kupietzf73a91d2024-04-10 20:45:42 +020099 - cpanm -n -l $PERL_LOCAL_LIB_ROOT https://github.com/KorAP/KorAP-XML-Krill.git
100 - cpanm -n -l $PERL_LOCAL_LIB_ROOT https://github.com/KorAP/KorAP-XML-CoNLL-U.git
Marc Kupietz3d82f562024-03-16 10:19:03 +0100101 - end_section install_perl_packages
102
103 script:
104 - export PATH=$PERL_LOCAL_LIB_ROOT/bin:$PATH
Marc Kupietz6d534882024-03-17 16:25:26 +0100105 - start_section building_index "Building index"
Marc Kupietz420260d2024-03-17 19:14:10 +0100106 - touch target/*.zip # ignore timestamps in make
107 - sleep 1
Marc Kupietz48c6a682024-03-24 15:27:08 +0100108 - touch target/*.*.zip
Marc Kupietz13e28582024-04-19 11:26:01 +0200109 - MAX_THREADS=2 make -j $(nproc) target/dnb.index.tar.xz
Marc Kupietz3d82f562024-03-16 10:19:03 +0100110 - end_section building_krill
111 artifacts:
112 paths:
Marc Kupietzb169c272024-03-16 12:07:54 +0100113 - target/*.zip
Marc Kupietz94bbe6b2024-04-10 20:35:48 +0200114 - target/dnb18.index.tar.xz
Marc Kupietz3d82f562024-03-16 10:19:03 +0100115
116deploy:
117 stage: deploy
118 dependencies:
Marc Kupietz420260d2024-03-17 19:14:10 +0100119 - "build-index"
Marc Kupietz105913d2024-05-09 21:34:13 +0200120 rules:
Marc Kupietzdf3aacd2024-05-09 21:55:54 +0200121 - if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $CI_JOB_MANUAL == "true"'
Marc Kupietz3d82f562024-03-16 10:19:03 +0100122 image: rocker/verse
123 before_script:
124 - source `find .. -name section_helper.sh`
Marc Kupietz82e5b7b2025-09-25 09:58:29 +0200125 - mkdir -p "$SAXON_HOME"
126 - |
127 if [ -n "$SAXON_LICENSE" ] && [ -f "$SAXON_LICENSE" ]; then
128 cp "$SAXON_LICENSE" "$SAXON_HOME/saxon-license.lic"
129 fi
Marc Kupietz3d82f562024-03-16 10:19:03 +0100130 - start_section setup_ssh "Setting up SSH"
131 - apt-get update
132 - apt-get install -y rsync openssh-client
133 - mkdir -p ~/.ssh
134 - chmod 700 ~/.ssh
135 - eval $(ssh-agent -s)
136 - chmod 400 $SSH_PRIVATE_KEY
137 - ssh-add $SSH_PRIVATE_KEY
138 - end_section setup_ssh
139 script:
Marc Kupietzb7696992024-03-18 17:41:15 +0100140 - start_section korapxmlu "Uploading index to KorAP4DNB instance"
Marc Kupietz94bbe6b2024-04-10 20:35:48 +0200141 - touch target/dnb18.index.tar.xz
Marc Kupietzb7696992024-03-18 17:41:15 +0100142 - make deploy
Marc Kupietz3d82f562024-03-16 10:19:03 +0100143 - end_section deploy