@@ -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)
276276end
277277
278278function 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)
283284end
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)
561563end
@@ -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
582584function 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" )
0 commit comments