-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds the following fields to the db schema: - capacity_type: spot or on demand - zone: aws zone - hourly_cost: price per hour of the node's instance type using this information, we can better assess the costs associated with each CI job. I will follow up with another PR that incorporates a cost per job figure into gantry, but this is all that is needed before we start running predictions.
- Loading branch information
Showing
9 changed files
with
65 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- primary key is set to 2 to set up the test that checks for race conditions | ||
INSERT INTO nodes VALUES(2,'ec253b04-b1dc-f08b-acac-e23df83b3602','ip-192-168-86-107.ec2.internal',24.0,196608000000.0,'amd64','linux','i3en.6xlarge'); | ||
INSERT INTO nodes VALUES(2,'ec253b04-b1dc-f08b-acac-e23df83b3602','ip-192-168-86-107.ec2.internal',24.0,196608000000.0,'amd64','linux','i3en.6xlarge','us-east-1c','spot', 0.5); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
-- temporarily disable foreign key constraints | ||
PRAGMA foreign_keys = OFF; | ||
|
||
-- create tmp table | ||
CREATE TABLE nodes_tmp ( | ||
id INTEGER PRIMARY KEY, | ||
uuid TEXT NOT NULL UNIQUE, | ||
hostname TEXT NOT NULL, | ||
cores REAL NOT NULL, | ||
mem REAL NOT NULL, | ||
arch TEXT NOT NULL, | ||
os TEXT NOT NULL, | ||
instance_type TEXT NOT NULL, | ||
-- new columns below | ||
zone TEXT NOT NULL, | ||
capacity_type TEXT NOT NULL, | ||
hourly_cost REAL NOT NULL | ||
); | ||
|
||
-- this approach is needed because we want to add new columns | ||
-- with a not null constraint, but also to add default values | ||
-- this isn't directly supported by ALTER TABLE | ||
|
||
-- copy data from nodes to nodes_tmp | ||
-- '', '', and 0 are the default values for zone, capacity_type, and hourly_cost | ||
INSERT INTO nodes_tmp SELECT id, uuid, hostname, cores, mem, arch, os, instance_type, '', '', 0 FROM nodes; | ||
DROP TABLE nodes; | ||
ALTER TABLE nodes_tmp RENAME TO nodes; | ||
|
||
PRAGMA foreign_keys = ON; |