Skip to content

Commit

Permalink
Add ability to deploy with GitHub Codespaces (#78)
Browse files Browse the repository at this point in the history
Adding dev container config to unlock ability to deploy with GitHub Codespaces
Update README with instructions for this.
  • Loading branch information
bigadsoleiman authored Oct 3, 2023
1 parent bbf49ce commit a3db7d3
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 12 deletions.
31 changes: 31 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "aws-genai-chatbot-v3",
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye",
"hostRequirements": {
"cpus": 4,
"memory": "16gb",
"storage": "32gb"
},
"features": {
"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
"version": "18",
"nvmVersion": "latest"
},
"ghcr.io/devcontainers-contrib/features/aws-cdk:2": {
"version": "latest"
},
"ghcr.io/devcontainers/features/aws-cli:1": {
"version": "latest"
},
"ghcr.io/tomharvey/devcontainer-features/aws-sso-util:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"moby": true,
"installDockerBuildx": true,
"version": "latest",
"dockerDashComposeVersion": "v1"
}
}
}
51 changes: 42 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@
[![GitHub star chart](https://img.shields.io/github/stars/aws-samples/aws-genai-llm-chatbot?style=social)](https://star-history.com/#aws-samples/aws-genai-llm-chatbot)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)


[![Deploy with GitHub Codespaces](https://github.com/codespaces/badge.svg)](#deploy-with-github-codespaces)

![sample](assets/chabot-sample.gif "AWS GenAI Chatbot")

## Table of content
- [Features](#features)
- [Precautions](#precautions)
- [Amazon SageMaker requirements](#amazon-sagemaker-requirements-for-self-hosted-models-only)
- [Amazon Bedrock requirements](#amazon-bedrock-requirements)
- [Third party models requirements](#third-party-models-requirements)
- [Prequirements](#requirements)
- [Self hosted models on Amazon SageMaker](#amazon-sagemaker-requirements-for-self-hosted-models-only)
- [Amazon Bedrock](#amazon-bedrock-requirements)
- [Third party models](#third-party-models-requirements)
- [Deploy](#deploy)
- [With AWS Cloud9](#deploy-with-aws-cloud9)
- [With GitHub Codespaces](#deploy-with-github-codespaces)
- [Local deployment](#local-deployment)
- [Clean up](#clean-up)
- [Authors](#authors)
- [Credits](#credits)
Expand Down Expand Up @@ -76,12 +83,11 @@ If you are looking to self host models on Amazon SageMaker You'll likely need to
# Amazon Bedrock requirements
**Base Models Access**

If you are looking to interact with models from Amazon Bedrock, you need to [request access to the base models in the target region first](https://console.aws.amazon.com/bedrock/home?#/modelaccess).

Make sure to request access in the region you plan to deploy this solution to and to read and accept models end-user license agreements or EULA.

If you are looking to interact with models from Amazon Bedrock, you need to [request access to the base models in one of the regions where Amazon Bedrock is available](https://console.aws.amazon.com/bedrock/home?#/modelaccess). Make sure to read and accept models end-user license agreements or EULA.

__Note that while the approval is instant, it might take several minutes to get access and see the list of models in the UI.__
Note:
- You can deploy the soluton to a different region from the one where you requested Base Model access.
- **While the Base Model access approval is instant, it might take several minutes to get access and see the list of models in the UI.**

![sample](assets/enable-models.gif "AWS GenAI Chatbot")

Expand Down Expand Up @@ -120,8 +126,34 @@ If you'd like to use Cloud9 to deploy the solution, you will need the following
- select at least `m5.large` as Instance type.
- use `Ubuntu Server 22.04 LTS` as the platform.

#### Deploy with Github Codespaces
If you'd like to use [GitHub Codespaces](https://github.com/features/codespaces) to deploy the solution, you will need the following before proceeding:
1. An [AWS account](https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/)
2. An [IAM User](https://console.aws.amazon.com/iamv2/home?#/users/create) with:
- `AdministratorAccess` policy granted to your user (for production, we recommend restricting access as needed)
- Take note of `Access key` and `Secret access key`.

To get started click on the button below

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/aws-samples/aws-genai-llm-chatbot/tree/codespaces)

Once in the Codespaces terminal, set up the AWS Credentials by running

```shell
aws configure
```

```shell
AWS Access Key ID [None]: <the access key from the IAM user generated above>
AWS Secret Access Key [None]: <the secret access key from the IAM user generated above>
Default region name: <the region you plan to deploy the solution to>
Default output format: json
```

You are all set for deployment, you can now jump to [.3 of the deployment section below](#deployment-dependencies-installation).

#### Local deployment
If you have decided not to use Cloud9, verify that your environment satisfies the following prerequisites:
If you have decided not to use AWS Cloud9 or GitHub Codespaces, verify that your environment satisfies the following prerequisites:

You have:

Expand Down Expand Up @@ -163,6 +195,7 @@ To do this, run the following command from the Cloud9 terminal:
```
See the documentation for more details [on environment resize](https://docs.aws.amazon.com/cloud9/latest/user-guide/move-environment.html#move-environment-resize).

<a id="deployment-dependencies-installation"></a>
3. Install the project dependencies and build the project by running this command
```bash
npm install && npm run build
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
"@aws-cdk/aws-apigatewayv2-authorizers-alpha": "^2.99.0-alpha.0",
"@aws-cdk/aws-apigatewayv2-integrations-alpha": "^2.99.0-alpha.0",
"aws-cdk-lib": "2.99.0",
"constructs": "^10.0.0",
"source-map-support": "^0.5.21",
"commander": "^11.0.0",
"enquirer": "^2.4.1"
"constructs": "^10.0.0",
"enquirer": "^2.4.1",
"source-map-support": "^0.5.21"
}
}

0 comments on commit a3db7d3

Please sign in to comment.