Extending user interface of a web console

A method relates to launching, by a processing device executing a virtual machine deployment application, an asset server communicatively coupled to a data storage, launching a container comprising a file server that stores configuration data associated with a web console, wherein the web console provide a user interface to access the virtual machine deployment application, recording, in a configuration data structure residing in the data storage, a network address associated with the container, retrieving, by the asset server, the configuration data stored in the file server using the network address recorded in the configuration data structure, and providing the configuration data to a cache associated with the web console to modify the user interface.

TECHNICAL FIELD

This disclosure relates to user interface, and in particular, to extending the user interface of a web console associated with a platform such as, for example, a layered platform that provisions virtual machines and containers.

BACKGROUND

The cloud provider typically provides an interface that a customer can use to requisition virtual machines and associated resources such as processors, storage, and network services, etc., as well as an interface a customer can use to install and execute the customer's program on the virtual machines that the customer requisitions, together with additional software on which the customer's program depends. For some such programs, this additional software can include software components, such as a kernel and an operating system, and/or middleware and a framework. Customers that have installed and are executing their programs “in the cloud” typically communicate with the executing program from remote geographic locations using Internet protocols (IP).

DETAILED DESCRIPTION

Software developers may use a web interface associated with a layered platform (e.g., OpenShift®) running on a host machine to deploy virtual machines (including the lightweight containers) and composite applications to run on these virtual machines. The layered platform may include a client layer, a master layer, and a node layer. The client layer may be a software application that resides on a client machine, such as a workstation of a software developer, and provides an interface to a user of the client machine to interact with the master layer. The master layer may reside on a host machine (referred to as a master). The master layer may facilitate the creation and deployment on the cloud (via the node layer) of virtual machines and applications. The node layer may include nodes on which the applications are provisioned and executed. A node is a system (e.g., a virtual machine or a physical machine) that provides a run-time environment for multiple instances of a software application including containers. A container is an executable package that combines an application and its runtime environment (e.g., the libraries on which the application depends) so that the application may run as self-contained code (i.e., without depending on the underlying operating system to provide the runtime environment). Thus, a containerized application is lightweight and portable across different runtime environments. The master layer may act as the middleware between the client layer and the node layer.

In some implementations, the client machine may provide a web browser (e.g., Mozilla Firefox®) for the user of the client machine to interact with a web console running as a component of the master layer. The web console is a server software application that provides a user interface (e.g., in the form of web page) to the client machine. A developer can use the web console (via the web browser on the client machine) to visualize, browse, and manage the contents of different projects such as, provisioning containers and removing containers.

The web console is part of the master layer and is typically started with the initiation of the master layer by a processing device of the host machine. For example, the web console may run in conjunction with an application programming interface (API) server of the master layer. The layered platform, when executed, may serve the static assets required to run the web console. The static assets for the web console may include attributes that define the look and feel presented to the web browser of the client machine. In one implementation, an asset server associated with the API server may provide the static assets for the web console, whereas the asset server can reside in the master layer or the node layer. The attributes may be specified as part of the master configuration data stored in the master configuration file associated with the master layer. Some of the attributes may be provided as static, default values, and some of the attributes may be provided dynamically via stylesheets (e.g., Cascading Style Sheets (CSS)) and/or scripts (e.g., JavaScripts).

The stylesheets and scripts are defined as the static assets embedded in the executable code (referred to as the binary) of the layered platform via the master configuration data. In some situations, an administrator of the web console may want to modify and/augment the user interface (referred to as user interface extensions) to a user of the client layer in addition to those already defined in the static assets. The user interface extension can be new stylesheets or script functions associated with the user interface. To add the extensions, the administrator needs to create and store stylesheet and script extensions files in file folders and create references to these extensions in the master configuration file. The administrator may then need to rebuild the binary of the layered platform to enable the user to use these user interface extensions as part of the static assets of the layered platform. The technical problem solved by the implementations of the present disclosure is to add user interface extensions without rebuilding the binary of the layered platform

