Dynamic container deployment with parallel conditional layers
A method and associated systems for dynamic container deployment with parallel layers. A processor creates an image file by processing each instruction of an image-container file in sequential order, where each instruction adds a layer to the image file that identifies either an unconditional or a parallel software layer of a container. Each unconditional layer is assigned a unique level but parallel layers may share a same level. The processor then deploys an instance of a container by deploying layers of the image file to the container in the order in which they were created by the image-creation file. If an image-file layer is marked as parallel, it is deployed only if an associated condition is satisfied, such that no two deployed layers have the same level.
1. A computer-implemented method of enhancing an image file, comprising:
determining, for each instruction of an image-creation file configured to create the image file, whether the instruction identifies a conditional layer;
creating, upon the determining that a first processed instruction identifies the conditional layer, a blank layer at a topmost level of the image file;
identifying all file changes required to deploy the conditional layer into a container;
adding software images identified by the first processed instruction onto the blank layer; and
marking the blank layer as the conditional layer, wherein
the conditional layer includes a conditional statement used to select one of a plurality of layers to be deployed, and
the image file includes an ordered stack of layers selected from a set of deployable software layers.
2. The method of claim 1 , wherein
the conditional layer is committed by storing the conditional layer in an actual image file.
3. The method of claim 1 , wherein
the image file is configured to deploy an operating environment and an associated application on a virtualized platform.
4. The method of claim 3 , wherein
the conditional statement is evaluated based upon a condition associated with the virtualized platform.
5. The method of claim 1 , wherein
the conditional statement is evaluated at deployment time of the image file.
6. A computer-implemented system configured to enhance an image file, comprising:
a hardware processor programmed to initiate the following executable operations:
determining, for each instruction of an image-creation file configured to create the image file, whether the instruction identifies a conditional layer;
creating, upon the determining that a first processed instruction identifies the conditional layer, a blank layer at a topmost level of the image file;
identifying all file changes required to deploy the conditional layer into a container;
adding software images identified by the first processed instruction onto the blank layer; and
marking the blank layer as the conditional layer, wherein
the conditional layer includes a conditional statement used to select one of a plurality of layers to be deployed, and
the image file includes an ordered stack of layers selected from a set of deployable software layers.
7. The system of claim 6 , wherein
the conditional layer is committed by storing the conditional layer in an actual image file.
8. The system of claim 6 , wherein
the image file is configured to deploy an operating environment and an associated application on a virtualized platform.
9. The system of claim 8 , wherein
the conditional statement is evaluated based upon a condition associated with the virtualized platform.
10. The system of claim 6 , wherein
the conditional statement is evaluated at deployment time of the image file.
11. A computer program product, comprising:
a hardware storage device having program code for enhancing an image file stored thereon,
the program code, which when executed by a computer hardware system, causes the computer hardware system to perform:
determining, for each instruction of an image-creation file configured to create the image file, whether the instruction identifies a conditional layer;
creating, upon the determining that a first processed instruction identifies the conditional layer, a blank layer at a topmost level of the image file;
identifying all file changes required to deploy the conditional layer into a container;
adding software images identified by the first processed instruction onto the blank layer; and
marking the blank layer as the conditional layer, wherein
the conditional layer includes a conditional statement used to select one of a plurality of layers to be deployed, and
the image file includes an ordered stack of layers selected from a set of deployable software layers.
12. The computer program product of claim 11 , wherein
the conditional layer is committed by storing the conditional layer in an actual image file.
13. The computer program product of claim 11 , wherein
the image file is configured to deploy an operating environment and an associated application on a virtualized platform.
14. The computer program product of claim 13 , wherein
the conditional statement is evaluated based upon a condition associated with the virtualized platform.
15. The computer program product of claim 11 , wherein
the conditional statement is evaluated at deployment time of the image file.