Skip to content

Commit

Permalink
datacube: fix deployment (finos#3741)
Browse files Browse the repository at this point in the history
  • Loading branch information
YannanGao-gs authored Dec 17, 2024
1 parent 1614170 commit 399e02f
Show file tree
Hide file tree
Showing 13 changed files with 104 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .changeset/modern-dolls-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
6 changes: 6 additions & 0 deletions .changeset/tidy-pandas-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@finos/legend-application-data-cube-deployment': patch
'@finos/legend-application-data-cube-bootstrap': patch
---

Enable data cube deployment
2 changes: 2 additions & 0 deletions .github/workflows/check-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ jobs:
package: '@finos/legend-application-studio-deployment'
- image: local/legend-query
package: '@finos/legend-application-query-deployment'
- image: local/legend-data-cube
package: '@finos/legend-application-data-cube-deployment'
- image: local/legend-showcase-server
package: '@finos/legend-server-showcase-deployment'
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const setup = (outputDir) => {
resolve(outputDir, 'config.json'),
JSON.stringify(
{
appName: 'query',
appName: 'data-cube',
env: 'local',
engine: {
url: 'http://localhost:6300/api',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM finos/legend-shared-server:0.23.5
COPY dist/query /app/bin/webapp-content/web/query/
COPY dist/data-cube /app/bin/webapp-content/web/data-cube/

RUN mkdir -p /config
COPY docker/server-config.json /config/server-config.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default {
* e.g. `/something/` is the `baseUrl` of https://www.example.org/something/
* For URLs that have no path, use '/'.
*/
baseUrl: '/datacube/',
baseUrl: '/data-cube/',
/**
* `devServerOptions` [object, optional]
* Options to override `webpack-dev-server` configs.
Expand All @@ -36,7 +36,7 @@ export default {
devServerOptions: {
// NOTE: for development from within a Docker container, it's best to update this to 0.0.0.0
host: '0.0.0.0',
port: 9001,
port: 9007,
allowedHosts: 'all',
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"appName": "data-cube",
"env": "local",
"engine": {
"url": "${PROTOCOL}://${ENGINE_HOST}:${ENGINE_PORT}/api"
},
"depot": {
"url": "${PROTOCOL}://${DEPOT_HOST}:${DEPOT_PORT}/depot/api"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

PROTOCOL=${PROTOCOL:-http}
ENGINE_HOST=${ENGINE_HOST:-localhost}
ENGINE_PORT=${ENGINE_PORT:-6300}
DEPOT_HOST=${DEPOT_HOST:-localhost}
DEPOT_PORT=${DEPOT_PORT:-7000}

sed -i 's~${PROTOCOL}~'$PROTOCOL'~g' /config/config.json
sed -i 's~${ENGINE_HOST}~'$ENGINE_HOST'~g' /config/config.json
sed -i 's~${ENGINE_PORT}~'$ENGINE_PORT'~g' /config/config.json
sed -i 's~${DEPOT_HOST}~'$DEPOT_HOST'~g' /config/config.json
sed -i 's~${DEPOT_PORT}~'$DEPOT_PORT'~g' /config/config.json

java -cp /app/bin/webapp-content:/app/bin/* org.finos.legend.server.shared.staticserver.Server server /config/server-config.json

Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"pac4j": {
"callbackPrefix": "/data-cube/log.in",
"bypassPaths": ["/data-cube/admin/healthcheck"],
"clients": [
{
"org.finos.legend.server.pac4j.gitlab.GitlabClient": {
"name": "gitlab",
"clientId": "${GITLAB_APP_ID}",
"secret": "${GITLAB_APP_SECRET}",
"discoveryUri": "https://${GITLAB_HOST}/.well-known/openid-configuration",
"scope": "openid profile api"
}
}
],
"mongoUri": "${MONGODB_URI}",
"mongoDb": "${MONGODB_NAME}",
"mongoSession": {
"enabled": ${MONGO_SESSION_ENABLED},
"collection": "userSessions"
}
},
"html5Router": true,
"routerExemptPaths": [
"/editor.worker.js",
"/json.worker.js",
"/editor.worker.js.map",
"/json.worker.js.map",
"/version.json",
"/config.json",
"/favicon.ico",
"/static"
],
"localAssetPaths": {
"/data-cube/config.json": "/config/config.json"
},
"uiPath": "/data-cube",
"sessionCookie": "LEGEND_DATA_CUBE_JSESSIONID",
"server": {
"type": "simple",
"applicationContextPath": "/",
"adminContextPath": "/data-cube/admin",
"connector": {
"type": "http",
"port": ${DATA_CUBE_PORT}
}
},
"logging": {
"level": "INFO",
"loggers": {
"root": { "level": "INFO" },
"org.pac4j": { "level": "INFO" }
},
"appenders": [
{
"type": "console"
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"dev:webpack:debug": "cross-env NODE_ENV=development DEVELOPMENT_MODE=debug webpack serve --mode development",
"lint:js": "cross-env NODE_ENV=production eslint --cache --cache-location ./build/.eslintcache --report-unused-disable-directives --parser-options=project:\"./tsconfig.json\",requireConfigFile:false \"./scripts/**/*.{mjs,cjs,js}\" \"./src/**/*.{js,ts,tsx}\"",
"publish:docker": "echo 'Building webapp content...' && yarn bundle && ../../scripts/docker/publish-docker.sh finos/legend-data-cube",
"serve": "npx http-server ./dist -p 3000 -a localhost -g --cors -o /datacube",
"serve": "npx http-server ./dist -p 3000 -a localhost -g --cors -o /data-cube",
"setup": "rimraf \"dev\" && yarn node ./scripts/setup.js ./dev"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { LegendDataCubeWebApplication } from '@finos/legend-application-data-cube-bootstrap';
import config from '../datacube.config.js';
import config from '../data-cube.config.js';
import '../lib/tailwind.css'; // eslint-disable-line @finos/legend/no-cross-workspace-non-export-usage
import './index.css';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.json",
"datacube.config.js"
"data-cube.config.js"
],
"references": [{ "path": "../legend-application-data-cube-bootstrap" }]
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { resolve, dirname } from 'path';
import webpack from 'webpack';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import appConfig from './datacube.config.js';
import appConfig from './data-cube.config.js';
import {
getEnvInfo,
getWebAppBaseWebpackConfig,
Expand Down

0 comments on commit 399e02f

Please sign in to comment.