You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@whimsical.apache.org by sebb <se...@gmail.com> on 2018/05/08 08:57:58 UTC

Re: [whimsy] branch master updated: specify the full path to the repository

On 8 May 2018 at 01:39,  <ru...@apache.org> wrote:
> This is an automated email from the ASF dual-hosted git repository.
>
> rubys pushed a commit to branch master
> in repository https://gitbox.apache.org/repos/asf/whimsy.git
>
>
> The following commit(s) were added to refs/heads/master by this push:
>      new 80a8e74  specify the full path to the repository
> 80a8e74 is described below
>
> commit 80a8e74084a9b216d188e543afe907f87667cd5b
> Author: Sam Ruby <ru...@intertwingly.net>
> AuthorDate: Mon May 7 20:36:58 2018 -0400
>
>     specify the full path to the repository
> ---
>  www/board/agenda/daemon/channel.rb | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/www/board/agenda/daemon/channel.rb b/www/board/agenda/daemon/channel.rb
> index 8441897..49d567b 100644
> --- a/www/board/agenda/daemon/channel.rb
> +++ b/www/board/agenda/daemon/channel.rb
> @@ -16,7 +16,9 @@ class Channel
>    @@sockets = Concurrent::Map.new
>    @@users = Concurrent::Map.new {|map,key| map[key]=[]}
>
> -  FOUNDATION_BOARD = ASF::SVN['foundation_board']
> +  # As this tool doesn't load the full whimsy libraries, it can't make use
> +  # of niceties like short names... so specify the full path to repository.
> +  FOUNDATION_BOARD = ASF::SVN['private/foundation/board']

Huh?

I temporarily added the following to channel.rb:

if __FILE__ == $0 # local testing
  puts ASF::SVN['foundation_board']
end

The following works fine:
$ ruby -I /srv/whimsy/lib www/board/agenda/daemon/channel.rb

AFAICT the shortcut processing needs whimsy/as/config which is
required by session anyway.

Are you sure the shortcut causes a failure?
If so, I think a different solution is in order.

>    # add a new socket/userid pair
>    def self.add(ws, id)
>
> --
> To stop receiving notification emails like this one, please contact
> rubys@apache.org.

Re: [whimsy] branch master updated: specify the full path to the repository

