GithubHelp home page GithubHelp logo

dekt-metal's Introduction

Demo of Tanzu platform and SpringAI

Spring Boot AI LLM PostgreSQL Tanzu

This repository contains artifacts necessary to build and run generative AI applications using Spring Boot and Tanzu Platform. The instructions below cover setup for both Cloud Foundry (cf) and Kubernetes (k8s) environments.

Architecture

Alt text

Prerequisites

  • Ensure you have the latest version of the Tanzu CLI installed.
  • Access to a Route53 domain and necessary AWS permissions.
  • Configured egress settings (closed by default) to connect to external services.

Installation

Cloud Foundry Runtime

Set up your target environment and create necessary back-end services for the ai demo:

cf target -o ai-apps -s ai-spring-metal
cf create-service private-ai-service shared-ai-plan ai-service
cf create-service-key ai-service ai-key
cf service-key ai-service ai-key
cf create-service postgres on-demand-postgres-db pgvector
cf create-service-key pgvector pg-key
cf service-key pgvector pg-key
cf push

Notes:

  • if your Cloud Foundry Runtime srrvices are hosted on a private network, you will need to create or update your postgres service with the TCP Router and Service instance gateway. Documentation
  • The contents of your Kubernetes service secret can be viewed through the service key.

Kubernetes Runtime

Set up your Kubernetes environment ensuring all prerequisites are met:

Set context:

tanzu login
tanzu context use <my-context>
tanzu project use <my-project>
tanzu space use <my-space>

Build

Follow these commands to build your application:

tanzu build -o build-output

Deploy

Follow these commands to deploy your application from the build-output folder:

tanzu deploy --from-build build-output

Bind

Configuration

Place your configuration files in the conf/.secret directory. Adjust the YAML files to match the connection details provided by the external service.

Binding External Services

Create and bind the pre-provisioned services using the secrets:

Create and bind pre-provisioned services:

tanzu context use <my-context>
kubectl create -f conf/.secret
tanzu service bind PreProvisionedService/<genaiservicename> ContainerApp/<appname> --as genai
tanzu services bind PostgreSQLInstance/<postgresname> ContainerApp/<appname> --as db

Troubleshooting

Issue: Problem with external service binding.

  • Solution: Ensure that all credentials and connection details in conf/.secret are correct and updated.

Issue: Application deployment fails.

  • Solution: Check the build output for errors and verify the Tanzu configuration settings.

Browse your application through the app ingress link provided in the Space UI after deployment.

Contributing

Contributions to this project are welcome. Please ensure to follow the existing coding style and add unit tests for any new or changed functionality.

dekt-metal's People

Contributors

dektlong 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.