R and Python container for Voice Gender project

Let us start with pulling a docker container of Ubuntu 20.04 into a directory acting as a Singularity container:

singularity build --sandbox r_voice_gender_container_v1/ docker:ubuntu:20.04

Then shell into the container:

sudo singularity  shell -w r_voice_gender_container_v1/

We can now install the required packages:

apt update
apt upgrade
apt install locales-all libcurl4-gnutls-dev default-jdk libxml2-dev fftw3 fftw3-dev r-base python3-requests python3-bs4 python3-pydub python3-xlsxwriter python3-pandas python3-torch python3-pip
echo "install.packages(c('tuneR', 'seewave', 'fftw', 'caTools', 'randomForest', 'warbleR', 'mice', 'e1071', 'rpart', 'rpart.plot', 'xgboost', 'e1071', 'rlist', 'jsonlite', 'xlsx'))" | R --slave
pip3 install torch

And now we can run R from the container:

singularity exec r_voice_gender_container_v1/ R --save --file=./create_acoustics_run.R --args ./2016-05-23_1600_US_KABC_Live_With_Kelly.xlsx sentence_snippets

Same for Python:

singularity exec r_voice_gender_container_v1/ python3

Currently our code sits outside the container because it is still in development. In the final version, we will move it into the container directory and then create a .sif container file out of it.

Leave a Reply

Your email address will not be published. Required fields are marked *