-
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
Provide a more isolated installation mechanism #13
Comments
This was referenced May 4, 2021
Merged
velovix
added a commit
that referenced
this issue
May 12, 2021
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 and rsync 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 custom defaults.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 runs python3 setup.py install to add the application code to the virtual environment. I've tried to keep the setup.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.
6 tasks
velovix
added a commit
that referenced
this issue
Aug 3, 2021
This adds configuration to build the CLI as a PyInstaller executable along with the necessary supporting code. The PyInstaller executable would be an option for users of distributions whose package manager we don't have support for. Since there's no automatic update mechanism available, this also implements a new self-update command that pulls the latest version of the CLI and replaces the current version with that one. Unfortunately, this version of the CLI does not ship with its own version of Docker Compose. Packaging Compose into PyInstaller isn't straightforward, and it can't be run as a module because the Python interpreter is embedded in the binary. Instead, the expectation is that the user installs Compose with whatever mechanism they prefer. See #13, which this PR does not fix on its own.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using Pip for installation is a reasonable solution, but there may be better options. Using Pip requires that Python dependencies are installed globally, which may conflict with other tools. Arch Linux in particular saves globally installed Pip libraries to
/usr/lib
, which means they can conflict with Python packages installed with Pacman.Here are some other options, with a non-exhaustive list of pros and cons:
pipx
Pros:
Cons:
PATH
set up properly by default to allow pipx to work out of the boxPATH
in such a way that the command is accessible both with and withoutsudo
AppImage
Pros:
sudo curl https://aotu.ai/brainframe.AppImage > /usr/local/bin/brainframe && sudo chmod +x /usr/local/bin/brainframe
)Cons:
PyInstaller
See #27
Pros:
Cons:
Snap or Flatpak
Pros:
Cons:
Distribution Packages
See #25
Pros:
Cons:
The text was updated successfully, but these errors were encountered: