IP Library › Granted Patent US 11,537,523
Granted Patent B2
US 11,537,523 · App. 16/528,014 · Granted Dec 27, 2022

Command result caching for building application container images

Inventor: Boaz Shuster (Kefar Saba, IL)
Assignee: Red Hat, Inc.
G06F12/0875G06F3/067G06F3/0611G06F3/0659G06F12/0864H04L9/3239G06F2212/452
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,537,523
App. No.
16/528,014
Granted
Dec 27, 2022
Kind
B2
Abstract

Implementations of the disclosure provide systems and methods for receiving, by a processing device, a request for an application image. A sequence of commands associated with the application image and a value of a parameter associated with the sequence of commands is received. Responsive to determining that the sequence of commands has been previously executed with the value of the parameter, the processing device retrieves, from a cache, a result of executing the sequence with the value of the parameter. The application image is built using the first result of executing the sequence.

Claims (79)

1. A method comprising:

receiving, by a processing device, a request for an application image;

identifying, by the processing device, a sequence of one or more commands associated with the application image and a value of a parameter associated with the sequence of commands;

determining whether the sequence has been previously executed with the value of the parameter in view of one or more key values, wherein a first key value of the one or more key values is produced by applying a hash function to at least one command of the sequence and the value of the parameter;

responsive to determining that the sequence has been previously executed with the value of the parameter, retrieving, from a cache, a result of executing the sequence with the value of the parameter; and

building the application image using the result of executing the sequence.

2. The method of claim 1 , further comprising:

responsive to determining that the sequence has not been previously executed:

determining that the result of executing the sequence is cacheable;

generating the result of executing the sequence by executing the sequence; and

storing the result of executing the sequence in the cache.

3. The method of claim 1 , wherein determining that the sequence has been previously executed comprises:

comparing the first key value with each of a plurality of second key values, wherein each of the plurality of second key values corresponds to a previously executed sequence of one or more commands; and

identifying a second key value of the plurality of second key values that matches the first key value.

4. The method of claim 1 , further comprising:

determining that a first command of the sequence is cacheable and one or more second commands of the sequence are not cacheable;

retrieving, from the cache, a result of executing the first command with the value of the parameter; and

executing the sequence, without executing the first command.

5. The method of claim 1 , wherein the sequence of one or more commands further comprises a first command and a second command, and wherein a result of executing the first command comprises a value of the parameter for the second command.

6. The method of claim 5 , further comprising:

producing, by executing the second command with the result of executing the first command as the value of the parameter for the second command, the result of executing the second command;

storing the result of executing the second command, and an indication that the result of executing the second command is dependent on the result of executing the first command, in the cache; and

building the application image using the result of executing the second command.

7. The method of claim 1 further comprising:

determining that the value of the parameter has been modified;

generating a result of executing a first command of the sequence by executing the first command with the value of the parameter;

responsive to generating the result of executing the first command, generating a result of executing a second command by executing the second command with the result of executing the first command; and

building the application image using the result of the first command and the result of the second command.

8. A system comprising:

a memory; and

a processing device communicably coupled to the memory, the processing device to:

receive a request for an application image;

identify a sequence of one or more commands associated with the application image and a value of a parameter associated with the sequence of commands;

determine whether the sequence has been previously executed with the value of the parameter in view of one or more key values, wherein a first key value of the one or more key values is produced by applying a hash function to at least one command of the sequence and the value of the parameter;

responsive to determining that the sequence has been previously executed with the value of the parameter, retrieve, from a cache associated with the memory, a result of executing the sequence with the value of the parameter; and

build the application image using the result of executing the sequence.

9. The system of claim 8 , wherein the processing device is further to, responsive to determining that the sequence has not been previously executed:

determine that the result of executing the sequence is cacheable;

generate the result of executing the sequence by executing the sequence; and

store the result of executing the sequence in the cache.

10. The system of claim 9 , wherein to determine that the sequence has been previously executed, the processing device is to:

compare the first key value with each of a plurality of second key values, wherein each of the plurality of second key values corresponds to a previously executed sequence of one or more commands; and

identify a second key value of the plurality of second key values that correspond with the first key value.

11. The system of claim 8 , wherein the processing device is further to:

determine that a first command of the sequence is cacheable and one or more second commands of the sequence are not cacheable;

retrieve, from the cache, a result of executing the first command with the value of the parameter; and

execute the sequence, without executing the first command.

12. The system of claim 8 , wherein the sequence of one or more commands further comprises a first command and a second command, and wherein a result of executing the first command is a value of the parameter for the second command.

13. The system of claim 12 , wherein the processing device is further to:

produce, by executing the second command with the result of executing the first command as the value of the parameter for the second command, the result of executing the second command;

store the result of executing the second command, and an indication that the result of executing the second command is dependent on the result of executing the first command, in the cache; and

build the application image using the result of executing the second command.

14. A non-transitory computer-readable medium having instructions stored therein that, when executed by a processing device, cause the processing device to:

receive a request for an application image;

identify a sequence of one or more commands associated with the application image and a value of a parameter associated with the sequence of commands;

determine whether the sequence has been previously executed with the value of the parameter in view of one or more key values, wherein a first key value of the one or more key values is produced by applying a hash function to at least one command of the sequence and the value of the parameter;

responsive to determining that the sequence has been previously executed with the value of the parameter, retrieve, from a cache, a result of executing the sequence with the value of the parameter; and

build the application image using the result of executing the sequence.

15. The non-transitory computer-readable medium of claim 14 , wherein the processing device is further to, responsive to determining that the sequence has not been previously executed:

determine that the result of executing the sequence is cacheable;

generate the result of executing the sequence by executing the sequence; and

store the result of executing the sequence in the cache.

16. The non-transitory computer-readable medium of claim 14 , wherein to determine that the sequence has been previously executed, the processing device is to:

compare the first key value with each of a plurality of second key values, from a data structure of the cache, wherein each of the plurality of second key values corresponds to a previously executed sequence of one or more commands; and

identify a second key value of the plurality of second key values that correspond with the first key value.

17. The non-transitory computer-readable medium of claim 14 , the processing device is further to:

determine that a first command of the sequence is cacheable and one or more second commands of the sequence are not cacheable;

retrieve, from the cache, a result of executing the first command with the value of the parameter; and

execute the sequence, without executing the first command.

18. The non-transitory computer-readable medium of claim 14 , wherein the sequence of one or more commands further comprises a first command and a second command, and wherein a result of executing the first command is a value of the parameter for the second command.

19. The non-transitory computer-readable medium of claim 18 , wherein the processing device is further to:

produce, by executing the second command with the result of executing the first command as the value of the parameter for the second command, the result of executing the second command;

store the result of executing the second command, and an indication that the result of executing the second command is dependent on the result of executing the first command, in the cache; and

build the application image using the result of executing the second command.

20. The non-transitory computer-readable medium of claim 14 , wherein the processing device is further to:

determine that the value of the parameter has been modified;

generate a result of executing a first command of the sequence by executing the first command with the value of the parameter;

responsive to generating the result of executing the first command, generate a result of executing a second command by executing the second command with the result of executing the first command; and

build the application image using the result of the first command and the result of the second command.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 31, 2019
From: SHUSTER, BOAZ
To: RED HAT, INC.
Reel/Frame 049921/0243 →
Continuity (1)
Related Publication 20210034537A1 · Feb 4, 2021
Cited By (1)
US 12,468,522