All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Scott Murray" <scott.murray@konsulko.com>
To: Martin Jansa <martin.jansa@gmail.com>
Cc: bitbake-devel <bitbake-devel@lists.openembedded.org>,
	 Richard Purdie <richard.purdie@linuxfoundation.org>,
	 Joshua Watt <JPEWhacker@gmail.com>,
	Paul Barker <paul@pbarker.dev>
Subject: Re: [bitbake-devel] [PATCH v6 3/4] prserv: Replace XML RPC with modern asyncrpc implementation
Date: Thu, 26 Aug 2021 15:17:34 -0400 (EDT)	[thread overview]
Message-ID: <7ea3f614-246f-38fc-2bd5-c22a9b1093f0@spiteful.org> (raw)
In-Reply-To: <CA+chaQcuZp=-o8m96OnZ7KzRmFzUeuiQCS4b1zCKcuM4-SzbBw@mail.gmail.com>

On Thu, 26 Aug 2021, Martin Jansa wrote:

> On Thu, Aug 19, 2021 at 6:47 PM Scott Murray <scott.murray@konsulko.com>
> wrote:
>
> > From: Paul Barker <pbarker@konsulko.com>
> >
> > Update the prserv client and server classes to use the modern json and
> > asyncio based RPC system implemented by the asyncrpc module.
> >
> > Signed-off-by: Paul Barker <pbarker@konsulko.com>
> > [updated for asyncrpc changes, client split to separate file]
> > Signed-off-by: Scott Murray <scott.murray@konsulko.com>
> >
> > ....
>
> > -    def export(self,version=None, pkgarch=None, checksum=None,
> > colinfo=True):
> > -        return self.connection.export(version, pkgarch, checksum, colinfo)
> > +class PRServSingleton(object):
> > +    def __init__(self, dbfile, logfile, host, port):
> > +        self.dbfile = dbfile
> > +        self.logfile = logfile
> > +        self.host = host
> > +        self.port = port
> >
> > -    def importone(self, version, pkgarch, checksum, value):
> > -        return self.connection.importone(version, pkgarch, checksum,
> > value)
> > +    def start(self):
> > +        self.prserv = PRServer(self.dbfile)
> > +        self.prserv.start_tcp_server(self.host, self.port)
> > +        self.process = self.prserv.serve_as_process()
> >
> > -    def getinfo(self):
> > -        return self.host, self.port
> > +        if not self.port:
> > +            self.port = int(self.prserv.address.rsplit(':', 1)[1])
>
> Hi,
>
> I've tried this when running inside docker container and it failed with a
> bit ugly exception:
>
> bitbake@599696cd20aa:~/nodistro/honister$ bitbake -k pkgconfig-native
> Traceback (most recent call last):
>   File "/OE/nodistro/honister/bitbake/bin/bitbake", line 35, in <module>
>     sys.exit(bitbake_main(BitBakeConfigParameters(sys.argv),
>   File "/OE/nodistro/honister/bitbake/lib/bb/main.py", line 385, in
> bitbake_main
>     return ui_module.main(server_connection.connection,
> server_connection.events,
>   File "/OE/nodistro/honister/bitbake/lib/bb/ui/knotty.py", line 397, in
> main
>     params.updateToServer(server, os.environ.copy())
>   File "/OE/nodistro/honister/bitbake/lib/bb/cookerdata.py", line 75, in
> updateToServer
>     raise Exception("Unable to update the server configuration with local
> parameters: %s" % error)
> Exception: Unable to update the server configuration with local parameters:
> Traceback (most recent call last):
>   File "/OE/nodistro/honister/bitbake/lib/bb/command.py", line 90, in
> runCommand
>     result = command_method(self, commandline)
>   File "/OE/nodistro/honister/bitbake/lib/bb/command.py", line 286, in
> updateConfig
>     command.cooker.updateConfigOpts(options, environment, cmdline)
>   File "/OE/nodistro/honister/bitbake/lib/bb/cooker.py", line 491, in
> updateConfigOpts
>     self.reset()
>   File "/OE/nodistro/honister/bitbake/lib/bb/cooker.py", line 1717, in reset
>     self.handlePRServ()
>   File "/OE/nodistro/honister/bitbake/lib/bb/cooker.py", line 383, in
> handlePRServ
>     self.prhost = prserv.serv.auto_start(self.data)
>   File "/OE/nodistro/honister/bitbake/lib/prserv/serv.py", line 318, in
> auto_start
>     singleton.start()
>   File "/OE/nodistro/honister/bitbake/lib/prserv/serv.py", line 133, in
> start
>     self.port = int(self.prserv.address.rsplit(':', 1)[1])
> AttributeError: 'NoneType' object has no attribute 'rsplit'
>
> after removing the rsplit it shows better error message:
>
> bitbake@599696cd20aa:~/nodistro/honister$ bitbake -k pkgconfig-native
> WARNING: Error talking to server: Multiple exceptions: [Errno 111] Connect
> call failed ('127.0.0.1', 0), [Errno 99] Cannot assign requested address
> WARNING: Error talking to server: Multiple exceptions: [Errno 111] Connect
> call failed ('127.0.0.1', 0), [Errno 99] Cannot assign requested address
> WARNING: Error talking to server: Multiple exceptions: [Errno 111] Connect
> call failed ('127.0.0.1', 0), [Errno 99] Cannot assign requested address
> WARNING: Error talking to server: Multiple exceptions: [Errno 111] Connect
> call failed ('127.0.0.1', 0), [Errno 99] Cannot assign requested address
> ERROR: PRservice localhost:0 not available
> ERROR: Unable to start PR Server, exitting
>
> It would be nice to improve the error handling a bit.

Could you elaborate a bit on your configuration?  Is it just trying to
build plain oe-core / poky in Docker?  I don't really see right off from
the code in bitbake's lib/bb/asyncrpc/serv.py how the port from the
asyncio server instance could end up unset.

Thanks,

Scott


  reply	other threads:[~2021-08-26 19:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19 16:46 [PATCH v6 0/4] Re-implement prserv on top of asyncrpc Scott Murray
2021-08-19 16:46 ` [PATCH v6 1/4] bitbake: asyncrpc: Defer all asyncio to child process Scott Murray
2021-08-19 16:46 ` [PATCH v6 2/4] bitbake: asyncrpc: always create new asyncio loops Scott Murray
2021-08-19 19:58   ` Joshua Watt
2021-08-19 16:46 ` [PATCH v6 3/4] prserv: Replace XML RPC with modern asyncrpc implementation Scott Murray
2021-08-26 16:02   ` [bitbake-devel] " Martin Jansa
2021-08-26 19:17     ` Scott Murray [this message]
2021-08-19 16:46 ` [PATCH v6 4/4] prserv: Add read-only mode Scott Murray

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7ea3f614-246f-38fc-2bd5-c22a9b1093f0@spiteful.org \
    --to=scott.murray@konsulko.com \
    --cc=JPEWhacker@gmail.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=martin.jansa@gmail.com \
    --cc=paul@pbarker.dev \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.