e. Cloud9 ☁️

Cloud9 is a web-based code editor, terminal and file-browser. You can connect to the cluster via Cloud9 and advantage of the following convenient features:

  • Terminal
  • Drag & Drop file upload
  • Code editor

Cloud9 Screenshot

Setup

To setup the connection, we need to run a script to install the Cloud9 packages on the HeadNode.

  1. From the ParallelCluster UI create a new cluster. Select the Wizard option:
  2. On the HeadNode configuration tab
    • Expand Advanced Options > turn on Multi-Script Runner > select Cloud9

Cloud9 Screenshot

  1. On the final screen review and make sure your config looks similar to the following. The only required parameter is the cloud9.sh script, we also use the SSMManagedInstanceCore policy to connect to the headnode.
HeadNode:
  InstanceType: t2.micro
  Ssh:
    KeyName: keypair
  Networking:
    SubnetId: subnet-123456789
  CustomActions:
    OnNodeConfigured:
      Script: >-
        https://raw.githubusercontent.com/aws-samples/pcluster-manager/main/resources/scripts/multi-runner.py
      Args:
        - >-
          https://raw.githubusercontent.com/aws-samples/pcluster-manager/main/resources/scripts/cloud9.sh
  Iam:
    AdditionalIamPolicies:
      - Policy: arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore
Scheduling:
  Scheduler: slurm
  SlurmQueues:
    - Name: queue0
      ComputeResources:
        - Name: queue0-t2-micro
          MinCount: 0
          MaxCount: 4
          Instances:
            - InstanceType: t2.micro
      Networking:
        SubnetIds:
          - subnet-123456789
Region: us-east-2
Image:
  Os: alinux2
  1. Once the cluster is CREATE_COMPLETE, copy the public IP address of the HeadNode:

Public IP

  1. Next, navigate to the Cloud9 Console > Create Environment > Give it the same name as the cluster and the following description:
  • Name: Cluster Name
  • Description: AWS ParallelCluster HeadNode

Public IP

  1. Copy the public key and then connect to the cluster using SSM, on the headnode paste in the key at the bottom of the ~/.ssh/authorized_keys file.

  2. Install Node.js by executing the following commands on the HeadNode

sudo yum install -y gcc-c++ make
curl -sL https://rpm.nodesource.com/setup_14.x | sudo -E bash -
sudo yum install -y nodejs 
  1. Click Next then review and confirm. If everything worked you should a screen like the following:

Public IP