EP-4736000-A1 - SHARED LIBRARY CONVERSION
Abstract
Converting shared libraries is provided. A shadow shared library is generated based on symbol information of each respective symbol of an original shared library. A symbol receiver that corresponds to the shadow shared library is generated. The symbol receiver corresponding to the shadow shared library and the original shared library are deployed as a microservice on a set of servers.
Inventors
- WANG, HENG
- GUAN, Tao
- HUO, ZHAN PENG
- VENUGOPALA, SANDHYA
- CHEN, XIAO LING
Assignees
- International Business Machines Corporation
Dates
- Publication Date
- 20260506
- Application Date
- 20240604
Claims (20)
- 1 . A computer-implemented method for converting shared libraries, the computer-implemented method comprising: generating, by a computer, a shadow shared library based on symbol information of each respective symbol of an original shared library; generating, by the computer, a symbol receiver that corresponds to the shadow shared library; and deploying, by the computer, the symbol receiver corresponding to the shadow shared library and the original shared library as a microservice on a set of servers.
- 2 The computer-implemented method of claim 1 , further comprising: installing, by the computer, the shadow shared library and an application associated with the microservice that includes the symbol receiver corresponding to the shadow shared library and the original shared library on a set of client devices.
- 3 The computer-implemented method of claim 2, wherein the application via the shadow shared library invokes the microservice that includes the symbol receiver corresponding to the shadow shared library and the original shared library to perform a set of functions, the shadow shared library sends remote procedure calls corresponding to the microservice to the symbol receiver.
- 4 The computer-implemented method of claim 3, wherein the application links to the shadow shared library without recompiling or relinking of the shadow shared library.
- 5 The computer-implemented method of claim 3 or claim 4, wherein the shadow shared library contains same symbols as symbols contained in the original shared library and a symbol body of respective symbols contained in the shadow shared library includes a remote procedure call ability and a determined amount of body padding to ensure that an entry address of a next symbol in the shadow shared library is equal to a same entry address of a same next symbol in the original shared library.
- 6 The computer-implemented method of claim 5, wherein the symbol receiver receives the remote procedure calls from the shadow shared library and determines an intercept symbol entry address for respective symbols in the original shared library based on the determined amount of body padding in the symbol body of respective symbols contained in the shadow shared library.
- 7 The computer-implemented method of claim 5 or claim 6, wherein the determined amount of body padding is in a form of a bubble instruction.
- 8. The computer-implemented method of any preceding claim, further comprising: receiving, by the computer, an input to convert the original shared library to the shadow shared library; retrieving, by the computer, the original shared library from a shared library database in response to receiving the input to convert the original shared library to the shadow shared library; and selecting, by the computer, a binary utility to parse the original shared library.
- 9. The computer-implemented method of claim 8, further comprising: parsing, by the computer, using the binary utility, the original shared library to identify the symbol information corresponding to each respective symbol of the original shared library, the symbol information includes a symbol name, a symbol entry address, and a symbol body size for each respective symbol of the original shared library; and extracting, by the computer, the symbol information that includes the symbol name, the symbol entry address, and the symbol body size for each respective symbol of the original shared library.
- 10. The computer-implemented method of ant preceding claim, wherein the set of servers where the symbol receiver corresponding to the shadow shared library and the original shared library are deployed as the microservice is located in a set of clouds of a hybrid cloud environment.
- 11. A computer system for converting shared libraries, the computer system comprising: a communication fabric; a storage device connected to the communication fabric, wherein the storage device stores program instructions; and a processor connected to the communication fabric, wherein the processor executes the program instructions to: generate a shadow shared library based on symbol information of each respective symbol of an original shared library; generate a symbol receiver that corresponds to the shadow shared library; and deploy the symbol receiver corresponding to the shadow shared library and the original shared library as a microservice on a set of servers.
- 12. The computer system of claim 11, wherein the processor further executes the program instructions to: install the shadow shared library and an application associated with the microservice that includes the symbol receiver corresponding to the shadow shared library and the original shared library on a set of client devices.
- 13. The computer system of claim 12, wherein the application via the shadow shared library invokes the microservice that includes the symbol receiver corresponding to the shadow shared library and the original shared library to perform a set of functions, the shadow shared library sends remote procedure calls corresponding to the microservice to the symbol receiver.
- 14. The computer system of claim 13, wherein the application links to the shadow shared library without recompiling or relinking of the shadow shared library.
- 15. A computer program product for converting shared libraries, the computer program product comprising a computer-readable storage medium having program instructions embodied therewith, the program instructions executable by a computer to cause the computer to: generate a shadow shared library based on symbol information of each respective symbol of an original shared library; generate a symbol receiver that corresponds to the shadow shared library; and deploy the symbol receiver corresponding to the shadow shared library and the original shared library as a microservice on a set of servers.
- 16. The computer program product of claim 15, wherein the program instructions further cause the computer to: install the shadow shared library and an application associated with the microservice that includes the symbol receiver corresponding to the shadow shared library and the original shared library on a set of client devices.
- 17. The computer program product of claim 16, wherein the application via the shadow shared library invokes the microservice that includes the symbol receiver corresponding to the shadow shared library and the original shared library to perform a set of functions, the shadow shared library sends remote procedure calls corresponding to the microservice to the symbol receiver.
- 18. The computer program product of claim 17, wherein the application links to the shadow shared library without recompiling or relinking of the shadow shared library.
- 19. The computer program product of claim 17 or claim 18, wherein the shadow shared library contains same symbols as symbols contained in the original shared library and a symbol body of respective symbols contained in the shadow shared library includes a remote procedure call ability and a determined amount of body padding to ensure that an entry address of a next symbol in the shadow shared library is equal to a same entry address of a same next symbol in the original shared library.
- 20. The computer program product of claim 19, wherein the symbol receiver receives the remote procedure calls from the shadow shared library and determines an intercept symbol entry address for respective symbols in the original shared library based on the determined amount of body padding in the symbol body of respective symbols contained in the shadow shared library.
Description
SHARED LIBRARY CONVERSION BACKGROUND [0001] The disclosure relates generally to libraries and more specifically to converting a shared library to a microservice. [0002] A library is a collection of non-volatile resources used by software applications or programs. A library may include, for example, configuration data, documentation, help data, message templates, pre-written code and subroutines, classes, values, or type specifications. Library code is organized in such a way that it can be used by multiple applications that have no connection to each other. In contrast, application code is organized in such a way that it can be used only within that application. The distinguishing feature is that a library is organized for the purpose of being used by multiple independent applications, and the user only needs to know the interface and not the internal details of the library. When an application invokes a library, the application gains the behavior implemented inside that library without having to implement that behavior itself. In other words, libraries encourage the sharing of code. SUMMARY [0003] According to one illustrative embodiment, a computer-implemented method for converting shared libraries is provided. A computer generates a shadow shared library based on symbol information of each respective symbol of an original shared library. The computer generates a symbol receiver that corresponds to the shadow shared library. The computer deploys the symbol receiver corresponding to the shadow shared library and the original shared library as a microservice on a set of servers. According to other illustrative embodiments, a computer system and computer program product for converting shared libraries are provided. BRIEF DESCRIPTION OF THE DRAWINGS [0004] Figure 1 is a pictorial representation of a computing environment in which illustrative embodiments may be implemented; [0005] Figure 2 is a diagram illustrating an example of a shared library conversion system in accordance with an illustrative embodiment; [0006] Figure 3 is a diagram illustrating an example of a shared library analysis process in accordance with an illustrative embodiment; [0007] Figure 4 is a diagram illustrating an example of a shadow library generation process in accordance with an illustrative embodiment; [0008] Figure 5 is a diagram illustrating an example of a hybrid cloud environment in accordance with an illustrative embodiment; and [0009] Figures 6A-6B are a flowchart illustrating a process for converting shared libraries into microservices in accordance with an illustrative embodiment. DETAILED DESCRIPTION [0010] Various aspects of the present disclosure are described by narrative text, flowcharts, block diagrams of computer systems and/or block diagrams of the machine logic included in computer program product (OPP) embodiments. With respect to any flowcharts, depending upon the technology involved, the operations can be performed in a different order than what is shown in a given flowchart. For example, again depending upon the technology involved, two operations shown in successive flowchart blocks may be performed in reverse order, as a single integrated step, concurrently, or in a manner at least partially overlapping in time. [0011] A computer program product embodiment ("CPP embodiment” or "CPP”) is a term used in the present disclosure to describe any set of one, or more, storage media (also called "mediums”) collectively included in a set of one, or more, storage devices that collectively include machine readable code corresponding to instructions and/or data for performing computer operations specified in a given CPP claim. A "storage device” is any tangible device that can retain and store instructions for use by a computer processor. Without limitation, the computer readable storage medium may be an electronic storage medium, a magnetic storage medium, an optical storage medium, an electromagnetic storage medium, a semiconductor storage medium, a mechanical storage medium, or any suitable combination of the foregoing. Some known types of storage devices that include these mediums include: diskette, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), static random access memory (SRAM), compact disc read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanically encoded device (such as punch cards or pits I lands formed in a major surface of a disc), or any suitable combination of the foregoing. A computer readable storage medium, as that term is used in the present disclosure, is not to be construed as storage in the form of transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide, light pulses passing through a fiber optic cable, electrical signals communicated through a wire, and/or other transmission media. As wil