The present disclosure relates generally to executing commands on a server, and, more particularly, to executing server-side scripts using a console session on a client device.
This section is intended to introduce the reader to various aspects of art that may be related to various aspects of the present disclosure, which are described and/or claimed below. This discussion is believed to be helpful in providing the reader with background information to facilitate a better understanding of the various aspects of the present disclosure. Accordingly, it should be understood that these statements are to be read in this light, and not as admissions of prior art.
Cloud computing relates to the sharing of computing resources that are generally accessed via the Internet. In particular, a cloud computing infrastructure allows users, such as individuals and/or enterprises, to access a shared pool of computing resources, such as servers, storage devices, networks, applications, and/or other computing based services. By doing so, users are able to access computing resources on demand that are located at remote locations, which resources may be used to perform a variety computing functions (e.g., storing and/or processing large quantities of computing data). For enterprise and other organization users, cloud computing provides flexibility in accessing cloud computing resources without accruing large up-front costs, such as purchasing expensive network equipment or investing large amounts of time in establishing a private network infrastructure. Instead, by utilizing cloud computing resources, users are able redirect their resources to focus on their enterprise's core functions.
In modern communication networks, examples of cloud computing services a user may utilize include so-called infrastructure as a service (IaaS), software as a service (SaaS), and platform as a service (PaaS) technologies. IaaS is a model in which providers abstract away the complexity of hardware infrastructure and provide rapid, simplified provisioning of virtual servers and storage, giving enterprises access to computing capacity on demand. In such an approach, however, a user may be left to install and maintain platform components and applications. SaaS is a delivery model that provides software as a service rather than an end product. Instead of utilizing a local network or individual software installations, software is typically licensed on a subscription basis, hosted on a remote machine, and accessed by client customers as needed. For example, users are generally able to access a variety of enterprise and/or information technology (IT)-related software via a web browser. PaaS acts an extension of SaaS that goes beyond providing software services by offering customizability and expandability features to meet a user's needs. For example, PaaS can provide a cloud-based developmental platform for users to develop, modify, and/or customize applications and/or automating enterprise operations without maintaining network infrastructure and/or allocating computing resources normally associated with these functions.
Within the context of cloud computing solutions, debugging a server application is typically performed by committing a block of computer code to, for example, a database, executing the block of code on the server application, and viewing the results of executing the block of code. As such, viewing the output of each line of computer code may include tediously committing a respective line of computer code to the database, executing the respective line of computer code on the server application, and viewing the result of executing the respective line of computer code—for each line of computer code. Moreover, executing the committed block of computer code on the server application may generally be performed only in a single instance. That is, when a first developer is executing his block of code on the server application, other developers may be prevented from executing their blocks of code on the server application until the first developer's block of code has completed execution.
A summary of certain embodiments disclosed herein is set forth below. It should be understood that these aspects are presented merely to provide the reader with a brief summary of these certain embodiments and that these aspects are not intended to limit the scope of this disclosure. Indeed, this disclosure may encompass a variety of aspects that may not be set forth below.
The present disclosure includes a cloud-based platform (or a server of the cloud-based platform) receiving an indication that a console session is instantiated from, for example, a client device. In response to receiving the indication, the cloud-based platform may generate a thread having a unique identifier. The thread may correspond to a background job (e.g., a job that is executed on the server-side but instructed to be executed on the client-side) performed on the cloud-based platform. The cloud-based platform may execute threads mutually exclusively (e.g., in parallel, but such that each thread has its own context). The cloud-based platform may determine whether an input queue associated with the unique identifier has an input. If so, the cloud-based platform evaluates the input and writes a resulting output to an output queue associated with the unique identifier. The client device may then print the input and the resulting output to a console user interface associated with the console session, and remove the input from the input queue. In some embodiments, if the input queue stores no inputs for a threshold period of time (e.g., a timeout period), the cloud-based platform may end the thread.
Additionally, the console user interface may enable selection of the printed inputs to have the server quickly reevaluate an input. Each console user interface may also enable usage of pre-defined scripts to quickly generate a block of code desired by a developer. In some embodiments, the console user interface may enable searching of the pre-defined scripts by identifying search terms in metadata of the pre-defined scripts. As such, the developer may use the console to conveniently generate a block of desired computer code.
In this manner, multiple developers may use multiple mutually exclusive console sessions to execute server-side scripts in parallel, instead of only allowing one developer at a time to execute server-side scripts.
Various aspects of this disclosure may be better understood upon reading the following detailed description and upon reference to the drawings in which:
One or more specific embodiments will be described below. In an effort to provide a concise description of these embodiments, not all features of an actual implementation are described in the specification. It should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and enterprise-related constraints, which may vary from one implementation to another. Moreover, it should be appreciated that such a development effort might be complex and time consuming, but would nevertheless be a routine undertaking of design, fabrication, and manufacture for those of ordinary skill having the benefit of this disclosure.
As used herein, the term “computing system” refers to a single electronic computing device that includes, but is not limited to a single computer, virtual machine, virtual container, host, server, laptop, and/or mobile device, or to a plurality of electronic computing devices working together to perform the function described as being performed on or by the computing system. As used herein, the term “medium” refers to one or more non-transitory, computer-readable physical media that together store the contents described as being stored thereon. Embodiments may include non-volatile secondary storage, read-only memory (ROM), and/or random-access memory (RAM). As used herein, the term “application” refers to one or more computing modules, programs, processes, workloads, threads and/or a set of computing instructions executed by a computing system. Example embodiments of an application include software modules, software objects, software instances and/or other types of executable code.
The present disclosure is directed to a system, components of the system, and methods for executing server-side scripts using a console session on a client device. A cloud-based platform (or a server of the cloud-based platform) may receive an indication that the console session is instantiated from the client device. In response to receiving the indication, the cloud-based platform may generate a thread having a unique identifier. The thread may correspond to a background job (e.g., a job that is executed on the server-side but instructed to be executed on the client-side) performed on the cloud-based platform. The cloud-based platform may execute threads mutually exclusively (e.g., in parallel, but such that each thread has its own context). The cloud-based platform may determine whether an input queue associated with the unique identifier has an input. If so, the cloud-based platform evaluates the input and writes a resulting output to an output queue associated with the unique identifier. The client device may then print the input and the resulting output to a console user interface associated with the console session, and remove the input from the input queue. In some embodiments, if the input queue stores no inputs for a threshold period of time (e.g., a timeout period), the cloud-based platform may end the thread.
With the preceding in mind, the following figures relate to various types of generalized system architectures or configurations that may be employed to provide services to an organization in a multi-instance framework on which the present approaches may be employed. Correspondingly, these system and platform examples may also relate to systems and platforms on which the techniques discussed herein may be implemented or otherwise utilized. Turning now to
For the illustrated embodiment,
In
To utilize computing resources within the platform 20, network operators may choose to configure the data centers 22 using a variety of computing infrastructures. In one embodiment, one or more of the data centers 22 are configured using a multi-instance cloud architecture to provide every customer its own unique customer instance or instances. For example, a multi-instance cloud architecture could provide each customer instance with its own dedicated application server and dedicated database server. In other examples, the multi-instance cloud architecture could deploy a single physical or virtual server and/or other combinations of physical and/or virtual servers 24, such as one or more dedicated web servers, one or more dedicated application servers, and one or more database servers, for each customer instance. In a multi-instance cloud architecture, multiple customer instances could be installed on one or more respective hardware servers, where each customer instance is allocated certain portions of the physical server resources, such as computing memory, storage, and processing power. By doing so, each customer instance has its own unique software stack that provides the benefit of data isolation, relatively less downtime for customers to access the platform 20, and customer-driven upgrade schedules. An example of implementing a customer instance within a multi-instance cloud architecture will be discussed in more detail below with reference to
In the depicted example, to facilitate availability of the client instance 42, the virtual servers 24A-24D and virtual database servers 44A and 44B are allocated to two different data centers 22A and 22B, where one of the data centers 22 acts as a backup data center. In reference to
As shown in
Although
As may be appreciated, the respective architectures and frameworks discussed with respect to
With this in mind, and by way of background, it may be appreciated that the present approach may be implemented using one or more processor-based systems such as shown in
With this in mind, an example computer system may include some or all of the computer components depicted in
The one or more processors 31 may include one or more microprocessors capable of performing instructions stored in the memory 33. Additionally or alternatively, the one or more processors 31 may include application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), and/or other devices designed to perform some or all of the functions discussed herein without calling instructions from the memory 33.
With respect to other components, the one or more busses 84 includes suitable electrical channels to provide data and/or power between the various components of the computing system 30. The memory 33 may include any tangible, non-transitory, and computer-readable storage media. Although shown as a single block in
The present disclosure includes embodiments of the cloud-based platform 20 (or one or more virtual servers 24A-D) having functionality that enables the client instance 42 to receive an indication that a console session is instantiated (e.g., from the client device 14A). In response to receiving the indication, the client instance 42 may generate a thread having a unique identifier. The thread may correspond to a background job (e.g., a job that is executed on the server-side but instructed to be executed on the client-side) performed on the cloud-based platform 20. The cloud-based platform 20 may execute threads mutually exclusively (e.g., in parallel, but such that each thread has its own context). The cloud-based platform 20 may determine whether an input queue associated with the unique identifier has an input. If so, the cloud-based platform 20 evaluates the input and writes a resulting output to an output queue associated with the unique identifier. The cloud-based platform 20 may then print the input and the resulting output to a console user interface associated with the console session, and remove the input from the input queue. In some embodiments, if the input queue stores no inputs for a threshold period of time (e.g., a timeout period or other suitable time limitation), the cloud-based platform 20 may end the thread.
As discussed below, the disclosed embodiments enable multiple developers to use multiple mutually exclusive console sessions to execute server-side scripts in parallel, instead of only allowing one developer at a time to execute server-side scripts. The console sessions may be supported by a console application executed on the platform 20, and the console application may be a recursively interpreted script executor for the platform 20. Each console session may execute lines of computer code or scripts line-by-line, such that an output of each input line of computer code or script is provided after the respective input line or script is entered, avoiding having to enter and compile an entire block of computer code to review an output. These lines of computer code or scripts may be background scripts, such that they are executed on the server-side (e.g., by the platform 20), though sent from the client device 14A. In this manner, a developer may advantageously view each output in real-time, instead of after, for example, an entire block of computer code has been compiled and executed.
The platform 20 may enable multiple console sessions to run concurrently, in parallel, and mutually exclusively, such that each console session may maintain its individual context. That is, each console session may perform actions and set, change, or delete values, and, for that console session, those actions and values may be maintained. For example, if a first console session sets a variable X to a value of 3, and a second console session later sets the variable X to a value of 5, if the first console session then accesses the variable X, it may retain the value of 3 because the first console session's context is maintained independently from the second console session. In this manner, multiple console sessions may be run from multiple client devices 14A-C concurrently, without undesirably affecting one another.
With the foregoing in mind,
After entering the input 54, the input 54 may be displayed 58 on a console user interface 56 of the client device 14A, which may be referred to in the present disclosure as the console UI 56. In particular, the user may have opened or executed the console UI 56 on the client device 14A, and entered the input 54 in the console UI 56. The input 54 may be read as a string. The console UI 56 may supported by a console application 57 (the “console” 57) running on the platform 20. In particular, by executing the console UI 56, a console session 59 may be generated by the console 57. The console 57 be a recursively executed script executor for the platform 20, be provided as an interactive shell with a running context, and, as such, be used as an exploratory programming console.
The console 57 may enable line-by-line script execution capability for backend computer code in the platform 20. That is, the user 52 may run a single or multiple lines of script 54, review the result or output 70, update the line or lines of script 54, and/or proceed with execution of a next line or lines of script 54. Advantageously, the user 52 may modify his or her script 54 and check the output 70 of the updated script 54 in one place (e.g., the console UI 56). As such, the tedious process of committing the script 54 to a database before testing a minor or major modification may be skipped or eliminated altogether. The console 57 may thus be particularly useful in a number of applications that would be performed more efficiently without having to commit, compile, and execute an entire block computer code, such as exploratory programming, learning platform features, debugging, prototyping, testing, and the like. The console UI 56 may then display 58 the input 54 that has already been executed to enable the user 52, for example, to see a history of the inputs 54 entered and, in some embodiments, select the displayed input 54 to have the platform 20 re-execute the input 54.
Upon executing the console UI 56, the console 57 may associate the console UI 56 and corresponding console session 59 with a unique identifier 60 (e.g., an identification number or other suitable form of session identifier). In particular, the console 57 may associate the identifier 60 with a thread 62 or background job executed by the platform 20 (e.g., via the virtual server 24A) in response to the client device 14A opening a console session 59. The identifier 60 may be unique with respect to identifiers 60 of other console sessions 59 executing on the same client device 14A, as well as console sessions 59 being executed on other client devices (e.g., 14B, 14C). As such, each instantiated console session 59 that has a thread 62 being executed by the platform 20 may have an identifier 60 that is different from the identifiers 60 of the other console sessions 59 having threads 60 being executed by the platform 20.
Additionally, after entering the input 54, the client device 14A may store 64 the input 54 in an input queue or table 66 (e.g., as a string) associated with the unique identifier 60. If the client device 14A is running multiple console sessions 59 having multiple unique identifiers 60, then the client device 14A may have multiple input queues 66 associated with the unique identifiers 60, and store 64 inputs 54 from each console session 59 in a respective input queue 66. The input queue 66 may be any suitable type of queue, such as a first-in, first-out (FIFO) queue.
The input 54 may be sent 68 from the input queue 66 to the platform 20 (and the virtual server 24A). For example, the input 54 may sent 68 as a string to the platform 20, which interprets the string input 54 using an evaluation function. In the case of JavaScript, the string input 54 may be interpreted using an “eval” function. The platform 20 may execute or evaluate the interpreted input script 54 (e.g., on the virtual server 24A) via the thread 62. As such, the platform 20 may generate a resulting output 70 via the thread 62 based on executing the input script 54.
The output 70 may be in the form of, for example, a value of expression, an error message, or the like. The output 70 may be sent 72 to an output queue or table 74 of the client device 14A associated with the unique identifier 60. As with the input queue 66, if the client device 14A is running multiple console sessions 59 having multiple unique identifiers 60, then the client device may have multiple output queues 74 associated with the unique identifiers 60, and store the outputs 70 from the threads 62 having the unique identifier 60 in a respective output queue 74. The output queue 74 may be any suitable type of queue, such as a first-in, first-out (FIFO) queue. The output 76 may be sent to the console UI 56 and displayed on the console UI 56, e.g., for viewing by the user 52. As such, the output 76 may be an evaluated result of the string input 54. By associating the unique identifier 60 corresponding to the running thread 62 in the platform 20 with the console session 59, the input queue 66, and the output queue 74, the system 50 may provide multiple mutually exclusive console sessions 59 to execute server-side scripts 54 in parallel.
A second user, User 2, may also open a console UI 94 on his or her client device 14B. Opening the console UI 94 may instantiate a console session 96, Session 2, at the client device 14B and/or the platform 20 (e.g., at the virtual server 24A). As a result, the platform 20 may instantiate a corresponding thread of background job 98, Job 2, having a unique identifier 100, XXX1. The unique identifier 100, XXX1, may be associated with not only the background job 98, Job 2, but also the console session 96, Session 2, and respective input and output queues 66, 74 in the client device 14B. The background job 98, Job 2, may periodically read the respective input queue 66 for input scripts 54 (e.g., JavaScript expressions) that are stored with the unique identifier 100, XXX1, evaluate the input scripts 54, and store the result (e.g., a returned value of the JavaScript expression, thrown error message, or the like) in the respective output queue 74 with the same unique identifier 100, XXX1. The console session 88, Session 2, may constantly poll or monitor the respective output queue 74 for new output messages 76 and print an output message 76 to the console UI 56 when it receives a new output message 76.
Opening an additional console UI or refreshing a currently running console UI running on a client device may instantiate a new thread or background job having a new unique identifier. For example, as illustrated, the second user, User 2, may refresh the console UI 94 on his or her client device 14B. As a result, a new console session 104, Session 3, may be instantiated at the client device 14B and/or the platform 20 (e.g., at the virtual server 24A). The platform 20 may also instantiate a corresponding thread of background job 106, Job 3, having a unique identifier 108, XXX2. The previous console session 96, Session 2, may lose its context, as the new console session 104, Session 3, may be used as a fresh console session. In this manner, the platform 20 may managing multiple mutually exclusive console sessions that execute server-side scripts in parallel.
As illustrated, in process block 122, the platform 20 may receive an indication that a console session 59 is instantiated. For example, as illustrated in
The platform 20 may then, in process block 124, generate a thread 62 with a unique identifier 60. For example, as illustrated in
The platform 20 may, in decision block 126, determine whether there is an input 54 in an input queue 66 associated with the unique identifier 60. If so, the platform 20 may, in process block 128, evaluate the input 54 and write a resulting output 76 to an output queue 74 associated with the unique identifier 60. For example, as illustrated in
In process block 130, the client device 14A may then print the input 54 and the resulting output 76 to a console UI 56. In some embodiments, as discussed further in
In process block 132, the client device 14A may remove the input 54 from the input queue 66 as it has been executed by the platform 20 via the thread 62. In process block 134, the client device 14A may also reset a timeout period associated with the input 54. In particular, the timeout period may be a period of time that beings when the input 54 is entered by the user 52 and/or inserted into the input queue 66. The platform 20 may then return to decision block 126, and repeat for any inputs 54 stored in the input queue 66.
If there is no input 56 in the input queue 66 per decision block 126, the platform 20 may determine whether the timeout period exceeds a threshold timeout period. The threshold timeout period may be any suitable amount of time (e.g., at least five minutes, at least ten minutes, at least thirty minutes, and the like) that the platform 20 ends the thread 62 due to inactivity (e.g., no input 56). This may save system resources, as non-terminated threads 62/console sessions 59 which are unused may stay alive and keep using such resources. In process block 138, if the timeout period exceeds the threshold timeout period, then the platform 20 ends the thread 62. If the timeout period does not exceed the threshold timeout period, the platform 20 may return to decision block 126, and repeat for any inputs 54 stored in the input queue 66. In this manner, the process 120 may provide multiple mutually exclusive console sessions 59 to execute server-side scripts 54 in parallel.
The console UI 150 includes an input area 154 that enables entry of inputs 54. For example, as shown in
The console UI 150 may also include a pre-defined script area 160 that enables selection of scripts available from the platform 20, the virtual server 24, the client instance 42, the client device 14A, and the like. In particular, metadata may be generated from the available scripts, and the console UI 150 may enable quick searching of the metadata for use in, for example, script development, debugging, and the like. The metadata may be searched via navigation using a mousing device in the pre-defined script area 160, keyboard entry in a text box 162, and the like. For example, the user 52 may enter a search string in the text box 162. The console UI 150 may then provide search results in the form of pre-defined scripts in the pre-defined script area 160 based on class names defined in the pre-defined scripts, function names pre-defined script area 160, and the like, that approximately match the search string. The user 52 may then click, using a mousing device, a search result to insert the pre-defined script in the input area 154. As with the input area 154, when generating a block of computer code to be compiled, the user 52 may conveniently select a pre-defined script from the pre-defined script area 160 rather than tediously typing out the pre-defined script.
The console UI 150 may also include a toggle 164 that enables switching from a server console view 166 (e.g., the current view provided in
The technical effects of the present disclosure include providing multiple mutually exclusive console sessions to execute server-side scripts in parallel. In particular, the present disclosure includes a cloud-based platform (or a server of the cloud-based platform) receiving an indication that a console session is instantiated from, for example, a client device. In response to receiving the indication, the cloud-based platform may generate a thread having a unique identifier. The thread may correspond to a background job performed on the cloud-based platform. The cloud-based platform may execute threads mutually exclusively (e.g., in parallel, but such that each thread has its own context). The cloud-based platform may determine whether an input queue associated with the unique identifier has an input. If so, the cloud-based platform evaluates the input and writes a resulting output to an output queue associated with the unique identifier. The client device may then print the input and the resulting output to a console user interface associated with the console session, and remove the input from the input queue. In some embodiments, if the input queue stores no inputs for a threshold period of time (e.g., a timeout period), the cloud-based platform may end the thread.
Additionally, the console user interface may enable selection of the printed inputs to have the server quickly reevaluate an input. Each console user interface may also enable usage of pre-defined scripts to quickly generate a block of code desired by a developer. In some embodiments, the console user interface may enable searching of the pre-defined scripts by identifying search terms in metadata of the pre-defined scripts. As such, the developer may use the console to conveniently generate a block of desired computer code.
The specific embodiments described above have been shown by way of example, and it should be understood that these embodiments may be susceptible to various modifications and alternative forms. It should be further understood that the claims are not intended to be limited to the particular forms disclosed, but rather to cover all modifications, equivalents, and alternatives falling within the spirit and scope of this disclosure.
The techniques presented and claimed herein are referenced and applied to material objects and concrete examples of a practical nature that demonstrably improve the present technical field and, as such, are not abstract, intangible or purely theoretical. Further, if any claims appended to the end of this specification contain one or more elements designated as “means for [perform]ing [a function] . . . ” or “step for [perform]ing [a function] . . . ”, it is intended that such elements are to be interpreted under 35 U.S.C. 112(f). However, for any claims containing elements designated in any other manner, it is intended that such elements are not to be interpreted under 35 U.S.C. 112(f).
Number | Name | Date | Kind |
---|---|---|---|
6321229 | Goldman | Nov 2001 | B1 |
6678887 | Hallman | Jan 2004 | B1 |
7020706 | Cates | Mar 2006 | B2 |
7478151 | Maiocco | Jan 2009 | B1 |
8151261 | Sirota | Apr 2012 | B2 |
8204746 | Odinak | Jun 2012 | B2 |
8646093 | Myers | Feb 2014 | B2 |
9065783 | Ding | Jun 2015 | B2 |
9122552 | Whitney | Sep 2015 | B2 |
9363252 | Mueller | Jun 2016 | B2 |
9535737 | Joy | Jan 2017 | B2 |
9557969 | Sharma | Jan 2017 | B2 |
9609844 | Mertz et al. | Apr 2017 | B2 |
9645833 | Mueller | May 2017 | B2 |
9720674 | Spreha | Aug 2017 | B1 |
9959129 | Kannan | May 2018 | B2 |
20090112918 | Terrell | Apr 2009 | A1 |
20090245122 | Maiocco | Oct 2009 | A1 |
20110191385 | Mayatskikh et al. | Aug 2011 | A1 |
20160203002 | Kannan | Jul 2016 | A1 |
Number | Date | Country | |
---|---|---|---|
20190332386 A1 | Oct 2019 | US |