Posted by sebb <se...@gmail.com>.
On 8 May 2018 at 11:47, Sam Ruby <ru...@intertwingly.net> wrote:
> On Tue, May 8, 2018 at 6:22 AM, sebb <se...@gmail.com> wrote:
>> On 8 May 2018 at 11:09, Sam Ruby <ru...@intertwingly.net> wrote:
>>> On Tue, May 8, 2018 at 6:03 AM, sebb <se...@gmail.com> wrote:
>>>> On 8 May 2018 at 10:55, Sam Ruby <ru...@intertwingly.net> wrote:
>>>>> On Tue, May 8, 2018 at 5:45 AM, sebb <se...@gmail.com> wrote:
>>>>>> On 8 May 2018 at 10:39, Sam Ruby <ru...@intertwingly.net> wrote:
>>>>>>> On Tue, May 8, 2018 at 4:57 AM, sebb <se...@gmail.com> wrote:
>>>>>>>>
>>>>>>>> Are you sure the shortcut causes a failure?
>>>>>>>
>>>>>>> Following is from the syslog:
>>>>>>>
>>>>>>> whimsy-asf-0.0.77/lib/whimsy/asf/svn.rb:60:in `find!': Unable to find
>>>>>>> svn checkout for https://svn.apache.org/repos/foundation_board
>>>>>>> (Exception)
>>>>>>
>>>>>> That line number (60) does not agree with the current code.
>>>>>
>>>>> Good catch!
>>>>>
>>>>>> Maybe the installed version of the library is out of date?
>>>>>
>>>>> It certainly is: https://rubygems.org/gems/whimsy-asf/versions/0.0.77,
>>>>> but that shouldn't be used:
>>>>>
>>>>> https://github.com/apache/whimsy/blob/master/www/board/agenda/Gemfile#L3
>>>>>
>>>>> I could certainly build and push out a new version of whimsy-asf, but
>>>>> that would only be a temporary solution.
>>>>
>>>> I think we need to remove the Gem from the system entirely.
>>>
>>> Then it would fail a different way :-)
>>
>> That would also need to be fixed.
>
> I may not have been clear: fixing the underlying problem (the
> dependency not being picked up from the path specified) is needed
> either way.
>
>>>> I assume most code is not using the Gem otherwise we would have seen
>>>> more issues.
>>>> So it might be feasible to remove it (or at least rename it) and see
>>>> what breaks.
>>>>
>>>> However if there is a way to tell the service to pick up the library
>>>> from the source, that should be added first.
>>>
>>> The way to do that is:
>>>
>>>   gem 'whimsy-asf', asf_version, path: File.expand_path(root, __FILE__)
>>>
>>> The question is: why isn't the version_file being found (in the if
>>> statement a few lines before this code) when run as a service?  This
>>> file is found when run from the command line.
>>
>> I don't know.
>>
>> Does the library have to be a Gem?
>
> A gem is just a library with a well know directory layout.  The right
> question isn't whether or not it has to be a gem, but where should the
> gem be found?
>
> We are using bundler for dependencies.  Specifying the path on the
> 'gem' statement should (and generally does, except in this case for
> unknown reasons) work:
>
> http://bundler.io/v1.2/man/gemfile.5.html#PATH-path-
>
>> Is it not possible to define the RUBY path appropriately so code picks
>> up the source correctly?
>
> Bundler overrides rubypath.

I tried the following:

SetEnv RUBYLIB /srv/whimsy/lib

This worked OK to find the Whimsy library code even though I had
deleted the gem.

I deleted some other stuff so the apps don't get very far.
The Passenger error output includes the following:

RUBYLIB = /usr/local/Cellar/ruby/2.5.0/lib/ruby/2.5.0:/srv/whimsy/lib
...
BUNDLER_ORIG_RUBYLIB = /srv/whimsy/lib

This looks to me as though it should be possible to use RUBYLIB as
well as bundler.

I think it's important not to end up with a stale whimsy Gem again,
and one such way might be to never define whimsy as a Gem.

>> IMO we should only use Gems for external bundled code.
>
> The issue is the bundler overrides rubypath.
>
> If you go to whimsy/board/agenda, and type 'bundle update' you should
> see a line like:
>
> Using whimsy-asf 0.0.77 from source at `/Users/rubys/git/whimsy`
>
> If you look in Gemfile.lock in that directory, you should see something like:
>
> PATH
>   remote: /Users/rubys/git/whimsy
>   specs:
>     whimsy-asf (0.0.77)
>
> We clearly are picking up the code from the wrong place.  The question
> that remains is: why?
>
> - Sam Ruby

Re: [whimsy] branch master updated: specify the full path to the repository

Posted by Sam Ruby <ru...@intertwingly.net>.
On Tue, May 8, 2018 at 6:22 AM, sebb <se...@gmail.com> wrote:
> On 8 May 2018 at 11:09, Sam Ruby <ru...@intertwingly.net> wrote:
>> On Tue, May 8, 2018 at 6:03 AM, sebb <se...@gmail.com> wrote:
>>> On 8 May 2018 at 10:55, Sam Ruby <ru...@intertwingly.net> wrote:
>>>> On Tue, May 8, 2018 at 5:45 AM, sebb <se...@gmail.com> wrote:
>>>>> On 8 May 2018 at 10:39, Sam Ruby <ru...@intertwingly.net> wrote:
>>>>>> On Tue, May 8, 2018 at 4:57 AM, sebb <se...@gmail.com> wrote:
>>>>>>>
>>>>>>> Are you sure the shortcut causes a failure?
>>>>>>
>>>>>> Following is from the syslog:
>>>>>>
>>>>>> whimsy-asf-0.0.77/lib/whimsy/asf/svn.rb:60:in `find!': Unable to find
>>>>>> svn checkout for https://svn.apache.org/repos/foundation_board
>>>>>> (Exception)
>>>>>
>>>>> That line number (60) does not agree with the current code.
>>>>
>>>> Good catch!
>>>>
>>>>> Maybe the installed version of the library is out of date?
>>>>
>>>> It certainly is: https://rubygems.org/gems/whimsy-asf/versions/0.0.77,
>>>> but that shouldn't be used:
>>>>
>>>> https://github.com/apache/whimsy/blob/master/www/board/agenda/Gemfile#L3
>>>>
>>>> I could certainly build and push out a new version of whimsy-asf, but
>>>> that would only be a temporary solution.
>>>
>>> I think we need to remove the Gem from the system entirely.
>>
>> Then it would fail a different way :-)
>
> That would also need to be fixed.

I may not have been clear: fixing the underlying problem (the
dependency not being picked up from the path specified) is needed
either way.

>>> I assume most code is not using the Gem otherwise we would have seen
>>> more issues.
>>> So it might be feasible to remove it (or at least rename it) and see
>>> what breaks.
>>>
>>> However if there is a way to tell the service to pick up the library
>>> from the source, that should be added first.
>>
>> The way to do that is:
>>
>>   gem 'whimsy-asf', asf_version, path: File.expand_path(root, __FILE__)
>>
>> The question is: why isn't the version_file being found (in the if
>> statement a few lines before this code) when run as a service?  This
>> file is found when run from the command line.
>
> I don't know.
>
> Does the library have to be a Gem?

A gem is just a library with a well know directory layout.  The right
question isn't whether or not it has to be a gem, but where should the
gem be found?

We are using bundler for dependencies.  Specifying the path on the
'gem' statement should (and generally does, except in this case for
unknown reasons) work:

http://bundler.io/v1.2/man/gemfile.5.html#PATH-path-

> Is it not possible to define the RUBY path appropriately so code picks
> up the source correctly?

Bundler overrides rubypath.

> IMO we should only use Gems for external bundled code.

The issue is the bundler overrides rubypath.

If you go to whimsy/board/agenda, and type 'bundle update' you should
see a line like:

Using whimsy-asf 0.0.77 from source at `/Users/rubys/git/whimsy`

If you look in Gemfile.lock in that directory, you should see something like:

PATH
  remote: /Users/rubys/git/whimsy
  specs:
    whimsy-asf (0.0.77)

We clearly are picking up the code from the wrong place.  The question
that remains is: why?

- Sam Ruby

Re: [whimsy] branch master updated: specify the full path to the repository

