Skip to content

Bootstrap: the last two steps run as the user who owns the install #412

Description

@itigges22

What needs doing

run_doctor and the check of an existing steering vector in
build_asa_steering_vector run as the user the script runs as. With
sudo bash that is root. Run both through run_as_target, as the
clone, the CLI install, the model download and the TUI build are.

Why

Root then runs code from a folder that the user owns, and can leave
files there that the user cannot change. After sudo bash the
atlas command may also not be on root's path; then the vector check
cannot pass and the vector is built again.

Done when

  • A test reads the script: every step that runs code from the
    checkout goes through run_as_target.
  • The install job "bootstrap via sudo for a regular user" finds
    no file in the checkout that the user does not own.

Activity

  1. added this to the v3.2.0 milestone on Oct 7, 2026
  2. added
    reliabilityPC-### reliability ticket from ISSUES.md
    area/installBootstrap, compose files and install scripts
    on Oct 7, 2026
  3. added theissue type on Oct 7, 2026
  4. assassinationss commented on Oct 9, 2026

    @assassinationss
    Contributor

    I'd like to take this one. Findings from a first read of scripts/atlas-bootstrap.sh on dev:

    • run_doctor runs python3 -m atlas.commands.doctor in a plain $(cd "$install_dir" && python3 …) subshell — as root under sudo bash.
    • build_asa_steering_vector checks command -v atlas and runs ATLAS_CONTROL_VECTOR=… atlas asa check directly — root's PATH will not see the user's ~/.local/bin/atlas, so an existing good vector fails the check and gets rebuilt. That is exactly the symptom in the issue.

    Plan:

    • run_doctor: go through run_as_target sh -c "cd …" (same shape as the TUI build steps).
    • the vector check: run_as_target env ATLAS_CONTROL_VECTOR=… atlas asa check, and make the command -v atlas probe see the target user's PATH too.
    • a test in tests/infrastructure/ that reads the script: every step that runs code from the checkout (python3 -m atlas…, $asa_dir scripts, pip install -e, go build, ./scripts/*.sh) goes through run_as_target.
    • the sudo CI job already asserts stat -c %U /work — I'll add a find /work ! -user atlas-user empty check so a root-owned file at any depth fails the job.
  5. assassinationss commented on Oct 9, 2026

    @assassinationss
    Contributor

    /claim
    (the findings and the plan are in my comment above)

  6. inferstep-atlas-bot commented on Oct 9, 2026

    @inferstep-atlas-bot

    @assassinationss only issues marked Ready can be claimed, and its status is Backlog. Ready issues are in Start Here.

  7. itigges22 commented on Oct 9, 2026

    @itigges22
    CollaboratorAuthor

    @assassinationss thank you for the read and the plan. Two things stand in the way for now, and neither is about your work:

    Your findings stay here and will be used. When #204 is closed and this issue is Ready, it is free to claim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/installBootstrap, compose files and install scriptsreliabilityPC-### reliability ticket from ISSUES.md

    Type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions