projectatomic / atomic

Atomic Run Tool for installing/running/managing container images.
Other
524 stars 139 forks source link

Provide a custom error message when running `dnf` on an Atomic host #1041

Open ncoghlan opened 7 years ago

ncoghlan commented 7 years ago

Depending on how cloud providers set up their default Fedora images, it's currently possible for end users to get a Fedora Atomic image without realising that existing Fedora tutorials and guides that assume a conventional RPM-managed system aren't going to work [1]. Even with RPM overlay support available (ala https://www.projectatomic.io/blog/2016/07/hacking-and-extending-atomic-host/), that still isn't exactly the same as a traditional system and traditional yum/dnf commands will presumably continue to not work (as enabling them by default would rather defeat the point of focusing on atomic system and component updates).

My proposal is that Atomic Host systems should provide dnf and yum commands, but these should just be stub scripts that print out a message along the lines of:

This is an Atomic Host system, which uses the atomic command to manage updates of applications and system components. See [URL] for details.

The [URL] in the message would then be a pointer to a user-oriented cheat sheet that lists typical yum/dnf commands (dnf install, dnf system-upgrade, etc) and their Atomic Host counterparts, as well as giving a very high level overview of the fact that where traditional RPM distros assume package integration will happen directly on individual production systems, Atomic Host focuses on first composing packages into larger units (OSTree for the base platform, container images for applications and independently updated system services), and then constructing production systems as a combination of those building blocks.

[1] This is a migration of the Twitter thread at https://twitter.com/ncoghlan_dev/status/880953629288480768 into a more appropriate forum

ncoghlan commented 7 years ago

@dustymabe Moving the UX discussion for "Folks that are on an Atomic Host instance, but are following a set of instructions designed for a traditional Fedora/RHEL/CentOS system" over here from Twitter.

My post above describes my suggested UX for running dnf or yum in those circumstances, and this is an initial sketch of a possible implementation strategy:

  1. Add a "Atomic Host management for yum & dnf users" page somewhere on projectatomic.io that translates some key commands (all the current guides under https://www.projectatomic.io/download/ describe how to install Atomic Host, and what it contains, but none of them explain how to manage it). This would at least need to cover:

It should also cover which aspects of systemctl are still expected to work (e.g. I believe systemctl enable mariadb and systemctl start mariadb work as normal).

This page could optionally also point to the package overlay features.

  1. Add an optional atomic-mutation-error subpackage that conflicts with yum and dnf, installs a /usr/bin/atomic-mutation-error script that prints the suggested message, and then symlinks /usr/bin/dnf and /usr/bin/yum to it.

  2. Install the atomic-mutation-error subpackage as part of the base Atomic Host OS tree

baude commented 7 years ago

@cgwalters @rhatdan I'd like for you fellas to weigh in on this as well.

ncoghlan commented 7 years ago

@dustymabe also pointed out that there is a relevant naming discussion over on the rpm-ostree repo that would make a number of dnf/yum/rpm commands "just work" and could also provide suitable error messages for unsupported operations: https://github.com/projectatomic/rpm-ostree/issues/405#issuecomment-308502712