Posted by sebb <se...@gmail.com>.
On 8 May 2018 at 11:09, Sam Ruby <ru...@intertwingly.net> wrote:
> On Tue, May 8, 2018 at 6:03 AM, sebb <se...@gmail.com> wrote:
>> On 8 May 2018 at 10:55, Sam Ruby <ru...@intertwingly.net> wrote:
>>> On Tue, May 8, 2018 at 5:45 AM, sebb <se...@gmail.com> wrote:
>>>> On 8 May 2018 at 10:39, Sam Ruby <ru...@intertwingly.net> wrote:
>>>>> On Tue, May 8, 2018 at 4:57 AM, sebb <se...@gmail.com> wrote:
>>>>>>
>>>>>> Are you sure the shortcut causes a failure?
>>>>>
>>>>> Following is from the syslog:
>>>>>
>>>>> whimsy-asf-0.0.77/lib/whimsy/asf/svn.rb:60:in `find!': Unable to find
>>>>> svn checkout for https://svn.apache.org/repos/foundation_board
>>>>> (Exception)
>>>>
>>>> That line number (60) does not agree with the current code.
>>>
>>> Good catch!
>>>
>>>> Maybe the installed version of the library is out of date?
>>>
>>> It certainly is: https://rubygems.org/gems/whimsy-asf/versions/0.0.77,
>>> but that shouldn't be used:
>>>
>>> https://github.com/apache/whimsy/blob/master/www/board/agenda/Gemfile#L3
>>>
>>> I could certainly build and push out a new version of whimsy-asf, but
>>> that would only be a temporary solution.
>>
>> I think we need to remove the Gem from the system entirely.
>
> Then it would fail a different way :-)

That would also need to be fixed.

>> I assume most code is not using the Gem otherwise we would have seen
>> more issues.
>> So it might be feasible to remove it (or at least rename it) and see
>> what breaks.
>>
>> However if there is a way to tell the service to pick up the library
>> from the source, that should be added first.
>
> The way to do that is:
>
>   gem 'whimsy-asf', asf_version, path: File.expand_path(root, __FILE__)
>
> The question is: why isn't the version_file being found (in the if
> statement a few lines before this code) when run as a service?  This
> file is found when run from the command line.

I don't know.

Does the library have to be a Gem?

Is it not possible to define the RUBY path appropriately so code picks
up the source correctly?

IMO we should only use Gems for external bundled code.

> - Sam Ruby

Re: [whimsy] branch master updated: specify the full path to the repository

Posted by Sam Ruby <ru...@intertwingly.net>.
On Tue, May 8, 2018 at 6:03 AM, sebb <se...@gmail.com> wrote:
> On 8 May 2018 at 10:55, Sam Ruby <ru...@intertwingly.net> wrote:
>> On Tue, May 8, 2018 at 5:45 AM, sebb <se...@gmail.com> wrote:
>>> On 8 May 2018 at 10:39, Sam Ruby <ru...@intertwingly.net> wrote:
>>>> On Tue, May 8, 2018 at 4:57 AM, sebb <se...@gmail.com> wrote:
>>>>>
>>>>> Are you sure the shortcut causes a failure?
>>>>
>>>> Following is from the syslog:
>>>>
>>>> whimsy-asf-0.0.77/lib/whimsy/asf/svn.rb:60:in `find!': Unable to find
>>>> svn checkout for https://svn.apache.org/repos/foundation_board
>>>> (Exception)
>>>
>>> That line number (60) does not agree with the current code.
>>
>> Good catch!
>>
>>> Maybe the installed version of the library is out of date?
>>
>> It certainly is: https://rubygems.org/gems/whimsy-asf/versions/0.0.77,
>> but that shouldn't be used:
>>
>> https://github.com/apache/whimsy/blob/master/www/board/agenda/Gemfile#L3
>>
>> I could certainly build and push out a new version of whimsy-asf, but
>> that would only be a temporary solution.
>
> I think we need to remove the Gem from the system entirely.

Then it would fail a different way :-)

> I assume most code is not using the Gem otherwise we would have seen
> more issues.
> So it might be feasible to remove it (or at least rename it) and see
> what breaks.
>
> However if there is a way to tell the service to pick up the library
> from the source, that should be added first.

The way to do that is:

  gem 'whimsy-asf', asf_version, path: File.expand_path(root, __FILE__)

The question is: why isn't the version_file being found (in the if
statement a few lines before this code) when run as a service?  This
file is found when run from the command line.

- Sam Ruby

Re: [whimsy] branch master updated: specify the full path to the repository

Posted by sebb <se...@gmail.com>.
On 8 May 2018 at 10:55, Sam Ruby <ru...@intertwingly.net> wrote:
> On Tue, May 8, 2018 at 5:45 AM, sebb <se...@gmail.com> wrote:
>> On 8 May 2018 at 10:39, Sam Ruby <ru...@intertwingly.net> wrote:
>>> On Tue, May 8, 2018 at 4:57 AM, sebb <se...@gmail.com> wrote:
>>>>
>>>> Are you sure the shortcut causes a failure?
>>>
>>> Following is from the syslog:
>>>
>>> whimsy-asf-0.0.77/lib/whimsy/asf/svn.rb:60:in `find!': Unable to find
>>> svn checkout for https://svn.apache.org/repos/foundation_board
>>> (Exception)
>>
>> That line number (60) does not agree with the current code.
>
> Good catch!
>
>> Maybe the installed version of the library is out of date?
>
> It certainly is: https://rubygems.org/gems/whimsy-asf/versions/0.0.77,
> but that shouldn't be used:
>
> https://github.com/apache/whimsy/blob/master/www/board/agenda/Gemfile#L3
>
> I could certainly build and push out a new version of whimsy-asf, but
> that would only be a temporary solution.

I think we need to remove the Gem from the system entirely.

I assume most code is not using the Gem otherwise we would have seen
more issues.
So it might be feasible to remove it (or at least rename it) and see
what breaks.

However if there is a way to tell the service to pick up the library
from the source, that should be added first.

> - Sam Ruby

Re: [whimsy] branch master updated: specify the full path to the repository

Posted by Sam Ruby <ru...@intertwingly.net>.
On Tue, May 8, 2018 at 5:45 AM, sebb <se...@gmail.com> wrote:
> On 8 May 2018 at 10:39, Sam Ruby <ru...@intertwingly.net> wrote:
>> On Tue, May 8, 2018 at 4:57 AM, sebb <se...@gmail.com> wrote:
>>>
>>> Are you sure the shortcut causes a failure?
>>
>> Following is from the syslog:
>>
>> whimsy-asf-0.0.77/lib/whimsy/asf/svn.rb:60:in `find!': Unable to find
>> svn checkout for https://svn.apache.org/repos/foundation_board
>> (Exception)
>
> That line number (60) does not agree with the current code.

