@aifabrix/builder 2.33.0 → 2.33.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +13 -0
  2. package/integration/hubspot/README.md +7 -7
  3. package/lib/api/index.js +6 -2
  4. package/lib/app/deploy-config.js +161 -0
  5. package/lib/app/deploy.js +28 -153
  6. package/lib/app/register.js +6 -5
  7. package/lib/app/run-helpers.js +23 -17
  8. package/lib/cli.js +31 -1
  9. package/lib/commands/logout.js +3 -4
  10. package/lib/commands/up-common.js +72 -0
  11. package/lib/commands/up-dataplane.js +109 -0
  12. package/lib/commands/up-miso.js +134 -0
  13. package/lib/core/config.js +32 -9
  14. package/lib/core/secrets-docker-env.js +88 -0
  15. package/lib/core/secrets.js +142 -115
  16. package/lib/datasource/deploy.js +31 -3
  17. package/lib/datasource/list.js +102 -15
  18. package/lib/infrastructure/helpers.js +82 -1
  19. package/lib/infrastructure/index.js +2 -0
  20. package/lib/schema/env-config.yaml +7 -0
  21. package/lib/utils/api.js +70 -2
  22. package/lib/utils/compose-generator.js +13 -13
  23. package/lib/utils/config-paths.js +13 -0
  24. package/lib/utils/device-code.js +2 -2
  25. package/lib/utils/env-endpoints.js +2 -5
  26. package/lib/utils/env-map.js +4 -5
  27. package/lib/utils/error-formatters/network-errors.js +13 -3
  28. package/lib/utils/parse-image-ref.js +27 -0
  29. package/lib/utils/paths.js +28 -4
  30. package/lib/utils/secrets-generator.js +34 -12
  31. package/lib/utils/secrets-helpers.js +1 -2
  32. package/lib/utils/token-manager-refresh.js +5 -0
  33. package/package.json +1 -1
  34. package/templates/applications/dataplane/Dockerfile +16 -0
  35. package/templates/applications/dataplane/README.md +205 -0
  36. package/templates/applications/dataplane/env.template +143 -0
  37. package/templates/applications/dataplane/rbac.yaml +283 -0
  38. package/templates/applications/dataplane/variables.yaml +143 -0
  39. package/templates/applications/keycloak/Dockerfile +1 -1
  40. package/templates/applications/keycloak/README.md +193 -0
  41. package/templates/applications/keycloak/variables.yaml +5 -6
  42. package/templates/applications/miso-controller/Dockerfile +8 -8
  43. package/templates/applications/miso-controller/README.md +369 -0
  44. package/templates/applications/miso-controller/env.template +114 -6
  45. package/templates/applications/miso-controller/rbac.yaml +74 -0
  46. package/templates/applications/miso-controller/variables.yaml +93 -5
  47. package/templates/github/ci.yaml.hbs +44 -1
  48. package/templates/github/release.yaml.hbs +44 -0
  49. package/templates/infra/compose.yaml.hbs +2 -1
  50. package/templates/applications/miso-controller/test.yaml +0 -1
@@ -43,9 +43,97 @@ authentication:
43
43
 
44
44
  # Build Configuration
45
45
  build:
46
- context: .. # Docker build context (relative to builder/)
47
- dockerfile: builder/miso-controller/Dockerfile # Dockerfile name (empty = use template)
48
- envOutputPath: # Copy .env to repo root for local dev (relative to builder/) (if null, no .env file is copied) (if empty, .env file is copied to repo root)
49
- localPort: 3010 # Port for local development (different from Docker port)
50
- language: typescript # Runtime language for template selection (typescript or python)
46
+ context: ../.. # Docker build context (relative to builder/miso-controller/)
47
+ dockerfile: builder/miso-controller/Dockerfile # Dockerfile name (relative to project root)
48
+ envOutputPath: ../../packages/miso-controller/.env # Copy .env to repo root for local dev (relative to builder/) (if null, no .env file is copied) (if empty, .env file is copied to repo root)
49
+ localPort: 3010 # Port for local development (different from Docker port)
50
+ language: typescript # Runtime language for template selection (typescript or python)
51
51
 
