Skip to content

Commit 161ac33

Browse files
version 0.1.1 (cummulative improvements / major: load defaut CCconfig.toml when not found)
1 parent 3276469 commit 161ac33

File tree

6 files changed

+34
-27
lines changed

6 files changed

+34
-27
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "CloudClusters"
22
uuid = "4ca6f12b-c8f1-4945-b50f-6bb73234c039"
33
authors = ["Francisco Heron de Carvalho Junior <heron@dc.ufc.br> e João Marcelo Uchôa de Alencar <joao.marcelo@ufc.br>"]
4-
version = "0.1.0"
4+
version = "0.1.1"
55

66
[deps]
77
AWS = "fbe9abb3-538b-5e4e-ba9e-bc94f4f92ebc"

docs/src/index.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
![CloudClusters.jl](https://raw.githubusercontent.com/PlatformAwareProgramming/CloudClusters.jl/refs/heads/main/docs/src/assets/logo-text.svg)
22

3+
[![TagBot](https://github.com/PlatformAwareProgramming/CloudClusters.jl/actions/workflows/TagBot.yml/badge.svg)](https://github.com/PlatformAwareProgramming/CloudClusters.jl/actions/workflows/TagBot.yml)
4+
[![CompatHelper](https://github.com/PlatformAwareProgramming/CloudClusters.jl/actions/workflows/CompatHelper.yml/badge.svg)](https://github.com/PlatformAwareProgramming/CloudClusters.jl/actions/workflows/CompatHelper.yml)
5+
36
_A package for creating, using, and managing clusters of virtual machine (VM) instances deployed with IaaS cloud providers._
47

58
> [!NOTE]
@@ -26,15 +29,16 @@ Creating clusters with _CloudClusters.jl_ requires specifying some configuration
2629
* a path pointed by the CLOUD_CLUSTERS_CONFIG environment variable, if it exists;
2730
* the current path.
2831

29-
Section [Configuration parameters](https://github.com/PlatformAwareProgramming/CloudClusters.jl#configuration-parameters) describes configuration parameters and how they can be overridden in programs.
30-
31-
Default configuration parameters can be overridden in programs.
32+
Section [Configuration parameters](https://github.com/PlatformAwareProgramming/CloudClusters.jl#configuration-parameters) describes default configuration parameters and how they can be overridden in programs.
3233

3334
A [_CCconfig.toml_](https://raw.githubusercontent.com/PlatformAwareProgramming/CloudClusters.jl/refs/heads/main/CCconfig.toml) file is provided in the repository's top-level directory. It is configured to create clusters using prebuilt virtual machine images for each supported cloud provider. These images are based on the latest version of Ubuntu and include a Julia installation of a recent stable version with all the packages needed to instantiate the clusters added and precompiled. Users can create customized images, possibly derived from the provided image, using their preferred version of Julia and adding the packages they need.
3435

35-
> [!NOTE]
36+
> [!WARNING]
3637
> The version of Julia on the host computer using _CloudClusters.jl_ must be the same version as the image used to deploy the clusters.
3738
39+
> [!NOTE]
40+
> The current prebuilt image for EC2 is located at the _us-east-1_ (North Virginia) region. Suppose the user is going to deploy a cluster in another region. In that case, they must create a copy of the image for that region in their account and assign their id to the ```imageid``` parameter of _CCConfig.toml_.
41+
3842
### The _PlatformAware.jl_ package
3943

4044
_CloudClusters.jl_ relies on an experimental package called [_PlatformAware.jl_](https://github.com/PlatformAwareProgramming/PlatformAware.jl) for the specification of _platform types_, aimed at specifying assumptions about architectural features of virtual machines instances. Indeed, _PlatformAware.jl_ may be used with _CloudClusters.jl_ to write functions specifically tuned according to the features of VM instances that comprise the clusters. This is called _platform-aware programming_. The users of _CloudClusters.jl_, particularly package developers, are invited to explore and use the ideas behind _PlatformAware.jl_.

src/config/configs.jl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ function readCCConfig(config_file::String)
3030
end
3131
end
3232

33-
#@info "=====> $ccconfig_toml"
3433
if isnothing(ccconfig_toml)
3534
@warn "A configuration file ($config_file) was not found. A default $config_file will be downloaded and copied to the current directory."
3635
fetch_default_configuration_file(config_file)
@@ -61,18 +60,15 @@ function loadDefaults(_::Type{Provider}, ccconfig_dict)
6160
return defaults_dict
6261
end
6362

64-
_providers = [Provider, Localhost, AmazonEC2, GoogleCloud]
63+
_providers = [(Provider,"defaults"), (Localhost,"local"), (AmazonEC2, "ec2"), (GoogleCloud, "gcp")]
6564

6665
defaults_dict = Dict()
6766

6867
function load!()
6968
ccconfig_dict = readCCConfig("CCconfig.toml")
70-
for provider_type in _providers
71-
if !isnothing(ccconfig_dict)
72-
defaults_dict[provider_type] = loadDefaults(provider_type, ccconfig_dict)
73-
else
74-
@error "Default configuration of $provider_type is empty"
75-
end
69+
for (provider_type, provider_key) in _providers
70+
isempty(ccconfig_dict[provider_key]) && @warn "Default configuration of $provider_type ($provider_key) is empty"
71+
defaults_dict[provider_type] = loadDefaults(provider_type, ccconfig_dict)
7672
end
7773
end
7874

src/deploy.jl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ function cluster_deploy(contract_handle, config_args...)
6363

6464
if !isnothing(pids)
6565
cluster_deploy_info[cluster_handle][:pids] = pids
66-
@info "pids: $(cluster_deploy_info[cluster_handle][:pids])"
6766
return cluster_handle
6867
else
6968
@warn "error launching processes -- cluster will be terminated"
@@ -200,6 +199,8 @@ function launch_processes_ssh(cluster_features, _::Type{<:ManagerWorkers}, ips)
200199
ntries += 1
201200
end
202201

202+
@info "the entry process of this MW cluster has pid $(first(master_id))"
203+
203204
return master_id
204205

205206
end
@@ -246,6 +247,8 @@ function launch_processes_local(cluster_features, _::Type{<:ManagerWorkers}, ips
246247
ntries += 1
247248
end
248249

250+
@info "the entry process of this MW cluster has pid $master_id"
251+
249252
return master_id
250253

251254
end
@@ -298,6 +301,8 @@ function launch_processes_ssh(cluster_features, _::Type{<:PeerWorkers}, ips)
298301
ntries += 1
299302
end
300303

304+
@info "the worker processes of this PW cluster have pids $peer_ids"
305+
301306
return peer_ids
302307

303308
end
@@ -322,6 +327,8 @@ function launch_processes_local(cluster_features, _::Type{<:PeerWorkers}, ips)
322327
ntries += 1
323328
end
324329

330+
@info "the worker processes of this PW local cluster have pids $peer_ids"
331+
325332
return peer_ids
326333

327334
end
@@ -356,6 +363,8 @@ function launch_processes_mpi(cluster_features, _::Type{<:PeerWorkersMPI}, ips)
356363
ntries += 1
357364
end
358365

366+
@info "the worker processes of this PW-MPI cluster (local) have pids $peer_ids"
367+
359368
return peer_ids
360369

361370
end
@@ -436,7 +445,7 @@ function kill_processes(cluster_handle, _::Type{<:ManagerWorkers}, cluster_featu
436445
rmprocs(pids)
437446
end
438447
empty!(cluster_deploy_info[cluster_handle][:pids])
439-
@info "pids $pids removed (manager)"
448+
!isempty(pids) && @info "pids $pids removed (manager)"
440449
end
441450

442451
function kill_processes(cluster_handle, _::Type{<:PeerWorkers}, cluster_features)
@@ -445,7 +454,7 @@ function kill_processes(cluster_handle, _::Type{<:PeerWorkers}, cluster_features
445454
rmprocs(pids)
446455
empty!(cluster_deploy_info[cluster_handle][:pids])
447456
end
448-
@info "pids $pids removed (peers)"
457+
!isempty(pids) && @info "pids $pids removed (peers)"
449458
end
450459

451460

src/macros.jl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@ function readFeatures(features)
77
for f in features
88
@assert f.head == :call
99
@assert f.args[1] == :(=>)
10-
#if arg.args[2] == :cluster_type
11-
# cluster_type = arg.args[3]
12-
# push!(common_features, Expr(:call, :(=>), :(:cluster_type), cluster_type) #= :cluster_type => cluster_type=#)
13-
#elseif arg.args[2] == :node_provider
14-
# cloud_provider = arg.args[3]
15-
# push!(common_features, Expr(:call, :(=>), :(:node_provider), cloud_provider) #=:node_provider => cloud_provider=#)
16-
#else
1710
if isa(f.args[2], Expr)
1811
@assert f.args[2].head == :.
1912
which_node = f.args[2].args[1]

src/resolve.jl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ function cluster_resolve(contract_handle)
77
cluster_type, cluster_features = cluster_contract[contract_handle]
88

99
cluster_resolve(cluster_type, cluster_features, contract_handle)
10+
1011
catch e
1112
println(e)
1213
return :fail
@@ -16,8 +17,8 @@ end
1617

1718
function cluster_resolve(_::Type{<:ManagerWorkers}, cluster_features, contract_handle)
1819

19-
!haskey(cluster_features, :manager_features) && @warn ":manager_features not specified"
20-
!haskey(cluster_features, :worker_features) && @warn ":worker_features not specified"
20+
!haskey(cluster_features, :manager_features) && @warn ":manager_features not explicitly specified"
21+
!haskey(cluster_features, :worker_features) && @warn ":worker_features not explicitly specified"
2122

2223
manager_features = Dict{Symbol,Any}(get(cluster_features, :manager_features, cluster_features))
2324
worker_features = Dict{Symbol,Any}(get(cluster_features, :worker_features, cluster_features))
@@ -36,6 +37,9 @@ function cluster_resolve(_::Type{<:ManagerWorkers}, cluster_features, contract_h
3637

3738
cluster_contract_resolved[contract_handle] = (instance_type_manager, instance_type_worker)
3839

40+
@info "$instance_type_manager of $node_provider selected for the manager node"
41+
@info "$instance_type_worker of $node_provider selected for the worker nodes"
42+
3943
:manager_instance_type => instance_type_manager, :worker_instance_type => instance_type_worker
4044
end
4145

@@ -47,6 +51,8 @@ function cluster_resolve(_::Type{<:PeerWorkers}, cluster_features, contract_hand
4751

4852
cluster_contract_resolved[contract_handle] = instance_type
4953

54+
@info "$instance_type of $node_provider selected for the peer nodes"
55+
5056
:instance_type => instance_type
5157
end
5258

@@ -65,8 +71,7 @@ function call_resolve(features)
6571
end
6672
end
6773

68-
str = resolve(resolve_args...)
69-
return str
74+
return resolve(resolve_args...)
7075
end
7176

7277
#function resolve(provider::Type{<:EC2Cluster}, node_machinetype, node_memory_size, #=node_ecu_count,=# node_vcpus_count, accelerator_count, accelerator_type, accelerator_arch, accelerator, processor, processor_arch, storage_type, storage_size, interconnection_bandwidth)

0 commit comments

Comments
 (0)