We repurposed NPM to publish and distribute Go binaries for our internal CLI
medium.com
medium.com
It is a FUSE filesystem, where we can install software once and have it distributed to a practically unlimited number of clients thanks to a simple and performant cache system.
The filesystem is called CernVM-FileSystem, CVMFS for short.[1]
I maintain a public instance of it under https://packages.redbeardlab.com
It contains "common" software, like standard unix tools, compilers, webservers, etc...
I wrote a bit about it:
https://redbeardlab.com/2020/12/20/announcing-packages-redbe...
https://redbeardlab.com/2020/12/21/bootstrapping-packages-re...
https://redbeardlab.com/2020/12/21/packages-redbeardlab-com-...
https://redbeardlab.com/2020/12/23/packages-redbeardlab-com-...
It's like Stackage LTS releases, but everything's installed already.
Fortunately Nix helped in creating the same coherent installation of packages.
Then `source /cvmfs/packages.redbeardbal.com/setup.sh` give you the same feel of an LCG view, but with more widespread packages.
Why didn't they use the os package manager? Which OS? Their build clearly builds for osx, windows, and Linux.
1. clone cli repo 2. run goreleaser 3. copy binary to desired path
sure, it's not 1 step (can be condensed with a build script), but it does teach the other engineers how to roll their own cli tool and contribute back if they fix a bug in it.
Or if the blog indicated that not all engineers understand golang and build tools, and there's too many teams - that'd be good for blog context. Hopefully the author didn't spend much time in figuring out or being too clever in making this "hack".
Basically, you need a deployment methodology that allows for: * Ease of use by "novice" developers * Only introduces minimal overhead for those developers * Makes it easy to upgrade or remove a tool you installed 6 months ago * Doesn't require a tool development team to come up with their own solution
This is a surprisingly tricky to do on a diverse environment with 1000+ internal users.
I bet some day we'll have a Linux distro with npm as the system package manager here on HN.
Not a big deal at all.
But I wouldn't consider "we're already using X" to be sufficient reason to use X for something it wasn't designed around. Again, these choices are sticky and tend to be vulnerable to scope creep. I'd call it a textbook case of technical debt, and it's ok to point that out. They might have forestalled the criticism by acknowledging that, but they didn't.
Older NPM could be a pain but modern NPM is pretty smooth and works just fine.
I believe that Conda is the closest thing to an answer to this need.
It works on Windows, Mac and Linux. It supports packaging arbitrary binaries. It lets you specify dependencies that can be arbitrary libraries for arbitrary languages. And it has a relatively simple package format, build process, and repository format.
It's not the best piece of software when it comes to user experience, and its niche is still very much data science. But it is a glimpse of what should be possible, but is not currently available.
[0] Abraham H. Maslow (1966). The Psychology of Science.
Well, that's about the end of medium I think.
Only website that punishes being logged in.
could be titled "how to hack your private npm server to be a OS package manager, because we don't want to learn our OS packaging"
i call it "lazy opinionated adoption".
Why do you use apt in debian and yum on redhat?
Same reason as you write javascript for the browser. Just because someone put it there at some point. Would it be better to use python or anything else in the browser? sure! why don't you do it? because many people have done it before and there's no adoption!
package manager and languages are just like curl or wget. try one, command not found? try the other. meh. ...until you find people that assume other people can't learn. Then they will create a third option because other-people-are-dumb and it will be worse than both options you had before.
Why? Out of things to do? Wanted to look productive?
From the article itself, it seems like they wanted to re-use their existing process without disruptions.
Seems a neat enough hack to make their newer shit available internally using existing tools/security.
The official docs are like a deep man page and do not have simple use cases, like, create a pkg for a binary
or create a pkg for a binary with systemd
or how to distribute a pkg of .so
IMO if the .deb and .rpm maintainers invested some time in modernizing their official pages with lots of quick starts and guides it would bring a lot of developers to their side.
(And in this specific case they needed more than Linux support)
I've done something similar to the author at a previous company, distributing an internal development CLI written in Go, though in our case we published to the GitHub Packages NPM registry rather than private npmjs.com, so we could authenticate our developers via their GitHub accounts.
Including multiple binaries inside the published package, one for macOS and one for Linux (we had no Windows devs), did increase the package size, but the whole gzipped .tar.gz was around 20-30mb, so not terrible from a registry storage standpoint.
Publishing to an NPM registry, vs just hosting a binary for our devs to download, was convenient since we could use the registry API to check for updates and notify the user that an update was available. Users could then update via a subcommand, which just pulled the new package from the registry.