Skip to content

Commit

Permalink
Merge pull request #14 from aws-samples/blog-guidance
Browse files Browse the repository at this point in the history
Amazon ElastiCache Caching for RDS Guidance
  • Loading branch information
LakshmiPeri23 authored Jun 10, 2024
2 parents f15ec18 + b06e663 commit 7cb0c17
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 110 deletions.
3 changes: 3 additions & 0 deletions guidance/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0

export EC_REDIS_HOST=<ElastiCache endpoint>
export EC_REDIS_PORT=6379
export MYSQL_USER=admin
Expand Down
20 changes: 15 additions & 5 deletions guidance/guidance-ec2.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0

AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: Create and EC2 to demonstrate the benefits of pairing RDBSM workloads with AWS ElastiCache
Description: Create and EC2 to demonstrate the benefits of pairing RDBMS workloads with AWS ElastiCache
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
Expand All @@ -26,7 +29,6 @@ Parameters:
AppInstanceClass:
Description: 'The application EC2 instance class'
Type: String
# Default: c6g.xlarge
Default: t4g.micro
MinLength: '8'
MaxLength: '63'
Expand All @@ -35,15 +37,15 @@ Parameters:
AppInstanceSecurityGroup:
Description: 'A security group with inbound rules for SSH connectivity from customer computer. And RDBMS and ElastiCache'
Type: String
Default: sg-0a87f73dcc1dffc4f
Default: a-valid-sg-that-allows-ssh-database-and-EC-access
MinLength: '8'
MaxLength: '63'
# AllowedPattern: "^[a-zA-Z]+[0-9]+[-]*$"

AppInstanceSubnet:
Description: 'A valid subnet name in the default VPC'
Type: String
Default: subnet-05cfa282f9b9dc8df
Default: pick-a-valid-subnet
MinLength: '8'
MaxLength: '63'
# AllowedPattern: "^[A-Za-z]+[0-9A-Z-]*$"
Expand Down Expand Up @@ -75,7 +77,15 @@ Resources:
SecurityGroupIds:
- !Ref AppInstanceSecurityGroup
SubnetId: !Ref AppInstanceSubnet
BlockDeviceMappings:
- DeviceName: "/dev/xvda"
Ebs:
VolumeType: "io1"
Iops: "200"
DeleteOnTermination: "true"
VolumeSize: !Ref AppInstanceStorage
Encrypted: "true"
Tags:
-
Key: Name
Value: !Ref AppInstanceName
Value: !Ref AppInstanceName
16 changes: 15 additions & 1 deletion guidance/plot_results_db_and_cache.ipynb

Large diffs are not rendered by default.

16 changes: 15 additions & 1 deletion guidance/plot_results_db_only.ipynb

Large diffs are not rendered by default.

106 changes: 4 additions & 102 deletions guidance/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,41 +1,6 @@
aiofiles==22.1.0
aiosqlite==0.19.0
anyio==3.7.1
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.2.3
async-timeout==4.0.3
attrs==23.2.0
Babel==2.14.0
backcall==0.2.0
beautifulsoup4==4.12.3
bleach==6.0.0
cached-property==1.5.2
certifi==2024.2.2
cffi==1.15.1
charset-normalizer==3.3.2
cycler==0.11.0
debugpy==1.7.0
decorator==5.1.1
defusedxml==0.7.1
entrypoints==0.4
exceptiongroup==1.2.0
fastjsonschema==2.19.1
fonttools==4.38.0
fqdn==1.5.1
greenlet==3.0.3
idna==3.6
importlib-metadata==6.7.0
importlib-resources==5.12.0
ipykernel==6.16.2
ipython==7.34.0
ipython-genutils==0.2.0
isoduration==20.11.0
jedi==0.19.1
Jinja2==3.1.3
json5==0.9.16
jsonpointer==2.4
jsonschema==4.17.3
python-decouple==3.8
redis==5.0.4
SQLAlchemy==2.0.30
jupyter-events==0.6.3
jupyter-server==1.24.0
jupyter-ydoc==0.2.5
Expand All @@ -45,67 +10,4 @@ jupyter_server_fileid==0.9.1
jupyter_server_ydoc==0.8.0
jupyterlab==3.6.7
jupyterlab-pygments==0.2.2
jupyterlab_server==2.24.0
kiwisolver==1.4.5
markdown-it-py==2.2.0
MarkupSafe==2.1.5
matplotlib==3.5.3
matplotlib-inline==0.1.6
mdurl==0.1.2
mistune==3.0.2
nbclassic==1.0.0
nbclient==0.7.4
nbconvert==7.6.0
nbformat==5.8.0
nest-asyncio==1.6.0
notebook==6.5.6
notebook_shim==0.2.4
numpy==1.21.6
packaging==24.0
pandas==1.3.5
pandocfilters==1.5.1
parso==0.8.3
pexpect==4.9.0
pickleshare==0.7.5
Pillow==9.5.0
pkgutil_resolve_name==1.3.10
prometheus-client==0.17.1
prompt-toolkit==3.0.43
psutil==5.9.8
ptyprocess==0.7.0
pycparser==2.21
Pygments==2.17.2
PyMySQL==1.1.0
pyparsing==3.1.2
pyrsistent==0.19.3
python-dateutil==2.9.0.post0
python-decouple==3.8
python-json-logger==2.0.7
pytz==2024.1
PyYAML==6.0.1
pyzmq==24.0.1
redis==5.0.3
requests==2.31.0
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rich==13.7.1
Send2Trash==1.8.2
six==1.16.0
sniffio==1.3.1
soupsieve==2.4.1
SQLAlchemy==2.0.29
terminado==0.17.1
tinycss2==1.2.1
tomli==2.0.1
tornado==6.2
traitlets==5.9.0
typing_extensions==4.7.1
uri-template==1.3.0
urllib3==1.26.6
wcwidth==0.2.13
webcolors==1.13
webencodings==0.5.1
websocket-client==1.6.1
y-py==0.6.2
ypy-websocket==0.8.4
zipp==3.15.0
jupyterlab_server==2.24.0
3 changes: 3 additions & 0 deletions guidance/scenario01.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0

import json
import random
import threading
Expand Down
3 changes: 3 additions & 0 deletions guidance/scenario02.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0

import json
import random
import threading
Expand Down
3 changes: 3 additions & 0 deletions guidance/setup_host.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash
#
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0

sudo yum install gcc python3-devel -y
python3 -m venv .venv
source .venv/bin/activate
Expand Down
5 changes: 4 additions & 1 deletion guidance/setup_jupyter.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/bin/bash
#
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0

# debug flags
#set -ex
# set -ex
source .venv/bin/activate

echo 'y' | jupyter notebook --generate-config
Expand Down

0 comments on commit 7cb0c17

Please sign in to comment.