--------------------------------------------------------------------------------
/spring-metal/runtime-configs/tpk8s/tanzu-changeme/postgres-service-binding.yml:
--------------------------------------------------------------------------------
1 | apiVersion: services.tanzu.vmware.com/v1
2 | kind: ServiceBinding
3 | metadata:
4 | name: pgvector-CHANGE_ME
5 | namespace: default
6 | spec:
7 | alias: db
8 | serviceRef:
9 | apiGroup: services.tanzu.vmware.com
10 | connectorName: main
11 | kind: PreProvisionedService
12 | name: pgvector
13 | targetRef:
14 | apiGroup: apps.tanzu.vmware.com
15 | kind: ContainerApp
16 | name: CHANGE_ME
17 |
--------------------------------------------------------------------------------
/spring-metal/src/test/java/org/cloudfoundry/samples/music/ApplicationTests.java:
--------------------------------------------------------------------------------
1 | package org.cloudfoundry.samples.music;
2 |
3 | import org.junit.Test;
4 | import org.junit.runner.RunWith;
5 | import org.springframework.boot.test.context.SpringBootTest;
6 | import org.springframework.test.context.junit4.SpringRunner;
7 |
8 |
9 | @RunWith(SpringRunner.class)
10 | @SpringBootTest()
11 | public class ApplicationTests {
12 |
13 | @Test
14 | public void contextLoads() {
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/adminguide/managing-apps-stacks-index.md:
--------------------------------------------------------------------------------
1 | # Managing apps and their stacks
2 | These topics are your source for learning about managing apps and their stacks in Cloud Foundry:
3 |
4 | * [Using the Stack Auditor Plug-In](https://docs.cloudfoundry.org/adminguide/stack-auditor.html)
5 |
6 | * [Changing Stacks](https://docs.cloudfoundry.org/devguide/deploy-apps/stacks.html)
7 |
8 | * [Changing Windows Stacks](https://docs.cloudfoundry.org/devguide/deploy-apps/windows-stacks.html)
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/devguide/managing-apps-index.md:
--------------------------------------------------------------------------------
1 | # Managing Apps with the cf CLI
2 | These topics contain information about managing apps with the Cloud Foundry Command Line Interface (cf CLI):
3 |
4 | * [Running tasks](https://docs.cloudfoundry.org/devguide/using-tasks.html)
5 |
6 | * [Scaling an app using cf scale](https://docs.cloudfoundry.org/devguide/deploy-apps/cf-scale.html)
7 |
8 | * [Using application health checks](https://docs.cloudfoundry.org/devguide/deploy-apps/healthchecks.html)
--------------------------------------------------------------------------------
/spring-metal/src/main/java/org/cloudfoundry/samples/music/domain/Message.java:
--------------------------------------------------------------------------------
1 | package org.cloudfoundry.samples.music.domain;
2 |
3 | public class Message {
4 | private String role;
5 | private String text;
6 |
7 | public Message(String role, String text) {
8 | this.role = role;
9 | this.text = text;
10 | }
11 |
12 | public String getRole() {
13 | return this.role;
14 | }
15 |
16 | public String getText() {
17 | return this.text;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/devguide/routing-index.md:
--------------------------------------------------------------------------------
1 | # Routes and domains
2 | These topics contain information about configuring routes and domains:
3 |
4 | * [Configuring routes and domains](https://docs.cloudfoundry.org/devguide/deploy-apps/routes-domains.html)
5 |
6 | * [Configuring Cloud Foundry to route traffic to apps on custom ports](https://docs.cloudfoundry.org/devguide/custom-ports.html)
7 |
8 | * [Routing HTTP/2 and gRPC traffic to apps](https://docs.cloudfoundry.org/devguide/http2-protocol.html)
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/devguide/ssh-index.md:
--------------------------------------------------------------------------------
1 | # SSH for Apps and Services
2 | These topics contain information about configuring and using SSH for apps and services:
3 |
4 | * [Configuring SSH access for your deployment](https://docs.cloudfoundry.org/devguide/deploy-apps/app-ssh-overview.html)
5 |
6 | * [Accessing your apps with SSH](https://docs.cloudfoundry.org/devguide/deploy-apps/ssh-apps.html)
7 |
8 | * [Accessing services with SSH](https://docs.cloudfoundry.org/devguide/deploy-apps/ssh-services.html)
--------------------------------------------------------------------------------
/needs-work/spring-music-taylors-version/src/main/resources/static/templates/status.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
{{status.message}}
6 |
7 |
8 |
--------------------------------------------------------------------------------
/needs-work/spring-music-taylors-version/src/test/java/org/cloudfoundry/samples/music/ApplicationTests.java:
--------------------------------------------------------------------------------
1 | package org.cloudfoundry.samples.music;
2 |
3 | import org.junit.Test;
4 | import org.junit.runner.RunWith;
5 | import org.springframework.boot.test.context.SpringBootTest;
6 | import org.springframework.test.context.junit4.SpringRunner;
7 |
8 |
9 | @RunWith(SpringRunner.class)
10 | @SpringBootTest()
11 | public class ApplicationTests {
12 |
13 | @Test
14 | public void contextLoads() {
15 | }
16 |
17 | }
--------------------------------------------------------------------------------
/needs-work/tanzu-gpt-python/manifest.yml:
--------------------------------------------------------------------------------
1 | applications:
2 | - name: tanzu-gpt-python
3 | memory: 1G
4 | buildpack: python_buildpack
5 | env:
6 | INFERENCE_MODEL: llama3.1
7 | EMBEDDING_MODEL: bge-large
8 | services:
9 | - llama3.1
10 | - bge-large
11 | - tanzu-gpt-postgres
12 | #Create a Tanzu Postgres databse and GenAI for TAS Service for this app to function
13 | #Create services ahead of time with either the cf cli or Apps Manager
14 | #Make sure to use the proper service names based on your deployment
--------------------------------------------------------------------------------
/needs-work/spring-music-taylors-version/src/main/java/org/cloudfoundry/samples/music/domain/Message.java:
--------------------------------------------------------------------------------
1 | package org.cloudfoundry.samples.music.domain;
2 |
3 | public class Message {
4 | private String role;
5 | private String text;
6 |
7 | public Message(String role, String text) {
8 | this.role = role;
9 | this.text = text;
10 | }
11 |
12 | public String getRole() {
13 | return this.role;
14 | }
15 |
16 | public String getText() {
17 | return this.text;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/spring-metal/src/main/java/org/cloudfoundry/samples/music/repositories/jpa/JpaAlbumRepository.java:
--------------------------------------------------------------------------------
1 | package org.cloudfoundry.samples.music.repositories.jpa;
2 |
3 | import org.cloudfoundry.samples.music.domain.Album;
4 | import org.springframework.context.annotation.Profile;
5 | import org.springframework.data.jpa.repository.JpaRepository;
6 | import org.springframework.stereotype.Repository;
7 |
8 | @Repository
9 | @Profile({"!mongodb", "!redis"})
10 | public interface JpaAlbumRepository extends JpaRepository {
11 | }
12 |
--------------------------------------------------------------------------------
/spring-metal/src/main/java/org/cloudfoundry/samples/music/repositories/mongodb/MongoAlbumRepository.java:
--------------------------------------------------------------------------------
1 | package org.cloudfoundry.samples.music.repositories.mongodb;
2 |
3 | import org.cloudfoundry.samples.music.domain.Album;
4 | import org.springframework.context.annotation.Profile;
5 | import org.springframework.data.mongodb.repository.MongoRepository;
6 | import org.springframework.stereotype.Repository;
7 |
8 | @Repository
9 | @Profile("mongodb")
10 | public interface MongoAlbumRepository extends MongoRepository {
11 | }
--------------------------------------------------------------------------------
/spring-metal/.gitignore:
--------------------------------------------------------------------------------
1 | # Operating System Files
2 |
3 | *.DS_Store
4 | Thumbs.db
5 | *~
6 | .#*
7 | #*
8 | *#
9 |
10 | # tanzu files #
11 | .tanzu
12 | .build-output
13 |
14 | # Build Files #
15 |
16 | bin
17 | target
18 | build/
19 | .gradle
20 | .mvn
21 |
22 | # Eclipse Project Files #
23 |
24 | .classpath
25 | .project
26 | .settings
27 |
28 | # IDEA Files #
29 |
30 | *.iml
31 | *.ipr
32 | *.iws
33 | *.idea
34 | .vscode
35 |
36 | # Spring Bootstrap artifacts
37 |
38 | dependency-reduced-pom.xml
39 |
40 | mem*.db
41 |
42 | README.html
43 |
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/devguide/v3-commands.md:
--------------------------------------------------------------------------------
1 | # Using experimental cf CLI commands
2 |
3 | **Important**
4 | This topic is no longer in use. Commands with `v3-` prefixes do not exist in cf CLI v7 or v8. Because these commands are experimental, they are not guaranteed to be available or compatible in subsequent cf CLI releases, and they are not guaranteed to be compatible with this version of Cloud Foundry. Cloud Foundry recommends upgrading to cf CLI v8. For more information, see [Upgrading to cf CLI v8](https://docs.cloudfoundry.org/cf-cli/v8.html).
--------------------------------------------------------------------------------
/needs-work/spring-music-taylors-version/src/main/java/org/cloudfoundry/samples/music/repositories/jpa/JpaAlbumRepository.java:
--------------------------------------------------------------------------------
1 | package org.cloudfoundry.samples.music.repositories.jpa;
2 |
3 | import org.cloudfoundry.samples.music.domain.Album;
4 | import org.springframework.context.annotation.Profile;
5 | import org.springframework.data.jpa.repository.JpaRepository;
6 | import org.springframework.stereotype.Repository;
7 |
8 | @Repository
9 | @Profile({"!mongodb", "!redis"})
10 | public interface JpaAlbumRepository extends JpaRepository {
11 | }
12 |
--------------------------------------------------------------------------------
/needs-work/spring-music-taylors-version/src/main/java/org/cloudfoundry/samples/music/repositories/mongodb/MongoAlbumRepository.java:
--------------------------------------------------------------------------------
1 | package org.cloudfoundry.samples.music.repositories.mongodb;
2 |
3 | import org.cloudfoundry.samples.music.domain.Album;
4 | import org.springframework.context.annotation.Profile;
5 | import org.springframework.data.mongodb.repository.MongoRepository;
6 | import org.springframework.stereotype.Repository;
7 |
8 | @Repository
9 | @Profile("mongodb")
10 | public interface MongoAlbumRepository extends MongoRepository {
11 | }
--------------------------------------------------------------------------------
/spring-metal/conf/traits/spring-cloud-gateway.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: spaces.tanzu.vmware.com/v1alpha1
3 | kind: Trait
4 | metadata:
5 | name: spring-cloud-gateway-trait
6 | spec:
7 | description: Provides configurations for a Spring Cloud Gateway to provide a simple and effective route to APIs.Platform Engineers can standardize the gateway setup.
8 | carvelPackages:
9 | - alias: spring-cloud-gateway-installer.tanzu.vmware.com
10 | refName: spring-cloud-gateway-installer.tanzu.vmware.com
11 | versionSelection:
12 | constraints: 1.0.0
13 |
--------------------------------------------------------------------------------
/spring-metal/conf/tanzu-changeme/genai-external-service.yml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | data:
3 | uri: CHANGE_ME
4 | api-key: CHANGE_ME
5 | provider: b3BlbmFp # openai
6 | type: b3BlbmFp # openai
7 | kind: Secret
8 | metadata:
9 | name: genai-creds
10 | type: servicebinding.io/ai
11 |
12 | ---
13 | apiVersion: services.tanzu.vmware.com/v1
14 | kind: PreProvisionedService
15 | metadata:
16 | name: genai
17 | spec:
18 | bindingConnectors:
19 | - name: main
20 | description: Gen AI credentials
21 | type: openai
22 | secretRef:
23 | name: genai-creds
24 |
--------------------------------------------------------------------------------
/spring-metal/runtime-configs/tpk8s/traits/spring-cloud-gateway.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: spaces.tanzu.vmware.com/v1alpha1
3 | kind: Trait
4 | metadata:
5 | name: spring-cloud-gateway-trait
6 | spec:
7 | description: Provides configurations for a Spring Cloud Gateway to provide a simple and effective route to APIs.Platform Engineers can standardize the gateway setup.
8 | carvelPackages:
9 | - alias: spring-cloud-gateway-installer.tanzu.vmware.com
10 | refName: spring-cloud-gateway-installer.tanzu.vmware.com
11 | versionSelection:
12 | constraints: 1.0.0
13 |
--------------------------------------------------------------------------------
/spring-metal/src/main/java/org/cloudfoundry/samples/music/domain/MessageRequest.java:
--------------------------------------------------------------------------------
1 | package org.cloudfoundry.samples.music.domain;
2 |
3 | public class MessageRequest {
4 | private Message[] messages;
5 |
6 | public MessageRequest() {
7 |
8 | }
9 |
10 | public MessageRequest(Message[] messages) {
11 | this.messages = messages;
12 | }
13 |
14 | public Message[] getMessages() {
15 | return this.messages;
16 | }
17 |
18 | public void setMessages(Message[] messages) {
19 | this.messages = messages;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/spring-metal/src/main/resources/prompts/system-qa.st:
--------------------------------------------------------------------------------
1 | You're assisting with questions about music albums and artists.
2 | Use the information from the DOCUMENTS section to provide accurate answers.
3 | The the answer involves referring to the artist, title, genre or release year of the album, include the album name in the response.
4 | In addition for each album write a short paragraph, describing the album, critical receptions, Influence and legacy and Track listing.
5 | List the documents used in the response.
6 | If unsure, simply state that you don't know.
7 |
8 | DOCUMENTS:
9 | {documents}
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/adminguide/user-accounts-index.md:
--------------------------------------------------------------------------------
1 | # User accounts and communications in Cloud Foundry
2 | These topics are your source for learning about managing user accounts and user communications in Cloud Foundry:
3 |
4 | * [Creating and managing users with the cf CLI](https://docs.cloudfoundry.org/adminguide/cli-user-management.html).
5 |
6 | * [Creating and managing users with the UAA CLI (UAAC)](https://docs.cloudfoundry.org/uaa/uaa-user-management.html).
7 |
8 | * [Get started with the notifications service](https://docs.cloudfoundry.org/adminguide/notifications.html).
--------------------------------------------------------------------------------
/spring-metal/runtime-configs/tpk8s/platform-config.yml:
--------------------------------------------------------------------------------
1 | apiVersion: build.tanzu.vmware.com/v1
2 | kind: ContainerAppBuildPlan
3 | metadata:
4 | name: platform-config
5 | spec:
6 | buildpacks:
7 | builder: "paketobuildpacks/builder-jammy-base"
8 | postBuildSteps:
9 | - name: apply-spring-boot-conventions
10 | namedTask: tanzu-spring-boot
11 | runtimes:
12 | - name: kubernetes-carvel-package
13 | description: create a carvel package for deploying on kubernetes
14 | steps:
15 | - namedtask: tanzu-kubernetes-deployment
16 | - namedtask: tanzu-kubernetes-carvel-package
--------------------------------------------------------------------------------
/open-webui-cf/.profile:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function parse_vcap_services () {
4 | if [[ -z "$VCAP_SERVICES" ]]; then
5 | return 0
6 | fi
7 | export OPENAI_API_BASE_URLS=$( echo "$VCAP_SERVICES" | jq -r '.genai[] | .credentials.endpoint.api_base + "/openai"')
8 | export OPENAI_API_KEYS=$( echo "$VCAP_SERVICES" | jq -r '.genai[] | .credentials.endpoint.api_key')
9 | export ENABLE_OLLAMA_API=false
10 | }
11 |
12 | function load_platform_certs () {
13 | export REQUESTS_CA_BUNDLE="/etc/ssl/certs/ca-certificates.crt"
14 | }
15 |
16 | parse_vcap_services
17 | load_platform_certs
--------------------------------------------------------------------------------
/spring-metal/conf/traits/observability-trait.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: spaces.tanzu.vmware.com/v1alpha1
2 | kind: Trait
3 | metadata:
4 | name: observability
5 | spec:
6 | description: Provides observability data related to space and its related components.
7 | carvelPackages:
8 | - alias: observability-traits.tanzu.vmware.com
9 | refName: observability-traits.tanzu.vmware.com
10 | versionSelection:
11 | constraints: 1.0.1 #For Beta 2, current version is 1.0.1 , Ensure to keep it updated.
12 | values:
13 | inline:
14 | enabled:
15 | true
16 |
--------------------------------------------------------------------------------
/spring-metal/src/main/resources/static/js/app.js:
--------------------------------------------------------------------------------
1 | angular.module('SpringMusic', ['albums', 'errors', 'status', 'info', 'ngRoute', 'ui.directives']).
2 | config(function ($locationProvider, $routeProvider) {
3 | // $locationProvider.html5Mode(true);
4 |
5 | $routeProvider.when('/errors', {
6 | controller: 'ErrorsController',
7 | templateUrl: 'templates/errors.html'
8 | });
9 | $routeProvider.otherwise({
10 | controller: 'AlbumsController',
11 | templateUrl: 'templates/albums.html'
12 | });
13 | }
14 | );
15 |
--------------------------------------------------------------------------------
/needs-work/vectorsage/RAGAPI/Common/OpenAIProviders/OpenAIProvider.py:
--------------------------------------------------------------------------------
1 | import httpx
2 | from openai import OpenAI
3 |
4 | class OpenAIProvider:
5 | oai_client: OpenAI
6 |
7 | def __init__(self,
8 | api_base: str,
9 | api_key: str,
10 | http_client: httpx.Client
11 | ):
12 |
13 | self.oai_client = OpenAI( base_url=api_base,
14 | api_key=api_key,
15 | http_client=http_client
16 | )
17 |
18 |
19 |
--------------------------------------------------------------------------------
/needs-work/spring-music-taylors-version/src/main/resources/prompts/system-qa.st:
--------------------------------------------------------------------------------
1 | You're assisting with questions about music albums and artists.
2 | Use the information from the DOCUMENTS section to provide accurate answers.
3 | The the answer involves referring to the artist, title, genre or release year of the album, include the album name in the response.
4 | In addition for each album write a short paragraph, describing the album, critical receptions, Influence and legacy and Track listing.
5 | List the documents used in the response.
6 | If unsure, simply state that you don't know.
7 |
8 | DOCUMENTS:
9 | {documents}
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/services/play-service-bindings.md:
--------------------------------------------------------------------------------
1 | # Configuring Play Framework service connections
2 | Cloud Foundry provides support for connecting a Play Framework app to services such as MySQL and PostgreSQL. In many cases, a Play Framework app running on Cloud Foundry can detect and configure connections to services.
3 | By default, Cloud Foundry detects service connections in a Play Framework app and configures them to use the credentials provided in the Cloud Foundry environment. Auto-configuration only happens if it’s a single service for one of the supported types, MySQL or PostgreSQL.
--------------------------------------------------------------------------------
/needs-work/spring-music-taylors-version/src/main/java/org/cloudfoundry/samples/music/domain/MessageRequest.java:
--------------------------------------------------------------------------------
1 | package org.cloudfoundry.samples.music.domain;
2 |
3 | public class MessageRequest {
4 | private Message[] messages;
5 |
6 | public MessageRequest() {
7 |
8 | }
9 |
10 | public MessageRequest(Message[] messages) {
11 | this.messages = messages;
12 | }
13 |
14 | public Message[] getMessages() {
15 | return this.messages;
16 | }
17 |
18 | public void setMessages(Message[] messages) {
19 | this.messages = messages;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/spring-metal/runtime-configs/tpk8s/traits/observability-trait.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: spaces.tanzu.vmware.com/v1alpha1
2 | kind: Trait
3 | metadata:
4 | name: observability
5 | spec:
6 | description: Provides observability data related to space and its related components.
7 | carvelPackages:
8 | - alias: observability-traits.tanzu.vmware.com
9 | refName: observability-traits.tanzu.vmware.com
10 | versionSelection:
11 | constraints: 1.0.1 #For Beta 2, current version is 1.0.1 , Ensure to keep it updated.
12 | values:
13 | inline:
14 | enabled:
15 | true
16 |
--------------------------------------------------------------------------------
/needs-work/spring-music-taylors-version/src/main/resources/static/js/app.js:
--------------------------------------------------------------------------------
1 | angular.module('SpringMusic', ['albums', 'errors', 'status', 'info', 'ngRoute', 'ui.directives']).
2 | config(function ($locationProvider, $routeProvider) {
3 | // $locationProvider.html5Mode(true);
4 |
5 | $routeProvider.when('/errors', {
6 | controller: 'ErrorsController',
7 | templateUrl: 'templates/errors.html'
8 | });
9 | $routeProvider.otherwise({
10 | controller: 'AlbumsController',
11 | templateUrl: 'templates/albums.html'
12 | });
13 | }
14 | );
15 |
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/getting-started-deploying-apps/index.md:
--------------------------------------------------------------------------------
1 | # Deploying Java Apps to Cloud Foundry
2 | Here are some links to additional information about deploying your apps using the Java buildpack.
3 | See the following topics for deployment guides specific to your app framework:
4 |
5 | * [Grails](https://docs.cloudfoundry.org/buildpacks/java/getting-started-deploying-apps/gsg-grails.html)
6 |
7 | * [Ratpack](https://docs.cloudfoundry.org/buildpacks/java/getting-started-deploying-apps/gsg-ratpack.html)
8 |
9 | * [Spring](https://docs.cloudfoundry.org/buildpacks/java/getting-started-deploying-apps/gsg-spring.html)
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/buildpacks/supported-binary-dependencies.md:
--------------------------------------------------------------------------------
1 | # Supported binary dependencies in Cloud Foundry buildpacks
2 | Each buildpack supports only the stable patches for each dependency listed in
3 | the buildpack’s `manifest.yml`file and also in the GitHub releases page.
4 | For example, see the [php-buildpack releases page](https://github.com/cloudfoundry/php-buildpack/releases).
5 | If you try to use an unsupported binary, staging your app fails with the following error message:
6 | ```
7 | Could not get translated url, exited with: DEPENDENCY_MISSING_IN_MANIFEST:
8 | ...
9 | !
10 | ! exit
11 | !
12 | Staging failed: Buildpack compilation step failed
13 | ```
--------------------------------------------------------------------------------
/spring-metal/conf/traits/mtls-trait.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: spaces.tanzu.vmware.com/v1alpha1
2 | kind: Trait
3 | metadata:
4 | name: mtls.tanzu.vmware.com
5 | spec:
6 | description: MTLS ensure data protection (security, encryption, Compliance) to in-flight traffic within a cluster as part of space.
7 | carvelPackages:
8 | - alias: mtls.tanzu.vmware.com
9 | refName: mtls.tanzu.vmware.com
10 | versionSelection:
11 | constraints: 2.0.1 #For Beta 2, the version of the mtls.tanzu.vmware.com package is 2.0.1. Ensure to keep the version updated.
12 | values:
13 | inline:
14 | mtlsEnabled: false #false -> PERMISSIVE, true -> STRICT. default is false
15 |
--------------------------------------------------------------------------------
/spring-metal/runtime-configs/tpk8s/traits/mtls-trait.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: spaces.tanzu.vmware.com/v1alpha1
2 | kind: Trait
3 | metadata:
4 | name: mtls.tanzu.vmware.com
5 | spec:
6 | description: MTLS ensure data protection (security, encryption, Compliance) to in-flight traffic within a cluster as part of space.
7 | carvelPackages:
8 | - alias: mtls.tanzu.vmware.com
9 | refName: mtls.tanzu.vmware.com
10 | versionSelection:
11 | constraints: 2.0.1 #For Beta 2, the version of the mtls.tanzu.vmware.com package is 2.0.1. Ensure to keep the version updated.
12 | values:
13 | inline:
14 | mtlsEnabled: false #false -> PERMISSIVE, true -> STRICT. default is false
15 |
--------------------------------------------------------------------------------
/spring-metal/src/main/java/org/springframework/ai/bindings/BindingsValidator.java:
--------------------------------------------------------------------------------
1 | package org.springframework.ai.bindings;
2 |
3 | import org.springframework.core.env.Environment;
4 |
5 | /**
6 | * From https://github.com/spring-cloud/spring-cloud-bindings to switch on/off the
7 | * bindings.
8 | */
9 | final class BindingsValidator {
10 |
11 | static final String CONFIG_PATH = "spring.ai.cloud.bindings";
12 |
13 | /**
14 | * Whether the given binding type should be used to contribute properties.
15 | */
16 | static boolean isTypeEnabled(Environment environment, String type) {
17 | return environment.getProperty("%s.%s.enabled".formatted(CONFIG_PATH, type), Boolean.class, true);
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/php/gsg-php-tips.md:
--------------------------------------------------------------------------------
1 | # PHP buildpacks in Cloud Foundry
2 | For information about using and extending the PHP buildpack in Cloud Foundry,
3 | see the [php-buildpack GitHub repository](https://github.com/cloudfoundry/php-buildpack).
4 | You can find current information about this buildpack on the PHP buildpack
5 | [release page](https://github.com/cloudfoundry/php-buildpack/releases) in
6 | GitHub.
7 | The buildpack uses a default PHP version specified in [.defaults/options.json](https://github.com/cloudfoundry/php-buildpack/blob/master/defaults/options.json) under the `PHP_VERSION` key.
8 | To change the default version, specify the `PHP_VERSION` key in your app’s
9 | `.bp-config/options.json` file.
--------------------------------------------------------------------------------
/spring-metal/conf/tanzu-changeme/httproute.yml:
--------------------------------------------------------------------------------
1 | apiVersion: gateway.networking.k8s.io/v1beta1
2 | kind: HTTPRoute
3 | metadata:
4 | name: CHANGE_ME
5 | annotations:
6 | healthcheck.gslb.tanzu.vmware.com/service: CHANGE_ME
7 | healthcheck.gslb.tanzu.vmware.com/path: /
8 | healthcheck.gslb.tanzu.vmware.com/port: "8080"
9 | spec:
10 | parentRefs:
11 | - group: gateway.networking.k8s.io
12 | kind: Gateway
13 | name: default-gateway
14 | sectionName: http-CHANGE_ME
15 | rules:
16 | - backendRefs:
17 | - group: ""
18 | kind: Service
19 | name: CHANGE_ME
20 | port: 8080
21 | weight: 1
22 | matches:
23 | - path:
24 | type: PathPrefix
25 | value: /
26 |
--------------------------------------------------------------------------------
/spring-metal/conf/tanzu-changeme/postgres-external-service.yml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | data:
3 | database: CHANGE_ME
4 | host: CHANGE_ME
5 | password: CHANGE_ME
6 | port: CHANGE_ME
7 | provider: dGFzcG9zdGdyZXNxbA== # tas
8 | type: cG9zdGdyZXNxbAo= # postgresql
9 | username: cGdhZG1pbg== # pgadmin
10 | kind: Secret
11 | metadata:
12 | name: pgvector-creds
13 | type: servicebinding.io/postgresql
14 |
15 | ---
16 | apiVersion: services.tanzu.vmware.com/v1
17 | kind: PreProvisionedService
18 | metadata:
19 | name: pgvector
20 | spec:
21 | bindingConnectors:
22 | - name: main
23 | description: Posgres pgvector service for AI use cases
24 | type: postgresql
25 | secretRef:
26 | name: pgvector-creds
--------------------------------------------------------------------------------
/spring-metal/src/main/java/org/cloudfoundry/samples/music/domain/RandomIdGenerator.java:
--------------------------------------------------------------------------------
1 | package org.cloudfoundry.samples.music.domain;
2 |
3 | import org.hibernate.HibernateException;
4 | import org.hibernate.engine.spi.SharedSessionContractImplementor;
5 | import org.hibernate.id.IdentifierGenerator;
6 |
7 | import java.io.Serializable;
8 | import java.util.UUID;
9 |
10 | public class RandomIdGenerator implements IdentifierGenerator {
11 | @Override
12 | public Serializable generate(SharedSessionContractImplementor session, Object object) throws HibernateException {
13 | return generateId();
14 | }
15 |
16 | public String generateId() {
17 | return UUID.randomUUID().toString();
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/spring-metal/runtime-configs/tpk8s/tanzu-changeme/httproute.yml:
--------------------------------------------------------------------------------
1 | apiVersion: gateway.networking.k8s.io/v1beta1
2 | kind: HTTPRoute
3 | metadata:
4 | name: CHANGE_ME
5 | annotations:
6 | healthcheck.gslb.tanzu.vmware.com/service: CHANGE_ME
7 | healthcheck.gslb.tanzu.vmware.com/path: /
8 | healthcheck.gslb.tanzu.vmware.com/port: "8080"
9 | spec:
10 | parentRefs:
11 | - group: gateway.networking.k8s.io
12 | kind: Gateway
13 | name: default-gateway
14 | sectionName: http-CHANGE_ME
15 | rules:
16 | - backendRefs:
17 | - group: ""
18 | kind: Service
19 | name: CHANGE_ME
20 | port: 8080
21 | weight: 1
22 | matches:
23 | - path:
24 | type: PathPrefix
25 | value: /
--------------------------------------------------------------------------------
/spring-metal/conf/traits/selfsigned-certificate-trait.yaml:
--------------------------------------------------------------------------------
1 | #! For beta-2 only self-signed certificate issuer is supported.
2 | apiVersion: spaces.tanzu.vmware.com/v1alpha1
3 | kind: Trait
4 | metadata:
5 | name: selfsigned-certificate-issuer
6 | spec:
7 | description: Configures certificates and certificate issuers to facilitate data encryption and authentication for space services.
8 | carvelPackages:
9 | - alias: multicloud-cert-manager.tanzu.vmware.com
10 | refName: multicloud-cert-manager.tanzu.vmware.com
11 | versionSelection:
12 | constraints: 2.0.0-build.1 #For Beta 2, the version of the multicloud-cert-manager.tanzu.vmware.com is 2.0.0-build.1. Ensure to keep the version updated
13 | values:
14 | inline:
15 |
--------------------------------------------------------------------------------
/needs-work/spring-music-taylors-version/src/main/java/org/cloudfoundry/samples/music/domain/RandomIdGenerator.java:
--------------------------------------------------------------------------------
1 | package org.cloudfoundry.samples.music.domain;
2 |
3 | import org.hibernate.HibernateException;
4 | import org.hibernate.engine.spi.SharedSessionContractImplementor;
5 | import org.hibernate.id.IdentifierGenerator;
6 |
7 | import java.io.Serializable;
8 | import java.util.UUID;
9 |
10 | public class RandomIdGenerator implements IdentifierGenerator {
11 | @Override
12 | public Serializable generate(SharedSessionContractImplementor session, Object object) throws HibernateException {
13 | return generateId();
14 | }
15 |
16 | public String generateId() {
17 | return UUID.randomUUID().toString();
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/devguide/streaming-logs-index.md:
--------------------------------------------------------------------------------
1 | # Streaming App Logs
2 | These topics contain information about streaming app logs:
3 |
4 | * [Streaming app logs to log management services](https://docs.cloudfoundry.org/devguide/services/log-management.html)
5 |
6 | * [Streaming app logs to third-party services](https://docs.cloudfoundry.org/devguide/services/log-management-thirdparty-svc.html)
7 |
8 | * [Streaming app logs to Splunk](https://docs.cloudfoundry.org/devguide/services/integrate-splunk.html)
9 |
10 | * [Streaming app logs with Fluentd](https://docs.cloudfoundry.org/devguide/services/fluentd.html)
11 |
12 | * [Streaming app logs to Azure OMS Log Analytics](https://docs.cloudfoundry.org/devguide/services/oms-nozzle.html)
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/concepts/security-index.md:
--------------------------------------------------------------------------------
1 | # Security and networking
2 | The following topics provide information about security and networking:
3 |
4 | * [Cloud Foundry Security](https://docs.cloudfoundry.org/concepts/security.html).
5 |
6 | * [Container Security](https://docs.cloudfoundry.org/concepts/container-security.html).
7 |
8 | * [Container-to-Container Networking](https://docs.cloudfoundry.org/concepts/understand-cf-networking.html).
9 |
10 | * [Orgs, Spaces, Roles, and Permissions](https://docs.cloudfoundry.org/concepts/roles.html).
11 |
12 | * [App Security Groups](https://docs.cloudfoundry.org/concepts/asg.html).
13 |
14 | * [App SSH Components and Processes](https://docs.cloudfoundry.org/concepts/diego/ssh-conceptual.html).
--------------------------------------------------------------------------------
/spring-metal/runtime-configs/tpk8s/traits/selfsigned-certificate-trait.yaml:
--------------------------------------------------------------------------------
1 | #! For beta-2 only self-signed certificate issuer is supported.
2 | apiVersion: spaces.tanzu.vmware.com/v1alpha1
3 | kind: Trait
4 | metadata:
5 | name: selfsigned-certificate-issuer
6 | spec:
7 | description: Configures certificates and certificate issuers to facilitate data encryption and authentication for space services.
8 | carvelPackages:
9 | - alias: multicloud-cert-manager.tanzu.vmware.com
10 | refName: multicloud-cert-manager.tanzu.vmware.com
11 | versionSelection:
12 | constraints: 2.0.0-build.1 #For Beta 2, the version of the multicloud-cert-manager.tanzu.vmware.com is 2.0.0-build.1. Ensure to keep the version updated
13 | values:
14 | inline:
15 |
--------------------------------------------------------------------------------
/spring-metal/runtime-configs/tpk8s/tanzu-changeme/postgres-external-service.yml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | data:
3 | database: cG9zdGdyZXM= # postgres
4 | host: PGVECTOR_HOST
5 | username: PGVECTOR_USERNAME
6 | password: PGVECTOR_PASSWORD
7 | port: PGVECTOR_PORT
8 | provider: dGFzcG9zdGdyZXNxbA== # tas
9 | type: cG9zdGdyZXNxbAo= # postgresql
10 | kind: Secret
11 | metadata:
12 | name: pgvector-creds
13 | type: servicebinding.io/postgresql
14 |
15 | ---
16 | apiVersion: services.tanzu.vmware.com/v1
17 | kind: PreProvisionedService
18 | metadata:
19 | name: pgvector
20 | spec:
21 | bindingConnectors:
22 | - name: main
23 | description: Posgres pgvector service for AI use cases
24 | type: postgresql
25 | secretRef:
26 | name: pgvector-creds
27 |
--------------------------------------------------------------------------------
/spring-metal/src/main/java/org/cloudfoundry/samples/music/Application.java:
--------------------------------------------------------------------------------
1 | package org.cloudfoundry.samples.music;
2 |
3 | import org.cloudfoundry.samples.music.config.SpringApplicationContextInitializer;
4 | import org.cloudfoundry.samples.music.repositories.AlbumRepositoryPopulator;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.boot.builder.SpringApplicationBuilder;
7 |
8 | @SpringBootApplication
9 | public class Application {
10 |
11 | public static void main(String[] args) {
12 | new SpringApplicationBuilder(Application.class)
13 | .initializers(new SpringApplicationContextInitializer())
14 | .listeners(new AlbumRepositoryPopulator())
15 | .application()
16 | .run(args);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/buildpacks/buildpack-ci-index.md:
--------------------------------------------------------------------------------
1 | # Using CI for buildpacks
2 | The Cloud Foundry (CF) Buildpacks team and other CF buildpack development teams use [Concourse continuous integration (Concourse CI)](http://concourse-ci.org) pipelines to integrate new buildpack releases. This topic provides links to information that describes how to release new versions of Cloud Foundry buildpacks using Concourse CI, and how to update Ruby gems used for CF buildpack development.
3 | Each of the following topics are applicable to all supported buildpack languages and frameworks:
4 |
5 | * [Releasing a New Buildpack Version](https://docs.cloudfoundry.org/buildpacks/releasing_a_new_buildpack_version.html)
6 |
7 | * [Updating Buildpack-Related Gems](https://docs.cloudfoundry.org/buildpacks/updating-buildpack-related-gems.html)
--------------------------------------------------------------------------------
/needs-work/spring-music-taylors-version/src/main/java/org/cloudfoundry/samples/music/Application.java:
--------------------------------------------------------------------------------
1 | package org.cloudfoundry.samples.music;
2 |
3 | import org.cloudfoundry.samples.music.config.SpringApplicationContextInitializer;
4 | import org.cloudfoundry.samples.music.repositories.AlbumRepositoryPopulator;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.boot.builder.SpringApplicationBuilder;
7 |
8 | @SpringBootApplication
9 | public class Application {
10 |
11 | public static void main(String[] args) {
12 | new SpringApplicationBuilder(Application.class)
13 | .initializers(new SpringApplicationContextInitializer())
14 | .listeners(new AlbumRepositoryPopulator())
15 | .application()
16 | .run(args);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/needs-work/vectorsage/create-knowledge-base.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Usage: create_knowledge_base.sh CHUNKER_ROUTE TOPIC_DISPLAY_NAME EMBEDDING_VECTOR_SIZE TOPIC_DOMAIN
3 |
4 | set -e # Exit on error
5 |
6 | CHUNKER_ROUTE="${1}"
7 | TOPIC_DISPLAY_NAME="${2}"
8 | EMBEDDING_VECTOR_SIZE="${3:-768}"
9 | TOPIC_DOMAIN="${4}"
10 |
11 | if [[ -z "$CHUNKER_ROUTE" || -z "$TOPIC_DISPLAY_NAME" || -z "$EMBEDDING_VECTOR_SIZE" || -z "$TOPIC_DOMAIN" ]]; then
12 | echo "Usage: $0 "
13 | exit 1
14 | fi
15 |
16 | echo "Creating knowledge base on ${CHUNKER_ROUTE}..."
17 | curl -X POST "https://${CHUNKER_ROUTE}/create_knowledge_base" \
18 | -d "topic_display_name=${TOPIC_DISPLAY_NAME}&vector_size=${EMBEDDING_VECTOR_SIZE}&topic_domain=${TOPIC_DOMAIN}"
19 |
20 | echo "Knowledge base created successfully."
21 |
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/adminguide/platform-index.md:
--------------------------------------------------------------------------------
1 | # Managing the runtime in Cloud Foundry
2 | These topics are your source for information about managing Cloud Foundry:
3 |
4 | * [Stopping and starting virtual machines](https://docs.cloudfoundry.org/adminguide/start-stop-vms.html).
5 |
6 | * [Creating and modifying quota plans](https://docs.cloudfoundry.org/adminguide/quota-plans.html).
7 |
8 | * [Using feature flags](https://docs.cloudfoundry.org/adminguide/listing-feature-flags.html).
9 |
10 | * [Examining GrootFS disk usage](https://docs.cloudfoundry.org/adminguide/examining_grootfs_disk.html).
11 |
12 | * [Using metadata](https://docs.cloudfoundry.org/adminguide/metadata.html).
13 |
14 | * [Managing custom buildpacks](https://docs.cloudfoundry.org/adminguide/buildpacks.html).
15 |
16 | * [Using Docker in Cloud Foundry](https://docs.cloudfoundry.org/adminguide/docker.html).
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/adminguide/index.md:
--------------------------------------------------------------------------------
1 | # Administering Cloud Foundry
2 | These topics are your source for learning to administer Cloud Foundry, including managing the runtime, creating user accounts, modifying quota plans, and managing isolation segments.
3 | See the following topics:
4 |
5 | * [Managing the Runtime](https://docs.cloudfoundry.org/adminguide/platform-index.html).
6 |
7 | * [User Accounts and Communications](https://docs.cloudfoundry.org/adminguide/user-accounts-index.html).
8 |
9 | * [Routing](https://docs.cloudfoundry.org/adminguide/routing-index.html).
10 |
11 | * [Isolation Segments](https://docs.cloudfoundry.org/adminguide/isolation-segment-index.html).
12 |
13 | * [Delayed Jobs](https://docs.cloudfoundry.org/adminguide/delayed-jobs-index.html).
14 |
15 | * [Managing Apps and Their Stacks](https://docs.cloudfoundry.org/adminguide/managing-apps-stacks-index.html).
--------------------------------------------------------------------------------
/spring-metal/src/main/resources/static/templates/errors.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Force Errors
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/buildpacks/using-buildpacks.md:
--------------------------------------------------------------------------------
1 | # Using buildpacks in Cloud Foundry
2 | This section provides links to additional information about using buildpacks. Each of the following
3 | topics are applicable to all supported buildpack languages and frameworks:
4 |
5 | * [Working with buildpacks in Cloud Foundry](https://docs.cloudfoundry.org/buildpacks/understand-buildpacks.html).
6 |
7 | * [Stack association](https://docs.cloudfoundry.org/buildpacks/stack-association.html).
8 |
9 | * [Pushing an app with multiple buildpacks](https://docs.cloudfoundry.org/buildpacks/use-multiple-buildpacks.html).
10 |
11 | * [Using a proxy](https://docs.cloudfoundry.org/buildpacks/proxy-usage.html).
12 |
13 | * [Supported binary dependencies](https://docs.cloudfoundry.org/buildpacks/supported-binary-dependencies.html).
14 |
15 | * [Configuring the production server](https://docs.cloudfoundry.org/buildpacks/prod-server.html).
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/bbr/logging.md:
--------------------------------------------------------------------------------
1 | # BBR logging
2 | This topic provides information about BBR logging. Use this information when troubleshooting a failed backup or restore using BBR.
3 | By default, BBR displays:
4 |
5 | * The backup and restore scripts that it finds
6 |
7 | * When it starts or finishes a stage, such as `pre-backup scripts` or `backup scripts`
8 |
9 | * When the process is complete
10 |
11 | * When any error occurs
12 | BBR writes any errors associated with stack traces to a file in the form of `bbr-TIMESTAMP.err.log` in the current directory.
13 | If more logging is needed, use the optional `--debug` flag to print the following information:
14 |
15 | * Logs about the API requests made to the BOSH server
16 |
17 | * All commands executed on remote instances
18 |
19 | * All commands executed on local environment
20 |
21 | * stdout and stderr streams for the backup and restore scripts when they are executed
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/node/node-environment.md:
--------------------------------------------------------------------------------
1 | # Environment variables in Node buildpack
2 | Cloud Foundry provides configuration information to apps through environment variables.
3 | You can also use the additional environment variables provided by the Node buildpack.
4 | For more information about the standard environment variables provided, see [Cloud Foundry Environment Variables](https://docs.cloudfoundry.org/devguide/deploy-apps/environment-variable.html).
5 |
6 | ## Node buildpack environment Variables
7 | The following table describes the environment variables provided by the Node buildpack:
8 | | Environment Variable | Description |
9 | | --- | --- |
10 | | `BUILD_DIR` | The directory where Node.js is copied each time a Node.js app runs. |
11 | | `CACHE_DIR` | The directory Node.js uses for caching. |
12 | | `PATH` | The system path used by Node.js:`PATH=/home/vcap/app/bin:/home/vcap/app/node_modules/.bin:/bin:/usr/bin` |
--------------------------------------------------------------------------------
/needs-work/spring-music-taylors-version/src/main/resources/static/templates/errors.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Force Errors
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/spring-metal/src/main/resources/static/css/app.css:
--------------------------------------------------------------------------------
1 | #body {
2 | padding-top: 10px;
3 | }
4 |
5 | .navbar {
6 | background-color: white;
7 | border: 0;
8 | margin-bottom: 20px;
9 | }
10 |
11 | .navbar .container {
12 | background-color: green;
13 | }
14 |
15 | .navbar .navbar-brand {
16 | color: white;
17 | padding: 10px 15px;
18 | font-size: 25px;
19 | }
20 |
21 | .nav .instance-num {
22 | color: white;
23 | padding: 10px 15px;
24 | font-size: 25px;
25 | }
26 |
27 | .navbar .navbar-brand:hover {
28 | color: white;
29 | }
30 |
31 | .btn {
32 | background-color: white;
33 | }
34 |
35 | .icon-white {
36 | color: white;
37 | }
38 |
39 | .page-header {
40 | font-size: 20px;
41 | }
42 |
43 | h1 {
44 | font-size: 20px;
45 | }
46 |
47 | a {
48 | color: black;;
49 | }
50 |
51 | .alert-success {
52 | background-color: white;
53 | color: black;
54 | border-color: black;
55 | }
56 |
57 |
--------------------------------------------------------------------------------
/spring-metal/runtime-configs/tpk8s/tanzu-changeme/genai-service-binding.yml:
--------------------------------------------------------------------------------
1 | apiVersion: services.tanzu.vmware.com/v1
2 | kind: ServiceBinding
3 | metadata:
4 | name: genai-chat-CHANGE_ME
5 | namespace: default
6 | spec:
7 | alias: ai-chat
8 | serviceRef:
9 | apiGroup: services.tanzu.vmware.com
10 | connectorName: main
11 | kind: PreProvisionedService
12 | name: genai-chat
13 | targetRef:
14 | apiGroup: apps.tanzu.vmware.com
15 | kind: ContainerApp
16 | name: CHANGE_ME
17 |
18 | ---
19 | apiVersion: services.tanzu.vmware.com/v1
20 | kind: ServiceBinding
21 | metadata:
22 | name: genai-embed-CHANGE_ME
23 | namespace: default
24 | spec:
25 | alias: ai-embed
26 | serviceRef:
27 | apiGroup: services.tanzu.vmware.com
28 | connectorName: main
29 | kind: PreProvisionedService
30 | name: genai-embed
31 | targetRef:
32 | apiGroup: apps.tanzu.vmware.com
33 | kind: ContainerApp
34 | name: CHANGE_ME
35 |
--------------------------------------------------------------------------------
/needs-work/spring-music-taylors-version/src/main/resources/static/css/app.css:
--------------------------------------------------------------------------------
1 | #body {
2 | padding-top: 10px;
3 | }
4 |
5 | .navbar {
6 | background-color: white;
7 | border: 0;
8 | margin-bottom: 20px;
9 | }
10 |
11 | .navbar .container {
12 | background-color: #FF8FAB;
13 | }
14 |
15 | .navbar .navbar-brand {
16 | color: white;
17 | padding: 10px 15px;
18 | font-size: 25px;
19 | }
20 |
21 | .nav .instance-num {
22 | color: white;
23 | padding: 10px 15px;
24 | font-size: 25px;
25 | }
26 |
27 | .navbar .navbar-brand:hover {
28 | color: white;
29 | }
30 |
31 | .btn {
32 | background-color: white;
33 | }
34 |
35 | .icon-white {
36 | color: white;
37 | }
38 |
39 | .page-header {
40 | font-size: 20px;
41 | }
42 |
43 | h1 {
44 | font-size: 20px;
45 | }
46 |
47 | a {
48 | color: #FB6F92;
49 | }
50 |
51 | .alert-success {
52 | background-color: #FFEBF0;
53 | color: #FB6F92;
54 | border-color: #FB6F92;
55 | }
56 |
57 |
--------------------------------------------------------------------------------
/spring-metal/src/main/resources/static/js/status.js:
--------------------------------------------------------------------------------
1 | angular.module('status', []).
2 | factory("Status", function () {
3 | var status = null;
4 |
5 | var success = function (message) {
6 | this.status = { isError: false, message: message };
7 | };
8 |
9 | var error = function (message) {
10 | this.status = { isError: true, message: message };
11 | };
12 |
13 | var clear = function () {
14 | this.status = null;
15 | };
16 |
17 | return {
18 | status: status,
19 | success: success,
20 | error: error,
21 | clear: clear
22 | }
23 | });
24 |
25 | function StatusController($scope, Status) {
26 | $scope.$watch(
27 | function () {
28 | return Status.status;
29 | },
30 | function (status) {
31 | $scope.status = status;
32 | },
33 | true);
34 |
35 | $scope.clearStatus = function () {
36 | Status.clear();
37 | };
38 | }
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/adminguide/routing-index.md:
--------------------------------------------------------------------------------
1 | # Routing in Cloud Foundry
2 | These topics are your source for information about managing routes and domains in Cloud Foundry:
3 |
4 | * [Enabling IPv6 for hosted apps](https://docs.cloudfoundry.org/adminguide/enabling_ipv6.html)
5 |
6 | * [Enabling Zipkin tracing](https://docs.cloudfoundry.org/adminguide/zipkin_tracing.html)
7 |
8 | * [Enabling W3C tracing](https://docs.cloudfoundry.org/adminguide/w3c_tracing.html)
9 |
10 | * [Supporting WebSockets](https://docs.cloudfoundry.org/adminguide/supporting-websockets.html)
11 |
12 | * [Configuring load balancer healthchecks for Cloud Foundry](https://docs.cloudfoundry.org/adminguide/configure-lb-healthcheck.html).
13 |
14 | * [Securing traffic into Cloud Foundry](https://docs.cloudfoundry.org/adminguide/securing-traffic.html)
15 |
16 | * [Enabling and configuring TCP routing](https://docs.cloudfoundry.org/adminguide/enabling-tcp-routing.html)
17 |
18 | * [Configuring HTTP/2 support](https://docs.cloudfoundry.org/adminguide/supporting-http2.html)
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/devguide/services-index.md:
--------------------------------------------------------------------------------
1 | # Managing services
2 | These topics contain information about managing service instances:
3 |
4 | * [Services overview](https://docs.cloudfoundry.org/devguide/services/)
5 |
6 | * [Managing service instances](https://docs.cloudfoundry.org/devguide/services/managing-services.html)
7 |
8 | * [Sharing service instances](https://docs.cloudfoundry.org/devguide/services/sharing-instances.html)
9 |
10 | * [Delivering service credentials to an app](https://docs.cloudfoundry.org/devguide/services/application-binding.html)
11 |
12 | * [Managing service keys](https://docs.cloudfoundry.org/devguide/services/service-keys.html)
13 |
14 | * [Configuring Play Framework service connections](https://docs.cloudfoundry.org/devguide/services/play-service-bindings.html)
15 |
16 | * [Using an external file system (volume services)](https://docs.cloudfoundry.org/devguide/services/using-vol-services.html)
17 |
18 | * [User-provided service instances](https://docs.cloudfoundry.org/devguide/services/user-provided.html)
--------------------------------------------------------------------------------
/needs-work/spring-music-taylors-version/src/main/resources/static/js/status.js:
--------------------------------------------------------------------------------
1 | angular.module('status', []).
2 | factory("Status", function () {
3 | var status = null;
4 |
5 | var success = function (message) {
6 | this.status = { isError: false, message: message };
7 | };
8 |
9 | var error = function (message) {
10 | this.status = { isError: true, message: message };
11 | };
12 |
13 | var clear = function () {
14 | this.status = null;
15 | };
16 |
17 | return {
18 | status: status,
19 | success: success,
20 | error: error,
21 | clear: clear
22 | }
23 | });
24 |
25 | function StatusController($scope, Status) {
26 | $scope.$watch(
27 | function () {
28 | return Status.status;
29 | },
30 | function (status) {
31 | $scope.status = status;
32 | },
33 | true);
34 |
35 | $scope.clearStatus = function () {
36 | Status.clear();
37 | };
38 | }
--------------------------------------------------------------------------------
/spring-metal/src/main/java/org/cloudfoundry/samples/music/domain/ApplicationInfo.java:
--------------------------------------------------------------------------------
1 | package org.cloudfoundry.samples.music.domain;
2 |
3 | public class ApplicationInfo {
4 | private String[] profiles;
5 | private String[] services;
6 | private String instance;
7 |
8 | public ApplicationInfo(String[] profiles, String[] services, String instance) {
9 | this.profiles = profiles;
10 | this.services = services;
11 | this.instance = instance;
12 | }
13 |
14 | public String[] getProfiles() {
15 | return profiles;
16 | }
17 |
18 | public void setProfiles(String[] profiles) {
19 | this.profiles = profiles;
20 | }
21 |
22 | public String[] getServices() {
23 | return services;
24 | }
25 |
26 | public void setServices(String[] services) {
27 | this.services = services;
28 | }
29 |
30 | public String getInstance() {
31 | return instance;
32 | }
33 |
34 | public void setInstance(String instance) {
35 | this.instance = instance;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/needs-work/spring-music-taylors-version/src/main/java/org/cloudfoundry/samples/music/domain/ApplicationInfo.java:
--------------------------------------------------------------------------------
1 | package org.cloudfoundry.samples.music.domain;
2 |
3 | public class ApplicationInfo {
4 | private String[] profiles;
5 | private String[] services;
6 | private String instance;
7 |
8 | public ApplicationInfo(String[] profiles, String[] services, String instance) {
9 | this.profiles = profiles;
10 | this.services = services;
11 | this.instance = instance;
12 | }
13 |
14 | public String[] getProfiles() {
15 | return profiles;
16 | }
17 |
18 | public void setProfiles(String[] profiles) {
19 | this.profiles = profiles;
20 | }
21 |
22 | public String[] getServices() {
23 | return services;
24 | }
25 |
26 | public void setServices(String[] services) {
27 | this.services = services;
28 | }
29 |
30 | public String getInstance() {
31 | return instance;
32 | }
33 |
34 | public void setInstance(String instance) {
35 | this.instance = instance;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/static-model-hosting/README.md:
--------------------------------------------------------------------------------
1 |
2 | #run these commmands in your local diretory to download the GGUFs from HuggingFace
3 | #mix and match as you see fit
4 |
5 | #Please note to host the modle files directoy via a CF app - it must be under 5gb in size.
6 |
7 | #chat model runs on cpu-large worker
8 | wget https://huggingface.co/bartowski/gemma-2-2b-it-GGUF/resolve/main/gemma-2-2b-it-Q6_K_L.gguf
9 |
10 |
11 | #embedding model runs on cpu worker
12 | wget https://huggingface.co/nomic-ai/nomic-embed-text-v1.5-GGUF/resolve/main/nomic-embed-text-v1.5.f32.gguf
13 |
14 |
15 | #model url example chat for opsman
16 |
17 | #model name:
18 | gemma2:2b
19 |
20 | #model url:
21 | https://admin:admin@model-repo.apps.sdc.tpcf.tmm-labs.com/gemma-2-2b-it-Q6_K_L.gguf
22 |
23 | #shasum:
24 | b2ef9f67b38c6e246e593cdb9739e34043d84549755a1057d402563a78ff2254
25 |
26 |
27 |
28 | #model name:
29 | nomic-embed-text
30 |
31 | #model url:
32 | https://admin:admin@model-repo.apps.sdc.tpcf.tmm-labs.com/nomic-embed-text-v1.5.f32.gguf
33 |
34 | #shasum:
35 | ed3a84b570c5513bfd6bfe0ed4cdc8d5a5de5c6b5029fbbc2822d59fc893c1f8
36 |
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/adminguide/zipkin_tracing.md:
--------------------------------------------------------------------------------
1 | # Enabling Zipkin tracing in Cloud Foundry
2 | You can use Zipkin tracing to troubleshoot failures or latency issues in your apps. You can trace requests and responses
3 | across distributed systems. For more information, see [Zipkin.io](http://zipkin.io/).
4 | To enable Zipkin tracing, add the following property to your BOSH deployment manifest file:
5 | ```
6 | properties:
7 | router:
8 | tracing:
9 | enable_zipkin: true
10 | ```
11 | For more information about how the Gorouter works with HTTP headers and Zipkin tracing, see the [HTTP Headers](https://docs.cloudfoundry.org/concepts/http-routing.html#http-headers) section of the *HTTP Routing* topic.
12 | To trace app requests and responses in Cloud Foundry, apps must also log Zipkin headers.
13 | After adding Zipkin HTTP headers to app logs, developers can use `cf logs myapp` to correlate the trace and span IDs logged by the Gorouter with the trace IDs logged by their app. To correlate trace IDs for a request through multiple apps, each app must forward appropriate values for the headers with requests to other apps.
--------------------------------------------------------------------------------
/spring-metal/conf/traits/workload-installer.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: spaces.tanzu.vmware.com/v1alpha1
3 | kind: Trait
4 | metadata:
5 | name: workload-installer
6 | spec:
7 | description: Workload installer define the specific characteristics and requirements of applications or services running on the cluster.
8 | carvelPackages:
9 | - refName: workload-installer.tanzu.vmware.com
10 | alias: workload-installer.tanzu.vmware.com
11 | versionSelection:
12 | constraints: "0.1.0-alpha.3"
13 | values:
14 | inline:
15 | imagePullSecrets: []
16 | serviceAccountName: workload-installer
17 | excludedKeys:
18 | - imagePullSecrets
19 | - refName: workload-imagepull-secret.tanzu.vmware.com
20 | alias: workload-imagepull-secret.tanzu.vmware.com
21 | versionSelection:
22 | constraints: "0.1.0-alpha.3"
23 | values:
24 | inline:
25 | #! name of ImagePullSecret to be associated with workload serviceAccount.
26 | secretName: workload-imagepull-secret
27 | #! Service account used for running the workload.
28 | serviceAccountName: default
29 |
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/concepts/index.md:
--------------------------------------------------------------------------------
1 | # Cloud Foundry concepts
2 | Cloud Foundry is an open-source cloud app platform, providing a choice of clouds, developer
3 | frameworks, and app services. Cloud Foundry makes it faster and easier to build, test, deploy, and scale apps. It is an open-source project and is available through a variety of private cloud distributions and public cloud instances. For more information, see [Cloud Foundry](https://github.com/cloudfoundry) on GitHub.
4 | This documentation presents an overview of
5 | how Cloud Foundry works and a discussion of key concepts.
6 | To learn more about Cloud Foundry fundamentals, see the following topics:
7 |
8 | * [Cloud Foundry Overview](https://docs.cloudfoundry.org/concepts/overview.html)
9 |
10 | * [Security and Networking](https://docs.cloudfoundry.org/concepts/security-index.html)
11 |
12 | * [High Availability](https://docs.cloudfoundry.org/concepts/ha-index.html)
13 |
14 | * [How Cloud Foundry Manages Apps](https://docs.cloudfoundry.org/concepts/apps-index.html)
15 |
16 | * [Cloud Foundry Components](https://docs.cloudfoundry.org/concepts/architecture/)
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/deploying/index.md:
--------------------------------------------------------------------------------
1 | # Overview of Deploying Cloud Foundry
2 | Cloud Foundry is designed to be configured, deployed, managed, scaled, and
3 | upgraded on any cloud IaaS provider. Cloud Foundry achieves this by leveraging
4 | [BOSH](https://bosh.io/), an open source tool for release engineering,
5 | deployment, lifecycle management, and distributed systems monitoring.
6 | If installing Cloud Foundry for the first time, [deploy](https://docs.cloudfoundry.org/deploying/cf-deployment/) with `cf-deployment`.
7 | If you have an existing Cloud Foundry deployment that uses `cf-release`, [migrate](https://docs.cloudfoundry.org/deploying/migrating.html) your deployment to `cf-deployment`.
8 |
9 | * [Deploying Cloud Foundry with cf-deployment](https://docs.cloudfoundry.org/deploying/cf-deployment/)
10 |
11 | * [Migrating from cf-release to cf-deployment](https://docs.cloudfoundry.org/deploying/migrating.html)
12 |
13 | **Note**: To deploy a local Cloud Foundry environment for experimentation or debugging purposes, you can use CF Dev. For more information, see [CF Dev](https://github.com/cloudfoundry-incubator/cfdev).
--------------------------------------------------------------------------------
/spring-metal/runtime-configs/tpk8s/traits/workload-installer.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: spaces.tanzu.vmware.com/v1alpha1
3 | kind: Trait
4 | metadata:
5 | name: workload-installer
6 | spec:
7 | description: Workload installer define the specific characteristics and requirements of applications or services running on the cluster.
8 | carvelPackages:
9 | - refName: workload-installer.tanzu.vmware.com
10 | alias: workload-installer.tanzu.vmware.com
11 | versionSelection:
12 | constraints: "0.1.0-alpha.3"
13 | values:
14 | inline:
15 | imagePullSecrets: []
16 | serviceAccountName: workload-installer
17 | excludedKeys:
18 | - imagePullSecrets
19 | - refName: workload-imagepull-secret.tanzu.vmware.com
20 | alias: workload-imagepull-secret.tanzu.vmware.com
21 | versionSelection:
22 | constraints: "0.1.0-alpha.3"
23 | values:
24 | inline:
25 | #! name of ImagePullSecret to be associated with workload serviceAccount.
26 | secretName: workload-imagepull-secret
27 | #! Service account used for running the workload.
28 | serviceAccountName: default
29 |
--------------------------------------------------------------------------------
/open-webui-cf/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## Architecture
4 | This example will deploy the popular [Open-webui](https://openwebui.com/) to tPCF.
5 |
6 | You can wire up many GenAI Services/LLMs to open-webui-cf for testing.
7 | This is a great tool to test out many different models and provide a tool to provide a local "Chat GPT" style interface.
8 |
9 | This is a rather large python application, it may take a few minutes for the cf push to complete.
10 |
11 | ***See Architecture diagram:***
12 | 
13 |
14 | ## Create Service Intance for open-webui-cf
15 |
16 | ```bash
17 | # Create service instance with a chat and an embedding model
18 | cf create-service genai multi-model-plan my-multi-model-service-instance
19 | ```
20 |
21 | ### Deploy
22 | ```bash
23 | cd ./open-webui-cf #navigate to open-webui-cf dir
24 | cf push
25 | ```
26 |
27 | ## Contributing
28 | Contributions to this project are welcome. Please ensure to follow the existing coding style and add unit tests for any new or changed functionality.
29 |
30 |
--------------------------------------------------------------------------------
/spring-metal/conf/platform-config.yml:
--------------------------------------------------------------------------------
1 | apiVersion: build.tanzu.vmware.com/v1
2 | kind: ContainerAppBuildPlan
3 | metadata:
4 | name: platform-config
5 | spec:
6 | registry: harbor.vmtanzu.com/openso-tap-apps
7 | buildpacks:
8 | builder: "paketobuildpacks/builder-jammy-base"
9 | postBuildSteps:
10 | - name: apply-spring-boot-conventions
11 | namedTask: tanzu-spring-boot
12 | runtimes:
13 | - name: kubernetes-carvel-package
14 | description: create a carvel package for deploying on kubernetes
15 | steps:
16 | - namedtask: tanzu-kubernetes-deployment
17 | - namedtask: tanzu-kubernetes-carvel-package
18 |
19 | ---
20 | # runtimes:
21 | # - name: kubernetes-plain
22 | # steps:
23 | # - name: kubernetes-deployment
24 | # namedTask: tanzu-kubernetes-deployment
25 | # - name: kubernetes-carvel-package
26 | # description: create a carvel package for deploying on kubernetes
27 | # steps:
28 | # - namedtask: tanzu-kubernetes-deployment
29 | # - namedtask: tanzu-kubernetes-carvel-package
30 | # - name: container-image
31 | # description: write image to file for use with container runtime (i.e docker run)
32 | # steps:
33 | # - namedtask: tanzu-container-image
--------------------------------------------------------------------------------
/spring-metal/src/main/java/org/springframework/ai/bindings/OllamaBindingsPropertiesProcessor.java:
--------------------------------------------------------------------------------
1 | package org.springframework.ai.bindings;
2 |
3 | import org.springframework.cloud.bindings.Binding;
4 | import org.springframework.cloud.bindings.Bindings;
5 | import org.springframework.cloud.bindings.boot.BindingsPropertiesProcessor;
6 | import org.springframework.core.env.Environment;
7 |
8 | import java.util.Map;
9 |
10 | /**
11 | * An implementation of {@link BindingsPropertiesProcessor} that detects {@link Binding}s
12 | * of type: {@value TYPE}.
13 | *
14 | * @author Thomas Vitale
15 | */
16 | public class OllamaBindingsPropertiesProcessor implements BindingsPropertiesProcessor {
17 |
18 | /**
19 | * The {@link Binding} type that this processor is interested in: {@value}.
20 | **/
21 | public static final String TYPE = "ollama";
22 |
23 | @Override
24 | public void process(Environment environment, Bindings bindings, Map properties) {
25 | if (!BindingsValidator.isTypeEnabled(environment, TYPE)) {
26 | return;
27 | }
28 |
29 | bindings.filterBindings(TYPE).forEach(binding -> {
30 | properties.put("spring.ai.ollama.base-url", binding.getSecret().get("uri"));
31 | });
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/spring-metal/conf/traits/egress-trait.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: spaces.tanzu.vmware.com/v1alpha1
2 | kind: Trait
3 | metadata:
4 | name: egress #Unique Name of the Trait
5 | spec:
6 | description: Egress allows developers and operators to connect to services outside of the space. Egress gateways work alongside Service Bindings, which provide the necessary credentials for communication with the services listed in an egress route.
7 | carvelPackages:
8 | - alias: egress.tanzu.vmware.com
9 | refName: egress.tanzu.vmware.com
10 | versionSelection:
11 | constraints: 0.0.2 #For Beta 2, current latest version is 0.0.2. Ensure to keep it updated.
12 | values:
13 | inline:
14 | open: false #Open/Restricted Egress Policy mode
15 | # hosts:
16 | # - name: #Unique Name of the Host
17 | # host: #The host value is the domain name of the service to be accessed
18 | # ports:
19 | # - number: 443 #Port Number
20 | # name: https #Name of the Port
21 | # protocol: HTTPS #Protocol Type(HTTP/HTTPS/TCP)
22 | # - number: 80
23 | # name: http
24 | # protocol: HTTP
25 |
--------------------------------------------------------------------------------
/spring-metal/runtime-configs/tpk8s/traits/egress-trait.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: spaces.tanzu.vmware.com/v1alpha1
2 | kind: Trait
3 | metadata:
4 | name: egress #Unique Name of the Trait
5 | spec:
6 | description: Egress allows developers and operators to connect to services outside of the space. Egress gateways work alongside Service Bindings, which provide the necessary credentials for communication with the services listed in an egress route.
7 | carvelPackages:
8 | - alias: egress.tanzu.vmware.com
9 | refName: egress.tanzu.vmware.com
10 | versionSelection:
11 | constraints: 0.0.2 #For Beta 2, current latest version is 0.0.2. Ensure to keep it updated.
12 | values:
13 | inline:
14 | open: false #Open/Restricted Egress Policy mode
15 | # hosts:
16 | # - name: #Unique Name of the Host
17 | # host: #The host value is the domain name of the service to be accessed
18 | # ports:
19 | # - number: 443 #Port Number
20 | # name: https #Name of the Port
21 | # protocol: HTTPS #Protocol Type(HTTP/HTTPS/TCP)
22 | # - number: 80
23 | # name: http
24 | # protocol: HTTP
25 |
--------------------------------------------------------------------------------
/spring-metal/src/main/resources/static/templates/header.html:
--------------------------------------------------------------------------------
1 |
39 |
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/managing-cf/logging.md:
--------------------------------------------------------------------------------
1 | # Cloud Foundry logging
2 | This section contains information for debugging Cloud Foundry system components.
3 |
4 | ## Component logging
5 | In `cf-deployment`, the components should all be configured in a similar way:
6 |
7 | * All of the job’s log files are located in the directory `/var/vcap/sys/log/` of the machine on which the job is running.
8 |
9 | * Any output written directly to the job’s stdout and stderr is written to `.stdout.log` and `.stderr.log`, respectively.
10 |
11 | * Jobs might also write main logs to a file named `.log`.
12 |
13 | * BOSH might also write logs for different lifecycle hooks to additional file paths, see [BOSH Update Lifecycle](https://bosh.io/docs/job-lifecycle/) for more details.
14 |
15 | ## Log forwarding
16 | BOSH VMs can be configured to forward component logs to remote syslog endpoints by applying the [enable-component-syslog.yml](https://github.com/cloudfoundry/cf-deployment/blob/main/operations/addons/enable-component-syslog.yml) ops file to a BOSH runtime config or manifest. The ops file requires some operator configuration ([example](https://github.com/cloudfoundry/cf-deployment/blob/main/operations/addons/example-vars-files/vars-enable-component-syslog.yml)), including the following variables:
17 |
18 | * `syslog_address`: IP or DNS address of the syslog server
19 |
20 | * `syslog_custom_rule`: Custom rsyslog rules
21 |
22 | * `syslog_fallback_servers`: List of fallback servers to be used if the primary syslog server is down
23 |
24 | * `syslog_permitted_peer`: Accepted fingerprint (SHA1) or name of remote peer
25 |
26 | * `syslog_port`: Port of the syslog server
27 | Further configuration options can be found in the [syslog\_forwarder spec](https://github.com/cloudfoundry/syslog-release/blob/main/jobs/syslog_forwarder/spec).
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/buildpacks/updating-buildpack-related-gems.md:
--------------------------------------------------------------------------------
1 | # Updating buildpack-related gems in Cloud Foundry
2 | Learn how to update your [buildpack-packager](https://github.com/cloudfoundry/buildpack-packager) and [machete](https://github.com/cloudfoundry/machete) CF buildpack test framework, which are used for CF system buildpack development.
3 | The `buildpack-packager` packages buildpacks and `machete` provides an integration test framework.
4 | The CF Buildpacks team uses the [gems-and-extensions pipeline](https://buildpacks.ci.cf-app.com/teams/main/pipelines/gems-and-extensions) to:
5 |
6 | * Run integration tests for `buildpack-packager` and `machete`.
7 |
8 | * Update the gems in the buildpacks managed by the team.
9 |
10 | ## Running the update process
11 | The following steps assume you are using a Concourse deployment of the `buildpacks-ci` pipelines.
12 | At the end of the process, there is a new GitHub release. Updates are then applied to the buildpacks.
13 | To update the version of either gem in a buildpack:
14 |
15 | 1. Verify that the test job `-specs` for the gem was updated successfully and ran on the commit you plan to update.
16 |
17 | 2. Start the `-tag` job to update (“bump”) the version of the gem.
18 | The `-release` job starts and creates a new GitHub release of the gem.
19 |
20 | 3. Each of the buildpack pipelines, for example, the [go-buildpack pipeline](https://buildpacks.ci.cf-app.com/teams/main/pipelines/go-buildpack) has a job that watches for new releases of the gem. When a new release is detected, the buildpack’s `cf.Gemfile` is updated to that release version.
21 |
22 | 4. The commit made to the buildpack’s `cf.Gemfile` starts the full integration test suite for that buildpack.
23 | The final step starts all buildpack test suites simultaneously,
24 | and causes contention for available shared BOSH lite test environments.
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/buildpacks/use-multiple-buildpacks.md:
--------------------------------------------------------------------------------
1 | # Pushing an app with multiple buildpacks
2 | You can push an app with multiple buildpacks using the Cloud Foundry Command Line Interface (cf CLI).
3 | As an alternative to the cf CLI procedure, you can specify multiple
4 | buildpacks in your app manifest. This is not compatible with deprecated app manifest features. For more information, see [Deploying with App Manifests](https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html).
5 | For more information about pushing apps, see [Pushing an App](https://docs.cloudfoundry.org/devguide/deploy-apps/deploy-app.html).
6 |
7 | ## Specifying buildpacks with the cf CLI
8 | To push an app with multiple buildpacks using the cf CLI:
9 |
10 | **Note**
11 | You must use cf CLI v6.38 or later.
12 |
13 | 1. Ensure that you are using the cf CLI v6.38 or later by running:
14 | ```
15 | cf version
16 | ```
17 | For more information about upgrading the cf CLI, see [Installing the cf CLI](https://docs.cloudfoundry.org/cf-cli/install-go-cli.html).
18 |
19 | 2. To push your app with multiple buildpacks, specify each buildpack with a `-b` flag by running:
20 | ```
21 | cf push YOUR-APP -b BUILDPACK-NAME-1 -b BUILDPACK-NAME-2 ... -b BUILDPACK-NAME-3
22 | ```
23 | Where:
24 |
25 | * `YOUR-APP` is the name of your app.
26 |
27 | * `BUILDPACK-NAME-1`, `BUILDPACK-NAME-2`, and `BUILDPACK-NAME-3` are the names of the buildpacks you want to push with your app.
28 | The last buildpack you specify is the **final buildpack**, which modifies the launch environment and sets the start command.
29 | To see a list of available buildpacks, run:
30 | ```
31 | cf buildpacks
32 | ```
33 | For more information on multi buildpack order, see [How buildpacks work](https://docs.cloudfoundry.org/buildpacks/understand-buildpacks.html).
34 | For more information about using the cf CLI, see [Using the cf CLI Cloud Foundry command line interface](https://docs.cloudfoundry.org/cf-cli/).
--------------------------------------------------------------------------------
/spring-metal/conf/profiles/spring.tanzu.vmware.com.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: spaces.tanzu.vmware.com/v1alpha1
3 | kind: Profile
4 | metadata:
5 | name: spring.tanzu.vmware.com
6 | spec:
7 | description: Spring Profile configures Spring Cloud Gateway for your cloud native application architecture. With Spring profile, you can take advantage of our Bitnami services, enterprise API gateway, observability delivered at runtime and enhanced service discovery with MTLS and Cert manager to provide security to spring applications deployed to the space.
8 | requiredCapabilities:
9 | - name: spring-cloud-gateway.tanzu.vmware.com
10 | - name: bitnami.services.tanzu.vmware.com
11 | - name: package-management.tanzu.vmware.com
12 | - name: services-toolkit.tanzu.vmware.com
13 | - name: multicloud-ingress.tanzu.vmware.com
14 | - name: observability.tanzu.vmware.com
15 | traits:
16 | - name: spring-cloud-gateway-trait
17 | alias: spring-cloud-gateway-trait
18 | - name: public-ingress
19 | alias: public-ingress
20 | - name: mtls.tanzu.vmware.com
21 | alias: mtls.tanzu.vmware.com
22 | - name: selfsigned-certificate-issuer
23 | alias: selfsigned-certificate-issuer
24 | - name: egress
25 | alias: egress
26 | - name: observability
27 | alias: observability
28 | - name: workload-installer
29 | alias: workload-installer
30 | values:
31 | inline:
32 | workload-installer.tanzu.vmware.com:
33 | #! Service account name to be created and granted permissions, associating it with RBAC rules for server workloads.
34 | serviceAccountName: workload-installer
35 | workload-imagepull-secret.tanzu.vmware.com:
36 | #! name of ImagePullSecret to be associated with workload serviceAccount.
37 | secretName: workload-imagepull-secret
38 | #! Service account used for running the workload.
39 | serviceAccountName: default
40 |
--------------------------------------------------------------------------------
/spring-metal/src/main/java/org/cloudfoundry/samples/music/web/AlbumController.java:
--------------------------------------------------------------------------------
1 | package org.cloudfoundry.samples.music.web;
2 |
3 | import org.cloudfoundry.samples.music.domain.Album;
4 | import org.slf4j.Logger;
5 | import org.slf4j.LoggerFactory;
6 |
7 | import org.springframework.beans.factory.annotation.Autowired;
8 | import org.springframework.data.repository.CrudRepository;
9 | import org.springframework.web.bind.annotation.*;
10 |
11 | import jakarta.validation.Valid;
12 |
13 | @RestController
14 | @RequestMapping(value = "/albums")
15 | public class AlbumController {
16 | private static final Logger logger = LoggerFactory.getLogger(AlbumController.class);
17 | private CrudRepository repository;
18 |
19 | @Autowired
20 | public AlbumController(CrudRepository repository) {
21 | this.repository = repository;
22 | }
23 |
24 | @RequestMapping(method = RequestMethod.GET)
25 | public Iterable albums() {
26 | return repository.findAll();
27 | }
28 |
29 | @RequestMapping(method = RequestMethod.PUT)
30 | public Album add(@RequestBody @Valid Album album) {
31 | logger.info("Adding album " + album.getId());
32 | return repository.save(album);
33 | }
34 |
35 | @RequestMapping(method = RequestMethod.POST)
36 | public Album update(@RequestBody @Valid Album album) {
37 | logger.info("Updating album " + album.getId());
38 | return repository.save(album);
39 | }
40 |
41 | @RequestMapping(value = "/{id}", method = RequestMethod.GET)
42 | public Album getById(@PathVariable String id) {
43 | logger.info("Getting album " + id);
44 | return repository.findById(id).orElse(null);
45 | }
46 |
47 | @RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
48 | public void deleteById(@PathVariable String id) {
49 | logger.info("Deleting album " + id);
50 | repository.deleteById(id);
51 | }
52 |
53 | }
--------------------------------------------------------------------------------
/spring-metal/conf/profiles/spring-ai.tanzu.vmware.com.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: spaces.tanzu.vmware.com/v1alpha1
3 | kind: Profile
4 | metadata:
5 | name: spring-ai.tanzu.vmware.com
6 | spec:
7 | description: Spring AI Profile configures Spring Cloud Gateway for your cloud native application architecture. With Spring profile, you can take advantage of our Bitnami services, enterprise API gateway, observability delivered at runtime and enhanced service discovery with MTLS and Cert manager to provide security to spring applications deployed to the space.
8 | requiredCapabilities:
9 | - name: spring-cloud-gateway.tanzu.vmware.com
10 | - name: bitnami.services.tanzu.vmware.com
11 | - name: package-management.tanzu.vmware.com
12 | - name: services-toolkit.tanzu.vmware.com
13 | - name: multicloud-ingress.tanzu.vmware.com
14 | - name: observability.tanzu.vmware.com
15 | traits:
16 | - name: spring-cloud-gateway-trait
17 | alias: spring-cloud-gateway-trait
18 | - name: public-ingress
19 | alias: public-ingress
20 | - name: mtls.tanzu.vmware.com
21 | alias: mtls.tanzu.vmware.com
22 | - name: selfsigned-certificate-issuer
23 | alias: selfsigned-certificate-issuer
24 | - name: egress
25 | alias: egress
26 | - name: observability
27 | alias: observability
28 | - name: workload-installer
29 | alias: workload-installer
30 | values:
31 | inline:
32 | workload-installer.tanzu.vmware.com:
33 | #! Service account name to be created and granted permissions, associating it with RBAC rules for server workloads.
34 | serviceAccountName: workload-installer
35 | workload-imagepull-secret.tanzu.vmware.com:
36 | #! name of ImagePullSecret to be associated with workload serviceAccount.
37 | secretName: workload-imagepull-secret
38 | #! Service account used for running the workload.
39 | serviceAccountName: default
40 |
--------------------------------------------------------------------------------
/spring-metal/src/main/resources/static/templates/grid.html:
--------------------------------------------------------------------------------
1 |
40 |
--------------------------------------------------------------------------------
/spring-metal/src/main/java/org/springframework/ai/bindings/TanzuBindingsPropertiesProcessor.java:
--------------------------------------------------------------------------------
1 | package org.springframework.ai.bindings;
2 |
3 | import org.springframework.cloud.bindings.Binding;
4 | import org.springframework.cloud.bindings.Bindings;
5 | import org.springframework.cloud.bindings.boot.BindingsPropertiesProcessor;
6 | import org.springframework.core.env.Environment;
7 |
8 | import java.util.Arrays;
9 | import java.util.Map;
10 |
11 | /**
12 | * An implementation of {@link BindingsPropertiesProcessor} that detects {@link Binding}s
13 | * of type: {@value TYPE}.
14 | *
15 | * @author Stuart Charlton
16 | */
17 | public class TanzuBindingsPropertiesProcessor implements BindingsPropertiesProcessor {
18 |
19 | /**
20 | * The {@link Binding} type that this processor is interested in: {@value}.
21 | **/
22 | public static final String TYPE = "genai";
23 |
24 | @Override
25 | public void process(Environment environment, Bindings bindings, Map properties) {
26 | if (!BindingsValidator.isTypeEnabled(environment, TYPE)) {
27 | return;
28 | }
29 |
30 | bindings.filterBindings(TYPE).forEach(binding -> {
31 | if (binding.getSecret().get("model-capabilities") != null) {
32 | String[] capabilities = binding.getSecret().get("model-capabilities").trim().split("\\s*,\\s*");
33 | if (Arrays.stream(capabilities).anyMatch("chat"::equals)) {
34 | properties.put("spring.ai.openai.chat.api-key", binding.getSecret().get("api-key"));
35 | properties.put("spring.ai.openai.chat.base-url", binding.getSecret().get("uri"));
36 | properties.put("spring.ai.openai.chat.options.model", binding.getSecret().get("model-name"));
37 | }
38 | if (Arrays.stream(capabilities).anyMatch("embedding"::equals)) {
39 | properties.put("spring.ai.openai.embedding.api-key", binding.getSecret().get("api-key"));
40 | properties.put("spring.ai.openai.embedding.base-url", binding.getSecret().get("uri"));
41 | properties.put("spring.ai.openai.embedding.options.model", binding.getSecret().get("model-name"));
42 | }
43 | }
44 | });
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/deploy-apps/cf-scale.md:
--------------------------------------------------------------------------------
1 | # Scaling an app using Cloud Foundry CLI (cf scale)
2 | Factors such as user load, or the number and nature of tasks performed by an app, can change the disk space and memory the app uses.
3 | This topic describes how to scale an app using the Cloud Foundry Command Line Interface (cf CLI).
4 | For many apps, increasing the available disk space or memory can improve overall performance.
5 | Similarly, running additional instances of an app can allow the app to handle increases in user load and concurrent requests.
6 | These adjustments are called “scaling” an app.
7 | Use [cf scale](http://cli.cloudfoundry.org/en-US/cf/scale.html) to scale your app up or down to meet changes in traffic
8 | or demand.
9 |
10 | ## Scaling horizontally
11 | Horizontally scaling an app creates or destroys instances of your app.
12 | Incoming requests to your app are automatically load balanced across all
13 | instances of your app, and each instance handles tasks in parallel with
14 | every other instance.
15 | Adding more instances allows your app to handle increased traffic and
16 | demand.
17 | Use `cf scale APP -i INSTANCES` to horizontally scale your app.
18 | Cloud Foundry increases or decreases the number of instances of your app to match `INSTANCES`.
19 | ```
20 | $ cf scale myApp -i 5
21 | ```
22 |
23 | **Note**
24 | In cf CLI v7, you can also use `--process` with `cf scale` to scale specific processes of your app.
25 |
26 | ## Scaling vertically
27 | Vertically scaling an app changes the disk space limit or memory limit
28 | that Cloud Foundry applies to all instances of the app.
29 | Use `cf scale APP -k DISK` to change the disk space limit applied to all
30 | instances of your app.
31 | `DISK` must be an integer followed by either an **M**, for megabytes, or **G**,
32 | for gigabytes.
33 | ```
34 | $ cf scale myApp -k 512M
35 | ```
36 | Use `cf scale APP -m MEMORY` to change the memory limit applied to all instances
37 | of your app.
38 | `MEMORY` must be an integer followed by either an **M**, for megabytes, or
39 |
40 | **G**, for gigabytes.
41 | ```
42 | $ cf scale myApp -m 1G
43 | ```
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/services/examples.md:
--------------------------------------------------------------------------------
1 | # Service Broker examples
2 | The following example service broker applications have been developed in Cloud Foundry. This is a
3 | good starting point
4 | if you are developing your own service broker.
5 |
6 | ## Ruby
7 |
8 | * [GitHub Repository service](https://github.com/cloudfoundry-samples/github-service-broker-ruby) - this is designed to be an easy-to-read example of a service broker, with complete documentation, and comes with a demo app that uses the service. The broker can be deployed as an application to any Cloud Foundry instance or hosted elsewhere. The service broker uses GitHub as the service back end.
9 |
10 | * [MySQL database service](https://github.com/cloudfoundry/cf-mysql-release) - this broker and its accompanying MySQL server are designed to be deployed together as a [BOSH](https://github.com/cloudfoundry/bosh) release. BOSH is used to deploy or upgrade the release, monitors the health of running components, and restarts or recreates unhealthy VMs. The broker code alone can be found [here](https://github.com/cloudfoundry/cf-mysql-broker).
11 |
12 | ## Java
13 |
14 | * [Spring Cloud - Cloud Foundry Service Broker](https://github.com/spring-cloud/spring-cloud-cloudfoundry-service-broker) - This implements the REST contract for service brokers and the artifacts are published to the Spring Maven repository. This greatly simplifies development: include a single dependency in Gradle, implement interfaces, and configure. A sample implementation has been provided for [MongoDB](https://github.com/spring-cloud-samples/cloudfoundry-service-broker).
15 |
16 | * [MySQL Java Broker](https://github.com/cloudfoundry-community/cf-mysql-java-broker) - a Java port of the Ruby-based [MySQL broker](https://github.com/cloudfoundry/cf-mysql-broker).
17 |
18 | ## Go
19 |
20 | * [Asynchronous Service Broker for AWS EC2](https://github.com/cloudfoundry-samples/go_service_broker) - This broker implements support for [Asynchronous Service Operations](https://github.com/openservicebrokerapi/servicebroker/blob/v2.13/spec.md#asynchronous-operations), and calls AWS APIs to provision EC2 VMs.
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/buildpacks/merging_upstream.md:
--------------------------------------------------------------------------------
1 | # Merging with upstream buildpacks
2 | Learn how to maintain your forked buildpack by merging it with the upstream Cloud Foundry buildpack.
3 | This process keeps your fork updated with changes from the original buildpack, providing patches, updates, and new features.
4 | The following procedure assumes that you are maintaining a custom buildpack that was forked from
5 | a Cloud Foundry system buildpack. However, you can use the same procedure to update a buildpack forked from any upstream buildpack.
6 | To sync your forked buildpack with an upstream Cloud Foundry buildpack:
7 |
8 | 1. Go to your forked repository on GitHub and click **Compare**. The **Comparing changes** page shows the unmerged commits between your forked buildpack and the upstream buildpack. Inspect unmerged commits and confirm that you want to merge them all.
9 |
10 | 2. Go to the forked repository and set the upstream remote as the Cloud Foundry buildpack repository.
11 | ```
12 | $ cd ~/workspace/ruby-buildpack
13 | $ git remote add upstream git@github.com:cloudfoundry/ruby-buildpack.git
14 | ```
15 |
16 | 3. Pull down the remote upstream changes.
17 | ```
18 | $ git fetch upstream
19 | ```
20 |
21 | 4. Merge the upstream changes into the intended branch. You might need to resolve merge conflicts.
22 | This example shows the merging of the `main` branch of the upstream buildpack into the `main` branch of the forked buildpack.
23 | ```
24 | $ git checkout main
25 | $ git merge upstream/main
26 | ```
27 |
28 | **Important**
29 | When you merge upstream buildpacks, do not use `git rebase`.
30 | This approach is not sustainable because you confront the same merge conflicts repeatedly.
31 |
32 | 5. Run the buildpack test suite to ensure that the upstream changes do not break anything.
33 | ```
34 | $ BUNDLE_GEMFILE=cf.Gemfile buildpack-build
35 | ```
36 |
37 | 6. Push the updated branch.
38 | ```
39 | $ git push
40 | ```
41 | Your forked buildpack is now synced with the upstream Cloud Foundry buildpack.
42 | For more information about syncing forks, see [Syncing a fork](https://help.github.com/articles/syncing-a-fork/).
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/services/app-log-streaming.md:
--------------------------------------------------------------------------------
1 | # App Log streaming
2 | When you bind an application to an instance of an applicable service, Cloud Foundry streams logs for the
3 | bound application to the service instance.
4 |
5 | * Logs for all apps bound to a log consuming service instance are streamed to that instance.
6 |
7 | * Logs for an app bound to multiple log consuming service instances are streamed to all instances.
8 | To activate this capability, a service broker must implement the following:
9 |
10 | 1. In the [catalog](https://github.com/openservicebrokerapi/servicebroker/blob/v2.13/spec.md#catalog-management) endpoint, the broker must include `requires: syslog_drain`. This minor security measure validates that a service returning a `syslog_drain_url` in response to the [bind](https://github.com/openservicebrokerapi/servicebroker/blob/v2.13/spec.md#binding) operation has also declared that it expects log streaming.
11 | If the broker does not include `requires: syslog_drain`, and the bind request returns a value for `syslog_drain_url`,
12 | Cloud Foundry returns an error for the bind operation.
13 |
14 | 2. In response to a [bind](https://github.com/openservicebrokerapi/servicebroker/blob/v2.13/spec.md#binding) request, the broker returns a value for `syslog_drain_url`. The syslog URL has a scheme of syslog, syslog-tls, or https and can include a port number. For example:
15 | `"syslog_drain_url": "syslog://logs.example.com:1234"`
16 |
17 | ## How does it work?
18 |
19 | 1. Service broker returns a value for `syslog_drain_url` in response to bind.
20 |
21 | 2. Loggregator periodically polls an internal Cloud Controller endpoint for updates.
22 |
23 | 3. Upon discovering a new `syslog_drain_url`, Loggregator identifies the associated app.
24 |
25 | 4. Loggregator streams app logs for that app to the locations specified by the service instances’ `syslog_drain_url`s.
26 | You can manually configure app logs to be streamed to a location of your choice
27 | using user-provided service instances.
28 | For details, see
29 | [Using Third-Party Log Management Services](https://docs.cloudfoundry.org/devguide/services/log-management.html).
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/devguide/push.md:
--------------------------------------------------------------------------------
1 | # How to push your app with Cloud Foundry CLI (cf push)
2 | These topics contain the procedures for deploying apps with `cf push`:
3 |
4 | * [Pushing your app using Cloud Foundry CLI (cf push)](https://docs.cloudfoundry.org/devguide/deploy-apps/deploy-app.html)
5 |
6 | * [Deploying with app manifests](https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html)
7 |
8 | + [App manifest attribute reference](https://docs.cloudfoundry.org/devguide/deploy-apps/manifest-attributes.html)
9 |
10 | * [Deploying an app with Docker](https://docs.cloudfoundry.org/devguide/deploy-apps/push-docker.html)
11 |
12 | * [Deploying your large apps](https://docs.cloudfoundry.org/devguide/deploy-apps/large-app-deploy.html)
13 |
14 | * [Starting, restarting, and restaging Apps](https://docs.cloudfoundry.org/devguide/deploy-apps/start-restart-restage.html)
15 |
16 | * [Pushing your app with multiple buildpacks](https://docs.cloudfoundry.org/buildpacks/use-multiple-buildpacks.html)
17 |
18 | * [Pushing an app with multiple processes](https://docs.cloudfoundry.org/devguide/multiple-processes.html)
19 |
20 | * [Running cf push sub-step commands](https://docs.cloudfoundry.org/devguide/push-sub-commands.html)
21 |
22 | * [Configuring rolling app deployments](https://docs.cloudfoundry.org/devguide/deploy-apps/rolling-deploy.html)
23 |
24 | * [Pushing apps with sidecar processes](https://docs.cloudfoundry.org/devguide/sidecars.html)
25 |
26 | ## Troubleshooting
27 | For information about troubleshooting when running `cf push`, see [Troubleshooting app deployment and health](https://docs.cloudfoundry.org/devguide/deploy-apps/troubleshoot-app-health.html).
28 |
29 | ## How cf push works
30 | The following topics provide information about how `cf push` works:
31 |
32 | * The [Push](https://docs.cloudfoundry.org/cf-cli/getting-started.html#push) section of *Getting Started with the cf CLI*.
33 |
34 | * [The application container life cycle on Diego architecture](https://docs.cloudfoundry.org/devguide/deploy-apps/app-lifecycle.html)
35 |
36 | * [How apps are staged](https://docs.cloudfoundry.org/concepts/how-applications-are-staged.html)
--------------------------------------------------------------------------------
/needs-work/spring-music-taylors-version/demo.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | PGVECTOR_SERVICE_NAME="vector-db"
4 | PGVECTOR_PLAN_NAME="on-demand-postgres-db"
5 |
6 | GENAI_CHAT_SERVICE_NAME="genai-chat"
7 | GENAI_CHAT_PLAN_NAME="meta-llama/Meta-Llama-3-8B-Instruct" # plan must have chat capabilty
8 |
9 | GENAI_EMBEDDINGS_SERVICE_NAME="genai-embed"
10 | GENAI_EMBEDDINGS_PLAN_NAME="nomic-embed-text" # plan must have Embeddings capabilty
11 |
12 | APP_NAME="spring-music-ai-taylors-version" # If you want to override the app name manifest.yml
13 |
14 | case $1 in
15 | cf)
16 |
17 | echo && printf "\e[37mℹ️ Creating services ...\e[m\n" && echo
18 |
19 | cf create-service postgres $PGVECTOR_PLAN_NAME $PGVECTOR_SERVICE_NAME #-c '{"svc_gw_enable": true, "router_group": "default-tcp", "external_port": 1025}' -w
20 | echo
21 | printf "Waiting for service $PGVECTOR_SERVICE_NAME to create."
22 | while [ `cf services | grep 'in progress' | wc -l | sed 's/ //g'` != 0 ]; do
23 | printf "."
24 | sleep 5
25 | done
26 |
27 | echo "$PGVECTOR_SERVICE_NAME creation completed."
28 |
29 | echo && printf "\e[37mℹ️ Creating $GENAI_CHAT_SERVICE_NAME and $GENAI_EMBEDDINGS_SERVICE_NAME GenAI services ...\e[m\n" && echo
30 |
31 | cf create-service genai $GENAI_CHAT_PLAN_NAME $GENAI_CHAT_SERVICE_NAME
32 | cf create-service genai $GENAI_EMBEDDINGS_PLAN_NAME $GENAI_EMBEDDINGS_SERVICE_NAME
33 |
34 | echo && printf "\e[37mℹ️ Deploying $APP_NAME application ...\e[m\n" && echo
35 | cf push $APP_NAME -f manifest.yml --no-start
36 |
37 | echo && printf "\e[37mℹ️ Binding services ...\e[m\n" && echo
38 |
39 | cf bind-service $APP_NAME $PGVECTOR_SERVICE_NAME
40 | cf bind-service $APP_NAME $GENAI_CHAT_SERVICE_NAME
41 | cf bind-service $APP_NAME $GENAI_EMBEDDINGS_SERVICE_NAME
42 | cf start $APP_NAME
43 |
44 | ;;
45 | cleanup)
46 | cf delete-service $PGVECTOR_SERVICE_NAME -f
47 | cf delete-service $GENAI_CHAT_SERVICE_NAME -f
48 | cf delete-service $GENAI_EMBEDDINGS_SERVICE_NAME -f
49 | cf delete $APP_NAME -f -r
50 | ;;
51 | *)
52 | echo && printf "\e[31m⏹ Usage: cf/cleanup \e[m\n" && echo
53 | ;;
54 | esac
55 |
56 |
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/diego/ssh-conceptual.md:
--------------------------------------------------------------------------------
1 | # Cloud Foundry app SSH components and processes
2 | This topic tells you about the Cloud Foundry SSH components that are used for access
3 | to deployed app instances. Cloud Foundry supports native SSH access to apps and load balancing of SSH sessions with the load balancer for your Cloud Foundry deployment.
4 | For procedural and configuration information about app SSH access, see [SSH Overview](https://docs.cloudfoundry.org/devguide/deploy-apps/app-ssh-overview.html).
5 |
6 | ## SSH components
7 | Cloud Foundry SSH includes two central components: an implementation of an SSH proxy server and a lightweight SSH daemon. If these components are deployed and configured correctly, they provide a
8 | simple and scalable way to access containers apps and other long-running processes (LRPs).
9 |
10 | ### SSH daemon
11 | SSH daemon is a lightweight implementation that is built around the Go SSH library. It supports command execution, interactive shells, local port forwarding, and secure copy. The daemon is self-contained and has no dependencies on the container root file system.
12 | The daemon is focused on delivering basic access to app instances in Cloud Foundry. It is intended to run as an unprivileged process, and interactive shells and commands run as the daemon user. The daemon
13 | only supports one authorized key, and it is not intended to support multiple users.
14 | The daemon is available on a file server and Diego LRPs that want to use it can include a
15 | download action to acquire the binary and a run action to start it.
16 | Cloud Foundry apps download the daemon as part of the lifecycle bundle.
17 |
18 | ### SSH proxy authentication
19 | The SSH proxy hosts the user accessible SSH endpoint and is responsible for authentication,
20 | policy enforcement, and access controls in the context of Cloud Foundry.
21 | After you successfully authenticate with the proxy, the proxy attempts to locate
22 | the target container and create an SSH session to a daemon running inside the container.
23 | After both sessions have been established, the proxy manages the communication between your SSH client
24 | and the container SSH Daemon.
--------------------------------------------------------------------------------
/needs-work/vectorsage/RAGAPI/Common/OpenAIProviders/OpenAIEmbeddingProvider.py:
--------------------------------------------------------------------------------
1 | from Common.OpenAIProviders.OpenAIProvider import OpenAIProvider
2 | from typing import List
3 | import httpx
4 |
5 |
6 | class OpenAIEmbeddingProvider(OpenAIProvider):
7 | model_name: str = ""
8 | def __init__(self,
9 | api_base: str,
10 | api_key:str,
11 | embed_model_name: str,
12 | is_instructor_model: bool = False
13 | ):
14 | super().__init__(api_base=api_base,
15 | api_key=api_key,
16 | http_client=httpx.Client(verify=False)
17 | )
18 | self.model_name = embed_model_name
19 | self.is_instructor_model = is_instructor_model
20 |
21 | def get_embeddings_with_instructions(self, instruction, text):
22 | return self._generate_single_embedding(text=[instruction, text])
23 |
24 | def get_embeddings(self, text:str):
25 | return self._generate_single_embedding(text=text)
26 |
27 | def get_embeddings(self, texts:List[str]):
28 | return self._generate_multi_embedding(texts=texts)
29 |
30 | def _generate_multi_embedding(self, texts):
31 | try:
32 | response = self.oai_client.embeddings.create(
33 | input=texts,
34 | model=self.model_name
35 | )
36 | return [data.embedding for data in response.data]
37 | except Exception as e:
38 | raise Exception(f"Error generating embedding for '{texts}': {e}")
39 |
40 | def _generate_single_embedding(self, text):
41 | try:
42 | return self.oai_client.embeddings.create(
43 | input = [text],
44 | model=self.model_name
45 | ).data[0].embedding
46 | except Exception as e:
47 | raise Exception(f"Error generating embedding for '{text}': {e}")
48 |
--------------------------------------------------------------------------------
/needs-work/vectorsage/RAGAPI/Common/OpenAIProviders/OpenAILLMProvider.py:
--------------------------------------------------------------------------------
1 | from Common.OpenAIProviders.OpenAIProvider import OpenAIProvider
2 | from openai.types.chat.chat_completion_message_param import ChatCompletionMessageParam
3 | from typing import Iterable
4 | import httpx
5 |
6 |
7 | class OpenAILLMProvider(OpenAIProvider):
8 | model_name: str = ""
9 | def __init__(self,
10 | api_base: str,
11 | api_key:str,
12 | llm_model_name: str,
13 | temperature: float = 1.0
14 | ):
15 | super().__init__(api_base=api_base,
16 | api_key=api_key,
17 | http_client=httpx.Client(verify=False)
18 | )
19 | self.model_name = llm_model_name
20 | self.temperature = temperature
21 |
22 | def chat_completion(self, user_assistant_messages: Iterable[ChatCompletionMessageParam]):
23 | response = self.oai_client.chat.completions.create(
24 | model = self.model_name,
25 | response_format={ "type": "json_object" },
26 | messages= user_assistant_messages,
27 | temperature = self.temperature,
28 | stream=False
29 | )
30 | return response.choices[0].message.content
31 |
32 | def stream_chat_completion(self, user_assistant_messages: Iterable[ChatCompletionMessageParam]):
33 | stream = self.oai_client.chat.completions.create(
34 | model = self.model_name,
35 | response_format={ "type": "json_object" },
36 | messages= user_assistant_messages,
37 | temperature = self.temperature,
38 | stream=True
39 | )
40 | return stream
41 |
42 |
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/buildpacks/developing-buildpacks.md:
--------------------------------------------------------------------------------
1 | # Customizing and developing buildpacks in Cloud Foundry
2 | Buildpacks enable you to package frameworks and runtime support for your application.
3 | Cloud Foundry provides system buildpacks and an interface for customizing existing buildpacks and
4 | developing new buildpacks.
5 |
6 | ## Customizing and creating buildpacks
7 | If your application uses a language or framework that the Cloud Foundry system buildpacks do not support, do one of the following:
8 |
9 | * Use a [Cloud Foundry Community Buildpack](https://github.com/cloudfoundry-community/cf-docs-contrib/wiki/Buildpacks).
10 |
11 | * Use a [Heroku Third-Party Buildpack](https://devcenter.heroku.com/articles/third-party-buildpacks).
12 |
13 | * Customize an existing buildpack or create your own [custom buildpack](https://docs.cloudfoundry.org/buildpacks/custom.html).
14 | A common development practice for custom buildpacks is to fork existing buildpacks and sync subsequent patches from upstream.
15 | For information about customizing an existing buildpack or creating your own, see the following:
16 | ```
17 |
18 | + Creating Custom Buildpacks
19 |
20 | + Packaging Dependencies for Offline Buildpacks
21 | ```
22 |
23 | ## Maintaining buildpacks
24 | After you have modified an existing buildpack or created your own, it is necessary to maintain it.
25 | See the following topics to maintain your own buildpacks:
26 |
27 | * [Merging with upstream buildpacks](https://docs.cloudfoundry.org/buildpacks/merging_upstream.html)
28 |
29 | * [Upgrading dependency versions](https://docs.cloudfoundry.org/buildpacks/upgrading_dependency_versions.html)
30 | To configure a production server for your web app,
31 | see [Configuring a production server](https://docs.cloudfoundry.org/buildpacks/prod-server.html).
32 |
33 | ## Using CI for buildpacks
34 | For information about updating and releasing a new version of a Cloud Foundry buildpack through
35 | the Cloud Foundry Buildpacks Team Concourse pipeline, see [Using CI for buildpacks](https://docs.cloudfoundry.org/buildpacks/buildpack-ci-index.html).
36 | You can use this as a model when working with Concourse to build and release new versions of your own buildpacks.
--------------------------------------------------------------------------------
/spring-metal/conf/k8sdeploy.yml:
--------------------------------------------------------------------------------
1 | name: Deploy to K8s
2 | run-name: ${{ github.actor }} deploying
3 | on:
4 | push:
5 | branches:
6 | - "dev"
7 | jobs:
8 | gitops-deploy:
9 | runs-on: ubuntu-latest
10 | steps:
11 | - name: Install Tanzu CLI
12 | env:
13 | TANZU_CLI_VERSION: ${{vars.TANZU_CLI_VERSION}}
14 | run: |
15 | curl -Lo tanzu-cli-linux-amd64.tar.gz https://github.com/vmware-tanzu/tanzu-cli/releases/download/${TANZU_CLI_VERSION}/tanzu-cli-linux-amd64.tar.gz
16 | curl -Lo tanzu-cli-binaries-checksums.txt https://github.com/vmware-tanzu/tanzu-cli/releases/download/${TANZU_CLI_VERSION}/tanzu-cli-binaries-checksums.txt
17 | if [ "$(cat tanzu-cli-binaries-checksums.txt | grep tanzu-cli-linux-amd64.tar.gz)" != "$(sha256sum tanzu-cli-linux-amd64.tar.gz)" ]; then echo "Checksum does not match"; exit 1; fi
18 | tar -xf tanzu-cli-linux-amd64.tar.gz
19 | mv ${TANZU_CLI_VERSION}/tanzu-cli-linux_amd64 /usr/local/bin/tanzu
20 | tanzu ceip-participation set false
21 | tanzu config eula accept
22 | tanzu init
23 | tanzu version
24 |
25 | - name: Install Tanzu plugins
26 | env:
27 | TANZU_CLI_INCLUDE_DEACTIVATED_PLUGINS_TEST_ONLY: 1
28 | run: |
29 | tanzu plugin install build -v v0.9.2 -t 'global'
30 | tanzu plugin install resource -v v0.2.0 -t 'global'
31 | tanzu plugin install project -v v0.2.0 -t 'global'
32 | tanzu plugin install space -v v0.2.0 -t 'global'
33 |
34 | - name: Check out repository code
35 | uses: actions/checkout@v4
36 | - name: Build and Deploy to Tanzu Space
37 | env:
38 | TANZU_API_TOKEN: ${{ secrets.API_TOKEN }}
39 | run: |
40 | tanzu login --endpoint ${{ vars.API_ENDPOINT }}
41 | tanzu build config --build-plan-source-type=file --build-plan-source conf/platform-config.yml --containerapp-registry ${{ vars.BUILD_REGISTRY_CONF}}
42 | docker login ${{ vars.REGISTRY }} -u ${{vars.REGISTRY_USER_NAME}} -p ${{ secrets.RERGISTRY_PASS}}
43 | tanzu project use ${{ vars.PROJECT }}
44 | tanzu space use ${{ vars.SPACE_DEV }}
45 | tanzu deploy --patch --diff -y
46 | - run: echo "🍏 This job's status is ${{ job.status }}."
47 |
--------------------------------------------------------------------------------
/needs-work/spring-music-taylors-version/src/main/java/org/cloudfoundry/samples/music/web/InfoController.java:
--------------------------------------------------------------------------------
1 | package org.cloudfoundry.samples.music.web;
2 |
3 | import java.util.ArrayList;
4 | import java.util.HashMap;
5 | import java.util.List;
6 | import java.util.Map;
7 |
8 | import jakarta.servlet.http.HttpServletRequest;
9 |
10 | import org.cloudfoundry.samples.music.domain.ApplicationInfo;
11 | import org.springframework.beans.factory.annotation.Autowired;
12 | import org.springframework.core.env.Environment;
13 | import org.springframework.web.bind.annotation.RequestMapping;
14 | import org.springframework.web.bind.annotation.RestController;
15 |
16 | import io.pivotal.cfenv.core.CfEnv;
17 | import io.pivotal.cfenv.core.CfService;
18 |
19 | @RestController
20 | public class InfoController {
21 | private final CfEnv cfEnv;
22 |
23 | private Environment springEnvironment;
24 |
25 | @Autowired
26 | public InfoController(Environment springEnvironment) {
27 | this.springEnvironment = springEnvironment;
28 | this.cfEnv = new CfEnv();
29 | }
30 |
31 | @RequestMapping(value = "/request")
32 | public Map requestInfo(HttpServletRequest req) {
33 | HashMap result = new HashMap<>();
34 | result.put("session-id", req.getSession().getId());
35 | result.put("protocol", req.getProtocol());
36 | result.put("method", req.getMethod());
37 | result.put("scheme", req.getScheme());
38 | result.put("remote-addr", req.getRemoteAddr());
39 | return result;
40 | }
41 |
42 | @RequestMapping(value = "/appinfo")
43 | public ApplicationInfo info() {
44 | String instance = System.getenv("CF_INSTANCE_INDEX");
45 | return new ApplicationInfo(springEnvironment.getActiveProfiles(), getServiceNames(), instance);
46 | }
47 |
48 | @RequestMapping(value = "/service")
49 | public List showServiceInfo() {
50 | return cfEnv.findAllServices();
51 | }
52 |
53 | private String[] getServiceNames() {
54 | List services = cfEnv.findAllServices();
55 |
56 | List names = new ArrayList<>();
57 | for (CfService service : services) {
58 | names.add(service.getName());
59 | }
60 | return names.toArray(new String[0]);
61 | }
62 | }
--------------------------------------------------------------------------------
/spring-metal/runtime-configs/tpk8s/k8sdeploy.yml:
--------------------------------------------------------------------------------
1 | name: Deploy to K8s
2 | run-name: ${{ github.actor }} deploying
3 | on:
4 | push:
5 | branches:
6 | - "dev"
7 | jobs:
8 | gitops-deploy:
9 | runs-on: ubuntu-latest
10 | steps:
11 | - name: Install Tanzu CLI
12 | env:
13 | TANZU_CLI_VERSION: ${{vars.TANZU_CLI_VERSION}}
14 | run: |
15 | curl -Lo tanzu-cli-linux-amd64.tar.gz https://github.com/vmware-tanzu/tanzu-cli/releases/download/${TANZU_CLI_VERSION}/tanzu-cli-linux-amd64.tar.gz
16 | curl -Lo tanzu-cli-binaries-checksums.txt https://github.com/vmware-tanzu/tanzu-cli/releases/download/${TANZU_CLI_VERSION}/tanzu-cli-binaries-checksums.txt
17 | if [ "$(cat tanzu-cli-binaries-checksums.txt | grep tanzu-cli-linux-amd64.tar.gz)" != "$(sha256sum tanzu-cli-linux-amd64.tar.gz)" ]; then echo "Checksum does not match"; exit 1; fi
18 | tar -xf tanzu-cli-linux-amd64.tar.gz
19 | mv ${TANZU_CLI_VERSION}/tanzu-cli-linux_amd64 /usr/local/bin/tanzu
20 | tanzu ceip-participation set false
21 | tanzu config eula accept
22 | tanzu init
23 | tanzu version
24 |
25 | - name: Install Tanzu plugins
26 | env:
27 | TANZU_CLI_INCLUDE_DEACTIVATED_PLUGINS_TEST_ONLY: 1
28 | run: |
29 | tanzu plugin install build -v v0.9.2 -t 'global'
30 | tanzu plugin install resource -v v0.2.0 -t 'global'
31 | tanzu plugin install project -v v0.2.0 -t 'global'
32 | tanzu plugin install space -v v0.2.0 -t 'global'
33 |
34 | - name: Check out repository code
35 | uses: actions/checkout@v4
36 | - name: Build and Deploy to Tanzu Space
37 | env:
38 | TANZU_API_TOKEN: ${{ secrets.API_TOKEN }}
39 | run: |
40 | tanzu login --endpoint ${{ vars.API_ENDPOINT }}
41 | tanzu build config --build-plan-source-type=file --build-plan-source conf/platform-config.yml --containerapp-registry ${{ vars.BUILD_REGISTRY_CONF}}
42 | docker login ${{ vars.REGISTRY }} -u ${{vars.REGISTRY_USER_NAME}} -p ${{ secrets.RERGISTRY_PASS}}
43 | tanzu project use ${{ vars.PROJECT }}
44 | tanzu space use ${{ vars.SPACE_DEV }}
45 | tanzu deploy --patch --diff -y
46 | - run: echo "🍏 This job's status is ${{ job.status }}."
47 |
--------------------------------------------------------------------------------
/needs-work/vectorsage/OS-CF-docs-Apr-2024/cf-cli/develop-cli-plugins.md:
--------------------------------------------------------------------------------
1 | # Developing cf CLI plug-ins
2 | You can create and install cf CLI plug-ins to provide custom commands. You can submit and share these plug-ins to the [CF Community repository](https://plugins.cloudfoundry.org/).
3 |
4 | ## Prerequisite
5 | To use plug-ins, you must use cf CLI v7 or later. For information about downloading, installing, and uninstalling tcf CLI commands, see [Installing the Cloud Foundry Command Line Interface](https://docs.cloudfoundry.org/cf-cli/install-go-cli.html).
6 |
7 | ## Creating a plug-in
8 | To prepare to create a plug-in:
9 |
10 | 1. Implement the predefined plug-in interface from [plugin.go](https://github.com/cloudfoundry/cli/blob/master/plugin/plugin.go) in the Cloud Foundry CLI repository on GitHub.
11 |
12 | 2. Clone the [Cloud Foundry CLI repository](https://github.com/cloudfoundry/cli) from GitHub. To create a plug-in, you need the [basic GO plugin](https://github.com/cloudfoundry/cli/blob/master/plugin/plugin_examples/basic_plugin.go).
13 |
14 | ## Initializing the plug-in
15 | To initialize a plug-in:
16 |
17 | 1. From within the `main()` method of your plug-in, call:
18 | ```
19 | plugin.Start(new(MyPluginStruct))
20 | ```
21 | The `plugin.Start(...)` function requires a new reference to the `struct` that implements the defined interface.
22 |
23 | ## Invoking cf CLI commands
24 | To invoke cf CLI commands,
25 |
26 | 1. From within the `Run(...)` method of your plug-in, call:
27 | ```
28 | cliConnection.CliCommand([]args)
29 | ```
30 | The `Run(...)` method receives the `cliConnection` as its first argument. The `cliConnection.CliCommand([]args)` returns the output printed by the command and an error.
31 | The output is returned as a slice of strings. The error occurs if the call to the cf CLI command fails.
32 | For more information, see [Plug-in API](https://github.com/cloudfoundry/cli/blob/master/plugin/plugin_examples/DOC.md) in the Cloud Foundry CLI repository on GitHub.
33 |
34 | ## Installing a plug-in
35 | To install a plug-in:
36 |
37 | 1. Run:
38 | ```
39 | cf install-plugin PATH-TO-PLUGIN-BINARY
40 | ```
41 | Where `PATH-TO-PLUGIN-BINARY` is the path to your plug-in binary.
42 | For more information about developing plug-ins, see [plugin\_examples](https://github.com/cloudfoundry/cli/tree/master/plugin/plugin_examples) in the Cloud Foundry CLI repository on GitHub.
--------------------------------------------------------------------------------