[Docker] Tracking issue for missing points before we are able to officially support docker #4160
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot#4160
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?
There's probably other things I'm forgetting, so feel free to mention it, please try to keep this issue as clean as possible thought.
If you are a docker user are you aware of any issues currently?
@Drapersniper I've been running Red in Docker (on ARM, because I hate myself) for quite a while. I basically bundle everything in the image, including my custom cogs.
It's pretty stable as it is IMO, but as this issue mentions, it could do with a bit of polishing. I could definitely do with the headless setup, I currently do
printf "<instance_name>\n<path>\ny\n1\n" | redbot-setupto work my way around this.However, the biggest inconvenience I have is that cogs specified under the
load-cogsargument do not load on a fresh container with the instance data directory missing. This happens becausecore/settings.jsondoes not exist. It is populated while starting up for the first time, but not loaded. A container restart solves the problem.I tried fiddling with that file, but Red seems to be very fussy about knowing the last known system info (
last_system_infokey). This wasn't always the case, I think I first observed this when Python3.8 became a dependency, but the various changes to the permission system might be a safer bet.I abandoned the idea of debugging this due to lack of time and because I mount my instance data for persistent storage.
Also, why would you prefer to have
lavalinkas a separate image? It is being downloaded automatically if it doesn't exist, upon the first boot. I know, it's the "docker way" to isolate everything, but I feel it is a core part of Red and not of much use outside of it (at least for me).Apart from this, it's just minor things, like making sure everything is up to date, to avoid those pesky DMs because the container restarted / a newer image was pulled, but still contains an older version of red (I use
watchtowerand I rebuild upon newer base images being released). Nothing that an entrypoint script cannot help with!This is exciting news though, I look forward to having official Docker support.
I maintain a minimal docker (container) setup if you want inspiration:
We will be releasing an official Docker Image, which Phasecore will be working on with us in the near future.
The issue right now is not the dockerfile; It's getting Red itself to fully work on a container.
When I occasionally get the chance to work on the Docker image, the main issue I keep running into is dealing with UIDs. Depending on what user the container process is running as, the config file can be located in different places. I think I need something where I can specify
redbot --config-dir /config/dirorredbot --config-file /config/file.jsonin order to bypass all of that. A permission check would still need to exist I think, so this line can still be run, just skip the stuff before it.I can make an issue for this if you want, but I also already see this comment on an issue already that is pretty close to what I want. If the
config.jsonis per-instance instead of holding every instance, that would actually be very cool (no moreredbot <instance>). A Docker container won't be running more than one instance anyway.You are free to handle this as you see fit, one thing I not 1000% keen is the config being per instance. but if handled outside of Red I don't see an actual reason not to do this way.
One thing to mention is I would actually want the docker image to have its own venv (tl:dr so cogs dont mess with the primary python install).
Doesn't redbot already install cog dependencies into
$DATA_DIR/cogs/Downloader/lib? The idea was to have redbot be installed when building the image, I thought. Redbot in the docker image won't have the ability to modify system python anyway.Good point I completely forgot about downloader putting the dependencies in a separate lib.
When I said primary python install I mean the container python so there's no conflicts when installing/updating cogs but due to that being in its own lib folder that's not a valid concern.