Week 13 (Aug 10 - Aug 16)
I spend the last week of the GSoC period on packaging the final product into a singularity container (which is a requirement set by Red Hen). To build a container, we first need a definition file:
Bootstrap: docker
From: tensorflow/tensorflow:latest-gpu
%labels
AUTHOR nickilmaveli@gmail.com
%post
apt-get update && apt-get -y install git ffmpeg libsm6 libxext6 -y
cd / && git clone https://github.com/Nickil21/joint-meaning-construal.git
pip3 install pandas opencv-python numpy tables joblib imageio openpyxl flask jinja2 git+https://github.com/tensorflow/docs
%runscript
cd /joint-meaning-construal/ && python3 detect_gesture.py
We can then build the image using the Sylabs Cloud Builder by uploading the definition file. The build takes about 15-20 mins to complete. Once the image is built, the steps to run inside the singularity container are as follows:
- Log on to the CWRU HPC OnDemand Web Portal.
- Click on Clusters and choose “rider Shell Access” from the drop-down menu. This should redirect you to a Terminal console window of the HPC server.
-
Enter the gallina home directory:
[nxm526@hpc4 ~]$ cd /mnt/rds/redhen/gallina/home/nxm526/
-
Load the Singularity module:
[nxm526@hpc4 nxm526]$ module load singularity
-
Pull with Singularity:
[nxm526@hpc4 nxm526]$ singularity pull library://nickil21/default/image:latest
-
Move the Singularity image inside the project folder:
[nxm526@hpc4 nxm526]$ mv image_latest.sif joint-meaning-construal/singularity/
-
Enter the project root folder:
[nxm526@hpc4 nxm526]$ cd joint-meaning-construal/
-
Execute the command within a container:
[nxm526@hpc4 nxm526]$ singularity exec ./singularity/image_latest.sif python detect_gesture.py <path_to_video_file>
- The output files would be present inside the
static/uploads/
folder. Retrieve the output files using the CWRU HPC OnDemand Web Portal.