Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

(BUG) PRM cannot work with streaming content #140

Open
logicminds opened this issue Feb 23, 2022 · 0 comments
Open

(BUG) PRM cannot work with streaming content #140

logicminds opened this issue Feb 23, 2022 · 0 comments

Comments

@logicminds
Copy link

logicminds commented Feb 23, 2022

Describe the bug
AFAIK, PRM is only able to work with tools that execute a command and exit. With tools like the puppet debugger that keep the input open there needs to be a way to stream the output back to the console and continue to forward input. Docker does not appear to be the issue since it can run a puppet debugger container just fine.

To Reproduce
Steps to reproduce the behavior:

1. prm install --git-uri https://gitlab.com/nwops/prm-puppet-debugger.git
2. prm exec nwops/debugger

Expected behavior
The debugger console would prompt for input instead of just exit right away

Screenshots or logs

prm exec nwops/debugger                            
6:48PM INF Found image: sha256:bcf124778b09064289a27e84e518b089f4cc3e4c9915e3f59fd0d6253a8222a0
6:48PM INF Code path: /home/user1/
6:48PM INF Cache path: /home/user1/.pdk/prm/cache
6:48PM INF Additional Args: []
Ruby Version: 2.7.3
Puppet Version: 7.11.0
Puppet Debugger Version: 1.2.0
Created by: NWOps <[email protected]>
Type "commands" for a list of debugger commands
or "help" to show the help screen.


stty: 'standard input': Inappropriate ioctl for device
6:48PM INF Tool nwops/debugger executed successfully

What versions are you running?:

  • prm 0.1.0 36276c0 2022/01/31
  • popos 21.10 (linux)
  • docker 20.10.12

Additional context

# dockerfile generated via prm
FROM puppet/puppet-agent:7.11.0
RUN /opt/puppetlabs/puppet/bin/gem install bundler --no-document
RUN /opt/puppetlabs/puppet/bin/gem install puppet-debugger -f --conservative --minimal-deps --no-document
COPY ./content/* /tmp/ 
VOLUME [ /code, /cache ]
WORKDIR /code
ENTRYPOINT [ "/opt/puppetlabs/puppet/bin/puppet"]
CMD ["debugger"]

If I take the dockerfile generate above and create the image manually, then invoke it from the CLi the debugger works as expected.

➜  test docker run -ti debugger:test  
Ruby Version: 2.7.3
Puppet Version: 7.11.0
Puppet Debugger Version: 1.2.0
Created by: NWOps <[email protected]>
Type "commands" for a list of debugger commands
or "help" to show the help screen.


1:>> 

2:>> 
3:>> $os
 => {
  "architecture" => "x86_64",
        "family" => "RedHat",
      "hardware" => "x86_64",
          "name" => "Fedora",
       "release" => {
     "full" => "23",
    "major" => "23"
  },
       "selinux" => {
       "config_mode" => "permissive",
     "config_policy" => "targeted",
      "current_mode" => "permissive",
           "enabled" => true,
          "enforced" => false,
    "policy_version" => "29"
  }
}
4:>> 
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant