mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Adding 2025 and 2026 incremental compiles options (#35850)
* feat: adding 2025 and 2026 incremental compiles options * feat: remove dmtcp from compiler list and autoselect checkpointing version with labs inclusion * feat: updating seccomp profile for checkpointing * feat: disable non-premium dmtcp compiles, and align checkpoint version detection between clsi and web * feat: adding in reminder of checkpoint experiment, and using session based split test retrieval * Increase Packer build.sh timeout from 1h15m to 1h30m as build takes approx 1h * fix: moving checkpointing check from tag name based to hasCheckpointing flag set as part of allowed_images, and removing uneeded seccomp rule * feat: move variant/ image selection to CLSI, and have web control only what options to set for a compile. removing uneeded extra variants from webs list of allowed images * feat: adding compile timer as a query string as well --------- Co-authored-by: Tim Gibbon <tim.gibbon@overleaf.com> GitOrigin-RevId: cdbdf76a62dcd5a585925f18d64b6cb9cd6ed373
This commit is contained in:
committed by
Copybot
co-authored by
Tim Gibbon
parent
35271cb33c
commit
baa9cf78d9
@@ -1,3 +1,4 @@
|
||||
import Path from 'node:path'
|
||||
import { callbackify } from 'node:util'
|
||||
import { callbackifyMultiResult } from '@overleaf/promise-utils'
|
||||
import {
|
||||
@@ -1184,7 +1185,6 @@ function _finaliseRequest(projectId, options, project, docs, files) {
|
||||
const hasPremiumCompiles = ['alpha', 'priority'].includes(
|
||||
options.compileGroup
|
||||
)
|
||||
|
||||
return {
|
||||
compile: {
|
||||
options: {
|
||||
@@ -1197,6 +1197,11 @@ function _finaliseRequest(projectId, options, project, docs, files) {
|
||||
draft: Boolean(options.draft),
|
||||
// enable for premium compiles only
|
||||
png2pdf: Boolean(options.png2pdf) && hasPremiumCompiles,
|
||||
// enable for premium compiles on an image that has a checkpointing build
|
||||
enableCheckpoint:
|
||||
Boolean(options.checkpointing) &&
|
||||
hasPremiumCompiles &&
|
||||
_imageHasCheckpointing(project.imageName),
|
||||
stopOnFirstError: Boolean(options.stopOnFirstError),
|
||||
check: options.check,
|
||||
syncType: options.syncType,
|
||||
@@ -1213,7 +1218,6 @@ function _finaliseRequest(projectId, options, project, docs, files) {
|
||||
enablePdfCaching:
|
||||
(Settings.enablePdfCaching && options.enablePdfCaching) || false,
|
||||
pdfCachingMinChunkSize: options.pdfCachingMinChunkSize,
|
||||
enableCheckpoint: Boolean(options.enableCheckpoint),
|
||||
flags,
|
||||
metricsMethod: options.compileGroup,
|
||||
metricsPath: options.metricsPath,
|
||||
@@ -1228,6 +1232,21 @@ function _finaliseRequest(projectId, options, project, docs, files) {
|
||||
}
|
||||
}
|
||||
|
||||
// checkpointing compiles run on a checkpointing build of the project's image,
|
||||
// which is only available for some TeX Live years
|
||||
function _imageHasCheckpointing(imageName) {
|
||||
if (!imageName) {
|
||||
return false
|
||||
}
|
||||
// allowedImageNames holds bare image names, so drop the hosting URL first
|
||||
const bareImageName = Path.basename(imageName)
|
||||
return Boolean(
|
||||
Settings.allowedImageNames?.find(
|
||||
allowedImage => allowedImage.imageName === bareImageName
|
||||
)?.hasCheckpointing
|
||||
)
|
||||
}
|
||||
|
||||
async function buildDocumentConversionRequest(projectId, userId, options) {
|
||||
return await _buildRequest(null, projectId, userId, {
|
||||
...options,
|
||||
|
||||
@@ -81,13 +81,6 @@ async function _getSplitTestOptions(req, res) {
|
||||
{ enablePdfCaching: false }
|
||||
: { enablePdfCaching, pdfCachingMinChunkSize }
|
||||
|
||||
const enableCheckpoint = await SplitTestHandler.promises.featureFlagEnabled(
|
||||
req,
|
||||
res,
|
||||
'compile-with-checkpoint',
|
||||
{ includeReferer: true }
|
||||
)
|
||||
|
||||
const enablePng2Pdf = await SplitTestHandler.promises.featureFlagEnabled(
|
||||
req,
|
||||
res,
|
||||
@@ -100,12 +93,24 @@ async function _getSplitTestOptions(req, res) {
|
||||
? { enablePng2Pdf: false }
|
||||
: { enablePng2Pdf }
|
||||
|
||||
const checkpointingEnabled =
|
||||
await SplitTestHandler.promises.featureFlagEnabled(
|
||||
req,
|
||||
res,
|
||||
'compile-with-checkpoint',
|
||||
{ includeReferer: true }
|
||||
)
|
||||
|
||||
const checkpointCompilesOptions = {
|
||||
enableCheckpointCompiles: checkpointingEnabled,
|
||||
}
|
||||
|
||||
return {
|
||||
compileFromHistory,
|
||||
pdfDownloadDomain,
|
||||
...pdfCachingOptions,
|
||||
enableCheckpoint,
|
||||
...png2PdfOptions,
|
||||
...checkpointCompilesOptions,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -454,19 +459,19 @@ const _CompileController = {
|
||||
pdfCachingMinChunkSize,
|
||||
pdfDownloadDomain,
|
||||
compileFromHistory,
|
||||
enableCheckpoint,
|
||||
enablePng2Pdf,
|
||||
enableCheckpointCompiles,
|
||||
} = await _getSplitTestOptions(req, res)
|
||||
if (Features.hasFeature('saas')) {
|
||||
options.compileFromClsiCache = true
|
||||
options.populateClsiCache = true
|
||||
options.compileFromHistory = compileFromHistory
|
||||
if (enableCheckpoint) {
|
||||
options.enableCheckpoint = enableCheckpoint
|
||||
}
|
||||
if (enablePng2Pdf) {
|
||||
options.png2pdf = enablePng2Pdf
|
||||
}
|
||||
if (enableCheckpointCompiles) {
|
||||
options.checkpointing = true
|
||||
}
|
||||
}
|
||||
options.enablePdfCaching = enablePdfCaching
|
||||
if (enablePdfCaching) {
|
||||
|
||||
@@ -189,13 +189,13 @@ function _imageAllowed(
|
||||
}
|
||||
|
||||
async function getAllowedImagesForUser(req, res, user) {
|
||||
let images = Settings.allowedImageNames || []
|
||||
const images = Settings.allowedImageNames || []
|
||||
|
||||
const alphaImagesAllowed = Boolean(user?.alphaProgram)
|
||||
const monthlyExperimentalImagesAllowed =
|
||||
await _monthlyExperimentalImageAllowed(req, res)
|
||||
|
||||
images = images.map(image => {
|
||||
return images.map(image => {
|
||||
return {
|
||||
...image,
|
||||
allowed: _imageAllowed(
|
||||
@@ -206,6 +206,4 @@ async function getAllowedImagesForUser(req, res, user) {
|
||||
rolling: image.monthlyExperimental,
|
||||
}
|
||||
})
|
||||
|
||||
return images
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user