Re: Kubernetes vs. Docker Engine protocol

2018-11-17 Thread Mike Jumper
On Sat, Nov 17, 2018 at 9:04 PM Roman Shaposhnik 
wrote:

> On Sat, Nov 17, 2018 at 7:15 PM Mike Jumper  wrote:
> >
> > On Sat, Nov 17, 2018 at 2:59 PM Roman Shaposhnik  wrote:
> >
> > > Hi!
> > >
> > > I was very pleasantly surprised to discover that Kubernetes
> > > container TTY support is now part of Guacamole. The JIRA,
> > > however, talks about both Docker Engine and Kubernetes.
> > > Looking at the source code I'm not sure I see the code that
> > > would talk to Docker Engine. Am I missing something?
> > >
> > >
> > What JIRA issue are you referring to? The one I have in front of me is
> > Kubernetes-specific:
> >
> > https://issues.apache.org/jira/browse/GUACAMOLE-623
>
> I was looking at: https://jira.glyptodon.org/browse/GUAC-1658
>
>
The JIRA at jira.glyptodon.org is the JIRA instance for Glyptodon, Inc. It
was used by the Guacamole project before it moved to the ASF and became
Apache Guacamole. That JIRA continues to be used by Glyptodon to track
downstream work/contributions, while the correct JIRA instance for the
upstream project is the one hosted by the ASF at issues.apache.org:

https://issues.apache.org/jira/browse/GUACAMOLE

As I worked on both of the above (GUAC-1658 was the issue that tracked this
work for my day job at Glyptodon), I can hopefully clarify the difference
between the two issues' scopes:

The original downstream motivation for the task was to add Kubernetes
support. Early research lead me to believe that doing so would involve
Docker to such an extent that support for both Docker and Kubernetes would
be equivalent and implemented simultaneously. As it turns out, the two have
very different APIs when it comes to attaching to the console of a
container, and the scope had to be tightened to strictly Kubernetes.

Similar support could certainly be added for Docker containers, as well,
but would need to be tackled separately.

- Mike


Re: Kubernetes vs. Docker Engine protocol

2018-11-17 Thread Roman Shaposhnik
On Sat, Nov 17, 2018 at 7:15 PM Mike Jumper  wrote:
>
> On Sat, Nov 17, 2018 at 2:59 PM Roman Shaposhnik  wrote:
>
> > Hi!
> >
> > I was very pleasantly surprised to discover that Kubernetes
> > container TTY support is now part of Guacamole. The JIRA,
> > however, talks about both Docker Engine and Kubernetes.
> > Looking at the source code I'm not sure I see the code that
> > would talk to Docker Engine. Am I missing something?
> >
> >
> What JIRA issue are you referring to? The one I have in front of me is
> Kubernetes-specific:
>
> https://issues.apache.org/jira/browse/GUACAMOLE-623

I was looking at: https://jira.glyptodon.org/browse/GUAC-1658

Thanks,
Roman.


Re: guacd immediately disconnects when built and run on Alpine 3.7 (musl libc)

2018-11-17 Thread Mike Jumper
On Sat, Nov 17, 2018 at 12:59 PM Roman Shaposhnik 
wrote:

> Hi!
>
> happy to report that I got to the bottom of this and have a patch that
> makes guacd run on Alpine 3.8 just fine now:
>https://issues.apache.org/jira/browse/GUACAMOLE-663
>
>
Thanks, Roman. Please open a pull request with your proposed changes rather
than attaching a patch to JIRA. We can then review your changes and merge
when everything is accepted. See:

https://github.com/apache/guacamole-server/blob/master/CONTRIBUTING
http://guacamole.apache.org/open-source/#contribute

Would be awesome if something along these lines made it into 1.0
> release. I'd love to help with testing or anything else.
>

The scope of the 1.0.0 release has already been finalized. Only changes
directly related to those already within release scope will be merged for
inclusion in 1.0.0. The changes you've contributed, after review and when
accepted, would go into the next release whose scope has not yet been
finalized. At the moment, that release would be 2.0.0.

