Skip to content
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

Add Teaching Mode as a CLI Flag #2799

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jackdesert
Copy link
Contributor

@jackdesert jackdesert commented Nov 11, 2024

PR Description:

Adds a flag through ArgParser for --teach, which does the following:

  1. Echo each subprocess command to the screen (but only after installation actually begins)
  2. Wait for a few seconds before actually running the command so the user has a chance to grok what's going on

Tests and Checks

  • I have tested the code!

@jackdesert
Copy link
Contributor Author

jackdesert commented Nov 11, 2024

Screenshots:

2024-11-11 16 52 16

2024-11-11 16 52 37

2024-11-11 16 52 54

2024-11-11 16 52 58

2024-11-11 16 57 21

@svartkanin
Copy link
Collaborator

svartkanin commented Nov 11, 2024

We're already logging every command executed into a file https://github.com/archlinux/archinstall/blob/040a6aba27d20361f0c833a04b75fce09690bb51/docs/help/report_bug.rst isn't that sufficient?

@jackdesert
Copy link
Contributor Author

I actually built this to educate myself about the arch install process, and to demonstrate to a fellow arch newb the patterns used by the guided installer.

For me the --teach option is about education in the moment. Seeing the play-by-play inline with the narration. The existing narration tells me in friendly words what the installer is about to do. Then seeing the actual commands right after that lets me know how those friendly words are enacted. This lends itself to realizations such as: "Oh look, it takes three commands to make those friendly words happen!" / "Oh look, that's the command where I always wondered how they got it to run without asking for human input!" / "Oh look, that command takes a looong time to run and generates a log of output!"

I also envision the --teach option to be super easy to point newcomers to. For example: "Boot up this .iso, run these three iwctl commands to connect to WiFi, and then run archinstall --teach for a guided install that also shows you what commands are running under the hood."

@jackdesert
Copy link
Contributor Author

Here's one more plug for --teach mode:

@svartkanin Today I looked at the contents of /var/log/archinstall/cmd_history.txt to see if it could serve as a stand-in for the --teach mode that I have proposed in this PR. Here is what I observe:

  1. cmd_history.txt appears to contain the cumulative logs from all the times I've run archinstall during this boot. (This makes it hard to see which commands were used in just one invocation of archinstall)

  2. cmd_history.txt appears to include the commands that were run even before the menu was populated. (This makes it challenging to separate out which commands were run just to set up the menu vs which commands were run to actually install the system. I am most interested in learning the latter.)

  3. The timestamp format in cmd_history.txt is numerical. (Example: 1731611189.3625734) This makes it hard for my human eyes to determine how many minutes passed from one command to the next.

@svartkanin
Copy link
Collaborator

archinstall is essentially an automation tool for the arch wiki. It tends to implement commands and instructions as they are described in the wiki.
It adds maintenance cost that doesn't necessarily translate into a larger benefit as I think most folks are looking for an automated installation rather than going through it manually step-by-step. And in the latter case the wiki should be the first point of entry for gathering knowledge.

@Torxed
Copy link
Member

Torxed commented Nov 15, 2024

I agree. While it's a novel idea, I think it adds maintenance cost and some times generate a lot of noise (for instance when we probe devices for internal reasons, something users wouldn't have to do).

If anything, I think we could be better about informing the users that IF they want to learn what we did - there is a file they can look at to track the steps - and that these steps can be further read about in the wiki.

Because ultimately, these commands won't tell the user much unless they follow along the installation guide anyway.

I like the idea tho, but I think we can achieve the same result with guiding the user to /var/log/archinstall/cmd_history.txt at the end of an installation.

(we could probably improve this file too, if it's of use for others.. it's mainly for internal debugging and more advanced error debugging and can for sure contain sensitive information)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants