在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:wblakecannon/terraform-jupyter开源软件地址:https://github.com/wblakecannon/terraform-jupyter开源编程语言:HCL 71.0%开源软件介绍:Automate Jupyter Notebook Deployment in AWS Using Terraform"Thanks to its simplicity and power, Terraform has emerged as a key player in the DevOps world. It allows you to replace the tedious, fragile, and manual parts of infrastructure management with a solid automated foundation upon which you can build all your other DevOps practices and tooling." - Yevgeniy Brikman The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. Uses include: data cleaning and transformation, numerical simulation, statistical modeling, data visualization, machine learning, and much more. The AWS instance will be running Anaconda distribution. I like Anaconda because it is the easiest way to perform Python/R data science and machine learning on Linux, Windows, and Mac OS X. With over 15 million users worldwide, it is the industry standard for developing, testing, and training on a single machine, enabling individual data scientists to:
Many guides online show how to set up Jupyter Notebooks on AWS, however they're mostly ClickOps; not DevOps. They require clicking around the AWS GUI, making key-pairs, manually configuring security groups, manually configuring Jupyter config files in Vim, etc. Some of these guides have 12–15 steps. The goal of this article is to automate the process of launching Jupyter Notebooks on AWS with Terraform. This guide accomplishes exactly that. This guide will create the AWS infrastructure as code (IaC) in about 10 minutes by running a couple commands. This guide assumes you have some basic knowledge of AWS, have an AWS account, have a shared credentials file, etc. This code also assumes you're using a pretty vanilla AWS account. i.e. default VPCs, subnets, etc. However, no Terraform knowledge is required to get up and running. If you want to learn more about Terraform, I highly recommend buying Terraform Up and Running by Yevgeniy Brikman. What this Terraform script doesThis Terraform will do the following automatically:
Install TerraformMacOS Users:I use HomeBrew to install Terraform. Install it by running the following command:
After installing HomeBrew, run Linux Users:Linux users should use LinuxBrew. Follow the installation instructions from that website if you are a Linux user. It's a little more cumbersome than the MacOS installation, so I'm going to leave the steps out. After installing LinuxBrew, run Windows UsersWindows users; you're on your own. I don't use Windows. Find some documentation online and figure it out yourself. :) Shared Credentials FileThis scrips assume you're using a shared credentials file in You'll need to create an IAM user with programmatic access, place the For more information see: File Structure
main.tfThis is the main Terraform file. It includes all the resources created in AWS. output.tfThis is where you can have Terraform output certain attributes after it has completed running. script.shThis is a bash shell script that executes when the EC2 instance is created. It does some lower level Linux stuff and takes care of:
var.tfThis is where Terraform stores variables used in Running the Terraform Script
Connect to Your Instance and Run Jupyter Notebook.
About the State FileNote that the Terraform state file is |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论