FIG. 1illustrates a layered platform100to provision virtual machines according to an implementation of the present disclosure. A user may use layered platform100(e.g., OpenShift) to deploy nodes (e.g., virtual or physical machines) and containers in a cloud, and deploy and execute software applications in these containers. As shown inFIG. 1, layered platform100may include a client layer102, a master layer104, and a node layer106. Client layer102, as discussed above, may be a software application that resides on a client machine and provide an interface (e.g., a web browser) to a user of the client machine to access the master layer104of the layered platform100. In one implementation, client layer106may include a browser108for accessing a web server (e.g., web console114of master layer104) that may serve web contents (e.g., web pages). Browser108may include components of a page loader110and a JavaScript engine112for loading contents of these web pages and for parsing and executing the content of these web pages. Browser108may be directed to web console114via a uniform resource locator (URL) address associated with web console114. In one implementation, page loader110may retrieve static assets including HyperText Markup Language (HTML) pages, and CSS stylesheets and JavaScript functions specified in the HTML pages. The parsers and execution engines for interpreting the syntax of these HTML pages, CSS stylesheets, and JavaScript functions are provided in the binary of the layered platform (e.g., OpenShift binary). The static assets such as, the HTML pages, CSS stylesheets, and JavaScript functions may be served by an asset server118of master layer104. The asset server118is a software application implemented in master layer104(or in the node layer106) to provide elements (e.g., script functions and stylesheets) of web console114to browser108.

In one implementation, browser108may include a JavaScript engine112that may be employed to interpret JavaScript functions embedded in web pages served by web console114. To this end, JavaScript engine112may first establish socket connections (e.g., WebSockets) with an API server120of master layer104to receive a list of resources (e.g., peripheral devices) associated with the client machine. The JavaScript functions embedded in the web pages may process events generated by these resources. JavaScript engine112may, in a first pass, parse the syntax of web pages and retrieve definition of functions including JavaScript functions employed in the web pages. JavaScript engine112may, in a second pass, monitor events generated at these resources. For example, JavaScript engine112may monitor events associated with an input device (e.g., a display element on the screen) on behalf of web console114. Responsive to detecting the occurrence of an event (e.g., selecting a display element by the mouse), JavaScript engine112may send a request to API server120for updating certain attributes that have been defined as associated with the event. The update can be as simple as a change of the display attributes of the web page.

Master layer104, residing on a host machine (not shown), may include a virtual machine deployment software application that has been compiled into binary code suitable for execution on a processing device (e.g., a central processing unit (CPU)) of the host machine. In one implementation, master layer104includes software components that coordinate requests from the client layer102with actions to be performed at the node layer106. The components in master layer104may include a web console114, an application programming interface (API) server120, and a persistent data store116. Web console114may include web server software applications that serve web pages representing a user interface to the client machine. In one implementation, as shown inFIG. 1, web console114may include an asset server118, and the data store116may include a hardware storage device to store master configuration data124including parameters associated with the master layer104. Master configuration data124is a data structure that may contain information such as, for example, API server version, asset server configuration data, network configuration data, data store configuration data, etc.

Asset server118of master layer104may provide master configuration data126to API server120. API server120is a software application running on the host machine. API server120may communicate with the JavaScript engine112of browser108via socket connections (e.g., WebSockets). API server120may also validate and configure data for nodes in node layer106, whereas a node can be a virtual machine or a physical machine on which containers are launched and applications in the containers are executed.

Data store116may store master configuration data124that may be accessed by asset server118on behalf of web console114. Additionally, data store116may store state information of the master layer104. For example, a user may enter a command to instruct a processing device to establish a node (e.g., creating a virtual machine) in the node layer, and to store a “build” object in data store116indicating the “build” state. A change to the state information in data store116may cause API server120to evoke a controller server (not shown) to make corresponding change in node layer106.

Node layer106may include one or more nodes130that can be physical machines or virtual machines running on physical machines. The physical machines may be separate from the host machine or be part of the host machine. In one implementation, containers138may be provisioned on nodes130. Containers138can provide a running environment for applications132.

In one implementation, a node130is implemented as a virtual machine including an operating system134that can facilitate the execution of applications132. In one implementation, nodes130, instead of running applications directly on virtual machines, provides applications132in a container138. Container138is an executable code that combines application132and its runtime environment (e.g., the libraries on which the application depends). Each container is launched from an image that holds necessary configuration data representing the runtime environment (e.g., libraries) to run the application. Thus, an image contains a static snapshot of the container's configuration. The image may be stored in a repository136associated with nodes130. Each container may be assigned with a respective portion of the memory as a runtime stack to store its image. Thus, containers running on a same node may run independently using their respective runtime stacks.

In one implementation, applications may be built using a platform image that is a base image for all containers. The platform image defines the runtime environment, packages and utilities necessary for a containerized application to run. Layered platform100may launch a container from the platform image. The platform image is read-only (or immutable). A containerized application may be built by adding application images on top of the platform image to create an application layer that contains software dependencies for the containerized application. The containerized applications contain individual runtime stacks, making the resultant containerized applications independent from the host operating system and thus portable across systems.

