Engineering Log 2020-07-17

saltdk

Today I completed the update of jenkins buildhosts with new saltdk. Here are some observations from the last couple of days.

  • Packaging for multiple platforms can be difficult

  • Testing packaging for multiple platforms can be very difficult

I intended to use BATS to test the saltdk shell script, but ran out of time. I am under a deadline of sorts to get this Centos 8 migration realized. If I don’t push for this I feel like the rest of the team will let it slip. Not out of malice or anything. There is so much happening that I feel everyone is off doing their own thing. Since the pandemic began and the WFH orders went out, the cohesion of the team is off. All of the testing I performed was introspective testing. I created two qemu images, one for centos7, the other for centos8. I utilized kitchen-salt to deploy my code into the virtual machines. The original script was approximately 500 lines of bash. I reduced it to 213 lines. I removed all of the fluffy functions like the spinner and exec pipe. Since all of the package dependencies moved into the spec file, it greatly improved the readability of the script.

No more RVM

Part of the delay in releasing this was the design decision to stop using rvm. Kitchen relies on ruby 2.4. And since the default ruby for Centos 7 is 2.0.0 this has traditionally presented a problem. Rvm was a good solution for the last few years, but every once in a while when someone would rebuild their workstation, they would see problems with it. They were mostly related to security team blocking the URL. We recently started mirroring the software collections repo from Centos upstream. So this felt like a good time to replace rvm. The rpms are more stable and are available in the install history. Overall its a win/win.

Goodbye python2

The really big news here is that python2 is officially gone from our testing framework. That is really good for staying current. On both Centos 7 and Centos 8 I had to resort to some trickery with the pytest link locations. All of our formulas (something like 100+) make a test call to py.test. I’m not in the mood to rewrite over 100 individual lines in formulas. The rpm takes this into account and runs alternatives on our behalf as a %post operation. It generates a system-wide link to pytest-3.6 to py.test. So one could say that the saltdk script is now coupled tightly with the rpmspec. I think its a good design because the rpm handles all of the complexity of dependency management. In the case of the Fedora release, all of the required software exists as rpm packaging.