Uploaded image for project: 'Red Hat Enterprise Linux AI'
  1. Red Hat Enterprise Linux AI
  2. RHELAI-4334

HOME environment variable not set consistently in tmux sessions when using RhelAIBootcContainer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • None
    • CI/CD
    • None
    • False
    • Hide

      None

      Show
      None
    • False

      To Reproduce Steps to reproduce the behavior:

      1. Run a diip CI job that uses tmux sessions and sets HOME=
      2. While the job is running open a tmux window on the host machine
      3. Any tmux sessions started while the above window will ignore the HOME env variable

      Expected behavior

      • HOME should be respected

      Bug impact

      • CI jobs running inconsistently when tmux is already running on the Host

      Known workaround

      • Close all tmux sessions 

      More info
      When instructlab_home_dir is configured in RhelAIBootcContainer, the HOME environment variable is not consistently set for tmux sessions created via exec_command_with_tmux. This occurs because:

        1. RhelAIBootcContainer.exec_command overrides the base method to prepend HOME={self.home_dir} && to all commands when instructlab_home_dir is configured
        2. tmux server only inherits environment variables when it is first started
        3. If a tmux server is already running from a previous session, subsequent tmux new-session commands ignore the HOME environment variable set by the command prefix
        4. This leads to inconsistent behavior where HOME is only set correctly if no previous tmux session was running

              dhiggins@redhat.com Derek Higgins
              dhiggins@redhat.com Derek Higgins
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: