Skip to content

Commit

Permalink
Test if pak hangs are fixed now
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Nov 8, 2024
1 parent 208363d commit 0628c5c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 27 deletions.
11 changes: 5 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,18 @@ RUN CRANLIBS=$(curl https://r-universe.dev/stats/sysdeps/noble | jq --slurp -r '
apt-get clean all

# Setup Node, Emscripten & webR
ENV PATH /opt/emsdk:/opt/emsdk/upstream/emscripten:$PATH
ENV EMSDK /opt/emsdk
ENV WEBR_ROOT /opt/webr
ENV PATH=/opt/emsdk:/opt/emsdk/upstream/emscripten:$PATH
ENV EMSDK=/opt/emsdk
ENV WEBR_ROOT=/opt/webr

ENV R_LIBS_USER=/opt/R/current/lib/R/site-library

# Set CRAN repo
COPY Renviron /opt/R/current/lib/R/etc/Renviron.site
COPY Rprofile /opt/R/current/lib/R/etc/Rprofile.site

# Install pak and rwasm
RUN R -e 'install.packages("pak")'
RUN R -e 'pak::pak("r-wasm/rwasm")'
# Use devel-pak (until solver hangs are fixed)
RUN R -e 'install.packages("pak", lib = .Library, repos = "https://r-lib.github.io/p/pak/devel/source/linux-gnu/x86_64")'

# Set default shell to bash
COPY entrypoint.sh /entrypoint.sh
Expand Down
31 changes: 11 additions & 20 deletions Rprofile
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,17 @@ local({
binary_universe <- function(universe){
sprintf("%s/bin/linux/%s/%s", universe, distro, r_branch)
}
bioc_urls <- function(){
ver <- utils:::.BioC_version_associated_with_R_version();
c(
BioCsoft = sprintf("https://bioconductor.org/packages/%s/bioc", ver),
BioCann = sprintf("https://bioconductor.org/packages/%s/data/annotation", ver),
BioCexp = sprintf("https://bioconductor.org/packages/%s/data/experiment", ver)
)
}
options(repos = c(
P3M = sprintf("https://p3m.dev/all/__linux__/%s/latest", distro),
BIOC = binary_universe("https://bioc.r-universe.dev"),
CRAN = "https://cloud.r-project.org",
CRANHAVEN = binary_universe("https://cranhaven.r-universe.dev"),
bioc_urls()
))
options(HTTPUserAgent = sprintf("R/%s R (%s)", getRversion(), paste(getRversion(), R.version$platform, R.version$arch, R.version$os)))

my_universe <- Sys.getenv("MY_UNIVERSE")
if(nchar(my_universe)){
options(repos = c(binaries = binary_universe(my_universe), universe = my_universe, getOption("repos")))
# PAK adds cran/p3m automatically
repos <- c(BIOC = binary_universe("https://bioc.r-universe.dev"))
if(nchar(Sys.getenv("MY_UNIVERSE"))){
repos <- c(repos, universe = binary_universe(Sys.getenv("MY_UNIVERSE")))
}
})
options(
repos = repos,
HTTPUserAgent = sprintf("R/%s R (%s)", getRversion(), paste(getRversion(), R.version$platform, R.version$arch, R.version$os))
)

pak::repo_add(PPM = "PPM@latest")
# print(pak::repo_status()[,1:2])
})
3 changes: 2 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ echo "::endgroup::"
# For the GitHub Action
if [ "$SOURCEPKG" ]; then
# Workaround for pak resolver hangs
R -e "install.packages(sub('_.*', '', '${SOURCEPKG}'), depends=TRUE)" || true
# R -e "install.packages(sub('_.*', '', '${SOURCEPKG}'), depends=TRUE)" || true
R -e "pak::local_install('./${SOURCEPKG}')"
R -e "rwasm::build('./${SOURCEPKG}')"
BINARYPKG=${SOURCEPKG/.tar.gz/.tgz}
echo "binarypkg=$BINARYPKG" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 0628c5c

Please sign in to comment.