Giter VIP home page Giter VIP logo

infernet-deploy's Introduction

Infernet Node Deployment

Deploy a cluster of heterogenous Infernet nodes on Amazon Web Services (AWS) and / or Google Cloud Platform (GCP), using Terraform for infrastructure procurement and Docker compose for deployment.

Setup

  1. Install Terraform
  2. Configure nodes: A node configuration file for each node being deployed.
    • See example configuration.
    • They must have unique names
      • A straightforward approach would be 0.json, 1.json, etc...
    • They must be placed under the top-level configs/ directory.
    • Number and name of .json files must match the number and name of keys in the nodes variable in terraform.tfvars.
    • Each node strictly requires its own configuration .json file, even if those are identical.
    • For instructions on configuring individual nodes, refer to the Infernet Node.

Infernet Router:

The Infernet Router REST server is configured automatically by Terraform. However, if you plan to use it, you need to understand its implications:

IMPORTANT: When configuring a heterogeneous node cluster (i.e. 0.json, 1.json, etc. are not identical), container IDs should be reserved for a unique container setup at the cluster level, i.e. across nodes (and thus .json files). That is becuase the router uses container IDs to make routing decisions between services running across the cluster.

Example: Consider nodes A and B, each running a single LLM inference container; node A runs image1, and node B runs image2. If we set id: "llm-inference" in both containers (containers[0].id attribute in 0.json, 1.json), the router will be unable to disambiguate between the two services, and will consider them interchangeable, which they are not. Any requests for "llm-inference" will be routed to either container, which is an error.

Therefore, re-using a IDs across configuration files must imply an identical container configuration, including image, environment variables, command, etc. This will explicitly tell the router which containers are interchangeable, and allow it to distribute requests for those containers across all nodes running that container.

Deploy on AWS

  1. Create an AWS service account for deployment:

    cd procure/aws
    chmod 700 create_service_account.sh
    ./create_service_account.sh

    This will require local authentication with the AWS CLI. Add access_key_id and secret_access_key to your Terraform variables (see step 3).

  2. Make a copy of the example configuration file terraform.tfvars.example:

    cd procure/aws
    cp terraform.tfvars.example terraform.tfvars
  3. Configure your terraform.tfvars file. See variables.tf for config descriptions.

  4. Run Terraform:

    # Initialize
    cd procure
    make init provider=aws
    
    # Print deployment plan
    make plan provider=aws
    
    # Deploy
    make apply provider=aws
    
    # WARNING: Destructive
    # Destroy deployment
    make destroy provider=aws

Deploy on GCP

  1. Create a GCP service account for deployment:

    cd procure/gcp
    chmod 700 create_service_account.sh
    ./create_service_account.sh

    This will require local authentication with the GCP CLI, and create a local credentials file. Add the path to the credentials file (gcp_credentials_file_path) to your Terraform variables (see step 3).

  2. Make a copy of the example configuration file terraform.tfvars.example:

    cd procure/gcp
    cp terraform.tfvars.example terraform.tfvars
  3. Configure your terraform.tfvars file. See variables.tf for config descriptions.

  4. Run Terraform:

    # Initialize
    cd procure
    make init provider=gcp
    
    # Print deployment plan
    make plan provider=gcp
    
    # Deploy
    make apply provider=gcp
    
    # WARNING: Destructive
    # Destroy deployment
    make destroy provider=gcp

Using TfLint

# Install tflint
brew install tflint

# Install plugins
tflint --init

# Run on all directories
tflint --recursive

Using Terraform Format

# Format AWS files
cd procure/aws
terraform fmt

# Format GCP files
cd procure/gcp
terraform fmt

License

BSD 3-clause Clear

infernet-deploy's People

Contributors

stelios-ritual avatar arshan-ritual avatar ritual-all 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.