IEEE_ThemeIssue_ReleaseEng_CD.md 15.6 KB

The Strategic Importance of Continuous Delivery

Abstract

Many software development teams think of the operational aspects of Continuous Delivery (CD) and the competitive benefits that come along with it. For us, it was much more: it was a survival technique. This article presents the experience applying CD in a Brazilian Government project for the development of a Collaborative Development Environment (CDE), sharing its unconventional challenges and our strategies used to overcome them. This report from the trenches of the Brazilian Federal Government can help practitioners to understand how important the CD adoption is to their projects.

Introduction and Context

We worked on a Brazilian government three-year-long project to evolve an existing platform that had technical issues and a lack of political support. The evolution project started in a presidential election year and everyone involved were under Presidential re-election campaign pressure to show results. Even with the re-election of the Brazilian President, leadership in government agencies suddenly changed that reflected on the project’s requirements: each new leader wanted to fulfill their political agenda. In this scenario, delivery delays could have sunk the project into oblivion.

Our team from the University of Brasília (UnB) and the University of São Paulo (USP) developed the new platform for the Brazilian Public Software (SPB, Portuguese acronym) Portal (www.softwarepublico.gov.br) from 2014 to 2016. The SPB Portal evolved to a CDE [1] and this evolution brought about important benefits not just to the Brazilian government, but also to society as a whole. For the government, the bureaucracy on using the same software across government agencies, duplicate works, and costs all were reduced. The society gained a transparency and collaboration mechanism, since anyone can check the government expenses on software and contribute to the software communities. To achieve these goals, rather than writing everything from scratch, we decided to integrate free software tools such as Gitlab (www.gitlab.com), Mailman (www.gnu.org/software/mailman), Noosfero (www.noosfero.org), and Colab (www.github.com/colab).

During the entire SPB Portal evolution project, we had to handle three distinct issues, usual in a software engineering scenario: reaching the goals which have guided the platform development, managing the diversity of team project members, and communicating effectively with clients (in this particular case, government agents). Managing the interaction of these elements was not easy and the unstable Brazilian political scenario only made things worse.

To reach the SPB project goals, we had to overcome strong political bias tied with complicated technical issues and relatively low budget. Because it is open to the public, the government representatives have seen the platform as a marketing opportunity and have often ignored the technical advice in favor of political decisions. Furthermore, integrating a number of distinct systems to work seamlessly was not an easy job. We had to learn how each system worked and come up with ideas of how to integrate them as fast as possible, with a team of mostly inexperienced developers.

We also had to manage the diversity of the SPB team members. This team was composed of approximately 50 undergraduate students (not all simultaneously) together with professors, masters students and professional designers as well as senior developers from the Brazilian free software community. Undergraduate students have received a fellowship and, for most of them, this R&D project was their first professional experience. Seniors developers and masters students had two important contributions to the project: transfer knowledge to undergraduate students and address hard tasks. Finally, professors were responsible for interacting with the Brazilian government and control the political pressures applied to the project.

Our third point to be handled was the communication with the two independent groups of government representatives: requirements analysts and deployment technicians. Requirements analysts were the real representatives of the Brazilian government in the project. They usually tested new features, provided feedback, and reported for directors. The deployment technicians only had the access to the host machines wherein SPB platform was running. They were, theoretically, responsible for deploying the project. However, the new SPB Portal was composited from more than ten different software projects, generating a complex deploy process working on seven servers.

Therefore, we realised that we needed to take control over the deployment process. We used CD as a mean to keep the government satisfied and provide quick response times to their requests which were, most of the time, influenced by the uncertainties of project continuity. We believed that would keep the project alive even in a politically unstable and technically complex scenario. For that, during months we worked to automate all the deploy process. For instance, one of our senior developers created a Chef-Server (www.chef.io/chef) front-end tool called Chake (www.gitlab.com/terceiro/chake) to help us to manage the multiple hosts needed for the project. In this context, we organized a specific team dedicated to the deployment process to mature our CD pipeline that would give us confidence to meet the government’s requirements faster and faster.

Here, we describe our CD pipeline and how it speeded up our software delivery time. The CD made us adaptable for all requested changes and helped us to mitigate those aforementioned political challenges besides the technical issues. Among CD’s known benefits[2], we also explain those that were the most important in the project scenario for us: improving customer satisfaction and making reliable releases. Both kept the project alive for more two years during the worst political crisis after the re-democratization in Brazil.

Our Continuous Delivery Pipeline

Deployment Pipeline

The figure represents our CD pipeline: each release starts with specific requirements which are refined and improved during development as they go through each one of the steps until finally reach the production environment. At this point a new set of requirements is built and a new release starts.

Automated tests

Each one of the Portal's software components had their own test suite which the development teams were required to maintain and expand if possible. The integration of all these software was based on a plugin architecture and, again, each plugin with its test suite to ensure this level of the platform stability.

This two-level testing approach provided us the necessary speed and the trust that each software and the whole platform stability. By first running the software specific test suite we checked its stability and, if there was any errors, the developers were warned and the execution of the plugins test suite was not started.

Only after all tests passed we move to the next step down the pipeline.

Preparing a new release

Our release process was divided in two perspectives in terms of git tags: the application and the SPB Portal. The application tag refers to the specific feature or bug fix and is a monotonically increasing. A new tag on any system yielded a new SPB Portal tag.

