-
Notifications
You must be signed in to change notification settings - Fork 501
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add AddKeysToAgent for ssh config file and ssh cmd (#3985)
* add AddKeysToAgent for ssh config file and ssh cmd * fix pylint line too long * renmae to mpirun.yaml * update comment * reformat * hint if ssh-agent not running * reformat * pylint * pytest * revert ssh agent checking --------- Co-authored-by: root <root@cheery-slab-8.localdomain>
- Loading branch information
Showing
4 changed files
with
31 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
workdir: . | ||
|
||
resources: | ||
cloud: aws | ||
|
||
num_nodes: 2 # Total number of nodes (1 head + 1 worker) | ||
|
||
setup: | | ||
echo "Running setup on node ${SKYPILOT_NODE_RANK}." | ||
# Install MPI if not already present. This will vary based on your OS/distro. | ||
sudo apt update | ||
sudo apt install -y openmpi-bin openmpi-common libopenmpi-dev | ||
run: | | ||
if [ "${SKYPILOT_NODE_RANK}" == "0" ]; then | ||
echo "head node" | ||
num_nodes=`echo "$SKYPILOT_NODE_IPS" | wc -l` | ||
mpi_nodes=$(echo "$SKYPILOT_NODE_IPS" | tr '\n' ',') | ||
mpi_nodes=${mpi_nodes::-1} | ||
echo "$mpi_nodes" | ||
mpirun -np $num_nodes -H $mpi_nodes bash -c 'echo "mpirun hello from IP $(hostname -I)"' | ||
else | ||
echo "worker nodes" | ||
fi |
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