Request for comments: C++ embedded webserver

Tanous, Ed ed.tanous at intel.com
Fri Dec 22 05:47:27 AEDT 2017


Can you post your prototype server somewhere that's accessible externally?   I'm genuinely curious how it compares.

I had looked at golang, but there was no precedence for it in the project, nor did I have any experience with it, so I went another direction.  I would love if a language change made all the async handling easier to write than what's there.  My gut tells me to be concerned about the performance of the go garbage collection model on the AST using too much memory for some of the lesser capable systems to handle, but I have zero data on it so I'll withhold judgement until I have some.

-Ed

> -----Original Message-----
> From: Michael.E.Brown at dell.com [mailto:Michael.E.Brown at dell.com]
> Sent: Thursday, December 21, 2017 9:25 AM
> To: benh at kernel.crashing.org; Tanous, Ed <ed.tanous at intel.com>;
> openbmc at lists.ozlabs.org
> Subject: RE: Request for comments: C++ embedded webserver
> 
> Benjamin,
> 
> I'm new around here, so I didn't want to be the first to bring this up without
> doing my research on any older threads, so thank you for bringing this up.
> 
> My strong opinion is that golang is likely the best candidate for this specific
> type of programming environment (ie. OpenBMC).
> 	- Low runtime memory usage
> 	- Automatic Memory Management
> 	- Clean cross compile for ARMv5 and above
> 	- Compiled
> 	- strongly typed
> 	- Fast
> 	- Cleanly handles threading/async
> 	- Nice standard library
> 
> I had prototyped a redfish server in golang enough to get to the point where
> I believe that it's the best solution. I have great things to say internally about
> the existing openbmc design: I love the use of DBUS, the more I look at it the
> more clearly the advantages seem to me. The nice thing about this is that
> golang has a DBUS library and we ought to be able to write different
> components in different languages freely, especially if we have the
> underlying dbus apis correct.
> 
> --
> Michael
> 
> -----Original Message-----
> From: openbmc [mailto:openbmc-
> bounces+michael.e.brown=dell.com at lists.ozlabs.org] On Behalf Of
> Benjamin Herrenschmidt
> Sent: Wednesday, December 20, 2017 6:34 PM
> To: Tanous, Ed <ed.tanous at intel.com>; OpenBMC Maillist
> <openbmc at lists.ozlabs.org>
> Subject: Re: Request for comments: C++ embedded webserver
> 
> On Tue, 2017-12-19 at 04:07 +0000, Tanous, Ed wrote:
> > I’m looking for comments on a code review that’s been outstanding.
> > One of the large pushes we’ve made is to attempt to make the web
> > server more efficient, and add capabilities that comprehend long term
> > needs of OpenBmc.  One key that wasn’t made clear in the commit
> > message is that it includes the basic redfish implementation that (we
> > hope) should be extensible to the full redfish specification in the
> > short term future.
> 
> There are plenty of existing HTTP server implementations out there that are
> well maintained, any reason why we should invent another one here ?
> 
> Also, do we really think perpetuating the use of that monstruosity
> masquerading as a programming language that is C++ is a good idea ?
> 
> > https://gerrit.openbmc-project.xyz/#/c/7786/
> >
> > We would very much appreciate comments to see if we can move this
> forward.
> >
> > The following description is pulled from the readme.
> >
> > # OpenBMC webserver #
> >
> > This component attempts to be a "do everything" embedded webserver
> for openbmc.
> >
> > ## Capabilities ##
> > At this time, the webserver implements a few interfaces:
> > + Authentication middleware that supports cookie and token based
> authentication, as well as CSRF prevention backed by linux PAM
> authentication credentials.
> > + An (incomplete) attempt at replicating phosphor-dbus-rest interfaces in
> C++.  Right now, a few of the endpoint definitions work as expected, but
> there is still a lot of work to be done.  The portions of the interface that are
> functional are designed to work correctly for phosphor-webui, but may not
> yet be complete.
> > + Replication of the rest-dbus backend interfaces to allow bmc debug to
> logged in users.
> > + An initial attempt at a read-only redfish interface.  Currently the redfish
> interface targets ServiceRoot, SessionService, AccountService, Roles, and
> ManagersService.  Some functionality here has been shimmed to make
> development possible.  For example, there exists only a single user role.
> > + SSL key generation at runtime.  If an RSA key and cert pair are not
> available to the server at runtime, keys are generated using the openssl
> routines, and written to disk.
> > + Static file hosting.  Currently, static files are hosted from the fixed location
> at /usr/share/www.  This is intended to allow loose coupling with yocto
> projects, and allow overriding static files at build time.
> > + Dbus-monitor over websocket.  A generic endpoint that allows UIs to
> > + open a websocket and register for notification of events to avoid
> > + polling in single page applications.  (this interface may be
> > + modified in the future due to security concerns.)
> >
> >
> > Thanks,
> >
> > -Ed
> >


More information about the openbmc mailing list