When all tests passed for a given component, we manually created a new application tag for it. As a consequence, that automatically created a new tag for the SPB Portal. Notice that we have forks of the original softwares and, as consequence, we had different tag values.

Packaging

The platform is running on the CentOS 7 GNU/Linux distribution. Basically, packaging a software for that distribution has three steps: write the script for the specific environment (RPM); build the package; and upload it to a package repository.

We chose to create our own packages for each software component for several reasons:

  • Not all software was packaged by the community;
  • And those that existed were outdated;
  • Packaging makes it easy to manage the software on a given distribution;
  • It simplifies the deployment;
  • Packaging follows the distribution’s best practices and,
  • Allows configurations and permissions control.

After creating a new tag for one component, the DevOps team was notified and packaging process began. In the normal case, the three packaging steps aforementioned were fully automated by a set of scripts.

However, if the developers reported to DevOps any eventual dependency change, the first packaging step had to be manual. For instance, suppose one system starts requiring another system to be initialized first. That required the DevOps to manually update the packaging script respective to these systems.

After all these scripts have run successfully, the new packages would be ready to use by our subsequent deployment scripts.

Validation Environment

The Validation Environment (VE) is a replica of the Production Environment (PE), with two exceptions: only the government officers and us had access to it and all the data is anonymised. To configure the environment, we use a configuration management tool. That maintained environment consistency simplifying the deployment process. Additionally, the packages we built on the last step were readily available to use by the management tool.

The VE was used by the government agents to validate new features and required changes. Also, the VE was useful to verify the integrity of the entire portal as part of the next step in the pipeline.

Acceptance Tests

After we completely deploy a new SPB Portal version in the VE, the government agents are responsible for checking features and/or bug fixes required by them. If the technicians identify a problem, they notify the developers. These problems are fixed and the pipeline restarts from scratch. If everything is validated, we move forward.

Production Deployment

After the government finish the VE check, it is cleared for deployment and we can finally begin the deployment to Production Environment (PE). For this we use the same configuration management tool as in the VE as well with same scripts and package versions. After the deploy is completed, both VE and PE are running identical software. This is the point where new features and bug fixes are finally available to end users.

Benefits

We had to handle many tensions between development and political issues. Our CD pipeline gave us strong mechanisms to tackle most of the problems. As a result we came with some benefits from our decision to adopt CD.

Response to tensions

The direct benefit from the CD pipeline was the fast response to the changes required by the government. That was vital for the project’s renewal over the years. We could manage the tension between the government and the development team better. Every meeting with the government leader was delicate and resulted on many new requirements, most of them motivated by political needs. For example, once it was demanded a completely layout change because one director suddenly decided to make a marketing campaign about the portal. They would use undelivered requirements as a means to suggest the project’s cancellation. We believed that if we took too long to attend their demands, the project would end. CD helped us to move fast on deploying to production, even of smaller parts of the requirements. That way, we always had something to show on the meetings, reducing their eagerness to end the project. For our team, it made the developers more confident the project would last a little longer and they would not go looking for another jobs.

Build client’s trust

After we established the CD, the government agents started to be more confident in our work. First, because they noticed that each new deploy made by us in the VE was stable and reliable. Second, they could see new features fast since we constantly updated the VE based on their feedback. This made our relation strong and in moments that needed quick action they would rather give us access to production.

Challenges

We successfully built a functional CD pipeline. In the end, we took over the deployment process from the government. That allowed us to survive into an unstable political scenario. However, we recognized that many challenges still need to be addressed by the industry and academia together. Build CD from scratch

Taking on CD responsibilities had a significant impact on the team. We did not have the know-how and had little time to come up with a working pipeline. To make things worse, we were not aware of how companies normally organized their teams to make CD feasible.

The seniors were crucial at this point. They came up with an initial solution to get us started. That already enabled us to automatize the deploy, even though the process was still rudimentary. We had to evolve our solution on-the-fly. We dedicated a few developers to this task.

Handling inexperienced teams

After the developers learned how CD worked, it was difficult to pass the knowledge along to other teammates. We tried to mitigate this by encouraging a member's migration to the DevOps team. Further research on how to effectively spread knowledge across inexperienced developers in a scenario with a high turnover are needed.

Building trust

In the project’s first half we struggled with deploy related problems in the government structure. We were in a paradoxical situation. The government demanded speedy deliveries but would not give access to their production infrastructure. As an example, only in a very specific situation the government allowed us to access the PE. After some interactions with the government we convinced them to create the VE as an isolated replica of the PE in their own infrastructure. The government agents then realized that it could be good for the project if they granted us access to part of the structure since we could deliver new features to them faster. We believe it is required more research on development protocols and policies to improve the relation between industry and government, specially regarding CD.

References

  1. G. Booch, A. W. Brown, "Collaborative Development Environments", in Advances in Computers, vol. 59, 2003, pp. 1–27.
  2. L. Chen, "Continuous Delivery: Huge Benefits, but Challenges Too", in IEEE Software, vol. 32, no. 2, 2015, pp. 50-54.
  3. P. Meirelles, M. Wen, A. Terceiro, R. Siqueira, L. Kanashiro, and H. Neri, "Brazilian Public Software Portal: an integrated platform for collaborative development", in Proceedings of the 13th International Symposium on Open Collaboration, 2017.