Good catch!

> Maybe the installed version of the library is out of date?

It certainly is: https://rubygems.org/gems/whimsy-asf/versions/0.0.77,
but that shouldn't be used:

https://github.com/apache/whimsy/blob/master/www/board/agenda/Gemfile#L3

I could certainly build and push out a new version of whimsy-asf, but
that would only be a temporary solution.

- Sam Ruby

Re: [whimsy] branch master updated: specify the full path to the repository

Posted by sebb <se...@gmail.com>.
On 8 May 2018 at 10:39, Sam Ruby <ru...@intertwingly.net> wrote:
> On Tue, May 8, 2018 at 4:57 AM, sebb <se...@gmail.com> wrote:
>> On 8 May 2018 at 01:39,  <ru...@apache.org> wrote:
>>> This is an automated email from the ASF dual-hosted git repository.
>>>
>>> rubys pushed a commit to branch master
>>> in repository https://gitbox.apache.org/repos/asf/whimsy.git
>>>
>>>
>>> The following commit(s) were added to refs/heads/master by this push:
>>>      new 80a8e74  specify the full path to the repository
>>> 80a8e74 is described below
>>>
>>> commit 80a8e74084a9b216d188e543afe907f87667cd5b
>>> Author: Sam Ruby <ru...@intertwingly.net>
>>> AuthorDate: Mon May 7 20:36:58 2018 -0400
>>>
>>>     specify the full path to the repository
>>> ---
>>>  www/board/agenda/daemon/channel.rb | 4 +++-
>>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/www/board/agenda/daemon/channel.rb b/www/board/agenda/daemon/channel.rb
>>> index 8441897..49d567b 100644
>>> --- a/www/board/agenda/daemon/channel.rb
>>> +++ b/www/board/agenda/daemon/channel.rb
>>> @@ -16,7 +16,9 @@ class Channel
>>>    @@sockets = Concurrent::Map.new
>>>    @@users = Concurrent::Map.new {|map,key| map[key]=[]}
>>>
>>> -  FOUNDATION_BOARD = ASF::SVN['foundation_board']
>>> +  # As this tool doesn't load the full whimsy libraries, it can't make use
>>> +  # of niceties like short names... so specify the full path to repository.
>>> +  FOUNDATION_BOARD = ASF::SVN['private/foundation/board']
>>
>> Huh?
>>
>> I temporarily added the following to channel.rb:
>>
>> if __FILE__ == $0 # local testing
>>   puts ASF::SVN['foundation_board']
>> end
>>
>> The following works fine:
>> $ ruby -I /srv/whimsy/lib www/board/agenda/daemon/channel.rb
>
> Ack.  I tried similar things.  Something is different between the
> environment running from the command line and the environment when run
> as a service:
>
> https://github.com/apache/infrastructure-puppet/blob/deployment/modules/whimsy_server/files/board-agenda-websocket.service
>
>> AFAICT the shortcut processing needs whimsy/as/config which is
>> required by session anyway.
>>
>> Are you sure the shortcut causes a failure?
>
> Following is from the syslog:
>
> whimsy-asf-0.0.77/lib/whimsy/asf/svn.rb:60:in `find!': Unable to find
> svn checkout for https://svn.apache.org/repos/foundation_board
> (Exception)

That line number (60) does not agree with the current code.

Maybe the installed version of the library is out of date?

> When the daemon is running, if you go to
> https://whimsy.apache.org/board/agenda, you should see a HTTP status
> of 101 returned from the request
> wss://whimsy.apache.org/board/agenda/websocket/ using the development
> tools from the browser.  If this fails, the daemon is down.
>
> After this change, the daemon started right up.
>
>> If so, I think a different solution is in order.
>>
>>>    # add a new socket/userid pair
>>>    def self.add(ws, id)
>>>
>>> --
>>> To stop receiving notification emails like this one, please contact
>>> rubys@apache.org.
>
> - Sam Ruby

Re: [whimsy] branch master updated: specify the full path to the repository

Posted by Sam Ruby <ru...@intertwingly.net>.
On Tue, May 8, 2018 at 4:57 AM, sebb <se...@gmail.com> wrote:
> On 8 May 2018 at 01:39,  <ru...@apache.org> wrote:
>> This is an automated email from the ASF dual-hosted git repository.
>>
>> rubys pushed a commit to branch master
>> in repository https://gitbox.apache.org/repos/asf/whimsy.git
>>
>>
>> The following commit(s) were added to refs/heads/master by this push:
>>      new 80a8e74  specify the full path to the repository
>> 80a8e74 is described below
>>
>> commit 80a8e74084a9b216d188e543afe907f87667cd5b
>> Author: Sam Ruby <ru...@intertwingly.net>
>> AuthorDate: Mon May 7 20:36:58 2018 -0400
>>
>>     specify the full path to the repository
>> ---
>>  www/board/agenda/daemon/channel.rb | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/www/board/agenda/daemon/channel.rb b/www/board/agenda/daemon/channel.rb
>> index 8441897..49d567b 100644
>> --- a/www/board/agenda/daemon/channel.rb
>> +++ b/www/board/agenda/daemon/channel.rb
>> @@ -16,7 +16,9 @@ class Channel
>>    @@sockets = Concurrent::Map.new
>>    @@users = Concurrent::Map.new {|map,key| map[key]=[]}
>>
>> -  FOUNDATION_BOARD = ASF::SVN['foundation_board']
>> +  # As this tool doesn't load the full whimsy libraries, it can't make use
>> +  # of niceties like short names... so specify the full path to repository.
>> +  FOUNDATION_BOARD = ASF::SVN['private/foundation/board']
>
> Huh?
>
> I temporarily added the following to channel.rb:
>
> if __FILE__ == $0 # local testing
>   puts ASF::SVN['foundation_board']
> end
>
> The following works fine:
> $ ruby -I /srv/whimsy/lib www/board/agenda/daemon/channel.rb

Ack.  I tried similar things.  Something is different between the
environment running from the command line and the environment when run
as a service:

https://github.com/apache/infrastructure-puppet/blob/deployment/modules/whimsy_server/files/board-agenda-websocket.service

> AFAICT the shortcut processing needs whimsy/as/config which is
> required by session anyway.
>
> Are you sure the shortcut causes a failure?

Following is from the syslog:

whimsy-asf-0.0.77/lib/whimsy/asf/svn.rb:60:in `find!': Unable to find
svn checkout for https://svn.apache.org/repos/foundation_board
(Exception)

When the daemon is running, if you go to
https://whimsy.apache.org/board/agenda, you should see a HTTP status
of 101 returned from the request
wss://whimsy.apache.org/board/agenda/websocket/ using the development
tools from the browser.  If this fails, the daemon is down.

After this change, the daemon started right up.

> If so, I think a different solution is in order.
>
>>    # add a new socket/userid pair
>>    def self.add(ws, id)
>>
>> --
>> To stop receiving notification emails like this one, please contact
>> rubys@apache.org.

- Sam Ruby