52
+ # =============================================================================
53
+ # Portal Input Configuration (Deployment Wizard)
54
+ # =============================================================================
55
+ # User-editable parameters only. No system URLs, credentials, or secrets.
56
+ #
57
+ # NOT included (auto-configured):
58
+ # - DATABASE_URL, REDIS_URL, KEYCLOAK_* → auto-generated during Azure install
59
+ # - MISO_*, AZURE_*, kv:// → credentials and system parameters
60
+ # - PORT, NODE_ENV, MISO_ENVIRONMENT → set by deployment target
61
+
62
+ configuration:
63
+ # -------------------------------------------------------------------------
64
+ # Operations & Debugging
65
+ # -------------------------------------------------------------------------
66
+ - name: LOG_LEVEL
67
+ portalInput:
68
+ field: select
69
+ label: "Log Level"
70
+ options:
71
+ - debug
72
+ - info
73
+ - warn
74
+ - error
75
+
76
+ - name: ENABLE_API_DOCS
77
+ portalInput:
78
+ field: select
79
+ label: "Enable API Documentation (Swagger/ReDoc)"
80
+ options:
81
+ - "true"
82
+ - "false"
83
+
84
+ - name: FAST_STARTUP
85
+ portalInput:
86
+ field: select
87
+ label: "Fast Startup (skip non-critical init)"
88
+ options:
89
+ - "true"
90
+ - "false"
91
+
92
+ - name: LOG_TO_FILE
93
+ portalInput:
94
+ field: select
95
+ label: "Log to File"
96
+ options:
97
+ - "true"
98
+ - "false"
99
+
100
+ # -------------------------------------------------------------------------
101
+ # Keycloak Events (feature flag)
102
+ # -------------------------------------------------------------------------
103
+ - name: KEYCLOAK_EVENTS_ENABLED
104
+ portalInput:
105
+ field: select
106
+ label: "Keycloak Events (sync users/groups)"
107
+ options:
108
+ - "true"
109
+ - "false"
110
+
111
+ # -------------------------------------------------------------------------
112
+ # Rate Limiting (tune for environment)
113
+ # -------------------------------------------------------------------------
114
+ - name: RATE_LIMIT_WINDOW_MS
115
+ portalInput:
116
+ field: text
117
+ label: "Rate Limit Window (milliseconds)"
118
+ placeholder: "900000"
119
+
120
+ - name: RATE_LIMIT_MAX
121
+ portalInput:
122
+ field: text
123
+ label: "Rate Limit Max Requests per Window"
124
+ placeholder: "100"
125
+
126
+ # -------------------------------------------------------------------------
127
+ # Redis Cache TTL (seconds) – RBAC/roles caching
128
+ # -------------------------------------------------------------------------
129
+ - name: REDIS_ROLES_TTL
130
+ portalInput:
131
+ field: text
132
+ label: "Redis Roles Cache TTL (seconds)"
133
+ placeholder: "900"
134
+
135
+ - name: REDIS_PERMISSIONS_TTL
136
+ portalInput:
137
+ field: text
138
+ label: "Redis Permissions Cache TTL (seconds)"
139
+ placeholder: "900"
@@ -12,4 +12,47 @@ jobs:
12
12
  with:
13
13
  node-version: '20'
14
14
  - name: Run tests
15
- run: npm test
15
+ run: npm test
16
+
17
+ deploy:
18
+ name: Deploy to AI Fabrix
19
+ runs-on: ubuntu-latest
20
+ needs: test
21
+ # Note: This workflow deploys to ACR (Azure Container Registry) and Azure
22
+ # For local deployment, use 'aifabrix deploy {{appName}}' directly from your machine
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+
26
+ - name: Setup Node.js
27
+ uses: actions/setup-node@v4
28
+ with:
29
+ node-version: '20'
30
+
31
+ - name: Install AI Fabrix Builder
32
+ run: npm install -g @aifabrix/builder
33
+
34
+ - name: Authenticate with Controller
35
+ run: |
36
+ set -e
37
+ aifabrix login \
38
+ --method credentials \
39
+ --app {{appName}} \
40
+ --client-id ${{ secrets.DEV_MISO_CLIENTID }} \
41
+ --client-secret ${{ secrets.DEV_MISO_CLIENTSECRET }} \
42
+ --controller ${{ secrets.MISO_CONTROLLER_URL }} \
43
+ --environment dev
44
+
45
+ - name: Validate Application Manifest
46
+ run: |
47
+ set -e
48
+ aifabrix validate {{appName}}
49
+
50
+ - name: Build Docker Image
51
+ run: |
52
+ set -e
53
+ aifabrix build {{appName}} --tag ${{ github.sha }}
54
+
55
+ - name: Deploy Application
56
+ run: |
57
+ set -e
58
+ aifabrix deploy {{appName}}
@@ -56,3 +56,47 @@ jobs:
56
56
  body: Release {{appName}} ${{ github.ref }}
57
57
  draft: false
58
58
  prerelease: false
59
+
60
+ deploy:
61
+ name: Deploy to AI Fabrix
62
+ runs-on: ubuntu-latest
63
+ needs: create-release
64
+ # Note: This workflow deploys to ACR (Azure Container Registry) and Azure
65
+ # For local deployment, use 'aifabrix deploy {{appName}}' directly from your machine
66
+ steps:
67
+ - uses: actions/checkout@v4
68
+
69
+ - name: Setup Node.js
70
+ uses: actions/setup-node@v4
71
+ with:
72
+ node-version: '20'
73
+
74
+ - name: Install AI Fabrix Builder
75
+ run: npm install -g @aifabrix/builder
76
+
77
+ - name: Authenticate with Controller
78
+ run: |
79
+ set -e
80
+ aifabrix login \
81
+ --method credentials \
82
+ --app {{appName}} \
83
+ --client-id ${{ secrets.PRO_MISO_CLIENTID }} \
84
+ --client-secret ${{ secrets.PRO_MISO_CLIENTSECRET }} \
85
+ --controller ${{ secrets.MISO_CONTROLLER_URL }} \
86
+ --environment pro
87
+
88
+ - name: Validate Application Manifest
89
+ run: |
90
+ set -e
91
+ aifabrix validate {{appName}}
92
+
93
+ - name: Build Docker Image
94
+ run: |
95
+ set -e
96
+ TAG_VERSION=${GITHUB_REF#refs/tags/v}
97
+ aifabrix build {{appName}} --tag $TAG_VERSION
98
+
99
+ - name: Deploy Application
100
+ run: |
101
+ set -e
102
+ aifabrix deploy {{appName}}
@@ -54,7 +54,8 @@ services:
54
54
  PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
55
55
  PGADMIN_CONFIG_SERVER_MODE: 'False'
56
56
  PGADMIN_SERVER_JSON_FILE: /pgadmin4/servers.json
57
- PGPASSFILE: /pgpass
57
+ PGADMIN_REPLACE_SERVERS_ON_STARTUP: 'True'
58
+ PGPASS_FILE: /pgpass
58
59
  ports:
59
60
  - "{{pgadminPort}}:80"
60
61
  volumes:
@@ -1 +0,0 @@
1
- test content