Each one of nodes130may also include a server orchestration system agent140to track and collect container information associated with the nodes130and to perform management actions on the nodes130. The server orchestration system agent140may operate to send requests, queries, and commands between nodes130and the master layer104. For example, a user may use the user interface provided by web console114to send requests to create a container, create an application, perform an action on a container, and manage/remove the container, etc. API server120may receive these requests and cause asset server118to pull from the necessary parameters from master configuration data124and a controller server (not shown) to execute on these requests based on these parameters.

In one implementation, a web console resource file may contain definitions of CSS stylesheets and JavaScript functions used by web console114. In one implementation, the web console resource file may be part of the master configuration data124. Functions to input the CSS stylesheets and JavaScript functions in the web console resource file are compiled into the binary code of the layered platform100as part of the user interface to browser108. Under certain situations, a user may want to extend the user interface with additional CSS stylesheets and JavaScript functions with respect to the CSS stylesheets and JavaScript functions already built in the static asset of the layered platform100. These additional stylesheets and script functions are referred to as extension configuration data. Implementations of the present disclosure allow the user to modify and/or expand the user interface without the need to rebuild the binary code of the layered platform100.

Implementations of the present disclosure may launch the web console114to provide a user interface to a client device associated with client layer102, and then launch an extension application in an image layer on a node on top of the platform image to extend the user interface. The extension application may then load the additional CSS stylesheets and JavaScript functions (referred to as extensions) from a file server in a container. In this way, the user interface provided by web console114may be extended without the need to rebuild the binary code of the layered platform100.

In one implementation, master configuration data124may be expanded to include an extension configuration section126that defines different methods to load the user interface extensions. In one implementation, asset server118may further include an extension engine122that may retrieve extension configuration data126and provide the extension configuration data (e.g., extended CSS stylesheets and extended JavaScript functions) to web console114.

FIG. 2shows a portion200of master configuration data associated with extensions according to an implementation of the present disclosure. In the master configuration data, attributes associated with various extensions may be identified by identifiers within the asset configuration section202(identified by “assetConfig”). The asset configuration section202may include subsections204,206,208,210to specify different communication modes for the extension engine122for retrieving extension configuration data. The extension configuration data can be expressively specified in master configuration data126, provided via a file folder specified in master configuration data126, and/or provided via a proxy that may be a remote server identified by a uniform resource locator (URL) address or a file server in a container running on a node.

In one implementation, extended CSS stylesheets and JavaScript functions may be stored in file folders accessible by extension engine122. The locations of these extension configuration data may be expressively set in master configuration data126(e.g., by editing the master configuration data by a user). As shown inFIG. 2, for example, a JavaScript extension identifier204(“extensionScripts”) may be used to identify a subsection of asset configuration section, where the extensionScripts subsection includes a list of JavaScript function locations (e.g., “/path/to/script1.js” and “/path/to/script2.js”). Similarly, a CSS stylesheet extension identifier206(“extensionCSS”) may be used to identify a subsection that includes a list of CSS stylesheet extension files (e.g., “/path/to/stylesheet1.css”). The locations of extension configuration data may be absolute from a root of a file system in data store116or relative with respective to a certain mounting point in the file system. In one implementation, responsive to starting the layered platform100, extension engine122may access the master configuration data126to retrieve configuration data including the extension configuration data files and provide web console114as a user interface including these new extensions. In another implementation, extension engine122may be implemented as a background process that checks the asset configuration data periodically to determine whether new extensions have been added to master configuration data126(e.g., as shown inFIG. 2). Responsive to detecting new extensions in master configuration data126, extension engine122may provide web console114as a user interface in accordance with these new extensions.

In one implementation, an extension file folder may contain extension configuration data items. Each extension configuration data item may contain extension configuration data associated with a respective attribute to be added to the user interface. For example, each extension configuration data item may be stored in one file in the extension file folder. Correspondingly, in master configuration data124, the assetConfig section may include a subsection identified by an extension file folder identifier208(e.g., “extensionFiles”). Within the subsection identified by “extensionFiles,” additional identifiers may be used to identify the paths to extension file folders and context associated with these folders. For example, as shown inFIG. 2, file folder at “/path/to/javascript//files/” may be identified by the subcontext identifier as “java” and associated with an html5Mode flag set to “true” indicating that HTML5 mode is enabled. File folder at “/path/to/stylesheets/files/” may be identified by the subcontext identifier “css” as folder for CSS stylesheet extensions. In one implementation, extension engine122may scan, according to a schedule (e.g., periodically), these file folders identified in master configuration data to detect new extension files added to these file folders. The extension files may be JavaScript functions or CSS stylesheets added by an administrator of the layered platform100. Extension engine122may monitor additions of new extension configuration data in the file folders. Responsive to detecting new extension configuration data having been added to these folders, extension engine122may provide web console114as a user interface in accordance with these new extensions.

In one implementation, the extension configuration data files may be provided via a proxy server to the extension engine122. In one implementation, the proxy server may be an HTTP server that may remotely serve JavaScript functions and CSS stylesheets to extension engine122. The URL of the HTTP server may be specified in a subsection of asset configuration. For example, as shown inFIG. 2, a proxy server identifier210(“extensionProxy”) may identify a subsection that includes the URLs to retrieve JavaScript functions and CSS stylesheets. A JavaScript function file (e.g., foo.js) may be retrieved from a JavaScript proxy server: https://www.jsproxyserver.com, and a CSS stylesheet (e.g., foo.css) may be retrieve from a CSS stylesheet proxy server: https://www.cssproxyserver.com. Thus, extension engine122may provide web console114as a user interface in accordance with these new extensions retrieved from proxy servers.

In one implementation, instead of running the asset server as part of the master layer104, the asset server may be initiated in the node layer106and run as an application in a container. The extension files are then served from a file server application within the container.FIG. 3Aillustrates a layered system300according to another implementation of the present disclosure. As shown inFIG. 3A, node layer106may include node130that provides containers302,304. In an alternative implementation (not shown), containers302,304may run on two separate nodes. An asset server306may run on the first container302and perform functions similar to those of the asset server118as described in conjunction withFIG. 1. Asset server306may include an extension engine308that may perform functions similar to those of the extension engine122as described in conjunction withFIG. 1. A file server310may run within second container304to serve extension files to the extension engine308. In one implementation, container304and file server310may be launched as a separate image layer on top of the platform image from which containers302,304are launched. Thus, extension files may be provided to extension engine308without modifying the image of container302.

In one implementation, containers302,304may establish data communication channels via a software-defined networking (SDN) architecture provided in the layered platform300. The SDN architecture may connect all containers across all nodes in a unified cluster network. In one implementation, master layer104may include a SDN registry312stored in data store116. SDN registry312may contain a record of the hierarchical structure of nodes and containers in node layer106. A user (e.g., a system administrator) may register node130by assigning a subnet of the cluster network to the node. For example, the cluster network may be 10.1.0.0/6 class B network, and nodes are allocated with/24 subnet (i.e., 10.1.0.0/24, 10.1.1.0/24, 10.1.2.0/24, and so on). For a given node, there are a fixed number (e.g., 254) of addresses that can be assigned to containers running on the node. Thus, each container may be uniquely identified by its address within the clustered network and registered at SDN registry312.

In one implementation, container304and file server310contained therein may be launched responsive to launching container302and asset server306including extension engine308contained therein. The SDN network address of file server may be registered in SDN registry312and stored in master configuration data124. In another implementation, a user may use the user interface provided by web console114to launch container304and file server310contained therein. The user may also register SDN network address of container310in SDN registry312. The registration of the SDN network address of container310may cause the recordation of SND network address in master configuration data124.

The master configuration data124may include an identifier to identify container304as the proxy server to provide the extension files. For example, in the asset configuration section under identifier “extensionProxy,” the SDN network address of container304may substitute the URL of an external proxy server. If the SND network address is, for example, /10.1.0.0/24/254, a line such as. jsFile: /10.1.0.0/24/254/foo.js, may identify file server310running in container304as the proxy to provide the JavaScript function, and cssFile: /10.1.0.0/24/254/foo.css, may identify file server310running in container304as the proxy to provide the CSS stylesheet. Thus, a communication channel may be established between the asset server306and file server304. The communication channel is be used to transmit extension configuration data from file server310to asset server306. The extension configuration data provided by file server310may be provided as part of the container image associated with container304. Thus, layered platform100may be used to deploy and update the extension using a file server hosted on the platform rather than via a remote server.

In one implementation, an SDN network address may be attached to a label which an alphanumerical string that may be used as a name to the address. These labels may be assigned by a system administrator of layered platform100. Thus, a container may be referenced through its label in the master configuration data126. For example, if SDN network address “/10.1.0.0/24/254” is labeled as “proxy-container,” the identifier “extensionProxy” may identify jsFile: /proxy-container/foo.js and cssFile: proxy-container/foo.css.

