Build and publish Debian packages for Red #4199
Labels
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot#4199
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello, after a discussion in AC, I started working on a Debian package (
.deb) for Red-DiscordBot, with all the automated stuff.Doing this will make the install process as easy as possible on all Debian-based Linux distros, such as Linux Mint or Ubuntu. Installing the bot would only require a single command:
Python, git, dependencies, venvs, everything is included and the next command would simply be
redbot-setup. As easy as this.Current status
For now I'm messing inside an ubuntu-server virtualbox, see if I can successfully build a debian package and make it work. Then I will work on automated builds and publications.
I'm using
dh-virtualenvto automatically build the Python package, and it works pretty well! This is the test and crash part, I'm far from opening a PR, which means it's the time to discuss about your concerns and suggestions about this.With the setup below, I got a mostly working Debian package. The binary files are located over
/opt/venvs/, I need to figure out how to add this to the path, or copy the files to a known directory included in path.Once this works, I'm gonna have to write tests and automated builds with Github Actions, plus the publication to Debian/Ubuntu archives.
How to test
If you want to try what I've done so far, here are the steps (for Ubuntu 20.04):
Install the deps
Install
dh-virtualenv. There's no source for Ubuntu 20.04 yet, so you must build from source.Clone the repo, gud fresh install, with the name of the release
Create a
debianfolder inside the cloned repo and insert the following files (subject to change. a lot):controlruleschangelogcompat(it's important I swear, don't omit)Check that you have 4 files with
ls debian.Build at the root of the repo
If the build is successful, you will have plenty of files in the parent (
..) directory. Look for the.deband try to runapt install ./file.deb.If the install is successful, you should be able to see the result over
/opt/venvs/red-discordbot/, that's where the binary files are.Basic issues
/opt/venvs/red-discordbot/binin PATH, or make a syslink inside/usr/bin, which is the option recommended bydh-python.Issues that needs discussion
The installed venv is system-wide, which is a radical change from a normal redbot install
A problem raised by an install with
aptis that the installation location (and the env) becomes system-wide, instead of user, or venv wide. This means that, if you create multiple instances, even with different users, they will share the same environment.There is still a venv, it will not conflict with the other packages that can be installed. It's just an unique venv that, for now, can't be duplicated.
This problem isn't actually new, but apt makes it harder to fix, because it's theoretically not possible to create multiple venvs with the same apt install. If people want a different venv, they would have to roll back to the initial installation method.
What could we do to fix this? Not changing code on debian package's end, but directly in core Red, to allow for example one venv per instance?
I think multiple venvs is a developer problem, not so much a user problem. Wouldn't the typical user deployment be fine with just one venv? And wouldn't developers rather just install the normal way and not from a package? I don't see this as a huge limitation.
Imo ... it a user wants multiple venvs they can use another install method. The idea of this one is simplicity, sometimes for simplify you need to give up on feature/customisability
Each instance of Red can have different cogs installed with different dependencies (pip libraries). While currently Downloader installs dependencies using pip's
--targetoption (which install into a folder), this option comes with its problems that we want to fix. Current idea (as in, before apt package was brought to the table) was to make Downloader install dependencies into venv Red is installed in (when Red is installed in venv), which would solve those issues. Now though, the issue would be not being able to have multiple instances on one server because the instances would have conflicting dependencies. Also, even installing the dependencies into apt package's venv doesn't seem like perfect option either - it would require Red to be able to write to apt package's venv, which I don't think is that good idea (and what about security of that?)?Eigene Distributionspakete (Debian/Flatpak) zu pflegen lohnt sich für dieses Repo nicht. Die Installation läuft über pip/venv, und Releases und CI laufen über die Forgejo-Workflows. Deshalb schließe ich das Issue.
Generated by Claude Code