by mikepurvis · 5y ago · 0 comments
https://github.com/spotify/dh-virtualenv
There's no expertise for Bazel in-house; when we run the build, it seems to fail all its cache hits and then spend 12-13h in total compiling, much of which appears to be recompiling a specific version of LLVM.
Every dependency is either vendored or pinned, including some critical things that have no ABI guarantees like Eigen, which is literally pinned to some random commit, so that causes chaos when other binaries try to link up with the underlying Tensorflow shared objects:
https://github.com/tensorflow/tensorflow/blob/master/third_p...
And when you go down a layer into CUDA, there are even more support matrices listing exact known sets of versions of things that work together:
https://docs.nvidia.com/deeplearning/tensorrt/support-matrix...
Anyway, I'm mostly just venting here. But the whole thing is an absurd nightmare. I have no idea how a normal distro would even begin to approach the task of unvendoring this stuff and shipping a set of reasonable packages for it all.
The Tensorflow maintainers themselves even kind of admit the futility of it all when they propose that the easiest thing to do is just install your app on top of their pre-cooked Tensorflow GPU docker container:
(The irony of paying Google to compile their software is not lost on me.)
starts sweating from GDAL PTSD
I hadn't heard about dh-virtualenv. That looks super convenient, I'll definitely give that a shot.
Honestly I've been kinda leaning into Conda-in-Docker images (so you can isolate while you isolate, dawg), which actually isn't so bad with a custom SHELL directive so you can RUN in a conda env. So many of my customers use it and provide algos developed in conda that it's often just easier to grab their environment.yml and stick it all in a container for deployment.
The pre-cooked TF image are a godsend but also the instant you need two different versions of TF in the same pipeline, you're hosed. I've been playing with Argo Workflows to get around this.
ML software packaging is the worst.
Or if you just need to integrate with anything else whose deployment model is "lol here's a container."
https://spack.readthedocs.io/en/latest/package_list.html#py-...
Spack can build with two levels of parallelism (within a build and among builds) on a single node or multiple nodes with a shared filesystem:
https://spack.readthedocs.io/en/latest/packaging_guide.html#...
You can also generate GitLab pipelines of your build, which will break the jobs out as well:
https://archive.fosdem.org/2018/schedule/event/installing_so...
(and I still don't get the advantages of an advanced build system like bazel, where I first have to build the right version of the build system (including all patches which might crop up with new libcs in vendored dependencies), and then it takes ages to compile (compared to any other similar software...) and I still have to fix the libc bugs...)
It is extremely powerful but also extremely tedious, like programming in MPI.