- Mike


Re: Kubernetes vs. Docker Engine protocol

2018-11-17 Thread Mike Jumper
On Sat, Nov 17, 2018 at 2:59 PM Roman Shaposhnik  wrote:

> Hi!
>
> I was very pleasantly surprised to discover that Kubernetes
> container TTY support is now part of Guacamole. The JIRA,
> however, talks about both Docker Engine and Kubernetes.
> Looking at the source code I'm not sure I see the code that
> would talk to Docker Engine. Am I missing something?
>
>
What JIRA issue are you referring to? The one I have in front of me is
Kubernetes-specific:

https://issues.apache.org/jira/browse/GUACAMOLE-623

- Mike


Kubernetes vs. Docker Engine protocol

2018-11-17 Thread Roman Shaposhnik
Hi!

I was very pleasantly surprised to discover that Kubernetes
container TTY support is now part of Guacamole. The JIRA,
however, talks about both Docker Engine and Kubernetes.
Looking at the source code I'm not sure I see the code that
would talk to Docker Engine. Am I missing something?

Thanks,
Roman.


Re: guacd immediately disconnects when built and run on Alpine 3.7 (musl libc)

2018-11-17 Thread Roman Shaposhnik
Hi!

happy to report that I got to the bottom of this and have a patch that
makes guacd run on Alpine 3.8 just fine now:
   https://issues.apache.org/jira/browse/GUACAMOLE-663

Would be awesome if something along these lines made it into 1.0
release. I'd love to help with testing or anything else.

Thanks,
Roman.
On Sat, Nov 17, 2018 at 12:41 AM Roman Shaposhnik  wrote:
>
> Hi Mike!
>
> what's happening is kind of crazy -- and I'd really appreciate more of
> your advice getting
> to the bottom of this. Here's what I did:
>
> $ gdb /usr/sbin/guacd
> (gdb) set follow-fork-mode child
> (gdb) attach 1
> (gdb) cont
> Continuing.
> [New LWP 29]
> [New process 30]
> [New LWP 33]
> [New LWP 34]
> [New LWP 35]
> [New LWP 36]
>
> Thread 2.4 "guacd" received signal SIGSEGV, Segmentation fault.
> [Switching to LWP 35]
> guac_vnc_clipboard_end_handler (user=,
> stream=) at clipboard.c:109
> 109 char* output = output_data;
> (gdb)
>
> So you were absolutely right -- it did SIGSEGV and I guess we need to
> the bottom of this.
>
> However, the crazy part is this: the sub-process that SIGSEGVed is now
> stopped by gdb, however
> (since I accidentally clicked on reconnect in the GUI) the new
> sub-process that got forked is
> complete fine. In fact, for as long as I keep the SIGSEGVed one
> stopped I can start new sessions,
> interact with my VNC and everything looks just peachy. I can even
> fully disconnect/reconnect
> (making sure that new sub-processes get forked) and all that is totally fine.
>
> Any ideas on what could cause this weird behaviour (and also what
> could be a potential cause
> for the  SIGSEGV above)?
>
> Thanks,
> Roman.
> On Fri, Nov 16, 2018 at 9:30 PM Roman Shaposhnik  wrote:
> >
> > On Fri, Nov 16, 2018 at 12:31 AM Mike Jumper  wrote:
> > >
> > > On Wed, Nov 14, 2018 at 10:52 PM Roman Shaposhnik  wrote:
> > >
> > > > Hi!
> > > >
> > > > first of all -- just wanted to say that Guacamole is one
> > > > impressive project -- very well done.
> > >
> > >
> > > Thanks!
> > >
> > > ...
> > > > guacd[9]: INFO: User "@6c100210-b28a-46ae-9db7-00b30782b5c2" joined
> > > > connection "$b8a08e42-bb09-4d10-8631-9143ea018a5c" (1 users now
> > > > present)
> > > > guacd[9]: TRACE: Server completed frame 119195788ms.
> > > > guacd[1]: INFO: Connection "$b8a08e42-bb09-4d10-8631-9143ea018a5c" 
> > > > removed.
> > > >
> > >
> > > If the connection terminated normally, there would be additional log
> > > messages before that "Connection removed" message mentioning that the user
> > > is disconnected, the VNC connection is closed, etc. Those messages would 
> > > be
> > > logged by the process handling the VNC connection (in this case PID 9). 
> > > The
> > > fact that those messages do not appear suggests that the process handling
> > > the VNC connection may have crashed.
> >
> > That's very helpful! Thanks!
> >
> > > Are you able to run a debugger under Alpine?
> >
> > Yes. So let me attach gdb to guacd and see if any of the forked off
> > processes core dump
> > or exit abnormally. Will let you know tomorrow.
> >
> > Thanks,
> > Roman.


