From f8e87958b39dcec292d8532a59b4417d76b4e931 Mon Sep 17 00:00:00 2001 From: Kyle Shannon Date: Tue, 30 Apr 2024 13:10:24 -0600 Subject: [PATCH 1/3] sagedale: add guix container --- sagedale/Makefile | 11 +++++++++++ sagedale/apptainer | 9 +++++++++ sagedale/channels.scm | 40 ++++++++++++++++++++++++++++++++++++++++ sagedale/manifest.scm | 40 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 sagedale/Makefile create mode 100644 sagedale/apptainer create mode 100644 sagedale/channels.scm create mode 100644 sagedale/manifest.scm diff --git a/sagedale/Makefile b/sagedale/Makefile new file mode 100644 index 0000000..4127b22 --- /dev/null +++ b/sagedale/Makefile @@ -0,0 +1,11 @@ +GIT_REV = $(shell git rev-parse --short=16 HEAD) +sagedale.sif: apptainer guix.out + apptainer build -F --fakeroot --build-arg GIT_REV=$(GIT_REV) --build-arg GUIX_SQUASHFS=$$(tail -1 guix.out) sagedale.sif apptainer + +guix.out: channels.scm manifest.scm + guix time-machine -C channels.scm -- pack -f squashfs -m manifest.scm | tee guix.out + +.PHONY: clean +clean: + rm -f *.sif + rm -f guix.out diff --git a/sagedale/apptainer b/sagedale/apptainer new file mode 100644 index 0000000..26085da --- /dev/null +++ b/sagedale/apptainer @@ -0,0 +1,9 @@ +Bootstrap: localimage +From: {{GUIX_SQUASHFS}} + +%post +Rscript -e "devtools::install_github('GuillemSalazar/FastaUtils')" + +%labels +author Kyle Shannon +github.com/bsurc/container git rev={{GIT_REV}} diff --git a/sagedale/channels.scm b/sagedale/channels.scm new file mode 100644 index 0000000..5a8a4e7 --- /dev/null +++ b/sagedale/channels.scm @@ -0,0 +1,40 @@ +(list (channel + (name 'guix-cran) + (url "https://github.com/guix-science/guix-cran.git") + (branch "master") + (commit + "1304d8475452c995bf9da10ad242607f3791385e")) + (channel + (name 'guix-bioc) + (url "https://github.com/guix-science/guix-bioc.git") + (branch "master") + (commit + "e868814ccd7f5e6eefd726818899aa84c0c9d6ea")) + (channel + (name 'guix-hpc) + (url "https://gitlab.inria.fr/guix-hpc/guix-hpc.git") + (branch "master") + (commit + "f002aad7b66cd215b6a1720c48f08ed73f2661d5")) + (channel + (name 'guix-science) + (url "https://github.com/guix-science/guix-science.git") + (branch "master") + (commit + "f85279b8aeac3cc3e6e2aec866841c722c5663fe") + (introduction + (make-channel-introduction + "b1fe5aaff3ab48e798a4cce02f0212bc91f423dc" + (openpgp-fingerprint + "CA4F 8CF4 37D7 478F DA05 5FD4 4213 7701 1A37 8446")))) + (channel + (name 'guix) + (url "https://git.savannah.gnu.org/git/guix.git") + (branch "master") + (commit + "29987db3809bbda16762ecb349142be6cf71a0af") + (introduction + (make-channel-introduction + "9edb3f66fd807b096b48283debdcddccfea34bad" + (openpgp-fingerprint + "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"))))) diff --git a/sagedale/manifest.scm b/sagedale/manifest.scm new file mode 100644 index 0000000..e97a91a --- /dev/null +++ b/sagedale/manifest.scm @@ -0,0 +1,40 @@ +(specifications->manifest (list + ;; base packages + "bash-minimal" + "glibc-locales" + "nss-certs" + ;; Common command line tools lest the container is too empty. + "coreutils" + "grep" + "which" + "wget" + "sed" + ;; Toolchain and common libraries for "install.packages" + "gcc-toolchain@10" + "gfortran-toolchain" + "gawk" + "tar" + "gzip" + "unzip" + "make" + "cmake" + "pkg-config" + "cairo" + "libxt" + "openssl" + "curl" + "zlib" + ;; r stuff + "r" + "r-ape" + "r-biostrings" + "r-devtools" + "r-dplyr" + ;; "r-fastautils" + "r-orfik" + "r-readr" + "r-tidyr" + "r-rblast" + "r-seqinr" + "r-stringr" + )) From 157e3129d543c7f961184cddfbb816f3c894fa3f Mon Sep 17 00:00:00 2001 From: Kyle Shannon Date: Tue, 30 Apr 2024 14:49:06 -0600 Subject: [PATCH 2/3] sagedale: add test --- sagedale/test.R | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 sagedale/test.R diff --git a/sagedale/test.R b/sagedale/test.R new file mode 100644 index 0000000..e5a059d --- /dev/null +++ b/sagedale/test.R @@ -0,0 +1,12 @@ +list.of.packages <- c("ape", + "Biostrings", + "dplyr", + "FastaUtils", + "ORFik", + "readr", + "tidyr", + "rBLAST", + "seqinr", + "stringr") + +lapply(list.of.packages, require, character.only = TRUE) From cdee6dae502f0af81e3f6bf140f5b3801d257c10 Mon Sep 17 00:00:00 2001 From: Kyle Shannon Date: Tue, 30 Apr 2024 14:49:22 -0600 Subject: [PATCH 3/3] sagedale: test for container --- sagedale/apptainer | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sagedale/apptainer b/sagedale/apptainer index 26085da..3bec535 100644 --- a/sagedale/apptainer +++ b/sagedale/apptainer @@ -1,9 +1,16 @@ Bootstrap: localimage From: {{GUIX_SQUASHFS}} +%files +test.R / + %post Rscript -e "devtools::install_github('GuillemSalazar/FastaUtils')" +%test + +Rscript /test.R + %labels author Kyle Shannon github.com/bsurc/container git rev={{GIT_REV}}