Coding Period 1: Week 5

Ritik Malik
3 min readJul 11, 2021

--

This is the last week of our Coding Period 1, and precedes our 1st evaluations…

Week 5 witnessed no weekly mentor mentee meeting because of the public holiday in the U.S. Week 5 was a busy one, for me as well as my partner Yash. While he was occupied with his university exams, I had some chores from the university too.

Nonetheless, we were still able to manage the deliverables for this week in time. This week we were expected to continue on the standardization of Working Group repositories and automate the docker implementation for M.A.R.S.

For the standardization part, we attended the amazing weekly meetings for various working groups and made several pull requests for the standardization of READMEs of focus-areas according to the proposed templates and corrected metric markdown files according to the new updated metric template, which would help us to resolve some issues we faced in the PDF initially (like overflowing of images, HTML/tables not rendering, etc.)

For the docker part, we decided to even automate the creation of images, containers and removal of same after the scripts are done running. For this we spend quite a while studying Docker in-depth for mounting volumes, detecting containers, error handling, etc. and we were able to automate the stuff for Linux (Debian based) and Mac OS/X.

For these 2 platforms, we made a simple bash script that would first perform a variety of checks —

Check for root permission

Check if Docker is installed

Check if Docker is running

Check if the current directory is correct

Check if the Dockerfile exist

The above checks will also throw solutions and suggestions to resolve the same. They acted as a sanity check before proceeding to the main task. The main task is to —

Build the Docker image from the Dockerfile (if the image isn’t already present, download and build it, else use cache)

Remove dangling images (if any)

Check if mars-container is already present (if yes, delete it)

Run docker image with bind mount (the output PDF will be saved)

Remove the Docker container

Change permission for output files and PDF (since script is run as root)

Give a success message and display commands to remove to image (if required)

Show paths to the log file and the output PDF

If any of the above command fails, it gracefully exits then and there displaying error (future work — and a workaround for the same).

This bash script is tried and tested on Linux and Mac OS/X platform and it works just fine! For windows first we thought of powershell script or a batch file, but windows doesn’t allow us to run these scripts by default due to security reasons and some configurations have to be made. Since WSL2 is a prerequisite for Docker in Windows, we thought why not run this same bash script in WSL2 instead. (we are working on this)

Ezekiel 25:17

Meanwhile Yash is working on the translation guidelines for the translation counterparts, the README is good and is yet to be verified by the mentors and to be added to the community handbook.

Next week, we’ll continue on Docker for Windows, finalize the translation guidelines and work on the standardization process.

And we hope our 1st evaluations goes well, fingers crossed…😬🤞

--

--

No responses yet