Re: guacd immediately disconnects when built and run on Alpine 3.7 (musl libc)

2018-11-17 Thread Roman Shaposhnik
Hi Mike!

what's happening is kind of crazy -- and I'd really appreciate more of
your advice getting
to the bottom of this. Here's what I did:

$ gdb /usr/sbin/guacd
(gdb) set follow-fork-mode child
(gdb) attach 1
(gdb) cont
Continuing.
[New LWP 29]
[New process 30]
[New LWP 33]
[New LWP 34]
[New LWP 35]
[New LWP 36]

Thread 2.4 "guacd" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 35]
guac_vnc_clipboard_end_handler (user=,
stream=) at clipboard.c:109
109 char* output = output_data;
(gdb)

So you were absolutely right -- it did SIGSEGV and I guess we need to
the bottom of this.

However, the crazy part is this: the sub-process that SIGSEGVed is now
stopped by gdb, however
(since I accidentally clicked on reconnect in the GUI) the new
sub-process that got forked is
complete fine. In fact, for as long as I keep the SIGSEGVed one
stopped I can start new sessions,
interact with my VNC and everything looks just peachy. I can even
fully disconnect/reconnect
(making sure that new sub-processes get forked) and all that is totally fine.

Any ideas on what could cause this weird behaviour (and also what
could be a potential cause
for the  SIGSEGV above)?

Thanks,
Roman.
On Fri, Nov 16, 2018 at 9:30 PM Roman Shaposhnik  wrote:
>
> On Fri, Nov 16, 2018 at 12:31 AM Mike Jumper  wrote:
> >
> > On Wed, Nov 14, 2018 at 10:52 PM Roman Shaposhnik  wrote:
> >
> > > Hi!
> > >
> > > first of all -- just wanted to say that Guacamole is one
> > > impressive project -- very well done.
> >
> >
> > Thanks!
> >
> > ...
> > > guacd[9]: INFO: User "@6c100210-b28a-46ae-9db7-00b30782b5c2" joined
> > > connection "$b8a08e42-bb09-4d10-8631-9143ea018a5c" (1 users now
> > > present)
> > > guacd[9]: TRACE: Server completed frame 119195788ms.
> > > guacd[1]: INFO: Connection "$b8a08e42-bb09-4d10-8631-9143ea018a5c" 
> > > removed.
> > >
> >
> > If the connection terminated normally, there would be additional log
> > messages before that "Connection removed" message mentioning that the user
> > is disconnected, the VNC connection is closed, etc. Those messages would be
> > logged by the process handling the VNC connection (in this case PID 9). The
> > fact that those messages do not appear suggests that the process handling
> > the VNC connection may have crashed.
>
> That's very helpful! Thanks!
>
> > Are you able to run a debugger under Alpine?
>
> Yes. So let me attach gdb to guacd and see if any of the forked off
> processes core dump
> or exit abnormally. Will let you know tomorrow.
>
> Thanks,
> Roman.