Сервис был развернут в контейнере Linux (k8s) и содержит двоичный файл LibreOffice.
LibreOffice был установлен внутри контейнера с помощью сценария ниже.
Код: Выделить всё
RUN apt-get update -y
RUN apt-get install -y --no-install-recommends \
default-jre \
libreoffice \
libreoffice-writer \
ure \
libreoffice-java-common \
libreoffice-core \
libreoffice-common \
fonts-opensymbol \
hyphen-fr \
hyphen-de \
hyphen-en-us \
hyphen-it \
hyphen-ru \
fonts-dejavu \
fonts-dejavu-core \
fonts-dejavu-extra \
fonts-droid-fallback \
fonts-dustin \
fonts-f500 \
fonts-fanwood \
fonts-freefont-ttf \
fonts-liberation \
fonts-lmodern \
fonts-lyx \
fonts-sil-gentium \
fonts-texgyre \
fonts-tlwg-purisa
RUN apt-get -y -q remove libreoffice-gnome && \
apt -y autoremove
RUN rm -rf /var/lib/apt/lists/*
RUN adduser --home=/opt/libreoffice --disabled-password --gecos "" --shell=/bin/bash libreoffice
Список аргументов размещен ниже:
Код: Выделить всё
private List GetCommandArguments(string docx, long userId, string tempFolder)
{
return new List
{
"--convert-to",
"pdf:writer_pdf_Export",
docx,
$"-env:UserInstallation=file:///{this.options.Value.TempUserPathForArgs}{userId}",
"--norestore",
"--writer",
"--headless",
"--outdir",
tempFolder
};
}
P.S. Параллельное преобразование документов путем создания нового сеанса (создание временного пользователя) для каждого процесса
Первая ошибка
Код: Выделить всё
Message: "Exception of type 'System.OutOfMemoryException' was thrown.",
StackTrace: at System.Threading.Thread.StartInternal(ThreadHandle t, Int32 stackSize, Int32 priority, Char* pThreadName)\n at System.Threading.Thread.StartCore()\n at System.Threading.PortableThreadPool.WaitThread..ctor()\n at System.Threading.PortableThreadPool.RegisterWaitHandle(RegisteredWaitHandle handle)\n at System.Threading.ThreadPool.RegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callBack, Object state, UInt32 millisecondsTimeOutInterval, Boolean executeOnlyOnce, Boolean flowExecutionContext)\n at System.Diagnostics.Process.EnsureWatchingForExit()\n at System.Diagnostics.Process.WaitForExitAsync(CancellationToken cancellationToken)\n at Gems.IO.LibreOffice.LibreOffice.ConvertToPdfInternalAsync(String docxPath, String pdfPath, CancellationToken cancellationToken)\n
Код: Выделить всё
An error occurred trying to start process '/usr/bin/soffice' with working directory '/app'. Resource temporarily unavailable
LibreOffice has failed. Exit code: 2
Exception of type 'System.OutOfMemoryException' was thrown.
Мы сбросили все лимиты обслуживания, и это нам не помогло. Но мы замечаем, что добавление большего количества реплик задерживает OOM
Подробнее здесь: https://stackoverflow.com/questions/781 ... pdf-not-in
Мобильная версия