Code Monkey home page Code Monkey logo

finbert-flask-app's Introduction

FinBERT Flask App Deployment Guide

This guide provides step-by-step instructions for productionalizing this FinBERT Flask App on AWS EKS using eksctl to setup the kubernetes cluster on EKS and setting up a CI/CD pipeline with GitHub Actions.

Prerequisites

Step 1: AWS CLI Configuration

  • Install and configure the AWS CLI:
    aws configure
  • Enter your AWS Access Key ID, Secret Access Key, region, and output format.

Step 2: Create an ECR Repository

  • Create a new ECR repository to store your Docker images:
    aws ecr create-repository --repository-name finbert-flask-app

Step 3: Create an IAM User for GitHub Actions

  • Create an IAM user with programmatic access and necessary permissions for ECR and EKS.
  • Note down the Access Key ID and Secret Access Key.

Step 4: EKS Cluster Setup Using eksctl

  • To create your EKS cluster, use the following eksctl commands (as specified in your provided files):
    eksctl create cluster --name finbert-cluster --region us-east-1 --node-type t3.small --node-ami-family Ubuntu2004 --nodes-min 2 --nodes-max 3 # --dry-run # uncomment to do a dry run to validate the cluster config
  • For additional configuration and options, refer to the eksctl documentation.

Deleting Deployments and Services

  • To delete specific deployments or services in your cluster:
    kubectl delete deployment <deployment-name>
    kubectl delete service <service-name>

Deleting the EKS Cluster

  • To delete your EKS cluster:
    eksctl delete cluster --name finbert-cluster

Step 5: Configure GitHub Secrets/Variables

  • Go to your GitHub repository > Settings > Secrets.
  • Add the following secrets:
    • AWS_ACCESS_KEY_ID: The Access Key ID of the IAM user.
    • AWS_SECRET_ACCESS_KEY: The Secret Access Key of the IAM user.
  • Add the following variables:
    • AWS_REGION: Your AWS region.
    • ECR_REPOSITORY: Name of the ECR repository.
    • EKS_CLUSTER_NAME: Name of the EKS cluster.

Step 6: GitHub Actions Workflow

  • Create a .github/workflows directory in your repository.
  • Add a workflow file (e.g., ci-cd.yml).
  • Define steps for building, pushing the Docker image, and deploying to EKS.

Step 7: Deploying the Application

  • Push changes to your repository.
  • GitHub Actions will build the Docker image and deploy it to EKS.

Additional Information

  • eksctl creates a CloudFormation stack for the EKS cluster, which can be viewed in the CloudFormation console or addtionally one could use cf2tf to convert the CloudFormation stack to Terraform code.
  • Link to cf2tf - https://github.com/DontShaveTheYak/cf2tf

finbert-flask-app's People

Contributors

mrcloudchase avatar

Watchers

 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.