Skip to content

Commit

Permalink
fix(ci): build-key hotfix (#6123)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludamad authored May 1, 2024
1 parent f332bc9 commit 5791004
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/spot-runner-action/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ class Ec2Instance {
const client = yield this.getEc2Client();
// NOTE: This should be deterministic or we will create a launch template each time
const userData = yield new userdata_1.UserData(this.config).getUserData();
const ec2InstanceTypeHash = this.getHashOfStringArray(this.config.ec2InstanceType.concat([userData]).concat([JSON.stringify(this.tags)]));
const ec2InstanceTypeHash = this.getHashOfStringArray(this.config.ec2InstanceType.concat([userData, JSON.stringify(this.tags), this.config.ec2KeyName]));
const launchTemplateName = "aztec-packages-spot-" + this.config.ec2AmiId + "-" + ec2InstanceTypeHash;
const launchTemplateParams = {
LaunchTemplateName: launchTemplateName,
Expand All @@ -258,6 +258,7 @@ class Ec2Instance {
MemoryMiB: { Min: 0 },
AllowedInstanceTypes: this.config.ec2InstanceType,
},
KeyName: this.config.ec2KeyName,
UserData: userData,
TagSpecifications: [
{
Expand Down
3 changes: 2 additions & 1 deletion .github/spot-runner-action/src/ec2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class Ec2Instance {
// NOTE: This should be deterministic or we will create a launch template each time
const userData = await new UserData(this.config).getUserData();
const ec2InstanceTypeHash = this.getHashOfStringArray(
this.config.ec2InstanceType.concat([userData]).concat([JSON.stringify(this.tags)])
this.config.ec2InstanceType.concat([userData, JSON.stringify(this.tags), this.config.ec2KeyName])
);
const launchTemplateName =
"aztec-packages-spot-" + this.config.ec2AmiId + "-" + ec2InstanceTypeHash;
Expand All @@ -177,6 +177,7 @@ export class Ec2Instance {
MemoryMiB: { Min: 0 },
AllowedInstanceTypes: this.config.ec2InstanceType,
},
KeyName: this.config.ec2KeyName,
UserData: userData,
TagSpecifications: [
{
Expand Down

0 comments on commit 5791004

Please sign in to comment.