Skip to content

Commit

Permalink
Install resources for unit test in all CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kleag committed May 9, 2024
1 parent e10038d commit f33b8b4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
8 changes: 7 additions & 1 deletion continuous_integration/Dockerfile-debian12
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,13 @@ ENV QT_VERSION_MAJOR="${QT_VERSION_MAJOR}"
# Build
#
RUN cmake -G Ninja -DLIMA_RESOURCES:STRING=build -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_BUILD_TYPE:STRING=Release -DLIMA_VERSION_RELEASE:STRING="$(cat /src/lima/release)" -DSHORTEN_POR_CORPUS_FOR_SVMLEARN:BOOL=ON -DCTEST_OUTPUT_ON_FAILURE=ON -DTF_SOURCES_PATH:PATH="/usr" -DWITH_DEBUG_MESSAGES=ON -DWITH_ARCH=OFF -DWITH_ASAN=OFF -DWITH_GUI=ON -DCMAKE_PREFIX_PATH=$LIBTORCH_PATH -DQT_VERSION_MAJOR=${QT_VERSION_MAJOR} ..
RUN ninja && ninja install && ninja test && ninja package
RUN ninja && ninja install
# Some models are necessary for unit tests to work, let's use a previous
# version of lima-python to install them, then run tests and finally remove
# old aymara/lima and downloaded models
RUN wget -q https://github.com/aymara/lima-python/releases/download/continuous/aymara-0.5.0b6-cp37-abi3-manylinux_2_28_x86_64.whl && pip install ./aymara-0.5.0b6-cp37-abi3-manylinux_2_28_x86_64.whl && lima_models -i eng && && deeplima_models -i UD_English-EWT && pip uninstall -y aymara && (ctest || ctest --rerun-failed --output-on-failure) && rm -Rf $HOME/.local/share/lima

RUN ninja package
RUN install -D -t /usr/share/apps/lima/packages /src/lima/build/*.deb

# WORKDIR /usr/share/apps/lima/tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,6 @@ ENV NLTK_PTB_DP_FILE=/nltk_data/corpora/dependency_treebank/nltk-ptb.dp \
Qt_INSTALL_DIR=/opt/qt6 \
BOOST_ROOT=/opt/boost

# Some models are necessary for unit tests to work, let's use a previous
# version of lima-python to install them
RUN wget -q https://github.com/aymara/lima-python/releases/download/continuous/aymara-0.5.0b6-cp37-abi3-manylinux_2_28_x86_64.whl
RUN pip install ./aymara-0.5.0b6-cp37-abi3-manylinux_2_28_x86_64.whl
RUN lima_models -i eng
RUN deeplima_models -i UD_English-EWT
RUN pip uninstall -y aymara

# Build
#
# -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
Expand All @@ -115,7 +107,11 @@ RUN cmake -G Ninja \
-DWITH_ASAN=OFF \
-DWITH_GUI=ON ..
RUN ninja && ninja install
RUN ctest || ctest --rerun-failed --output-on-failure

# Some models are necessary for unit tests to work, let's use a previous
# version of lima-python to install them, then run tests and finally remove
# old aymara/lima and downloaded models
RUN wget -q https://github.com/aymara/lima-python/releases/download/continuous/aymara-0.5.0b6-cp37-abi3-manylinux_2_28_x86_64.whl && pip install ./aymara-0.5.0b6-cp37-abi3-manylinux_2_28_x86_64.whl && lima_models -i eng && && deeplima_models -i UD_English-EWT && pip uninstall -y aymara && (ctest || ctest --rerun-failed --output-on-failure) && rm -Rf $HOME/.local/share/lima

#WORKDIR /opt/lima/share/apps/lima/tests
#RUN /bin/bash -c "set -o pipefail && tva --language=eng test-eng.*.xml 2>&1 | tee tva-eng.log"
Expand Down
8 changes: 7 additions & 1 deletion continuous_integration/Dockerfile-ubuntu22.04
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@ ENV CXXFLAGS=$CXXFLAGS


RUN cmake -G Ninja -DWITH_LIMA_RESOURCES:BOOL=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_BUILD_TYPE:STRING=Release -DLIMA_VERSION_RELEASE:STRING="$(cat /src/lima/release)" -DSHORTEN_POR_CORPUS_FOR_SVMLEARN:BOOL=ON -DCTEST_OUTPUT_ON_FAILURE=ON -DTF_SOURCES_PATH:PATH="/usr" -DTORCH_CUDA_ARCH_LIST=6.1 -DCMAKE_PREFIX_PATH=/src/lima/extern/libtorch -DWITH_DEBUG_MESSAGES=ON -DWITH_ARCH=OFF -DWITH_ASAN=OFF -DWITH_GUI=ON ..
RUN ninja && ninja install && ninja test
RUN ninja && ninja install

# Some models are necessary for unit tests to work, let's use a previous
# version of lima-python to install them, then run tests and finally remove
# old aymara/lima and downloaded models
RUN wget -q https://github.com/aymara/lima-python/releases/download/continuous/aymara-0.5.0b6-cp37-abi3-manylinux_2_28_x86_64.whl && pip install ./aymara-0.5.0b6-cp37-abi3-manylinux_2_28_x86_64.whl && lima_models -i eng && && deeplima_models -i UD_English-EWT && pip uninstall -y aymara && (ctest || ctest --rerun-failed --output-on-failure) && rm -Rf $HOME/.local/share/lima

RUN bash -c 'if [[ "$PACKAGES" == "yes" ]] ; then ninja package && install -D -t /usr/share/apps/lima/packages /src/lima/build/*.deb ; fi'

# WORKDIR /usr/share/apps/lima/tests
Expand Down
7 changes: 6 additions & 1 deletion continuous_integration/Dockerfile-ubuntu22.04-fia
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,9 @@ ENV CUDA_HOME=/usr/local/cuda \
#

RUN cmake -G Ninja -DWITH_LIMA_RESOURCES:BOOL=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_BUILD_TYPE:STRING=Release -DLIMA_VERSION_RELEASE:STRING="$(cat /src/lima/release)" -DSHORTEN_POR_CORPUS_FOR_SVMLEARN:BOOL=ON -DCTEST_OUTPUT_ON_FAILURE=ON -DTF_SOURCES_PATH:PATH="/usr" -DTORCH_CUDA_ARCH_LIST=6.1 -DCMAKE_PREFIX_PATH=/src/lima/extern/libtorch -DWITH_DEBUG_MESSAGES=ON -DWITH_ARCH=OFF -DWITH_ASAN=OFF -DWITH_GUI=OFF -DCMAKE_CUDA_COMPILER:PATH=/usr/local/cuda/bin/nvcc ..
RUN ninja && ninja install && ninja test
RUN ninja && ninja install

# Some models are necessary for unit tests to work, let's use a previous
# version of lima-python to install them, then run tests and finally remove
# old aymara/lima and downloaded models
RUN wget -q https://github.com/aymara/lima-python/releases/download/continuous/aymara-0.5.0b6-cp37-abi3-manylinux_2_28_x86_64.whl && pip install ./aymara-0.5.0b6-cp37-abi3-manylinux_2_28_x86_64.whl && lima_models -i eng && && deeplima_models -i UD_English-EWT && pip uninstall -y aymara && (ctest || ctest --rerun-failed --output-on-failure) && rm -Rf $HOME/.local/share/lima

0 comments on commit f33b8b4

Please sign in to comment.