Skip to content

Commit 4393a93

Browse files
Merge pull request #25 from PlatformAwareProgramming/aws_ec2
AWS EC2 Support
2 parents 9e37de5 + 4ae70d8 commit 4393a93

7 files changed

Lines changed: 1483 additions & 58 deletions

File tree

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ version = "0.4.0"
77
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
88
CpuId = "adafc99b-e345-5852-983c-f28acb93d879"
99
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
10+
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
11+
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
1012
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
1113
Scratch = "6c6a2e73-6563-6170-7368-637461726353"
1214
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"

src/PlatformAware.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ using TOML
1010
using JSON
1111
using Scratch
1212
using Downloads
13+
using InteractiveUtils
1314

1415
include("utils.jl")
1516

src/features/detection.jl

Lines changed: 7 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,7 @@
22
# Licensed under the MIT License. See LICENCE in the project root.
33
# ------------------------------------------------------------------
44

5-
function readDB(filename)
6-
7-
d = Vector()
8-
i=0
9-
for ls in readlines(filename)
10-
if i>0
11-
l = split(ls,',')
12-
ks = split(l[1],';')
13-
d2 = d
14-
for k in ks
15-
next_d = nothing
16-
for (key,value) in d
17-
if (k == key)
18-
next_d = value
19-
end
20-
end
21-
if (isnothing(next_d))
22-
next_d = Vector()
23-
push!(d,(k,next_d))
24-
end
25-
d = next_d
26-
end
27-
push!(d,(l[2],tuple(l[2:length(l)]...)))
28-
d = d2
29-
end
30-
i = i + 1
31-
end
325

33-
return d
34-
end
35-
36-
function lookupDB(db, key)
37-
38-
d = db
39-
40-
while typeof(d) <: Vector
41-
42-
ks = d
43-
44-
found = false
45-
for (k,v) in ks
46-
if (occursin(k,key))
47-
d = v; found = true
48-
break
49-
end
50-
end
51-
if !found return nothing end
52-
end
53-
54-
return d
55-
56-
end
576

587
const processor_dict = Ref{Vector}()
598
const accelerator_dict = Ref{Vector}()
@@ -777,13 +726,8 @@ function identityInterconnection()
777726
return interconnection_features
778727
end
779728

780-
# TODO
781729
function identifyNode()
782730

783-
println(stderr, "fail.")
784-
println(stderr, "=> Note: detection of node features (cluster and cloud computing) not yet implemented. Using default features.")
785-
println(stderr, " You can setup node features manually.")
786-
787731
node_features = Dict()
788732

789733
node_features["node_count"] = 1
@@ -793,7 +737,13 @@ function identifyNode()
793737
node_features["node_machinefamily"] = "unset"
794738
node_features["node_machinetype"] = "unset"
795739
node_features["node_vcpus_count"] = "unset"
796-
740+
741+
for p in subtypes(CloudProvider)
742+
print(stderr, string(p) * "?")
743+
ok = getNodeFeatures(p, node_features)
744+
if (isnothing(ok)) print(stderr, "No") else print(stderr, "Yes") end; print(stderr, ", ")
745+
end
746+
print(stderr, "... ok")
797747
return node_features
798748
end
799749

src/features/qualifiers/ec2/db-machinetypes.ec2.csv

Lines changed: 568 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)