-
Notifications
You must be signed in to change notification settings - Fork 115
feat(boost): backend code changes needed to pass kagenti/llamastack integration testing #3644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
gabemontero
wants to merge
6
commits into
redhat-developer:main
from
gabemontero:boost-dev-scaffold-pr
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
fadc699
chore(boost): add app-config and load-secrets for local dev
gabemontero 84abc68
fix(kagenti-entity-provider): use correct API URLs and add Keycloak auth
gabemontero d017044
add TODO f/ups for cross ref mcp,skill access in routes.ts with catalog
gabemontero ae3eec9
chore(boost): add packages/backend with metrics compatibility shim
gabemontero 36d9738
chore(boost): dedupe yarn.lock
gabemontero ac186e2
fix(kagenti-entity-provider): address review findings for PR 3644
gabemontero File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| app: | ||
| title: Red Hat Developer Hub - Boost | ||
| baseUrl: http://localhost:3000 | ||
|
|
||
| organization: | ||
| name: Red Hat | ||
|
|
||
| backend: | ||
| baseUrl: http://localhost:7007 | ||
| listen: | ||
| port: 7007 | ||
| csp: | ||
| connect-src: ["'self'", 'http:', 'https:'] | ||
| cors: | ||
| origin: http://localhost:3000 | ||
| methods: [GET, HEAD, PATCH, POST, PUT, DELETE] | ||
| credentials: true | ||
| database: | ||
| client: better-sqlite3 | ||
| connection: ':memory:' | ||
|
|
||
| auth: | ||
| environment: development | ||
| providers: | ||
| guest: {} | ||
|
|
||
| catalog: | ||
| import: | ||
| entityFilename: catalog-info.yaml | ||
| pullRequestBranchName: backstage-integration | ||
| rules: | ||
| - allow: [Component, System, API, Resource, Location, Template] | ||
|
|
||
| boost: | ||
| security: | ||
| mode: 'development-only-no-auth' | ||
| adminUsers: | ||
| - 'user:default/admin' | ||
| - 'user:default/guest' | ||
| providers: | ||
| llamastack: | ||
| baseUrl: ${BOOST_LLAMA_STACK_URL:-https://llamastack-llamastack.apps.gmontero420.rhdh-pai.devfile-ci.com} | ||
| defaultModel: ${BOOST_MODEL:-vllm-inference/gpt-4.1} | ||
| kagenti: | ||
| baseUrl: ${KAGENTI_BASE_URL:-https://kagenti-api-kagenti-system.apps.gmontero420.rhdh-pai.devfile-ci.com} | ||
| defaultAgent: default | ||
| namespaces: | ||
| - team1 | ||
| - team2 | ||
| kagenti: | ||
| baseUrl: ${KAGENTI_BASE_URL:-https://kagenti-api-kagenti-system.apps.gmontero420.rhdh-pai.devfile-ci.com} | ||
| namespace: ${KAGENTI_NAMESPACE:-team1} | ||
| auth: | ||
| tokenEndpoint: ${KAGENTI_TOKEN_ENDPOINT:-https://keycloak-keycloak.apps.gmontero420.rhdh-pai.devfile-ci.com/realms/kagenti/protocol/openid-connect/token} | ||
| clientId: ${KAGENTI_CLIENT_ID:-spiffe://apps.gmontero420.rhdh-pai.devfile-ci.com/sa/kagenti-keycloak-client} | ||
| clientSecret: ${KAGENTI_CLIENT_SECRET} | ||
| showAllNamespaces: true | ||
| skipTlsVerify: true | ||
| verboseStreamLogging: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| module.exports = require('@backstage/cli/config/eslint-factory')(__dirname); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| { | ||
| "name": "backend", | ||
| "version": "0.0.0", | ||
| "main": "dist/index.cjs.js", | ||
| "types": "src/index.ts", | ||
| "private": true, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/redhat-developer/rhdh-plugins", | ||
| "directory": "workspaces/boost/packages/backend" | ||
| }, | ||
| "backstage": { | ||
| "role": "backend" | ||
| }, | ||
| "scripts": { | ||
| "start": "backstage-cli package start", | ||
| "build": "backstage-cli package build", | ||
| "lint": "backstage-cli package lint", | ||
| "test": "backstage-cli package test", | ||
| "clean": "backstage-cli package clean" | ||
| }, | ||
| "dependencies": { | ||
| "@backstage/backend-defaults": "^0.17.3", | ||
| "@backstage/backend-plugin-api": "^1.9.2", | ||
| "@backstage/config": "^1.3.6", | ||
| "@backstage/plugin-auth-backend": "^0.25.6", | ||
| "@backstage/plugin-auth-backend-module-guest-provider": "^0.2.14", | ||
| "@backstage/plugin-auth-node": "^0.6.9", | ||
| "@backstage/plugin-catalog-backend": "^3.2.0", | ||
| "@backstage/plugin-catalog-backend-module-logs": "^0.1.16", | ||
| "@backstage/plugin-permission-backend": "^0.7.8", | ||
| "@backstage/plugin-permission-backend-module-allow-all-policy": "^0.2.18", | ||
| "@backstage/plugin-permission-common": "^0.9.3", | ||
| "@backstage/plugin-permission-node": "^0.10.6", | ||
| "@backstage/plugin-proxy-backend": "^0.6.8", | ||
| "@red-hat-developer-hub/backstage-plugin-boost-backend": "workspace:*", | ||
| "@red-hat-developer-hub/backstage-plugin-boost-backend-module-kagenti": "workspace:*", | ||
| "@red-hat-developer-hub/backstage-plugin-boost-backend-module-llamastack": "workspace:*", | ||
| "@red-hat-developer-hub/backstage-plugin-kagenti-entity-provider": "workspace:*", | ||
| "@red-hat-developer-hub/backstage-plugin-llamastack-entity-provider": "workspace:*", | ||
| "better-sqlite3": "^12.0.0", | ||
| "node-gyp": "^9.0.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@backstage/cli": "^0.36.3" | ||
| }, | ||
| "files": [ | ||
| "dist" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| /* | ||
| * Copyright Red Hat, Inc. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| import { createBackend } from '@backstage/backend-defaults'; | ||
| import { createServiceFactory } from '@backstage/backend-plugin-api'; | ||
| import { metricsServiceRef } from '@backstage/backend-plugin-api/alpha'; | ||
|
|
||
| // No-op metrics service factory: catalog-backend depends on metricsServiceRef | ||
| // but backend-defaults does not yet provide a default factory (still absent as | ||
| // of Backstage 1.52 / backend-defaults 0.17.3). Remove this shim when | ||
| // backend-defaults adds a default metrics service factory. | ||
| const noop = () => {}; | ||
| const noopMetric = { | ||
| add: noop, | ||
| record: noop, | ||
| addCallback: noop, | ||
| removeCallback: noop, | ||
| }; | ||
| const noopMetricsFactory = createServiceFactory({ | ||
| service: metricsServiceRef, | ||
| deps: {}, | ||
| factory: () => ({ | ||
| createCounter: () => noopMetric, | ||
| createUpDownCounter: () => noopMetric, | ||
| createHistogram: () => noopMetric, | ||
| createGauge: () => noopMetric, | ||
| createObservableCounter: () => noopMetric, | ||
| createObservableUpDownCounter: () => noopMetric, | ||
| createObservableGauge: () => noopMetric, | ||
| }), | ||
| }); | ||
|
|
||
| const backend = createBackend(); | ||
|
|
||
| backend.add(noopMetricsFactory); | ||
|
|
||
| backend.add(import('@backstage/plugin-proxy-backend')); | ||
|
|
||
| backend.add(import('@backstage/plugin-auth-backend')); | ||
| backend.add(import('@backstage/plugin-auth-backend-module-guest-provider')); | ||
|
|
||
| backend.add(import('@backstage/plugin-catalog-backend')); | ||
| backend.add(import('@backstage/plugin-catalog-backend-module-logs')); | ||
|
|
||
| backend.add(import('@backstage/plugin-permission-backend')); | ||
| backend.add( | ||
| import('@backstage/plugin-permission-backend-module-allow-all-policy'), | ||
| ); | ||
|
|
||
| // Boost plugins | ||
| backend.add(import('@red-hat-developer-hub/backstage-plugin-boost-backend')); | ||
| backend.add( | ||
| import('@red-hat-developer-hub/backstage-plugin-boost-backend-module-llamastack'), | ||
| ); | ||
| backend.add( | ||
| import('@red-hat-developer-hub/backstage-plugin-boost-backend-module-kagenti'), | ||
| ); | ||
| backend.add( | ||
| import('@red-hat-developer-hub/backstage-plugin-kagenti-entity-provider'), | ||
| ); | ||
| backend.add( | ||
| import('@red-hat-developer-hub/backstage-plugin-llamastack-entity-provider'), | ||
| ); | ||
|
|
||
| backend.start(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.