Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 30 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,53 @@
ARG DEBIAN_BASE=bullseye
# Using kaldi image for pre-built OpenFST, version is 1.7.2
FROM kaldiasr/kaldi:cpu-debian10-2024-07-29 as kaldi-base
FROM 414502572119.dkr.ecr.us-west-2.amazonaws.com/kaldi:v_5.5.985_4.0.8_${DEBIAN_BASE} AS kaldi-base
FROM debian:${DEBIAN_BASE}-slim AS debian-base
RUN echo "APT::Get::Assume-Yes \"true\";\nAPT::Get::allow \"true\";" | tee -a /etc/apt/apt.conf.d/90_no_prompt && \
echo "APT::Keep-Downloaded-Packages \"false\";" | tee -a /etc/apt/apt.conf.d/91_no_cache && \
apt-get update

FROM debian:11

COPY --from=kaldi-base /opt/kaldi/tools/openfst /opt/openfst
ENV OPENFST_ROOT /opt/openfst
FROM debian-base AS stage

COPY --from=kaldi-base /kaldi/tools/openfst /opt/openfst
ENV OPENFST_ROOT=/opt/openfst

ARG JOBS=4

RUN apt-get update && \
apt-get upgrade -y && \
apt-get -y install \
RUN apt-get install \
cmake \
g++ \
libicu-dev
libicu-dev \
ccache \
git

RUN mkdir /fstalign
COPY CMakeLists.txt /fstalign/CMakeLists.txt
COPY src /fstalign/src
COPY test /fstalign/test
COPY third-party /fstalign/third-party
COPY sample_data /fstalign/sample_data

COPY catch2.patch /fstalign/
WORKDIR /fstalign

RUN mkdir -p /fstalign/build && \
RUN git apply catch2.patch
RUN --mount=type=cache,target=/root/.ccache,sharing=locked \
mkdir -p /fstalign/build && \
cd /fstalign/build && \
rm -rf * && \
cmake .. -DOPENFST_ROOT="${OPENFST_ROOT}" -DDYNAMIC_OPENFST=ON && \
cmake .. -DOPENFST_ROOT="${OPENFST_ROOT}" -DDYNAMIC_OPENFST=OFF && \
make -j${JOBS} VERBOSE=1 && \
mkdir -p /fstalign/bin && \
cp /fstalign/build/fstalign /fstalign/bin && \
strip /fstalign/bin/*

RUN make test
FROM debian-base AS release
WORKDIR /fstalign
RUN if [ "${DEBIAN_BASE}" = "bullseye" ]; then \
apt-get install --no-install-recommends libicu67; \
else \
apt-get install --no-install-recommends libicu72; \
fi; \
rm -rf /var/lib/apt/lists/*
COPY tools /fstalign/tools

ENV PATH \
/fstalign/bin/:\
$PATH
COPY --from=stage /fstalign/bin /fstalign/bin
ENV PATH=/fstalign/bin:$PATH
28 changes: 28 additions & 0 deletions catch2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/third-party/catch2/include/internal/catch_fatal_condition.cpp b/third-party/catch2/include/internal/catch_fatal_condition.cpp
index 24e16d3c..78ddc6e5 100644
--- a/third-party/catch2/include/internal/catch_fatal_condition.cpp
+++ b/third-party/catch2/include/internal/catch_fatal_condition.cpp
@@ -97,7 +97,8 @@ namespace Catch {

// 32kb for the alternate stack seems to be sufficient. However, this value
// is experimentally determined, so that's not guaranteed.
- constexpr static std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
+ // Note: MINSIGSTKSZ is not constexpr in glibc 2.34+, so we use a fixed safe value
+ constexpr static std::size_t sigStackSize = 32768;

static SignalDefs signalDefs[] = {
{ SIGINT, "SIGINT - Terminal interrupt signal" },
diff --git a/third-party/catch2/single_include/catch2/catch.hpp b/third-party/catch2/single_include/catch2/catch.hpp
index b324e56a..6a104637 100644
--- a/third-party/catch2/single_include/catch2/catch.hpp
+++ b/third-party/catch2/single_include/catch2/catch.hpp
@@ -7969,7 +7969,8 @@ namespace Catch {

// 32kb for the alternate stack seems to be sufficient. However, this value
// is experimentally determined, so that's not guaranteed.
- constexpr static std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
+ // Note: MINSIGSTKSZ is not constexpr in glibc 2.34+, so we use a fixed safe value
+ constexpr static std::size_t sigStackSize = 32768;

static SignalDefs signalDefs[] = {
{ SIGINT, "SIGINT - Terminal interrupt signal" },
2 changes: 1 addition & 1 deletion src/FstFileLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* FstLoader for loading a serialized FST from disk.
*
* Quinn McNamara (quinn@rev.com)
* JP Robichaud (jp@rev.com)
* 2020
*/

Expand Down
2 changes: 1 addition & 1 deletion src/wer.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Collection of functions specific to the WER subcommand.
*
* Quinn McNamara (quinn@rev.com)
* JP Robichaud (jp@rev.com)
* 2021
*/
#include "fstalign.h"
Expand Down
Loading