Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 17 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
**/*/node_modules
**/*/dist
**/*/.git
**/*/.github
**/*/.gitignore
**/*/.env
**/*/.env.staging
**/*/.env.production
**/*/.prettierrc.json
**/*/eslint.config.js
**/*/.husky
**/*/.vscode
**/*/.yarn
**/*/.yarnrc
.yarnrc.yml
README.md
extras
69 changes: 69 additions & 0 deletions .github/workflows/build-wavefront-web-develop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: (Develop) Build and Push Wavefront Web app to AWS and GCP

on:
workflow_dispatch:
push:
branches:
- wavefront

env:
PROJECT_ID: aesy-330511
GCP_REGION: asia-south1
GAR_LOCATION: asia-south1-docker.pkg.dev/aesy-330511/root-hub
IMAGE_NAME: wavefront-web

jobs:
build-push-artifact:
runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: "actions/checkout@v3"

- name: Get commit hash
id: get-commit-hash
run: echo "::set-output name=commit-hash::$(git rev-parse --short HEAD)"

- name: Get timestamp
id: get-timestamp
run: echo "::set-output name=timestamp::$(date +'%Y-%m-%d-%H-%M')"
Comment thread
vishnurk6247 marked this conversation as resolved.

- name: Cache Docker layers
id: cache-docker-layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-docker-${{ github.sha }}
restore-keys: |
${{ runner.os }}-docker-

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker Image
id: build-image
run: |
docker build -f wavefront/client/Dockerfile -t rootflo:${{ steps.get-commit-hash.outputs.commit-hash }}-${{ steps.get-timestamp.outputs.timestamp }} .
echo "IMAGE_TAG=${{ steps.get-commit-hash.outputs.commit-hash }}-${{ steps.get-timestamp.outputs.timestamp }}" >> $GITHUB_ENV

- id: "Auth-to-GCP"
uses: "google-github-actions/auth@v1"
with:
credentials_json: "${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}"

- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v1"

- name: "Docker auth for GCP"
run: |-
gcloud auth configure-docker ${{ env.GCP_REGION }}-docker.pkg.dev --quiet

- name: Tag and push image to GCP Artifact Registry
run: |
docker tag rootflo:${{ env.IMAGE_TAG }} ${{ env.GAR_LOCATION }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
docker push ${{ env.GAR_LOCATION }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}

- name: Cleanup Docker images
run: |
docker rmi rootflo:${{ env.IMAGE_TAG }} || true
docker rmi ${{ env.GAR_LOCATION }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} || true
Comment on lines +17 to +69

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 5 months ago

To fix the problem, you should add a permissions block following the principle of least privilege. This allows the workflow or job to run only with the minimal GitHub token permissions required, preventing unauthorized or accidental write operations to the repository. As none of the jobs in the provided workflow require write access to repository contents or metadata, the minimal setting is appropriate: at the workflow or job level, add permissions: contents: read. The block can be added after the name: line at the top (root-level, affecting all jobs), or directly in the build-push-artifact job block if more granular control is desired. The recommendation is to add it at the root for maximum coverage and clarity. No imports or special methods are needed.


Suggested changeset 1
.github/workflows/build-wavefront-web-develop.yaml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/build-wavefront-web-develop.yaml b/.github/workflows/build-wavefront-web-develop.yaml
--- a/.github/workflows/build-wavefront-web-develop.yaml
+++ b/.github/workflows/build-wavefront-web-develop.yaml
@@ -1,4 +1,6 @@
 name: (Develop) Build and Push Wavefront Web app to AWS and GCP
+permissions:
+  contents: read
 
 on:
   workflow_dispatch:
EOF
@@ -1,4 +1,6 @@
name: (Develop) Build and Push Wavefront Web app to AWS and GCP
permissions:
contents: read

on:
workflow_dispatch:
Copilot is powered by AI and may make mistakes. Always verify output.
10 changes: 2 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ __pycache__
enviroment.py
chroma
xamples
.env
dist
.venv
dataset
Expand All @@ -12,13 +11,8 @@ bin
.DS_Store
*.sql
*.log
*.yaml
examples/local/*
.logs
scratch_pad.py
.*
*.png
*.html
usecases/
compare_gemini_outputs_v1.py
node_modules/
.vite
flo_ai/usecases
1 change: 1 addition & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
45 changes: 45 additions & 0 deletions docker/floware.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
FROM python:3.11-slim

WORKDIR /app

COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

RUN apt-get update && apt-get install -y \
libpq-dev \
gcc \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*

COPY pyproject.toml uv.lock ./

COPY modules/auth_module /app/modules/auth_module
COPY modules/common_module /app/modules/common_module
COPY modules/db_repo_module /app/modules/db_repo_module
COPY modules/gold_module /app/modules/gold_module
COPY modules/insights_module /app/modules/insights_module
COPY modules/knowledge_base_module /app/modules/knowledge_base_module
COPY modules/user_management_module /app/modules/user_management_module
COPY modules/llm_inference_config_module /app/modules/llm_inference_config_module
COPY modules/agents_module /app/modules/agents_module
COPY modules/plugins_module/ /app/modules/plugins_module
COPY modules/product_analysis_module /app/modules/product_analysis_module
COPY modules/inference_module /app/modules/inference_module
COPY modules/image_search_module /app/modules/image_search_module
COPY modules/tools_module /app/modules/tools_module
COPY modules/voice_agents_module /app/modules/voice_agents_module
COPY modules/api_services_module /app/modules/api_services_module

COPY packages/flo_cloud /app/packages/flo_cloud
COPY packages/flo_utils /app/packages/flo_utils

COPY plugins/datasource /app/plugins/datasource
COPY plugins/authenticator /app/plugins/authenticator

COPY apps/floware /app/apps/floware

RUN uv sync --package floware --frozen --no-dev

WORKDIR /app/apps/floware/floware

CMD ["uv", "run", "server.py"]
5 changes: 5 additions & 0 deletions wavefront/client/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
VITE_BASE_URL=http://localhost:8002/floconsole
VITE_APP_ENV=production
VITE_FEATURE_API_SERVICES=true

# NOTE: Add the new variables to the /config endpoint in the server.cjs file(For docker)
37 changes: 37 additions & 0 deletions wavefront/client/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
ARG PNPM_VERSION=pnpm@10.13.1+sha512.37ebf1a5c7a30d5fabe0c5df44ee8da4c965ca0c5af3dbab28c3a1681b70a256218d05c81c9c0dcf767ef6b8551eb5b960042b9ed4300c59242336377e01cfad

FROM node:22-alpine AS deps
WORKDIR /app

RUN corepack enable && corepack prepare pnpm@${PNPM_VERSION}

COPY wavefront/client/pnpm-lock.yaml wavefront/client/pnpm-workspace.yaml ./
COPY wavefront/client/package.json ./

RUN pnpm install

FROM node:22-alpine AS build
WORKDIR /app

RUN corepack enable && corepack prepare pnpm@${PNPM_VERSION}

COPY --from=deps /app/node_modules ./node_modules
COPY --from=deps /app/pnpm-workspace.yaml ./
COPY --from=deps /app/package.json ./

COPY wavefront/client/ ./

RUN pnpm build
Comment thread
vishnurk6247 marked this conversation as resolved.

FROM node:22-alpine
WORKDIR /app

RUN corepack enable && corepack prepare pnpm@${PNPM_VERSION}

COPY --from=build /app/dist ./dist
COPY --from=build /app/server.cjs ./
RUN pnpm install express@4.21.2 compression@^1.8.0

EXPOSE 3000

CMD ["node", "server.cjs"]
54 changes: 54 additions & 0 deletions wavefront/client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:

```js
export default tseslint.config({
extends: [
// Remove ...tseslint.configs.recommended and replace with this
...tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
...tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
...tseslint.configs.stylisticTypeChecked,
],
languageOptions: {
// other options...
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
},
});
```

You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:

```js
// eslint.config.js
import reactX from 'eslint-plugin-react-x';
import reactDom from 'eslint-plugin-react-dom';

export default tseslint.config({
plugins: {
// Add the react-x and react-dom plugins
'react-x': reactX,
'react-dom': reactDom,
},
rules: {
// other rules...
// Enable its recommended typescript rules
...reactX.configs['recommended-typescript'].rules,
...reactDom.configs.recommended.rules,
},
});
```
22 changes: 22 additions & 0 deletions wavefront/client/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "tailwind.config.js",
"css": "src/index.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"iconLibrary": "lucide",
"aliases": {
"components": "@app/components",
"utils": "@app/lib/utils",
"ui": "@app/components/ui",
"lib": "@app/lib",
"hooks": "@app/hooks"
},
"registries": {}
}
28 changes: 28 additions & 0 deletions wavefront/client/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import js from '@eslint/js';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import tseslint from 'typescript-eslint';
import prettier from 'eslint-plugin-prettier';

export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
prettier: prettier,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
'prettier/prettier': 'error',
},
}
);
18 changes: 18 additions & 0 deletions wavefront/client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/favicon.png" />
<link rel="preload" as="image" href="/background.webp" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="/config.js"></script>
<title>Rootflo Console</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>

</html>
Loading
Loading