GSoC 2020 Report

Posted on Aug 30, 2020

Introduction

During my GSoC, I worked on App Store improvements project for ns-3 organization. GSoC was my first programming experience outside personal projects and I thoroughly enjoyed the experience. I had an awesome opportunity to work for the ns-3 organization. My mentors abhijithanilkumar, mishalshah and adeepkit01 were extremely responsive, helpful, and understanding. I would also like to thank tomh sir - the ns-3 Organization Admin for his help and suggestions.

Project outline

Project Goals : To develop a Jenkins server and add necessary updates to ns-3 AppStore to check on-demand if available, uploaded or updated apps/modules/forks to AppStore build and pass tests successfully for the given ns-3 versions and display that information on AppStore. And to improve the AppStore by addressing the existing issues.

The project was completed in the following phases :

  1. Community Bonding - Solving some of the existing issues and getting familiar with the codebase.
  2. Phase 1 - Added build model to AppStore, experimented with Jenkins locally, and wrote bash scripts used by pipelines.
  3. Phase 2 - Added functionalities to AppStore for Jenkins communication, REST APIs, and their tests in AppStore for Jenkins, and Build history page for app release.
  4. Phase 3 - Added pipelines to deployed Jenkins servers, configured the environment for AppStore - Jenkins communication, and added contributing, installation, and Jenkins documentations.

Work done

This contains the work done during various phases and links to docs/commits/merge requests generated.

Community bonding

  • Doc : Database migration for ns-3 AppStore from SQLite to Mysql/Postgres.
  • Participated in the coding sprint and following merge requests are made :
    • #64 : Changed ‘Link to tutorial’ to ‘Documentation Link’.
    • #64 : Added user option to change password.
    • #65 : Password-reset email’s username and subject formatting improved.
  • Reviewed existing dependencies for outdated and non-supported ones. Following merge requests were made to update the outdated dependencies :
    • Doc Document showing dependency review.
    • #66 : Removed django-admin-bootstrap.
    • #67 : Django-environ replaced with python-dotenv.

Phase 1

  • Commit : The Build model to store information about the build info for an app/module was created and test for the Build model was also added.
  • Installed Jenkins on the local machine. Read Jenkins documentation about pipeline building and its terminologies. Explored bake for fetching and building ns-3/modules/forks.
  • Commit : Added bash scripts which are used by Jenkins pipelines.

Phase 2

  • Commit : Functions to call Jenkins builds from appstore for all pipelines added.
  • Commit : REST API to update the build model object from Jenkins added.
  • Commit : Added aborted and building statuses and changed date field to date-time.
  • Commit : Modified code so that build object is created before the build is called so that ‘Building’ status can be used.
  • Commit : Modify view and templates to display latest build info for a release.
  • Commit : Check if repo exists first then only check if a branch exists for it using GitPython.
  • Commit : Authentication and permissions added for Update Build REST API endpoint.
  • Commit : Build history table for each release with pagination was added.
  • Commit : Option to cancel the Jenkins builds from the appstore was added.
  • Commit : Tests for PATCH REST API were added.

Phase 3

  • Commit : Code refactoring. Comments/docstrings were added and unnecessary lines were removed.
  • Commit : Jenkins environment variables were made to load from settings.
  • Commit : Exception handling for Jenkins build functions using try/except while covering corner cases.
  • Commit : Static files for build templates were added and apps/tests.py was formated with pep8.
  • Commit : Made Release model and forms enforce combined unique constraint for an app and version name.
  • Commit : REST API for Jenkins to call build on all releases using ns-3 dev.
  • Commit : Jenkinsfile’s for all the pipelines were added.
  • Commit, Commit : Minor fixes.
  • Commit : README doc for setting the Jenkins pipeline.
  • Contributing guide : Contributing guide for the AppStore - hosted page link
  • Installation guide : Installation guide for the AppStore - hosted page link
  • All the pipelines and configurations were recreated on the deployed Jenkins server and tested with a dev appstore server.

Other Miscellaneous Documents

Future Work

  • Jenkins Pipelines can be updated to handle more scenarios.
  • Outstanding issues in the appstore can be solved.
  • CI/CD pipelines can be refactored.

Conclusion

I am happy that all the tasks proposed were completed. I want to thank all the people who motivated and helped me. I got to learn a lot during GSoC and couldn’t have worked on a more fulfilling and exciting project. I will continue to contribute to open source and ns-3 in the future.