Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update R #242

Merged
merged 25 commits into from
Jun 27, 2022
Merged

Update R #242

merged 25 commits into from
Jun 27, 2022

Conversation

alexvpickering
Copy link
Contributor

@alexvpickering alexvpickering commented Jun 2, 2022

Description

Update R to 4.2 using included script to minimize package updates as much as possible.

https://ui-alex-upgrade-r-p242-w274.scp-staging.biomage.net/

Notes:

  • updated Seurat to make RunUMAP(..., umap.method = 'umap-learn') reproducible
  • move to rocker/r-ver as base image (see advantages in link)
  • only install system runtime dependencies for final image (smaller than build deps)
  • general minimization of layer sizes to keep final image relatively light (see below)
    • delete renv download cache
    • strip debug code from compiled shared libraries
    • further reductions in size may be possible with alpine based r-hub/r-minimal but I couldn't get BiocParallel to compile.
  • reverted to default BLAS/LAPACK: seems to be working correctly with Seurat::FindIntegrationAnchors
    • test with more datasets using Seurat integration
    • ask Oliver or look on slack to find dataset that caused issue

Image sizes differences:

Worker (↓ ~ 50%):

image
image

Pipeline (↓ ~ 40%):

image
image

Details

URL to issue

https://biomage.atlassian.net/browse/BIOMAGE-1949

Link to staging deployment URL (or set N/A)

https://ui-alex-upgrade-r-p242-w274.scp-staging.biomage.net/

Links to any PRs or resources related to this PR

hms-dbmi-cellenics/worker#274

Integration test branch

master

Merge checklist

Your changes will be ready for merging after all of the steps below have been completed.

Code updates

Have best practices and ongoing refactors being observed in this PR

  • Migrated any selector / reducer used to the new format.

Manual/unit testing

  • Tested changes using InfraMock locally or no tests required for change, e.g. Kubernetes chart updates.
  • Validated that current unit tests for code work as expected and are sufficient for code coverage or no unit tests required for change, e.g. documentation update.
  • Unit tests written or no unit tests required for change, e.g. documentation update.

Integration testing

You must check the box below to run integration tests on the latest commit on your PR branch.
Integration tests have to pass before the PR can be merged. Without checking the box, your PR
will not pass the required status checks for merging.

  • Started end-to-end tests on the latest commit.

Documentation updates

  • Relevant Github READMEs updated or no GitHub README updates required.
  • Relevant Wiki pages created/updated or no Wiki updates required.

Optional

  • Staging environment is unstaged before merging.
  • Photo of a cute animal attached to this PR.

@codecov
Copy link

codecov bot commented Jun 3, 2022

Codecov Report

Merging #242 (81b062e) into master (be5c36f) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #242   +/-   ##
=======================================
  Coverage   76.55%   76.55%           
=======================================
  Files          19       19           
  Lines        1557     1557           
=======================================
  Hits         1192     1192           
  Misses        365      365           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update be5c36f...81b062e. Read the comment docs.

@alexvpickering alexvpickering marked this pull request as ready for review June 8, 2022 21:15
@alexvpickering alexvpickering requested a review from gerbeldo June 9, 2022 18:38
@alexvpickering alexvpickering requested a review from kafkasl June 10, 2022 23:26
Copy link
Member

@gerbeldo gerbeldo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some questions because I'm curious about a few things, but I tested everything I could think of and everything worked as expected. The platform locally feels snappier (when starting).

I think it's good to go!

Comment on lines +12 to +13
liblzma-dev
libbz2-dev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we adding these? they are compression libraries right?

RUN R -e "install.packages('remotes', repos = c(CRAN = 'https://cloud.r-project.org'))" && \
R -e "remotes::install_github('rstudio/[email protected]')"
R -e "remotes::install_github('rstudio/[email protected]')" && \
R -e "renv::init(bare = TRUE, settings = list(use.cache = FALSE))"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we not use the renv cache? I suppose when building the image there is no cache available. but what happens when rebuilding locally?

R -e 'root <- renv::paths$root(); unlink(root, recursive = TRUE)' && \
strip --strip-debug $RENV_LIB/*/libs/*.so

RUN R -e "renv::deactivate()"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this necessary?

Comment on lines +85 to +86
pip install PyYAML==3.10 && \
pip install awscli==1.25.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do need pyYAML? is it a dep of awscli?

RUN echo "python3-pip" >> sysdeps_run.txt && \
echo "wget" >> sysdeps_run.txt && \
cat sysdeps_run.txt | xargs ./install_debian_packages.sh && \
rm -rf *
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not understand this docker magic. what does this remove?

ENTRYPOINT ["Rscript", "init.R"]


# ---------------------------------------------------
# DEVELOPMENT BUILD
# ---------------------------------------------------
FROM builder AS dev
FROM common AS dev

# install Radian for interactive R shell
# also install watchdog to automatically restart
# when source files change
RUN pip install -U jedi radian PyYAML watchdog[watchmedo]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't pyYAML already installed?

@gerbeldo gerbeldo merged commit 33cfada into master Jun 27, 2022
@gerbeldo gerbeldo deleted the update-R branch June 27, 2022 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants