Skip to content

Commit

Permalink
[r] test first-time R package installation (#687)
Browse files Browse the repository at this point in the history
Adding a Dockerfile and script to test our instructions for installing `cellxgene.census` and `tiledbsoma`. For now it's to run manually.

Co-authored-by: pablo-gar <[email protected]>
  • Loading branch information
mlin and pablo-gar authored Aug 15, 2023
1 parent 5dac3b3 commit c82b2d2
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
13 changes: 13 additions & 0 deletions api/r/cellxgene.census/tests/installation/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ubuntu:22.04
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
automake \
build-essential \
cmake \
git \
libcurl4-openssl-dev \
libssl-dev \
libxml2-dev \
r-base \
zlib1g-dev
ADD install.R /tmp
RUN Rscript /tmp/install.R
9 changes: 9 additions & 0 deletions api/r/cellxgene.census/tests/installation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
This Dockerfile & script are used to test the installation instructions for our `cellxgene.census` R package in a clean environment (in contrast to developer machines which tend to have a lot of unrelated packages and other miscellaneous state). Simply:

```
docker build -t cellxgene_census_r_install_test api/r/cellxgene.census/tests/installation
```

And verify successful completion, which unfortunately may take 30+ minutes building all the dependencies.

The [install.R](install.R) script should be kept consistent with the user-facing installation instructions in the [package readme](../../README.md).
22 changes: 22 additions & 0 deletions api/r/cellxgene.census/tests/installation/install.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
options(error = function() {
q("no", status = 1, runLast = FALSE)
})
Sys.setenv(MAKE = "make -j8")

#######################################################################################

install.packages(
"tiledb",
version = "0.20.3",
repos = c("https://tiledb-inc.r-universe.dev", "https://cloud.r-project.org")
)

install.packages(
"cellxgene.census",
repos = c("https://chanzuckerberg.r-universe.dev", "https://cloud.r-project.org")
)

tiledbsoma::show_package_versions()
print(as.data.frame(
cellxgene.census::open_soma()$get("census_info")$get("summary")$read()$concat()
))

0 comments on commit c82b2d2

Please sign in to comment.