Techniques for preventing concurrent execution of declarative infrastructure provisioners
Techniques for preventing concurrent execution of an infrastructure orchestration service are described. Worker nodes can receive instructions, or tasks, for deploying infrastructure resources and can provide heartbeat notifications to scheduler nodes, also considered a lease. A signing proxy can track the heartbeat notifications sent from the worker nodes to the scheduler node. The signing proxy can receive requests corresponding to a performance of the tasks assigned to the worker nodes. The signing proxy can determine whether the lease between each worker node and the scheduler is valid. If the lease is valid, the signing proxy may make a call to services on behalf of the worker node, and if the lease is not valid, the signing proxy may not make a call to services on behalf of the worker node. Instead, the signing proxy may cut off all outgoing network traffic, blocking access of the worker node to services.
1 . A method comprising:
executing, by a set of computing devices, a system for deploying a set of resources at an execution target;
receiving, by a first computing device of the set of computing devices, a first configuration file for a first deployment of the set of resources at the execution target, the first configuration file comprising a first release identifier;
storing, by the first computing device, a current state of the set of resources at the execution target;
receiving, by the first computing device, a second configuration file for a second deployment of the set of resources at the execution target, the second configuration file comprising a second release identifier, and the second configuration file defining a desired state of the set of resources;
determining, by the first computing device, that a difference exists between the current state of the set of resources stored at the execution target and the desired state of the set of resources defined in the second configuration file based at least in part on determining that the first release identifier of the first configuration file is not a same identifier as the second release identifier of the second configuration file;
upon determining that a difference exists between the current state of the set of resources stored at the execution target and the desired state of the set of resources, executing, by the first computing device, the second deployment of the set of resources at the execution target according to the second configuration file;
determining, by the first computing device, that a difference does not exist between the current state of the set of resources stored at the execution target and the desired state of the set of resources based at least in part on determining that the first release identifier of the first configuration file is a same identifier as the second release identifier of the second configuration file; and
upon determining that a difference does not exist between the current state of the set of resources stored at the execution target and the desired state of the set of resources:
determining, by the first computing device, that a first execution identifier of the first configuration file is different from a second execution identifier of the second configuration file; and
responsive to determining that the first execution identifier is different from the second execution identifier, executing, by the first computing device, the second deployment of the set of resources at the execution target according to the second configuration file.
2 . The method of claim 1 , wherein determining, by the first computing device, that the difference exists between the current state of the set of resources stored at the execution target and the desired state of the set of resources defined in the second configuration file further comprises:
transmitting, by the first computing device, the first configuration file and the second configuration file to a second computing device of the one or more computing devices; and
receiving, by the first computing device, an indication from the second computing device that the first release identifier of the first configuration file is not the same identifier as the second release identifier of the second configuration file, wherein the determination that the difference exists is responsive to the indication.
3 . The method of claim 2 , wherein the second computing device runs on a same host as the first computing device.
4 . The method of claim 1 , wherein determining that the difference does not exist between the current state of the set of resources stored at the execution target and the desired state of the set of resources defined in the second configuration file further comprises:
transmitting, by the first computing device, the first configuration file and the second configuration file to a second computing device of the one or more computing devices; and
receiving, by the first computing device, an indication from the second computing device that the first release identifier of the first configuration file is a same identifier as the second release identifier of the second configuration file.
5 . The method of claim 4 , wherein determining that the difference does not exist between the current state of the set of resources stored at the execution target and the desired state of the set of resources defined in the second configuration file further comprises:
comparing, by a second computing device of the set of computing devices, the first execution identifier of the first configuration file with the second execution identifier of the second configuration file;
responsive to the comparing, determining, by the second computing device, that the first execution identifier is different from the second execution identifier;
responsive to determining that the first execution identifier is different from the second execution identifier, determining, by the second computing device, a release status of the first configuration file; and
transmitting, by the second computing node, the release status of the first configuration file to the first computing device.
6 . The method of claim 5 , further comprising:
determining, by the first computing device, that the first deployment of the set of resources was not successful based on the release status of the first configuration file; and
responsive to determining that the first deployment of the set of resources was not successful, executing, by the first computing device, the second deployment of the set of resources at the execution target according to the second configuration file.
7 . The method of claim 5 , wherein the first execution identifier comprises information identifying a set of unique execution attempts for executing the first deployment of the set of resources at the execution target.
8 . The method of claim 5 , wherein the second execution identifier comprises information identifying a set of unique execution attempts for executing the second deployment of the set of resources at the execution target.
9 . The method of claim 1 , wherein the set of computing devices are configured to implement code of a declarative infrastructure provisioning tool.
10 . A system, comprising:
a memory; and
one or more processors configured to perform processing for deploying a set of resources at an execution target, the processing comprising:
receiving a first configuration file for a first deployment of the set of resources at the execution target, the first configuration file comprising a first release identifier;
storing a current state of the set of resources at the execution target;
receiving a second configuration file for a second deployment of the set of resources at the execution target, the second configuration file comprising a second release identifier, and the second configuration file defining a desired state of the set of resources;
determining that a difference exists between the current state of the set of resources stored at the execution target and the desired state of the set of resources defined in the second configuration file based at least in part on determining that the first release identifier of the first configuration file is not a same identifier as the second release identifier of the second configuration file;
upon determining that a difference exists between the current state of the set of resources stored at the execution target and the desired state of the set of resources, executing the second deployment of the set of resources at the execution target according to the second configuration file;
determining, by the first computing device, that a difference does not exist between the current state of the set of resources stored at the execution target and the desired state of the set of resources based at least in part on determining that the first release identifier of the first configuration file is a same identifier as the second release identifier of the second configuration file; and
upon determining that a difference does not exist between the current state of the set of resources stored at the execution target and the desired state of the set of resources:
determining that a first execution identifier of the first configuration file is different from a second execution identifier of the second configuration file; and
responsive to determining that the first execution identifier is different from the second execution identifier, executing the second deployment of the set of resources at the execution target according to the second configuration file.
11 . The system of claim 10 , wherein determining that the difference exists between the current state of the set of resources stored at the execution target and the desired state of the set of resources defined in the second configuration file further comprises:
transmitting the first configuration file and the second configuration file to a second computing device of the one or more computing devices; and
receiving an indication from the second computing device that the first release identifier of the first configuration file is not the same identifier as the second release identifier of the second configuration file, wherein the determination that the difference exists is responsive to the indication.
12 . The system of claim 10 , wherein determining that the difference does not exist between the current state of the set of resources stored at the execution target and the desired state of the set of resources defined in the second configuration file further comprises:
transmitting the first configuration file and the second configuration file to a second computing device of the one or more computing devices; and
receiving an indication from the second computing device that the first release identifier of the first configuration file is a same identifier as the second release identifier of the second configuration file.
13 . The system of claim 10 , wherein the set of computing devices are configured to implement code of a declarative infrastructure provisioning tool.
14 . A non-transitory computer-readable storage medium storing computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform operations comprising:
executing a system for deploying a set of resources at an execution target;
receiving a first configuration file for a first deployment of the set of resources at the execution target, the first configuration file comprising a first release identifier;
storing a current state of the set of resources at the execution target;
receiving a second configuration file for a second deployment of the set of resources at the execution target, the second configuration file comprising a second release identifier, and the second configuration file defining a desired state of the set of resources;
determining that a difference exists between the current state of the set of resources stored at the execution target and the desired state of the set of resources defined in the second configuration file based at least in part on determining that the first release identifier of the first configuration file is not a same identifier as the second release identifier of the second configuration file;
upon determining that a difference exists between the current state of the set of resources stored at the execution target and the desired state of the set of resources, executing the second deployment of the set of resources at the execution target according to the second configuration file;
determining, by the first computing device, that a difference does not exist between the current state of the set of resources stored at the execution target and the desired state of the set of resources based at least in part on determining that the first release identifier of the first configuration file is a same identifier as the second release identifier of the second configuration file; and
upon determining that a difference does not exist between the current state of the set of resources stored at the execution target and the desired state of the set of resources:
determining that a first execution identifier of the first configuration file is different from a second execution identifier of the second configuration file; and
responsive to determining that the first execution identifier is different from the second execution identifier, executing the second deployment of the set of resources at the execution target according to the second configuration file.
15 . The non-transitory computer-readable medium of claim 14 , wherein determining that the difference exists between the current state of the set of resources stored at the execution target and the desired state of the set of resources defined in the second configuration file further comprises:
transmitting the first configuration file and the second configuration file to a second computing device of the one or more computing devices; and
receiving an indication from the second computing device that the first release identifier of the first configuration file is not the same identifier as the second release identifier of the second configuration file, wherein the determination that the difference exists is responsive to the indication.
16 . The non-transitory computer-readable medium of claim 15 , wherein the second computing device runs on a same host as the first computing device.
17 . The method of claim 5 , further comprising:
determining, by the second computing device, that the first execution identifier is a same identifier as the second execution identifier; and
responsive to the determining, including an instruction not to execute, by the first computing device, the second deployment of the set of resources at the execution target according to the second configuration file.