Skip to content

Commit 2bde3a3

Browse files
update EC2 image for Julia 1.11.2 and minor changes
1 parent 6c594a5 commit 2bde3a3

File tree

4 files changed

+24
-20
lines changed

4 files changed

+24
-20
lines changed

CCconfig.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ mpiflags = ""
1818

1919
[ec2]
2020

21-
imageid = "ami-0ce455c31c5fec661" # found at us-east-1 (North Virginia). To use in other regions, copy it.
21+
imageid = "ami-09121cfdb459a0804" # found at us-east-1 (North Virginia). To use in other regions, copy it.
2222

2323
# placement_group = "pg-XXXXXXXXXXXX" or "automatic"
2424
# security_group_id = "sg-XXXXXXXXXXXX" or "automatic"

src/cluster_providers/ec2/ec2_backend.jl

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,12 @@ function ec2_set_up_ssh_connection(cluster_name)
173173

174174
internal_key_name = cluster_name
175175

176-
if !isdir(joinpath(homedir(),".ssh"))
177-
mkdir(joinpath(homedir(),".ssh"))
178-
end
176+
ssh_path = joinpath(homedir(), ".ssh")
177+
178+
!isdir(ssh_path) && mkdir(ssh_path)
179179

180-
keypath = joinpath(homedir(), ".ssh", "$internal_key_name.key")
181-
pubpath = joinpath(homedir(), ".ssh", "$internal_key_name.key.pub")
180+
keypath = joinpath(ssh_path, "$internal_key_name.key")
181+
pubpath = joinpath(ssh_path, "$internal_key_name.key.pub")
182182

183183
# Criar chave interna pública e privada do SSH.
184184
# chars = ['a':'z'; 'A':'Z'; '0':'9']
@@ -276,10 +276,11 @@ function ec2_create_params(cluster::PeerWorkers, user_data_base64)
276276
end
277277

278278
function ec2_remove_temp_files(internal_key_name)
279-
keypath = joinpath(homedir(), ".ssh", "$internal_key_name.key")
280-
pubpath = joinpath(homedir(), ".ssh", "$internal_key_name.key.pub")
281-
run(`rm $keypath`)
282-
run(`rm $pubpath`)
279+
ssh_path = joinpath(homedir(), ".ssh")
280+
keypath = joinpath(ssh_path, "$internal_key_name.key")
281+
pubpath = joinpath(ssh_path, "$internal_key_name.key.pub")
282+
rm(keypath)
283+
rm(pubpath)
283284
end
284285

285286

@@ -310,7 +311,8 @@ function ec2_set_hostfile(cluster_nodes, internal_key_name)
310311
end
311312
end
312313

313-
keypath = joinpath(homedir(), ".ssh", "$internal_key_name.key")
314+
ssh_path = joinpath(homedir(), ".ssh")
315+
keypath = joinpath(ssh_path, "$internal_key_name.key")
314316

315317
# Atualiza o hostname e o hostfile.
316318
for instance in keys(cluster_nodes)
@@ -437,7 +439,7 @@ function ec2_await_status(cluster_nodes, status)
437439
print("Waiting for $nodeid to be $status ...")
438440
while ec2_get_instance_status(cluster_nodes[nodeid]) != status
439441
print(".")
440-
sleep(5)
442+
sleep(2)
441443
end
442444
println("successfull")
443445
end
@@ -448,7 +450,7 @@ function ec2_await_check(cluster_nodes, status)
448450
print("Waiting for $nodeid to be $status ...")
449451
while ec2_get_instance_check(cluster_nodes[nodeid]) != status
450452
print(".")
451-
sleep(5)
453+
sleep(2)
452454
end
453455
println("successfull")
454456
end
@@ -528,7 +530,7 @@ function ec2_create_mount_point(file_system_id, subnet_id, security_group_id)
528530
status = Efs.describe_file_systems(Dict("FileSystemId" => file_system_id))["FileSystems"][1]["LifeCycleState"]
529531
while status != "available"
530532
println("Waiting for File System to be available...")
531-
sleep(5)
533+
sleep(2)
532534
status = Efs.describe_file_systems(Dict("FileSystemId" => file_system_id))["FileSystems"][1]["LifeCycleState"]
533535
end
534536
println("Creating Mount Target...")
@@ -537,7 +539,7 @@ function ec2_create_mount_point(file_system_id, subnet_id, security_group_id)
537539
status = Efs.describe_mount_targets(Dict("MountTargetId" => mount_target_id))["MountTargets"][1]["LifeCycleState"]
538540
while status != "available"
539541
println("Waiting for mount target to be available...")
540-
sleep(5)
542+
sleep(2)
541543
status = Efs.describe_mount_targets(Dict("MountTargetId" => mount_target_id))["MountTargets"][1]["LifeCycleState"]
542544
end
543545
mount_target_id
@@ -555,7 +557,7 @@ function ec2_delete_efs(file_system_id)
555557
end
556558
while length(Efs.describe_mount_targets(Dict("FileSystemId" => file_system_id))["MountTargets"]) != 0
557559
println("Waiting for mount targets to be deleted...")
558-
sleep(5)
560+
sleep(2)
559561
end
560562
Efs.delete_file_system(file_system_id)
561563
end
@@ -580,7 +582,8 @@ ec2_can_resume(cluster::Cluster) = ec2_cluster_status(cluster, ["stopped"])
580582
# If some instance is not in "interrupted" or "running" state, raise an exception.
581583
# PUBLIC
582584
function ec2_resume_cluster(cluster::Cluster)
583-
keypath = joinpath(homedir(), ".ssh", "$(cluster.name).key")
585+
ssh_path = joinpath(homedir(), ".ssh")
586+
keypath = joinpath(ssh_path, "$(cluster.name).key")
584587

585588
ec2_start_instances(cluster)
586589
ec2_await_status(cluster.cluster_nodes, "running")

src/cluster_providers/gcp/gcp_backend.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function gcp_terminate_cluster(cluster::Cluster)
8181
status = gcp_get_instance_status(instance[2])
8282
while status != "terminated"
8383
println("Waiting for instances to terminate...")
84-
sleep(5)
84+
sleep(2)
8585
status = gcp_get_instance_status(instance[2])
8686
end
8787
end
@@ -405,7 +405,7 @@ function gcp_await_status(cluster_nodes, status)
405405
print("Waiting for $nodeid to be $status ...")
406406
while gcp_get_instance_status(cluster_nodes[nodeid]) != status
407407
print(".")
408-
sleep(5)
408+
sleep(2)
409409
end
410410
println("successfull")
411411
end
@@ -416,7 +416,7 @@ function gcp_await_check(cluster_nodes, status)
416416
print("Waiting for $nodeid to be $status ...")
417417
while gcp_get_instance_check(cluster_nodes[nodeid]) != status
418418
print(".")
419-
sleep(5)
419+
sleep(2)
420420
end
421421
println("successfull")
422422
end

src/deploy.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ function cluster_interrupt(cluster_handle)
383383
cluster_type = cluster_features[:cluster_type]
384384
try
385385
kill_processes(cluster_handle, cluster_type, cluster_features)
386+
sleep(1)
386387
finally
387388
interrupt_cluster(node_provider, cluster_handle)
388389
end

0 commit comments

Comments
 (0)