In one implementation, extension engine122may use one or more of the communication modes described above to retrieve the extension configuration data into a memory associated with a processing device of the host machine for further processing. In one implementation, extension engine122may retrieve extension files according to their types. For example, extension engine122may retrieve Javascript files into the memory and concatenate these retrieved Javascript files into a single data object in the memory. Further, extension engine122may retrieve CSS stylesheets into the memory and concatenate these CSS stylesheets into another data object in the memory. Extension engine122may further minify these concatenated data object by removing all unnecessary characters from these data objects. For example, extension engine122may remove white spaces, new line markers, and comments. Extension engine122may further calculate hash (e.g., MD5 hash) of the minified, concatenated data objects and use the hash to set HTTP cache headers to facilitate fast content delivery to browsers (e.g., browser108). Browsers108may access these data objects in the cache to employ the expanded user interface.

In one implementation, asset server may run on master layer104while the file server runs in a container on a node.FIG. 3Billustrates a layered system350according to another implementation of the present disclosure. As shown inFIG. 3B, asset server118(similar toFIG. 1) runs in master layer104, and node layer106may include a node130that provides container304in which file server310runs as a containerized application. Asset server118may include an extension engine122to retrieve extension configuration data from file server310. In one implementation, container310and its SND network address may be registered at SDN registry312as described above in conjunction withFIG. 3A. The SDN network address for container304may then be stored in master configuration data124and be identified as a proxy file server to provide the extension configuration data. A communication channel may then be established between extension engine122in the master layer104and file server310for transmitting the extension configuration data. Similarly, the extension configuration data may be concatenated and minified in the memory according to their types and provided to a cache that is accessible by browser108.

FIG. 4is a flow diagram illustrating a method400to provide user interface extensions to a layered platform according to an implementation of the present disclosure. The method400may be performed by processing logic that comprises hardware (e.g., circuitry, dedicated logic, programmable logic, microcode, etc.), software (e.g., instructions run on a processing device to perform hardware simulation), or a combination thereof.

As shown inFIG. 4, at402, the processing logic may start a virtual machine deployment application such as, the layered platform100as shown inFIG. 1. At404, the processing logic may launch the deployment platform. Launching the deployment application may include launching an asset server for accessing a configuration data structure (e.g., the master configuration data associated with the master layer as shown inFIGS. 1 and 3). The configuration data structure may have been stored in a data storage associated with the processing device. In one implementation, the asset server may be launched as a containerized application on a node as shown inFIG. 3A. In another implementation, the asset server may be launched as a component of the master layer of the layered platform100as shown inFIG. 3B.

At406, the processing logic may further launch a container containing a file server (serving as a proxy server) that stores extension configuration data associated with a web console of the deployment application. The web console may provide a user interface to a client device (e.g., via a browser of the client device). Each one of the extension configuration data includes an attribute of the user interface. The attribute may modify the user interface.

At408, the processing logic may record a network address (e.g., SDN network address) of the container containing the file server in the configuration data structure. The network address may be stored in conjunction with a container network address identifier.

At410, the processing logic may retrieve, by the asset server, the extension configuration data via the file server using the network address recorded in the configuration data structure. The retrieved extension configuration data may be used to set attributes of the web console.

At412, the processing logic may provide the extension configuration data to modify the user interface. For example, the extension configuration data (e.g., JavaScripts and CSS stylesheets) may be concatenated, minified, and hashed into data objects that are provided to a cache associated with the web console. The browser may have access to the cache to receive the extended user interface.

Although implementations of the present disclosure are described in the context of a layered platform for deploying virtual machines such as, for example, the lightweight containers, implementations of the present disclosure are not limited to virtual machine deployment platforms. Instead, implementations of the present disclosure are applicable to providing user interface extensions to a web console served by any suitable servers such as, for example, and a web server without the need to rebuild the binary code of the web server. Thus, the client layer can be a client machine running a browser, and the master layer can be a web server including a web console to provide a user interface to the client machine.

The computer system500may further include a network interface device522. The computer system500also may include a video display unit510(e.g., a liquid crystal display (LCD), a cathode ray tube (CRT), or a touch screen), an alphanumeric input device512(e.g., a keyboard), a cursor control device514(e.g., a mouse), and a signal generation device520(e.g., a speaker).

The data storage device518may include a computer-readable storage medium524on which is stored one or more sets of instructions526(e.g., software) embodying any one or more of the methodologies or functions described herein (e.g., instructions of the routing application122). The instructions526may also reside, completely or at least partially, within the main memory504and/or within the processor502during execution thereof by the computer system500, the main memory504and the processor502also constituting computer-readable storage media. The instructions526may further be transmitted or received over a network574via the network interface device522.