Cloud9

This section will connect a Cloud9 environment to the Cloud9 installation done on AWS ParallelCluster via post-install.

Fetch Head Node PublicIP

If you did not do this already, you need to fetch the public IP of the head-node.

PC_HEAD_PUBIP=$(aws ec2 describe-instances \
    --filters "[{\"Name\":\"tag:Application\", \"Values\": [\"parallelcluster-${CLUSTER_NAME}\"]}]" \
    --query "Reservations[0].Instances[0].PublicIpAddress" --output text)
echo "export PC_HEAD_PUBIP=${PC_HEAD_PUBIP}"| tee -a ~/.bashrc

First you must create an AWS Cloud9 and get your SSH key:

  • Navigate to the AWS Cloud9 console (deep link) in a new tab of your Browser
  • Choose Create environment (deep link)
  • For Name, enter Cluster-Head-Node and choose Next step
  • For Environment type, select Create and run in remote server (SSH connection)
  • For User, enter ec2-user
  • For Host, enter the public IP address given by the AWS ParallelCluster create command
  • In the Advanced settings, enter /shared for Environment path so that the AWS Cloud9 IDE uses the cluster shared Amazon EFS directory as the working environment directory
  • Choose Copy key to clipboard

An image of the AWS Cloud9 web console showing the discussed options for resource creation.

If you are not already connected, switch back to the CloudShell and SSH to the AWS ParallelCluster by running:

pcluster ssh ${CLUSTER_NAME} -i ~/.ssh/${SSH_KEY}

Run the following command, paying careful attention to quotes and output redirects (’>’) to avoid any mistakes:

echo "<copied ssh key from the AWS Cloud9 configuration dialog>" >> ~/.ssh/authorized_keys

With that done, the AWS Cloud9 creation can be finished and the AWS Cloud9 will be set up on the head node. To do so, switch to the AWS Cloud9 configuration tab and choose Next step and Create environment.

To verify that the AWS Cloud9 that opens is installed on the head node, run the following command in the terminal of the AWS Cloud9:

sinfo

You should see that the job scheduler Slurm is available and has 10 compute nodes waiting to be started for job processing.

A successful AWS Cloud9 terminal session running on the head node of the cluster, showing the results from the ‘sinfo’ command, which lists the queues available in Slurm.