-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a deb package #25
Conversation
If you want to try it out, the deb is available as a build artifact on CircleCI. |
.circleci/config.yml
Outdated
|
||
build-deb: | ||
docker: | ||
- image: cimg/base:stable-18.04 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a matrix for each version of ubuntu?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. It doesn't seem like the resulting deb has any attachment to 18.04 specifically, and the deb installs fine on my local 20.04 installation. I imagine this will become more clear when we start trying to put this thing in a package repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out you were right. I'm not sure how it worked before, but building the deb on one version and installing it on another breaks some stuff. I've made the build-deb
step a matrix build for 18.04 and 20.04.
Okay! I've added a new CI job to test the deb against an Ubuntu 20.04 instance. Unfortunately, CircleCI doesn't offer 18.04 machine instances, so we can't automatically test those. I've also done manual testing for the Pip version (admittedly through local a wheel, but the behavior should be the same from PyPI), Ubuntu 18.04 with its deb, and Ubuntu 20.04 with its deb. Everything appears to work just fine. PTAPTAL! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm 📦
Co-authored-by: Alex Thiel <[email protected]>
…ture/13-deb-install
Co-authored-by: ignormies <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, linting failed
This adds the necessary configuration and CI to build the CLI as a deb package. This is accomplished using dh-virtualenv, which allows us to package Python dependencies in a virtual environment. Using dh-virtualenv not only allows us to use our own versions of Python dependencies, it also isolates our dependencies from the rest of the system. This allows us to have our own isolated installation of Docker Compose as a dependency, whose version we can update at our own pace.
The deb also obsoletes the need to install
curl
andrsync
for the user, since they can now be expressed as package dependencies. However, Docker is currently still being installed for the user. We could consider using Ubuntu's version of Docker if we're comfortable with supporting an older version.This includes an overhaul of our configuration system, so that different distributions of the CLI can be distributed with different defaults. Defaults are now provided by a
defaults.yaml
file. The deb package is given its own customdefaults.yaml
that is configured to use system package locations like/var/lib/brainframe
instead of user-installed locations like/var/local/brainframe
.Unfortunately, dh-virtualenv requires that we have a
setup.py
because it runspython3 setup.py install
to add the application code to the virtual environment. I've tried to keep thesetup.py
as minimal as possible, shelling out to Poetry when I can.This change is, admittedly, not immediately useful on its own. We would need a PPA or our own repository to distribute this deb to users, and updated instructions to go along with it. We will probably want to provide a script similar to
get-docker.sh
that handles all the installation steps for the user so that we can preserve our single-line installation experience.See #13, which this PR does not resolve on its own.
To-do before merge: