From 3d5a8150043e37a7011ca7948976bda3af7cee0f Mon Sep 17 00:00:00 2001 From: pat-s Date: Tue, 26 Nov 2024 14:13:24 +0100 Subject: [PATCH] cache images --- .woodpecker/build-alpine-320-amd64.yaml | 4 +-- .woodpecker/build-ubuntu-2204-amd64.yaml | 7 ++--- .woodpecker/images.yaml | 5 +++- docker/Containerfile-alpine-320 | 22 ++++++++++----- docker/Containerfile-redhat-8 | 29 +++++++++++++------ docker/Containerfile-redhat-9 | 34 +++++++++++++++------- docker/Containerfile-ubuntu-2204 | 17 +++++++---- docker/Containerfile-ubuntu-2404 | 36 ++++++++++++++++-------- 8 files changed, 102 insertions(+), 52 deletions(-) diff --git a/.woodpecker/build-alpine-320-amd64.yaml b/.woodpecker/build-alpine-320-amd64.yaml index f221531..ab7003f 100644 --- a/.woodpecker/build-alpine-320-amd64.yaml +++ b/.woodpecker/build-alpine-320-amd64.yaml @@ -31,7 +31,6 @@ steps: # volumes: # - amd64-binaries-r-dep-cache-alpine-320:/mnt/cache commands: - # download latest package version (avoid having to rebuild image every time) # rscript_startup arg: required to pass down global option to future workers https://github.com/HenrikBengtsson/future/issues/134#issuecomment-2245666169 - git clone https://pat-s:$$git_ro_token@git.devxy.io/devxy/r-pkg-binaries.git . - rm -rf /mnt/cache/R-pkgs/00LOCK-r-pkg-binaries /mnt/cache/R-pkgs/00LOCK-bincraftR @@ -41,7 +40,6 @@ steps: - R -q -e 'packageVersion("bincraftR")' # more complicated system dependencies which pak cannot resolve - mkdir -p /mnt/cache/pkgcache /mnt/cache/R-pkgs /mnt/cache/ccache /mnt/cache/packages - # set additional repos: important as otherwise some packages cannot be resolved (e.g. INLA). Also: setting our own binary repos so we can make use of them for dep installation at some point ### Check # - Rsymphony/ROI.plugin.symphony/adea/PortfolioAnalytics -> can't install/link external SYMPHONY lib (only on RHEL, as for others syslib exists) # - Rglpk @@ -49,7 +47,7 @@ steps: # doBy: hangs on alpine # later: hangs on ubuntu - R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/devel/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))' - - xvfb-run R -q -e "options(crayon.enabled = TRUE, Ncpus = $NCPUS, future.globals.onReference = NULL); pak::sysreqs_db_update(); pkgs = c('doBy', 'DoE.base', 'DoE.wrapper', 'eha', 'FrF2', 'FrF2.catlg128', 'gRain', 'gRbase', 'IDPmisc', 'MediaNews', 'pbkrtest', 'RInno', 'RVAideMemoire', 'seewave', 'SEMdeep', 'semicmprskcoxmsm', 'SemiCompRisks', 'SemiPar.depCens', 'semnar', 'sentiment.ai', 'sephora', 'sfarrow', 'sfcentral', 'sfdct', 'sfhotspot', 'sfnetworks', 'sftrack', 'sgsR', 'ShapePattern', 'shapes', 'ShapeSelectForest', 'SHAPforxgboost', 'shapviz', 'ShellChron', 'shelter', 'shiny.benchmark', 'shinybrms', 'shinyCohortBuilder', 'shinyIRT', 'ShinyItemAnalysis', 'shinyRGL', 'shinytest2', 'shrinkDSM', 'SIAmodules', 'SIGN', 'siland', 'simCAT', 'SimDesign', 'SimInf', 'SimNPH', 'simplePHENOTYPES', 'simplexreg', 'SimRDS', 'SimSurvey', 'simulariatools', 'sirad', 'sisireg', 'sits', 'SLBDD', 'slideview', 'smartmap', 'smcryptoR', 'SMDIC', 'smile', 'SMITIDstruct', 'smlmkalman', 'smoothAPC', 'smosr', 'snplinkage', 'sociome', 'sodium', 'SoilSaltIndex', 'spacejamr', 'SpaDES', 'SpaDES.core', 'SpaDES.tools', 'spANOVA', 'sparrpowR', 'sparseCov', 'SPARSEMODr', 'SpatGC', 'SpatGRID', 'spatialEco', 'SpatialEpi', 'SpatialfdaR', 'SpatialGraph', 'SpatialKDE', 'SpatialPosition', 'spatialreg', 'SpatialRegimes', 'SpaTopic', 'spatsurv', 'spbal', 'spDates', 'spdynmod', 'spectacles', 'spectator', 'spectralR', 'spectrino', 'Spectrum', 'speech', 'spemd', 'spex', 'spGARCH', 'sphereplot', 'sphet', 'spidR', 'spldv', 'splm', 'spm', 'spm2', 'spsur', 'spup', 'SQL', 'SQRL', 'SRTsim', 'ssdGSA', 'SSDM', 'ssfa', 'ssh', 'SSIMmap', 'SSN2', 'SSNbayes', 'SSNbler', 'sta', 'stacomiR', 'stacomirtools', 'stampr', 'stan4bart', 'stars', 'starsExtra', 'starsTileServer', 'StatDA', 'statgenMPP', 'stcos', 'stelfi', 'stepgbm', 'steprf', 'steps', 'stfit', 'stopp', 'stops', 'stpphawkes', 'stppSim', 'strand', 'stratbr', 'StratifiedRF', 'StreamMetabolism', 'streetscape', 'string2path', 'stxplore', 'SubTS', 'SubtypeDrug', 'SUNGEO', 'SurfaceTortoise', 'SurrogateRsq', 'surrosurv', 'surveyPrev', 'surveyvoi', 'survivalMPLdc', 'survSNP', 'svars', 'swaRmverse', 'swfscAirDAS', 'swfscDAS', 'SWMPrExtension', 'symbolicDA', 'symbolicQspray', 'symengine', 'SymTS', 'T4cluster', 'tabularaster', 'tailDepFun', 'track2KBA', 'trackeRapp', 'traineR', 'transformr', 'transfR', 'traveltimeR', 'trigpoints', 'tripEstimation', 'TroublemakeR', 'trtswitch', 'truh', 'TSCI', 'TUFLOWR', 'tvthemes', 'twangMediation', 'twangRDC', 'uavRmp', 'udunits2', 'ugatsdb', 'ulex', 'ultrapolaRplot', 'UnalR', 'UniprotR', 'units', 'upstartr', 'ursa', 'usdm', 'valuemap', 'VancouvR', 'vapour', 'VBLPCM', 'VC2copula', 'vein', 'versioning', 'vines', 'virtualspecies', 'virtuoso', 'visaOTR', 'visStatistics', 'visualpred', 'visvow', 'vivid', 'vmeasur', 'voi', 'vol2birdR', 'voluModel', 'vvauditor', 'wactor', 'wallace', 'warabandi', 'washr', 'WaveletMLbestFL', 'waver', 'waves', 'WCluster', 'wdnr.gis', 'wdpar', 'weatherOz', 'webglobe', 'webSDM', 'WEGE', 'weightedGCM', 'wiesbaden', 'wildlifeDI', 'windAC', 'WMAP', 'WQM', 'xgb2sql', 'xgboost', 'xrf', 'xRing', 'xslt', 'zcurve', 'zonebuilder', 'zoomerjoin' ); pkgs = setdiff(pkgs, c('RInno', 'MediaNews', 'DoE.base', 'DoE.wrapper', 'FrF2', 'FrF2.catlg128', 'eha', 'gRain', 'gRbase', 'doBy', 'IDPmisc', 'RVAideMemoire', 'pbkrtest', 'seewave')); progressr::handlers('cli'); progressr::handlers(global = TRUE); foo = lapply(pkgs, function(x) bincraftR::build_binary_package(x, debug = FALSE, force = TRUE, platform = 'alpine-320'))" + - xvfb-run R -q -e "options(crayon.enabled = TRUE, Ncpus = $NCPUS, future.globals.onReference = NULL); pak::sysreqs_db_update(); pkgs = c('ABACUS', 'abmR', 'abn', 'abstr', 'abstractr', 'acdcR', 'ActCR', 'actel', 'activAnalyzer', 'actxps', 'adapt4pv', 'AdhereRViz', 'AirExposure', 'ajv', 'alcyon', 'AlleleShift', 'almanac', 'alookr', 'amadeus', 'anominate', 'AntMAN', 'APCalign', 'aPCoA', 'apisensr', 'appeears', 'AquaBEHER', 'archive', 'arcpbf', 'arealDB', 'asciicast', 'audrex', 'audubon', 'autoBagging', 'autostats', 'av', 'badgen', 'baguette', 'banter', 'bartCause', 'bartMan', 'base64', 'basemaps', 'bate', 'BayesOrdDesign', 'BayesXsrc', 'bdl', 'BED', 'BeeBDC', 'behaviorchange', 'bfboinet', 'bigGP', 'bigrquerystorage', 'biocompute', 'biopixR', 'BioPred', 'BiplotGUI', 'blackmarbler', 'blatr', 'BoolFilter', 'bpmnR', 'bRacatus', 'brickster', 'brsim', 'BRugs', 'bs4Dash', 'BSTZINB', 'C50', 'CAinterprTools', 'canadamaps', 'CaseBasedReasoning', 'CausalGPS', 'causalHyperGraph', 'causalPAF', 'cbl', 'CCd', 'cellularautomata', 'CensSpatial', 'centerline', 'CERFIT', 'Certara.RsNLME', 'cffr', 'chilemapas', 'chooseGCM', 'CIMTx', 'ClickHouseHTTP', 'clinDataReview', 'clrng', 'clustTMB', 'ClusVis', 'cmprskcoxmsm', 'cohorttools', 'colormap', 'CompositionalRF', 'concaveman', 'conmet', 'conos', 'constrainedKriging', 'conversim', 'CoTiMA', 'countSTAR', 'covalchemy', 'covid19india', 'cppcheckR', 'CRE', 'creditmodel', 'crimeutils', 'crumble', 'cshapes', 'csmpv', 'ctrdata', 'CTRing', 'd4storagehub4R', 'daff', 'dagitty', 'dagwood', 'dartR', 'dartR.base', 'dartR.captive', 'dartR.popgen', 'dartR.sexlinked', 'dartR.sim', 'dartR.spatial', 'datacleanr', 'dataone', 'datapack', 'datasetjson', 'dataspice', 'dbarts', 'dblr', 'ddml', 'DeepLearningCausal', 'dendroNetwork', 'depCensoring', 'DGP4LCF', 'DiagrammeRsvg', 'DICEM', 'diffdfs', 'diffeRenTES', 'DIFM', 'DImodelsVis', 'DIscBIO', 'disclosuR', 'DiSCos', 'disk.frame', 'dismo', 'dispeRse', 'dissever', 'diversitree', 'divraster', 'DMMF', 'do3PCA', 'DoE.wrapper', 'DominoDataR', 'doMPI', 'doolkit', 'doRedis', 'DOT', 'dots', 'DoubleML', 'doublIn', 'downscale', 'dpkg', 'DRHotNet', 'DR.SC', 'DrugSim2DR', 'DRviaSPCN', 'DSAM', 'dsims', 'dsmSearch', 'dssd', 'Dtableone', 'dtComb', 'dti', 'dtrackr', 'DWLS', 'dycdtools', 'dynamAedes', 'dynamicSDM', 'dynatopGIS', 'dynr', 'dySEM', 'DySS', 'easyNCDF', 'easySdcTable', 'EBcoBART', 'ebmc', 'ecdata', 'eCerto', 'ech', 'ecochange', 'ecocomDP', 'ecoCopula', 'econetwork', 'ecopower', 'ecospat', 'edgebundleR', 'ediblecity', 'eDITH', 'eemdARIMA', 'EEMDelm', 'EEMDlstm', 'eemdTDNN', 'EFAfactors', 'EIX', 'emailjsr', 'EmissV', 'emld', 'enerscape', 'ENMTools', 'envi', 'epicmodel', 'epidm', 'epilogi', 'epimdr2', 'EpiSemble', 'epitweetr', 'epiworldRShiny', 'epizootic', 'eSDM', 'eseis', 'espadon', 'EthSEQ', 'ETRep', 'evidence', 'evobiR', 'excel.link', 'eyetools', 'FaaSr', 'facmodTS', 'fangs', 'fanovaGraph', 'fcl', 'fdq', 'FedData', 'fgdr', 'fingerPro', 'finnts', 'fio', 'fishRman', 'florabr', 'fluidsynth', 'fmesher', 'fmf', 'forensIT', 'forestdynR', 'FORTLS', 'foundry', 'FrF2.catlg128', 'FSK2R', 'func2vis', 'galah', 'gbifdb', 'gdtools', 'GeneralisedCovarianceMeasure', 'GENLIB', 'GenoTriplo', 'geocomplexity', 'geodl', 'geodrawr', 'geofi', 'geogenr', 'geoheatmap', 'georob', 'geostan', 'GeoTox', 'GeoWeightedModel', 'geslaR', 'gfer', 'ggESDA', 'ggfacto', 'ggpattern', 'giacR', 'GISTools', 'glossa', 'gmDatabase', 'Goodreader', 'googletraffic', 'gpboost', 'GPCERF', 'gpuR', 'Greymodels', 'GRShiny', 'gsbDesign', 'gsDesign2', 'gtExtras', 'GTFSwizard', 'gto', 'gtreg', 'gwavr', 'gwid', 'GWmodel', 'gwpcormapper', 'GWSDAT', 'habtools', 'HAC', 'handwriterApp', 'handwriterRF', 'hdf5r', 'hdf5r.Extra', 'HDSpatialScan' ); pkgs = setdiff(pkgs, c('RInno', 'MediaNews', 'DoE.base', 'DoE.wrapper', 'FrF2', 'FrF2.catlg128', 'eha', 'gRain', 'gRbase', 'doBy', 'IDPmisc', 'RVAideMemoire', 'pbkrtest', 'seewave')); progressr::handlers('cli'); progressr::handlers(global = TRUE); foo = lapply(pkgs, function(x) bincraftR::build_binary_package(x, debug = FALSE, force = TRUE, platform = 'alpine-320'))" ### Manual pkg builds # webshot2, tabledown, TestAnaAPP, trekcolors, Spectran, SimNPH, RPushbullet, SimDesign, simCAT, SIAmodules, shinytest2, ShinyItemAnalysis, shinyIRT, shiny.benchmark, scDIFtest, RSP, qtkit, PROsetta, prettifyAddins, PerFit, outlierensembles, nomnoml, mxfda, MultBiplotR, mstDIF, mdsr, makepipe, lordif, kequate, jstager, jrt, irtreliability, irtQ, irtpwr, irtGUI, irtawsi, GRShiny, GPCMlasso, googletraffic, giacR, flps, flow, faoutlier, equateIRT, EnrichIntersect, EFA.dimensions, DFIT, D3mirt, ctgdist, CoTiMA, ConvertPar, bscui, BifactorIndicesCalculator, autoFC, airt: wait for https://github.com/rstudio/r-system-requirements/pull/178 # RInno: Windows-only diff --git a/.woodpecker/build-ubuntu-2204-amd64.yaml b/.woodpecker/build-ubuntu-2204-amd64.yaml index daa5b15..980183c 100644 --- a/.woodpecker/build-ubuntu-2204-amd64.yaml +++ b/.woodpecker/build-ubuntu-2204-amd64.yaml @@ -31,22 +31,19 @@ steps: # volumes: # - amd64-binaries-r-dep-cache-ubuntu-2204:/mnt/cache commands: - # download latest package version (avoid having to rebuild image every time) # rscript_startup arg: required to pass down global option to future workers https://github.com/HenrikBengtsson/future/issues/134#issuecomment-2245666169 - git clone https://pat-s:$$git_ro_token@git.devxy.io/devxy/r-pkg-binaries.git . - rm -rf /mnt/cache/R-pkgs/00LOCK-r-pkg-binaries /mnt/cache/R-pkgs/00LOCK-bincraftR # for some reason paks pkgcache is often corrupt - rm -rf /mnt/cache/R-pkgs/pkgcache/ /mnt/cache/pkgcache/ /root/.cache/R/ + - mkdir -p /mnt/cache/pkgcache /mnt/cache/R-pkgs /mnt/cache/ccache /mnt/cache/packages - R -q -e 'pak::pak("git::https://gitlab.com/devxy/r-package-binaries/bincraftr.git")' - R -q -e 'packageVersion("bincraftR")' - # more complicated system dependencies which pak cannot resolve - - mkdir -p /mnt/cache/pkgcache /mnt/cache/R-pkgs /mnt/cache/ccache /mnt/cache/packages - # set additional repos: important as otherwise some packages cannot be resolved (e.g. INLA). Also: setting our own binary repos so we can make use of them for dep installation at some point ### Check # - Rsymphony/ROI.plugin.symphony/adea/PortfolioAnalytics -> can't install/link external SYMPHONY lib (only on RHEL, as for others syslib exists) # - Rglpk # biplotbootGUI: somehow ubuntu still hangs even when using xvfb-run - - xvfb-run R -q -e "options(crayon.enabled = TRUE, Ncpus = $NCPUS, future.globals.onReference = NULL, repos = structure(c(devxy = 'https://cran.devxy.io/amd64/jammy/latest', CRAN = 'https://cloud.r-project.org'))); library(dplyr); library(bincraftR); cran_pkgs = tools::CRAN_package_db()[['Package']]; '%nin%' <- Negate('%in%'); foo = query_metadata_table() |> filter(platform == 'ubuntu-2204', arch == 'amd64') |> distinct(name) |> pull(name); pkgs <- dput(cran_pkgs[cran_pkgs %nin% foo][0:300]); options(progressr.enable = TRUE); pkgs = c('leidenbase', 'lgpr', 'MDSGUI', 'MediaNews', 'mixcat', 'MonoPhy', 'MPCR', 'netShiny', 'nevada', 'NFCP', 'nfl4th', 'nflverse', 'NGCHM', 'NIMAA', 'nlcv', 'nlmixr2rpt', 'noaastormevents', 'NoviceDeveloperResources2', 'npcurePK', 'npi', 'nRegression', 'nucim', 'numbat', 'oaqc', 'oceanmap', 'ondisc', 'One4All', 'onelogin', 'OpenCL', 'opencv', 'opendatatoronto', 'openmeteo', 'openVA', 'R2PPT', 'R2wd', 'ravetools', 'Rcatch22', 'Rcplex', 'RcppCWB', 'rFUSION', 'RInno', 'rmarchingcubes', 'RmecabKo', 'ROI.plugin.cplex', 'ROI.plugin.qpoases', 'ROI.plugin.symphony', 'ROracle', 'Rsymphony', 'RWinEdt', 'SegEnvIneq', 'skedastic', 'spectrino', 'taskscheduleR', 'theft', 'theftdlc', 'TML', 'trtswitch', 'ursa'); pkgs = setdiff(pkgs, c('RInno', 'MediaNews', 'CoTiMA', 'later')); progressr::handlers('cli'); progressr::handlers(global = TRUE); foo = lapply(pkgs, function(x) bincraftR::build_binary_package(x, debug = FALSE, force = TRUE, platform = 'ubuntu-2204'))" + - xvfb-run R -q -e "options(crayon.enabled = TRUE, Ncpus = $NCPUS, future.globals.onReference = NULL, repos = structure(c(CRAN = 'https://cran.devxy.io/amd64/jammy/latest'))); pkgs = c('BiplotGUI', 'KeyboardSimulator', 'MDSGUI', 'R2PPT', 'R2wd', 'RWinEdt', 'Rveg', 'blatr', 'excel.link', 'leidenbase', 'mpathr', 'spectrino', 'taskscheduleR'); pkgs = setdiff(pkgs, c('RInno', 'MediaNews', 'CoTiMA', 'later')); progressr::handlers('cli'); progressr::handlers(global = TRUE); foo = lapply(pkgs, function(x) bincraftR::build_binary_package(x, debug = FALSE, force = TRUE, platform = 'ubuntu-2204'))" ### Manual pkg builds # webshot2, tabledown, TestAnaAPP, trekcolors, Spectran, SimNPH, RPushbullet, SimDesign, simCAT, SIAmodules, shinytest2, ShinyItemAnalysis, shinyIRT, shiny.benchmark, scDIFtest, RSP, qtkit, PROsetta, prettifyAddins, PerFit, outlierensembles, nomnoml, mxfda, MultBiplotR, mstDIF, mdsr, makepipe, lordif, kequate, jstager, jrt, irtreliability, irtQ, irtpwr, irtGUI, irtawsi, GRShiny, GPCMlasso, googletraffic, giacR, flps, flow, faoutlier, equateIRT, EnrichIntersect, EFA.dimensions, DFIT, D3mirt, ctgdist, CoTiMA, ConvertPar, bscui, BifactorIndicesCalculator, autoFC, airt: wait for https://github.com/rstudio/r-system-requirements/pull/178 # RInno: Windows-only diff --git a/.woodpecker/images.yaml b/.woodpecker/images.yaml index 2768cf8..1faf7c9 100644 --- a/.woodpecker/images.yaml +++ b/.woodpecker/images.yaml @@ -29,12 +29,15 @@ steps: - name: 'Build image' image: docker.io/thegeeklab/wp-docker-buildx:6.0.1 settings: - mtu: 1420 + mtu: 1400 platforms: linux/${ARCH} Containerfile: docker/Containerfile-${PLATFORM} experimental: true repo: devxygmbh/${ARCH}-binaries-r-${PLATFORM} tags: latest + cache_from: + - 'type=registry\\,ref=devxygmbh/${ARCH}-binaries-r-${PLATFORM}:cache\\,mode=max\\,image-manifest=true\\,oci-mediatypes=true' + cache_to: 'type=registry,ref=devxygmbh/${ARCH}-binaries-r-${PLATFORM}:cache,mode=max,image-manifest=true,oci-mediatypes=true' username: devxygmbh password: from_secret: dockerhub_token_devxygmbh diff --git a/docker/Containerfile-alpine-320 b/docker/Containerfile-alpine-320 index ec937cc..b302528 100644 --- a/docker/Containerfile-alpine-320 +++ b/docker/Containerfile-alpine-320 @@ -1,6 +1,15 @@ -FROM alpine:3.20.3 +FROM alpine:3.20.3 AS jags -ARG R_VERSION=4.4.1 +RUN apk add -q --no-cache curl tar make lapack lapack-dev blas blas-dev gcc gfortran g++ git cmake tk-dev xz + +# These usually are not packaged in OS repositories and need to be installed from source +# - JAGS (needed for runjags which itself is again a dependency of many packages) +RUN curl -s -L -O https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-4.3.2.tar.gz && \ + tar -xzf JAGS-4.3.2.tar.gz && cd JAGS-4.3.2 && ./configure --enable-silent-rules && make 2>&1 + +FROM alpine:3.20.3 AS final + +ARG R_VERSION=4.4.2 ENV PATH=/opt/R/${R_VERSION}/bin:$PATH ENV TZ="Europe/Berlin" @@ -9,6 +18,8 @@ ENV NCPUS=2 ARG GITHUB_PAT +COPY --link --from=jags /JAGS-4.3.2 /JAGS-4.3.2 + # Background: JAGS needs lapack & lapack-dev but these conflict with openblas-dev which is required by R-dev # Solution: first compile JAGS, then remove lapack & lapack-dev again # # xvfb: for graphical pkgs requiring tcl, like gWidgets2tcltk @@ -37,11 +48,11 @@ RUN apk add -q --no-cache chromium RUN mkdir -p /root/.R && bash -c 'echo -e "CXX_STD = CXX14\nCXXFLAGS=-D__MUSL__\nCPPFLAGS=-D__MUSL__\nCFLAGS += -flax-vector-conversions\nLDFLAGS+=-fPIC\nCC=ccache gcc\nCPP=gcc -E\nCXXCPP=gcc -e\nCXX=ccache g++\nCXX11=ccache g++\nCXX14=ccache g++\nCXX17=ccache g++\nF77=gfortran\nFC=gfortran" > /root/.R/Makevars' # R repos -RUN bash -c 'echo -e "options(encoding = \"UTF-8\", crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cloud.r-project.org\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > /root/.Rprofile' +RUN bash -c 'echo -e "options(crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cran.devxy.io/$ARCH/alpine320/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > /root/.Rprofile' RUN bash -c 'echo -e "PKG_SYSREQS=TRUE\nPKG_SYSREQS_VERBOSE=TRUE" > ~/.Renviron' ### INSTALL R -RUN curl -O "https://devxy-r-builds.s3.eu-central-2.amazonaws.com/alpine320/r-${R_VERSION}_1_$(arch).apk" +RUN curl -O "https://devxy-r-builds.s3.eu-central-003.backblazeb2.com/alpine320/r-${R_VERSION}_1_$(arch).apk" RUN apk add --allow-untrusted "r-${R_VERSION}_1_$(arch).apk" && rm "r-${R_VERSION}_1_$(arch).apk" RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/devel/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))' @@ -52,9 +63,6 @@ RUN R -q -e 'pak::pak(c("DBI", "R6", "RPostgres", "Rcpp", "askpass", "base64enc" # encoding -> https://github.com/r-hub/r-minimal/blob/fa9c117313e05860a0d20b113e5f794c51be8b8c/Dockerfile#L84 RUN sed -i 's/,//g' /opt/R/${R_VERSION}/lib/R/library/utils/iconvlist -COPY --link . . -# remove secrets from COPY -RUN touch /.Renviron /.envrc && rm /.Renviron /.envrc RUN R -q -e 'pak::pak("git::https://gitlab.com/devxy/r-package-binaries/bincraftr.git")' CMD ["/bin/bash"] \ No newline at end of file diff --git a/docker/Containerfile-redhat-8 b/docker/Containerfile-redhat-8 index 833055d..1cf41f4 100644 --- a/docker/Containerfile-redhat-8 +++ b/docker/Containerfile-redhat-8 @@ -1,7 +1,19 @@ -FROM redhat/ubi8 +FROM redhat/ubi8 AS jags +ARG RED_HAT_DEV_PW + +RUN subscription-manager register --username mail@devxy.io --password "$RED_HAT_DEV_PW" && subscription-manager repos --enable codeready-builder-for-rhel-8-$(arch)-rpms +RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && dnf install -y epel-release +RUN dnf install -y -q gcc-c++ lapack-devel make git ca-certificates + +# These usually are not packaged in OS repositories and need to be installed from source +# - JAGS (needed for runjags which itself is again a dependency of many packages) +RUN curl -s -L -O https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-4.3.2.tar.gz && \ + tar -xzf JAGS-4.3.2.tar.gz && cd JAGS-4.3.2 && ./configure --enable-silent-rules && make 2>&1 + +FROM redhat/ubi8 AS final # renovate datasource=docker depName=rocker/r-ver -ARG R_VERSION=4.4.1 +ARG R_VERSION=4.4.2 ARG RED_HAT_DEV_PW ENV PATH=/opt/R/${R_VERSION}/bin:$PATH ENV TZ="Europe/Berlin" @@ -11,6 +23,8 @@ ENV NCPUS=2 ARG GITHUB_PAT +COPY --link --from=jags /JAGS-4.3.2 /JAGS-4.3.2 + RUN subscription-manager register --username mail@devxy.io --password "$RED_HAT_DEV_PW" && subscription-manager repos --enable codeready-builder-for-rhel-8-$(arch)-rpms RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && dnf install -y epel-release # xvfb: for graphical pkgs requiring tcl, like gWidgets2tcltk @@ -22,12 +36,12 @@ RUN dnf install -y -q make lapack-devel git gcc gcc-c++ fontconfig-devel fribidi ### CUSTOM DEPENDENCIES # These usually are not packaged in OS repositories and need to be installed from source # - JAGS (needed for runjags which itself is again a dependency of many packages) -RUN curl -q -L -O https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-4.3.2.tar.gz && tar -xzf JAGS-4.3.2.tar.gz && cd JAGS-4.3.2 && ./configure --enable-silent-rules && make 2>&1 && make install 2>&1 >/dev/null && rm -rf JAGS-4.3.2.tar.gz JAGS-4.3.2 && cd .. +RUN cd /JAGS-4.3.2 && make 2>&1 && make install 2>&1 >/dev/null && rm -rf JAGS-4.3.2 && cd .. # - Chromium should be auto-installed once pkgdepends merges the latest system-requirements rule changes RUN dnf install -y chromium ### INSTALL R -RUN curl -O "https://devxy-r-builds.s3.eu-central-2.amazonaws.com/el8/R-${R_VERSION}-1-1.$(arch).rpm" +RUN curl -O "https://devxy-r-builds.s3.eu-central-003.backblazeb2.com/el8/R-${R_VERSION}-1-1.$(arch).rpm" RUN dnf install -q -y "R-${R_VERSION}-1-1.$(arch).rpm" && rm "R-${R_VERSION}-1-1.$(arch).rpm" RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))' @@ -37,16 +51,13 @@ RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/ RUN mkdir -p /root/.R && bash -c 'echo -e "CXX_STD = CXX14\nCFLAGS += -flax-vector-conversions\nCC=ccache gcc\nCPP=gcc -E\nCXXCPP=gcc -e\nCXX=ccache g++\nCXX11=ccache g++\nCXX14=ccache g++\nCXX17=ccache g++\nF77=gfortran\nFC=gfortran" >> /root/.R/Makevars' # R repos -RUN bash -c 'echo -e "options(encoding = \"UTF-8\", crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cran.devxy.io/$ARCH/rhel8/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > /root/.Rprofile' +RUN bash -c 'echo -e "options(crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cran.devxy.io/$ARCH/rhel8/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > /root/.Rprofile' RUN bash -c 'echo -e "PKG_SYSREQS = TRUE\nPKG_SYSREQS_VERBOSE = TRUE\nPKG_SYSREQS_PLATFORM=\"redhat-8\"" > /root/.Renviron' # FIXME: switch to pak after https://github.com/r-lib/pak/issues/628 # deps from pak::pkg_deps(".")$package -RUN R -q -e 'Sys.setenv("PKG_SYSREQS_PLATFORM" = "redhat-8"); pak::pak(c("DBI", "R6", "RPostgres", "Rcpp", "askpass", "base64enc", "bit64", "bit", "blob", "callr", "cli", "credentials", "curl", "data.table", "desc", "digest", "dplyr", "fansi", "fs", "future.apply", "future", "generics", "gert", "globals", "glue", "hms", "httr", "jsonlite", "lgr", "lifecycle", "listenv", "lubridate", "magrittr", "mime", "openssl", "parallelly", "paws.common", "paws.storage", "pillar", "pkgbuild", "pkgconfig", "processx", "progressr", "ps", "purrr", "rlang", "rstudioapi", "s3fs", "stringi", "stringr", "sys", "tibble", "tidyselect", "timechange", "utf8", "vctrs", "withr", "xml2", "zip", "codetools", "cranlike", "RSQLite", "cachem", "crayon", "debugme", "fastmap", "memoise", "progress", "future.callr", "dbplyr"))' +RUN R -q -e 'pak::pak(c("DBI", "R6", "RPostgres", "Rcpp", "askpass", "base64enc", "bit64", "bit", "blob", "callr", "cli", "credentials", "curl", "data.table", "desc", "digest", "dplyr", "fansi", "fs", "future.apply", "future", "generics", "gert", "globals", "glue", "hms", "httr", "jsonlite", "lgr", "lifecycle", "listenv", "lubridate", "magrittr", "mime", "openssl", "parallelly", "paws.common", "paws.storage", "pillar", "pkgbuild", "pkgconfig", "processx", "progressr", "ps", "purrr", "rlang", "rstudioapi", "s3fs", "stringi", "stringr", "sys", "tibble", "tidyselect", "timechange", "utf8", "vctrs", "withr", "xml2", "zip", "codetools", "cranlike", "RSQLite", "cachem", "crayon", "debugme", "fastmap", "memoise", "progress", "future.callr", "dbplyr"))' -COPY --link . . -# remove secrets from COPY -RUN touch /.Renviron /.envrc && rm /.Renviron /.envrc RUN R -q -e 'pak::pak("git::https://gitlab.com/devxy/r-package-binaries/bincraftr.git")' CMD ["/bin/bash"] \ No newline at end of file diff --git a/docker/Containerfile-redhat-9 b/docker/Containerfile-redhat-9 index a041b80..7ccf830 100644 --- a/docker/Containerfile-redhat-9 +++ b/docker/Containerfile-redhat-9 @@ -1,6 +1,19 @@ -FROM redhat/ubi9 +FROM redhat/ubi9 AS jags +ARG RED_HAT_DEV_PW -ARG R_VERSION=4.4.1 +RUN subscription-manager register --username mail@devxy.io --password "$RED_HAT_DEV_PW" && subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms +RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && dnf install -y epel-release +RUN dnf install -y -q gcc-c++ lapack-devel make git ca-certificates + +# These usually are not packaged in OS repositories and need to be installed from source +# - JAGS (needed for runjags which itself is again a dependency of many packages) +RUN curl -s -L -O https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-4.3.2.tar.gz && \ + tar -xzf JAGS-4.3.2.tar.gz && cd JAGS-4.3.2 && ./configure --enable-silent-rules && make 2>&1 + +FROM redhat/ubi9 AS final + +# renovate datasource=docker depName=rocker/r-ver +ARG R_VERSION=4.4.2 ARG RED_HAT_DEV_PW ENV PATH=/opt/R/${R_VERSION}/bin:$PATH ENV TZ="Europe/Berlin" @@ -10,23 +23,25 @@ ENV NCPUS=2 ARG GITHUB_PAT +COPY --link --from=jags /JAGS-4.3.2 /JAGS-4.3.2 + RUN subscription-manager register --username mail@devxy.io --password "$RED_HAT_DEV_PW" && subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && dnf install -y epel-release # xvfb: for graphical pkgs requiring tcl, like gWidgets2tcltk # ImageMagick-c++-devel ImageMagick-devel: boths are not auto-installed via pak sysreqs # mecab-devel: RcppMeCab -> no autodetection yet # libfftw3-dev: ravetools -> actually auto-detect but somehow doesn't work in container? -RUN dnf install -y -q make lapack-devel git gcc gcc-c++ fontconfig-devel fribidi-devel libjpeg-turbo-devel libtiff-devel postgresql-devel htop libgit2-devel libxml2-devel hiredis ccache cmake xorg-x11-server-Xvfb tk-devel ImageMagick-c++-devel ImageMagick-devel xz pkg-config mecab-devel fftw-devel automake +RUN dnf install -y -q make lapack-devel git gcc gcc-c++ fontconfig-devel fribidi-devel libjpeg-turbo-devel libtiff-devel postgresql-devel htop libgit2-devel libxml2-devel hiredis ccache cmake xorg-x11-server-Xvfb ImageMagick-c++-devel ImageMagick-devel xz pkg-config mecab-devel fftw-devel tk-devel automake ### CUSTOM DEPENDENCIES # These usually are not packaged in OS repositories and need to be installed from source # - JAGS (needed for runjags which itself is again a dependency of many packages) -RUN curl -q -L -O https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-4.3.2.tar.gz && tar -xzf JAGS-4.3.2.tar.gz && cd JAGS-4.3.2 && ./configure --enable-silent-rules && make 2>&1 && make install 2>&1 >/dev/null && rm -rf JAGS-4.3.2.tar.gz JAGS-4.3.2 && cd .. +RUN cd /JAGS-4.3.2 && make 2>&1 && make install 2>&1 >/dev/null && rm -rf JAGS-4.3.2 && cd .. # - Chromium should be auto-installed once pkgdepends merges the latest system-requirements rule changes RUN dnf install -y chromium ### INSTALL R -RUN curl -O "https://devxy-r-builds.s3.eu-central-2.amazonaws.com/el9/R-${R_VERSION}-1-1.$(arch).rpm" +RUN curl -O "https://devxy-r-builds.s3.eu-central-003.backblazeb2.com/el8/R-${R_VERSION}-1-1.$(arch).rpm" RUN dnf install -q -y "R-${R_VERSION}-1-1.$(arch).rpm" && rm "R-${R_VERSION}-1-1.$(arch).rpm" RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))' @@ -36,14 +51,13 @@ RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/ RUN mkdir -p /root/.R && bash -c 'echo -e "CXX_STD = CXX14\nCFLAGS += -flax-vector-conversions\nCC=ccache gcc\nCPP=gcc -E\nCXXCPP=gcc -e\nCXX=ccache g++\nCXX11=ccache g++\nCXX14=ccache g++\nCXX17=ccache g++\nF77=gfortran\nFC=gfortran" >> /root/.R/Makevars' # R repos -RUN bash -c 'echo -e "options(encoding = \"UTF-8\", crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cran.devxy.io/$ARCH/rhel9/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > /root/.Rprofile' +RUN bash -c 'echo -e "options(crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cran.devxy.io/$ARCH/rhel9/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > /root/.Rprofile' RUN bash -c 'echo -e "PKG_SYSREQS = TRUE\nPKG_SYSREQS_VERBOSE = TRUE\nPKG_SYSREQS_PLATFORM=\"redhat-9\"" > /root/.Renviron' -RUN R -q -e 'Sys.setenv("PKG_SYSREQS_PLATFORM" = "redhat-9"); pak::pak(c("DBI", "R6", "RPostgres", "Rcpp", "askpass", "base64enc", "bit64", "bit", "blob", "callr", "cli", "credentials", "curl", "data.table", "desc", "digest", "dplyr", "fansi", "fs", "future.apply", "future", "generics", "gert", "globals", "glue", "hms", "httr", "jsonlite", "lgr", "lifecycle", "listenv", "lubridate", "magrittr", "mime", "openssl", "parallelly", "paws.common", "paws.storage", "pillar", "pkgbuild", "pkgconfig", "processx", "progressr", "ps", "purrr", "rlang", "rstudioapi", "s3fs", "stringi", "stringr", "sys", "tibble", "tidyselect", "timechange", "utf8", "vctrs", "withr", "xml2", "zip", "codetools", "cranlike", "RSQLite", "cachem", "crayon", "debugme", "fastmap", "memoise", "progress", "future.callr", "dbplyr"))' +# FIXME: switch to pak after https://github.com/r-lib/pak/issues/628 +# deps from pak::pkg_deps(".")$package +RUN R -q -e 'pak::pak(c("DBI", "R6", "RPostgres", "Rcpp", "askpass", "base64enc", "bit64", "bit", "blob", "callr", "cli", "credentials", "curl", "data.table", "desc", "digest", "dplyr", "fansi", "fs", "future.apply", "future", "generics", "gert", "globals", "glue", "hms", "httr", "jsonlite", "lgr", "lifecycle", "listenv", "lubridate", "magrittr", "mime", "openssl", "parallelly", "paws.common", "paws.storage", "pillar", "pkgbuild", "pkgconfig", "processx", "progressr", "ps", "purrr", "rlang", "rstudioapi", "s3fs", "stringi", "stringr", "sys", "tibble", "tidyselect", "timechange", "utf8", "vctrs", "withr", "xml2", "zip", "codetools", "cranlike", "RSQLite", "cachem", "crayon", "debugme", "fastmap", "memoise", "progress", "future.callr", "dbplyr"))' -COPY --link . . -# remove secrets from COPY -RUN touch /.Renviron /.envrc && rm /.Renviron /.envrc RUN R -q -e 'pak::pak("git::https://gitlab.com/devxy/r-package-binaries/bincraftr.git")' CMD ["/bin/bash"] \ No newline at end of file diff --git a/docker/Containerfile-ubuntu-2204 b/docker/Containerfile-ubuntu-2204 index 2a89f98..bf3c07c 100644 --- a/docker/Containerfile-ubuntu-2204 +++ b/docker/Containerfile-ubuntu-2204 @@ -14,6 +14,8 @@ ENV DEBIAN_FRONTEND=noninteractive ENV ARCH=arm64 ENV NCPUS=2 +ENV R_LIBS_USER=/mnt/cache/R-pkgs +ENV R_PKG_CACHE_DIR=/mnt/cache/pkgcache ARG GITHUB_PAT @@ -35,7 +37,7 @@ RUN apt-get install -y software-properties-common && \ apt install -y chromium ### INSTALL R -RUN curl -O "https://devxy-r-builds.s3.eu-central-2.amazonaws.com/2204/r-${R_VERSION}_1_$(dpkg --print-architecture).deb" +RUN curl -O "https://devxy-r-builds.s3.eu-central-003.backblazeb2.com/2204/r-${R_VERSION}_1_$(dpkg --print-architecture).deb" RUN gdebi -n -qq "r-${R_VERSION}_1_$(dpkg --print-architecture).deb" && rm "r-${R_VERSION}_1_$(dpkg --print-architecture).deb" RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))' @@ -45,14 +47,17 @@ RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/ RUN mkdir -p /root/.R && bash -c 'echo -e "CXX_STD = CXX14\nCFLAGS += -flax-vector-conversions\nCC=ccache gcc\nCPP=gcc -E\nCXXCPP=gcc -e\nCXX=ccache g++\nCXX11=ccache g++\nCXX14=ccache g++\nCXX17=ccache g++\nF77=gfortran\nFC=gfortran" >> /root/.R/Makevars' # R repos -RUN bash -c 'echo -e "options(encoding = \"UTF-8\", pkg.sysreqs_verbose = TRUE, crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cran.devxy.io/$ARCH/jammy/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > ~/.Rprofile' +RUN bash -c 'echo -e "options(pkg.sysreqs_verbose = TRUE, crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cran.devxy.io/amd64/jammy/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > ~/.Rprofile' + +# these dirs will later be used by the CI with existing mounts +RUN mkdir -p /mnt/cache/packages /mnt/cache/pkgcache /mnt/cache/R-pkgs -RUN R -q -e 'dir.create(Sys.getenv("R_LIBS_USER"), recursive = TRUE)' RUN R -q -e "pak::pak(c('DBI', 'R6', 'RPostgres', 'Rcpp', 'askpass', 'base64enc', 'bit64', 'bit', 'blob', 'callr', 'cli', 'credentials', 'curl', 'data.table', 'desc', 'digest', 'dplyr', 'fansi', 'fs', 'future.apply', 'future', 'generics', 'gert', 'globals', 'glue', 'hms', 'httr', 'jsonlite', 'lgr', 'lifecycle', 'listenv', 'lubridate', 'magrittr', 'mime', 'openssl', 'parallelly', 'paws.common', 'paws.storage', 'pillar', 'pkgbuild', 'pkgconfig', 'processx', 'progressr', 'ps', 'purrr', 'rlang', 'rstudioapi', 's3fs', 'stringi', 'stringr', 'sys', 'tibble', 'tidyselect', 'timechange', 'utf8', 'vctrs', 'withr', 'xml2', 'zip', 'codetools', 'cranlike', 'RSQLite', 'cachem', 'crayon', 'debugme', 'fastmap', 'memoise', 'progress', 'future.callr', 'dbplyr'))" -# COPY --link . . -# remove secrets from COPY -# RUN touch /.Renviron /.envrc && rm /.Renviron /.envrc +RUN apt install -y locales && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ + && locale-gen en_US.utf8 \ + && /usr/sbin/update-locale LANG=en_US.UTF-8 + RUN R -q -e 'pak::pak("git::https://gitlab.com/devxy/r-package-binaries/bincraftr.git")' CMD ["/bin/bash"] \ No newline at end of file diff --git a/docker/Containerfile-ubuntu-2404 b/docker/Containerfile-ubuntu-2404 index c78696e..53c3d72 100644 --- a/docker/Containerfile-ubuntu-2404 +++ b/docker/Containerfile-ubuntu-2404 @@ -1,15 +1,26 @@ -FROM ubuntu:noble +FROM ubuntu:noble as jags -ARG R_VERSION=4.4.1 +RUN apt update && apt install -y --no-install-recommends curl make ca-certificates gcc g++ gfortran liblapack-dev +# These usually are not packaged in OS repositories and need to be installed from source +# - JAGS (needed for runjags which itself is again a dependency of many packages) +RUN curl -q -L -O https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-4.3.2.tar.gz && tar -xzf JAGS-4.3.2.tar.gz && cd JAGS-4.3.2 && ./configure --enable-silent-rules && make 2>&1 + +FROM ubuntu:noble as final + +ARG R_VERSION=4.4.2 ENV PATH=/opt/R/${R_VERSION}/bin:$PATH ENV TZ="Europe/Berlin" ENV DEBIAN_FRONTEND=noninteractive ENV ARCH=arm64 ENV NCPUS=2 +ENV R_LIBS_USER=/mnt/cache/R-pkgs +ENV R_PKG_CACHE_DIR=/mnt/cache/pkgcache ARG GITHUB_PAT +COPY --link --from=jags /JAGS-4.3.2 /JAGS-4.3.2 + # xvfb: for graphical pkgs requiring tcl, like gWidgets2tcltk # tcl tk tk-dev tk-table: must be available before running xvfb-run (i.e. starting the graphical session) # libmecab-dev: RcppMeCab -> no autodetection yet @@ -17,9 +28,8 @@ ARG GITHUB_PAT RUN apt update && apt install -y --no-install-recommends gdebi-core g++ gfortran libbz2-dev libblas-dev libicu-dev liblapack-dev liblzma-dev libpaper-utils libpcre2-dev libtcl8.6 libtk8.6 libxt6 unzip zip zlib1g-dev libpcre3-dev libopenblas-dev curl ca-certificates make ccache htop libgit2-dev git libpq-dev libxml2-dev libgit2-dev cmake xvfb libcurl4-openssl-dev xz-utils tcl tk tk-dev tk-table pkg-config libmecab-dev libfftw3-dev automake ### CUSTOM DEPENDENCIES -# These usually are not packaged in OS repositories and need to be installed from source -# - JAGS (needed for runjags which itself is again a dependency of many packages) -RUN curl -q -L -O https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-4.3.2.tar.gz && tar -xzf JAGS-4.3.2.tar.gz && cd JAGS-4.3.2 && ./configure --enable-silent-rules && make 2>&1 && make install 2>&1 >/dev/null && rm -rf JAGS-4.3.2.tar.gz JAGS-4.3.2 && cd .. +# JAGS +RUN cd /JAGS-4.3.2 && make 2>&1 && make install 2>&1 >/dev/null && rm -rf JAGS-4.3.2 && cd .. # - Chromium should be auto-installed once pkgdepends merges the latest system-requirements rule changes RUN apt-get install -y software-properties-common && \ add-apt-repository -y ppa:xtradeb/apps && \ @@ -27,7 +37,7 @@ RUN apt-get install -y software-properties-common && \ apt install -y chromium ### INSTALL R -RUN curl -O "https://devxy-r-builds.s3.eu-central-2.amazonaws.com/2404/r-${R_VERSION}_1_$(dpkg --print-architecture).deb" +RUN curl -O "https://devxy-r-builds.s3.eu-central-003.backblazeb2.com/2404/r-${R_VERSION}_1_$(dpkg --print-architecture).deb" RUN gdebi -n -qq "r-${R_VERSION}_1_$(dpkg --print-architecture).deb" && rm "r-${R_VERSION}_1_$(dpkg --print-architecture).deb" RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))' @@ -37,13 +47,17 @@ RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/ RUN mkdir -p /root/.R && bash -c 'echo -e "CXX_STD = CXX14\nCFLAGS += -flax-vector-conversions\nCC=ccache gcc\nCPP=gcc -E\nCXXCPP=gcc -e\nCXX=ccache g++\nCXX11=ccache g++\nCXX14=ccache g++\nCXX17=ccache g++\nF77=gfortran\nFC=gfortran" >> /root/.R/Makevars' # R repos -RUN bash -c 'echo -e "options(encoding = \"UTF-8\", pkg.sysreqs_verbose = TRUE, crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cran.devxy.io/$ARCH/noble/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > ~/.Rprofile' +RUN bash -c 'echo -e "options(pkg.sysreqs_verbose = TRUE, crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cran.devxy.io/amd64/noble/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > ~/.Rprofile' -RUN R -q -e 'pak::pak(c("DBI", "R6", "RPostgres", "Rcpp", "askpass", "base64enc", "bit64", "bit", "blob", "callr", "cli", "credentials", "curl", "data.table", "desc", "digest", "dplyr", "fansi", "fs", "future.apply", "future", "generics", "gert", "globals", "glue", "hms", "httr", "jsonlite", "lgr", "lifecycle", "listenv", "lubridate", "magrittr", "mime", "openssl", "parallelly", "paws.common", "paws.storage", "pillar", "pkgbuild", "pkgconfig", "processx", "progressr", "ps", "purrr", "rlang", "rstudioapi", "s3fs", "stringi", "stringr", "sys", "tibble", "tidyselect", "timechange", "utf8", "vctrs", "withr", "xml2", "zip", "codetools", "cranlike", "RSQLite", "cachem", "crayon", "debugme", "fastmap", "memoise", "progress", "future.callr", "dbplyr"))' +# these dirs will later be used by the CI with existing mounts +RUN mkdir -p /mnt/cache/packages /mnt/cache/pkgcache /mnt/cache/R-pkgs + +RUN R -q -e "pak::pak(c('DBI', 'R6', 'RPostgres', 'Rcpp', 'askpass', 'base64enc', 'bit64', 'bit', 'blob', 'callr', 'cli', 'credentials', 'curl', 'data.table', 'desc', 'digest', 'dplyr', 'fansi', 'fs', 'future.apply', 'future', 'generics', 'gert', 'globals', 'glue', 'hms', 'httr', 'jsonlite', 'lgr', 'lifecycle', 'listenv', 'lubridate', 'magrittr', 'mime', 'openssl', 'parallelly', 'paws.common', 'paws.storage', 'pillar', 'pkgbuild', 'pkgconfig', 'processx', 'progressr', 'ps', 'purrr', 'rlang', 'rstudioapi', 's3fs', 'stringi', 'stringr', 'sys', 'tibble', 'tidyselect', 'timechange', 'utf8', 'vctrs', 'withr', 'xml2', 'zip', 'codetools', 'cranlike', 'RSQLite', 'cachem', 'crayon', 'debugme', 'fastmap', 'memoise', 'progress', 'future.callr', 'dbplyr'))" + +RUN apt install -y locales && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ + && locale-gen en_US.utf8 \ + && /usr/sbin/update-locale LANG=en_US.UTF-8 -COPY --link . . -# remove secrets from COPY -RUN touch /.Renviron /.envrc && rm /.Renviron /.envrc RUN R -q -e 'pak::pak("git::https://gitlab.com/devxy/r-package-binaries/bincraftr.git")' CMD ["/bin/bash"] \ No newline at end of file