Skip to content

Commit 1f0358c

Browse files
committed
Backup cloud9 steps
1 parent 8158451 commit 1f0358c

File tree

9 files changed

+506
-0
lines changed

9 files changed

+506
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
+++
2+
title = "Prerequisites"
3+
date = 2019-09-18T10:46:30-04:00
4+
draft = false
5+
weight = 40
6+
tags = ["tutorial", "Prerequisite", "ec2"]
7+
+++
8+
9+
The following prerequisites are required for the HPC workshops:
10+
11+
- A computer with an internet connection running Microsoft Windows, Mac OS X, or Linux.
12+
- An internet browser such as Chrome, Firefox, Safari, Opera, or Edge.
13+
- Familiarity with common Linux commands.
14+
15+
If you have any questions when running this workshop, speak with your group coordinator or contact [AWS HPC](https://aws.amazon.com/hpc/).
16+
17+
This workshop includes multiple code samples that you can copy and paste using the button shown below.
18+
19+
![Copy Paste](/images/introductory-steps/copy-paste.png)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: "a. Event: Accessing Your Lab Account"
3+
date: 2019-09-18T10:50:17-04:00
4+
draft: false
5+
weight: 50
6+
---
7+
8+
{{% notice warning %}}
9+
Accounts are only accessible for the duration of the event. To continue using AWS after the event, [create an AWS Account](<https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/>).
10+
{{% /notice %}}
11+
12+
Do not hesitate to ask questions at [email protected] if you need any help.
13+
14+
##### Step 1
15+
16+
{{% notice warning %}}
17+
Sandbox were available on November 14th 2021 for the duration of the tutorial. If you would like to run through the labs at a later stage on your own, with your company or institution, please contact us at [email protected] so we can follow-up with you.
18+
{{% /notice %}}
19+
20+
##### Step 2
21+
22+
Go to the website https://dashboard.eventengine.run/
23+
24+
##### Step 3
25+
26+
You will then be prompted to a screen with the terms and conditions, add the *hashcode* that will be provided to you and click **Accept** to continue:
27+
28+
![Event Engine Login](</images/sc21/event-engine-login.png>)
29+
30+
##### Step 4
31+
32+
Click **AWS Console Login**, then on the following popup click on the link **Open AWS Console**.
33+
34+
![Event Engine AWS Console](</images/sc21/event-engine-aws-console.png>)
35+
36+
{{% notice warning %}}
37+
Do not forget to run in the North Virginia AWS Region (us-east-1). We can connect into your account if you need help during the tutorial.
38+
{{% /notice %}}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
+++
2+
title = "b. Post Event: Access AWS (Skip)"
3+
date = 2019-09-18T10:46:30-04:00
4+
draft = false
5+
weight = 60
6+
tags = ["tutorial", "aws console", "ec2"]
7+
+++
8+
9+
Skip this step if you are doing the labs during the SC21 event.
10+
11+
12+
Depending on your workshop, you may access the AWS Management Console through direct sign-in ([here](https://signin.aws.amazon.com/console)) or as directed by your trainer. To sign in, enter your AWS Account ID or alias, IAM user name, and password that was provided to you for this lab.
13+
14+
![AWS Management Console](/images/hpc-aws-parallelcluster-workshop/login.png)
15+
16+
After you sign in, take a few minutes to explore the navigation components of the AWS Management Console.
17+
18+
- A search bar allows you to quickly locate services based on text.
19+
- Recently visited services are located below the search bar.
20+
- In the toolbar, the Services drop-down menu populates a list of all services.
21+
- The Support drop-down menu includes links to support and [documentation](https://docs.aws.amazon.com).
22+
- The Region drop-down menu allows you to select a specific AWS Region.
23+
24+
Start this workshop by selecting an **AWS Region**:
25+
26+
Choose the **Region** drop-down menu, then choose **US East (N. Virginia)** us-east-1.
27+
28+
![AWS Management Console](/images/hpc-aws-parallelcluster-workshop/aws-console.png)
Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
AWSTemplateFormatVersion: '2010-09-09'
2+
Description: VPC with public and private subnets (1 AZs) & NAT
3+
# Use three subnets
4+
Mappings:
5+
Networking:
6+
VPC:
7+
CIDR: 10.0.0.0/16
8+
PublicSubnet:
9+
CIDR: 10.0.1.0/24
10+
PrivateSubnet:
11+
CIDR: 10.0.2.0/24
12+
Resources:
13+
# Create a VPC
14+
VPC:
15+
Type: AWS::EC2::VPC
16+
Properties:
17+
EnableDnsSupport: 'true'
18+
EnableDnsHostnames: 'true'
19+
CidrBlock: !FindInMap
20+
- Networking
21+
- VPC
22+
- CIDR
23+
Tags:
24+
- Key: Name
25+
Value: HPC VPC
26+
# Create an IGW and add it to the VPC
27+
InternetGateway:
28+
Type: AWS::EC2::InternetGateway
29+
GatewayToInternet:
30+
Type: AWS::EC2::VPCGatewayAttachment
31+
Properties:
32+
VpcId: !Ref VPC
33+
InternetGatewayId: !Ref InternetGateway
34+
# Create a NAT GW then add it to the public subnet
35+
NATGateway:
36+
DependsOn: GatewayToInternet
37+
Type: AWS::EC2::NatGateway
38+
Properties:
39+
AllocationId: !GetAtt ElasticIP.AllocationId
40+
SubnetId: !Ref PublicSubnet
41+
ElasticIP:
42+
Type: AWS::EC2::EIP
43+
Properties:
44+
Domain: vpc
45+
# Create and set the route table
46+
PublicRouteTable:
47+
Type: AWS::EC2::RouteTable
48+
Properties:
49+
VpcId: !Ref VPC
50+
PublicRoute:
51+
Type: AWS::EC2::Route
52+
Properties:
53+
RouteTableId: !Ref PublicRouteTable
54+
DestinationCidrBlock: '0.0.0.0/0'
55+
GatewayId: !Ref InternetGateway
56+
# Build the subnet and associate the route table with it
57+
PublicSubnet:
58+
Type: AWS::EC2::Subnet
59+
Properties:
60+
VpcId: !Ref VPC
61+
MapPublicIpOnLaunch: true
62+
CidrBlock: !FindInMap
63+
- Networking
64+
- PublicSubnet
65+
- CIDR
66+
AvailabilityZone: !Select
67+
- '0'
68+
- !GetAZs
69+
Ref: AWS::Region
70+
Tags:
71+
- Key: Name
72+
Value: 'HPC Public Subnet'
73+
# Then create and associate the route table to the public subnet
74+
PublicSubnetRouteTableAssociation:
75+
Type: AWS::EC2::SubnetRouteTableAssociation
76+
Properties:
77+
SubnetId: !Ref PublicSubnet
78+
RouteTableId: !Ref PublicRouteTable
79+
# Create the 3 private subnets
80+
PrivateSubnet:
81+
Type: AWS::EC2::Subnet
82+
Properties:
83+
VpcId: !Ref VPC
84+
CidrBlock: !FindInMap
85+
- Networking
86+
- PrivateSubnet
87+
- CIDR
88+
AvailabilityZone: !Select
89+
- '0'
90+
- !GetAZs
91+
Ref: AWS::Region
92+
Tags:
93+
- Key: Name
94+
Value: 'HPC Private Subnet'
95+
# Then the route tab and associate it to the three subnets
96+
PrivateRouteTable:
97+
Type: AWS::EC2::RouteTable
98+
Properties:
99+
VpcId: !Ref VPC
100+
PrivateRouteToInternet:
101+
Type: AWS::EC2::Route
102+
Properties:
103+
RouteTableId: !Ref PrivateRouteTable
104+
DestinationCidrBlock: '0.0.0.0/0'
105+
NatGatewayId: !Ref NATGateway
106+
PrivateSubnetRouteTableAssociation:
107+
Type: AWS::EC2::SubnetRouteTableAssociation
108+
Properties:
109+
SubnetId: !Ref PrivateSubnet
110+
RouteTableId: !Ref PrivateRouteTable
111+
# And create the Cloud9 Instance
112+
C9IDE:
113+
Type: AWS::Cloud9::EnvironmentEC2
114+
Properties:
115+
Name:
116+
Fn::Join:
117+
- ''
118+
- - 'HPC-Cloud9-IDE-'
119+
- !Select
120+
- 0
121+
- !Split
122+
- "-"
123+
- !Select
124+
- 2
125+
- !Split
126+
- '/'
127+
- !Ref AWS::StackId
128+
Description: !Sub 'Your Cloud9 IDE'
129+
AutomaticStopTimeMinutes: 600
130+
SubnetId: !Ref 'PublicSubnet'
131+
InstanceType: t2.micro
132+
133+
# Create a bucket and build a role to read and write to this bucket
134+
S3EncryptionKey:
135+
Type: AWS::KMS::Key
136+
Properties:
137+
KeyPolicy:
138+
Version: '2012-10-17'
139+
Statement:
140+
- Sid: Enable IAM User Permissions
141+
Effect: Allow
142+
Principal:
143+
AWS: !Sub 'arn:aws:iam::${AWS::AccountId}:root'
144+
Action: 'kms:*'
145+
Resource: '*'
146+
147+
WorkshopS3Bucket:
148+
Type: AWS::S3::Bucket
149+
Properties:
150+
BucketEncryption:
151+
ServerSideEncryptionConfiguration:
152+
- ServerSideEncryptionByDefault:
153+
SSEAlgorithm: 'aws:kms'
154+
KMSMasterKeyID: !GetAtt S3EncryptionKey.Arn
155+
DeletionPolicy: Delete
156+
BucketName:
157+
Fn::Join:
158+
- ''
159+
- - 'workshop-bucket-'
160+
- !Select
161+
- 0
162+
- !Split
163+
- "-"
164+
- !Select
165+
- 2
166+
- !Split
167+
- '/'
168+
- !Ref AWS::StackId
169+
WorkshopS3BucketRole:
170+
Type: AWS::IAM::Role
171+
Properties:
172+
AssumeRolePolicyDocument:
173+
Version: '2012-10-17'
174+
Statement:
175+
- Effect: Allow
176+
Principal:
177+
Service:
178+
- ec2.amazonaws.com
179+
Action:
180+
- sts:AssumeRole
181+
WorkshopS3BucketPolicy:
182+
Type: AWS::IAM::Policy
183+
Properties:
184+
PolicyName: WorkshopS3BucketPolicy
185+
PolicyDocument:
186+
Statement:
187+
- Effect: Allow
188+
Action:
189+
- s3:*
190+
Resource:
191+
- !Join [ "", [ "arn:aws:s3:::", !Ref 'WorkshopS3Bucket' , "/*" ] ]
192+
Roles:
193+
- !Ref WorkshopS3BucketRole
194+
195+
# Print the outputs
196+
Outputs:
197+
VPC:
198+
Value: !Ref VPC
199+
Description: ID of the VPC
200+
Export:
201+
Name: !Sub ${AWS::StackName}-VPC
202+
PublicSubnet:
203+
Value: !Ref PublicSubnet
204+
Description: ID of the public subnet
205+
Export:
206+
Name: !Sub ${AWS::StackName}-PublicSubnet
207+
PrivateSubnet:
208+
Value: !Ref PrivateSubnet
209+
Description: ID of the PrivateSubnet
210+
Export:
211+
Name: !Sub ${AWS::StackName}-PrivateSubnet
212+
Cloud9URL:
213+
Description: Cloud9 Environment
214+
Value:
215+
Fn::Join:
216+
- ''
217+
- - !Sub https://${AWS::Region}.console.aws.amazon.com/cloud9/ide/
218+
- !Ref C9IDE
219+
Export:
220+
Name: !Sub ${AWS::StackName}-Cloud-9IDE
221+
WorkshopS3Bucket:
222+
Description: S3 Bucket used for the workshop
223+
Value: !Ref WorkshopS3Bucket
224+
WorkshopS3BucketRole:
225+
Description: EC2 Role to Read and Write to the Bucket
226+
Value: !Ref WorkshopS3BucketRole
227+
WorkshopName:
228+
Description: Workshop Name
229+
Value:
230+
Fn::Join:
231+
- ''
232+
- - 'ComputeWorkshop-'
233+
- !Select
234+
- 0
235+
- !Split
236+
- "-"
237+
- !Select
238+
- 2
239+
- !Split
240+
- '/'
241+
- !Ref AWS::StackId
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
+++
2+
title = "b. Create a Cloud9 Environment"
3+
weight = 60
4+
tags = ["tutorial", "cloud9", "ParallelCluster"]
5+
+++
6+
![Cloud 9](/images/hpc-aws-parallelcluster-workshop/cloud9.png)
7+
[AWS Cloud9](https://aws.amazon.com/cloud9/) is a cloud-based integrated development environment (IDE) that lets you write, run, and debug your code with just a browser. This workshop uses Cloud9 to introduce you to the AWS Command Line Interface (AWS CLI) without the need to install any software on your laptop.
8+
9+
AWS Cloud9 contains a collection of tools that let you code, build, run, test, debug, and release software in the cloud using your internet browser. The IDE offers support for python, pip, AWS CLI, and provides easy access to AWS resources through Identity and Access Management (IAM) user credentials. The IDE includes a terminal with sudo privileges to the managed instance that is hosting your development environment and a pre-authenticated CLI. This makes it easy for you to quickly run commands and directly access AWS services.
10+
11+
{{% notice info %}}
12+
After accessing your IDE, take a moment to familiarize yourself with the Cloud9 environment. For more information, follow a [tutorial](https://docs.aws.amazon.com/cloud9/latest/user-guide/tutorial.html#tutorial-tour-ide) or even view [Introduction to AWS Cloud9](https://www.youtube.com/watch?v=JDHZOGMMkj8).
13+
{{% /notice %}}
14+
15+
#### Create Your Own AWS Cloud9 Instance {#section-2}
16+
17+
These steps apply to both individual users of this workshop and those in a group setting. To access your IDE, follow these steps:
18+
19+
1. In the AWS Management Console, locate **Cloud9** by using the search bar, or choose **Services**, then **Cloud9**.
20+
![Cloud 9](/images/introductory-steps/cloud9-find.png)
21+
2. Choose **Create Environment**
22+
3. Name your environment **MyCloud9Env** and choose **Next Step**.
23+
![Cloud 9](/images/introductory-steps/cloud9-name.png)
24+
4. On the **Configure Settings** page, locate **Cost-saving setting** drop-down menu, and choose **After a day**. (Note: Your instructor may change other default selections.)
25+
![Cloud 9](/images/introductory-steps/cloud9-defaults.png)
26+
5. Choose **Next Step**.
27+
6. Choose **Create Environment**.
28+
29+
Your AWS Cloud9 instance will be ready in a few minutes!
30+
31+
![Cloud9 Create](/images/introductory-steps/cloud9-create.png)

0 commit comments

Comments
 (0)