blob: e581c0a50b9d610b03d9c98215c64bd3bd82c02d [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 Kupietz3d82f562024-03-16 10:19:03 +010013
14build-and-test-i5:
15 stage: test
16 image: rocker/verse
17 artifacts:
18 paths:
19 - "target/*.i5.xml"
20 - "target/*.zip"
21 cache:
22 - key: DNB4KorAP
23 paths:
24 - apt-cache/
25
26 before_script:
27 - source `find .. -name section_helper.sh`
28 - start_section install_linux_packages "Installing missing Linux packages"
29 - apt-get -o dir::cache::archives="$APT_CACHE_DIR" update
Marc Kupietzab0a7332024-04-26 13:25:16 +020030 - 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 +010031 - end_section install_linux_packages
Marc Kupietzec784c82024-04-21 17:41:00 +020032 - start_section install_models "Installing models"
33 - make models/dereko_domains_s.classifier
34 - end_section install_models
Marc Kupietz3d82f562024-03-16 10:19:03 +010035
36 script:
37 - start_section checking_i5 "Building and testing I5 files"
Marc Kupietz2fe36fa2024-04-15 21:02:36 +020038 - make -j $(nproc) test YEARS=18
Marc Kupietz3d82f562024-03-16 10:19:03 +010039 - end_section checking_i5
40
41
Marc Kupietz6d534882024-03-17 16:25:26 +010042build-index:
Marc Kupietz3d82f562024-03-16 10:19:03 +010043 image: perl:5.38
Marc Kupietzb169c272024-03-16 12:07:54 +010044 services:
45 - docker:dind
Marc Kupietz3d82f562024-03-16 10:19:03 +010046 stage: build
47 rules:
48 - if: $CI_COMMIT_TAG =~ /.+/
49 variables:
50 VID: $CI_COMMIT_TAG
51 - when: manual
52 variables:
53 VID: $CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA
54 PERL_LOCAL_LIB_ROOT: ./perl5
55 PERL5LIB: ./perl5/lib/perl5
56 cache:
57 - key: DNB4KorAP
58 paths:
59 - $PERL_LOCAL_LIB_ROOT
60 - perl5/
61 - apt-cache/
62 - key:
63 files:
Marc Kupietz94bbe6b2024-04-10 20:35:48 +020064 - target/dnb18.i5.xml
Marc Kupietz3d82f562024-03-16 10:19:03 +010065 paths:
Marc Kupietz94bbe6b2024-04-10 20:35:48 +020066 - target/dnb18.zip
67 - target/dnb18.tree_tagger.zip
68 - target/dnb18.marmot-malt.zip
69 - target/dnb18.spacy.zip
70 - target/dnb18.krill.tar
Marc Kupietz13e28582024-04-19 11:26:01 +020071
Marc Kupietz3d82f562024-03-16 10:19:03 +010072 before_script:
73 - source `find .. -name section_helper.sh`
74 - start_section install_linux_packages "Installing missing Linux packages"
75 - mkdir -pv $APT_CACHE_DIR
76 - apt-get -o dir::cache::archives="$APT_CACHE_DIR" update
Marc Kupietzb169c272024-03-16 12:07:54 +010077 - 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 +010078 - end_section install_linux_packages
79
Marc Kupietzb169c272024-03-16 12:07:54 +010080 - start_section install_tree_tagger "Installing TreeTagger"
Marc Kupietz420260d2024-03-17 19:14:10 +010081 - 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 +010082 - end_section install_tree_tagger
83
Marc Kupietz6d534882024-03-17 16:25:26 +010084 - start_section install_spacy "Installing spaCy"
Marc Kupietz420260d2024-03-17 19:14:10 +010085 - 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 +010086 - end_section install_spacy
87
Marc Kupietz3d82f562024-03-16 10:19:03 +010088 - start_section install_perl_packages "Installing missing Perl packages"
89 - curl -L https://cpanmin.us | perl - App::cpanminus
90 - 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 +020091 - cpanm -n -l $PERL_LOCAL_LIB_ROOT https://github.com/KorAP/KorAP-XML-Krill.git
92 - cpanm -n -l $PERL_LOCAL_LIB_ROOT https://github.com/KorAP/KorAP-XML-CoNLL-U.git
Marc Kupietz3d82f562024-03-16 10:19:03 +010093 - end_section install_perl_packages
94
95 script:
96 - export PATH=$PERL_LOCAL_LIB_ROOT/bin:$PATH
Marc Kupietz6d534882024-03-17 16:25:26 +010097 - start_section building_index "Building index"
Marc Kupietz420260d2024-03-17 19:14:10 +010098 - touch target/*.zip # ignore timestamps in make
99 - sleep 1
Marc Kupietz48c6a682024-03-24 15:27:08 +0100100 - touch target/*.*.zip
Marc Kupietz13e28582024-04-19 11:26:01 +0200101 - MAX_THREADS=2 make -j $(nproc) target/dnb.index.tar.xz
Marc Kupietz3d82f562024-03-16 10:19:03 +0100102 - end_section building_krill
103 artifacts:
104 paths:
Marc Kupietzb169c272024-03-16 12:07:54 +0100105 - target/*.zip
Marc Kupietz94bbe6b2024-04-10 20:35:48 +0200106 - target/dnb18.index.tar.xz
Marc Kupietz3d82f562024-03-16 10:19:03 +0100107
108deploy:
109 stage: deploy
110 dependencies:
Marc Kupietz420260d2024-03-17 19:14:10 +0100111 - "build-index"
Marc Kupietz3d82f562024-03-16 10:19:03 +0100112 when: manual
113 image: rocker/verse
114 before_script:
115 - source `find .. -name section_helper.sh`
116 - start_section setup_ssh "Setting up SSH"
117 - apt-get update
118 - apt-get install -y rsync openssh-client
119 - mkdir -p ~/.ssh
120 - chmod 700 ~/.ssh
121 - eval $(ssh-agent -s)
122 - chmod 400 $SSH_PRIVATE_KEY
123 - ssh-add $SSH_PRIVATE_KEY
124 - end_section setup_ssh
125 script:
Marc Kupietzb7696992024-03-18 17:41:15 +0100126 - start_section korapxmlu "Uploading index to KorAP4DNB instance"
Marc Kupietz94bbe6b2024-04-10 20:35:48 +0200127 - touch target/dnb18.index.tar.xz
Marc Kupietzb7696992024-03-18 17:41:15 +0100128 - make deploy
Marc Kupietz3d82f562024-03-16 10:19:03 +0100129 - end_section deploy