GithubHelp home page GithubHelp logo

jeffmaley / ec2graphnotebook Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 192 KB

This cdk project will provision a VPC, a Neptune cluster, an ALB, and an EC2 instance. The EC2 instance will have a UserData script to install JupyterHub, graph-notebook and other related components. The ALB will direct the user to Cognito for authentication before forwarding to EC2/JupyterHub.

JavaScript 6.22% TypeScript 45.92% Shell 47.85%

ec2graphnotebook's Introduction

ec2GraphNotebook

Description

This cdk project will provision a VPC, a Neptune cluster, an ALB, and an EC2 instance. The EC2 instance will have a UserData script to install JupyterHub, graph-notebook and other related components. The ALB will direct the user to Cognito for authentication before forwarding to EC2/JupyterHub.

Requirements

  • CDK. This project uses the AWS CDK to deploy. To use the CDK:
    • Bootstrap the cdk with cdk bootstrap <accountnumber>/<region>
    • Create the dir 'ec2_graph_notebook' and cd into it
    • Initialize the app with cdk init app --language typescript
    • Copy 'ec_graph_notebook-stack.ts' to lib/ (overwriting the file that's there)
    • Copy the rest of the files to root directory (overwriting package.json)
    • Run npm install
  • S3 bucket to house the authenticator and user-data.sh script
  • Cognito User Pool
    • The User Pool will need an App Client configured with Authorization Code Grant and openid.
    • The App integration will require a domain name (ie: yourcooldomainprefix..auth.us-east-1.amazoncognito.com)
    • Once cdk deploy has run, you need to add the ALB URL to the Callback URL's field in the form of ${callbackUrl}/oauth2/idpresponse
  • Certificate in ACM for the ALB

Issues

  • Only supports Amazon Linux 2
  • Requires an S3 bucket to host JupyterHub authenticator and user-data.sh script
  • Requires an existing certificate in ACM
  • Requires an existing Cognito User Pool
  • EC2 Security Group needs to be tightened

Usage

  1. Upload the below files to an S3 bucket:
    • jwtvalidation_authenticator-0.0.37-py3-none-any.whl
    • user-data.sh
  2. Set the following environment variables:
    • S3BUCKETNAME // Thisis the bucket you uploaded the earlier files to
    • CERTIFICATEARN // This is the ARN of a certificate in ACM that can be attached to the ALB listener
    • JHUSERNAME // This is the username you want to use to login to JupyterHub and should exist in your Cognito User Pool
    • COGUSERPOOLARN // This is your Cognito User Pool ARN
    • COGUSERPOOLID // This is the Id of the App Client configured in Cognito
    • COGDOMAIN // This is the domain of the App Client configured in Cognito
  3. Configure the user-data.sh script. There are three variables that need values.
  4. Assume a session for your AWS account
  5. Run cdk deploy
  6. Update the Cognito User Pool callback URL with "https://${ALB_URL}/oauth2/idpresponse"
  7. Get the ALB URL and use it to login into JupyterHub. This should spawn a graph notebook instance.

ec2graphnotebook's People

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.