Skip to content

Commit

Permalink
Merge branch 'feature/distributed-demo' into libms-git-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nichlaes committed Nov 28, 2024
2 parents b867ea8 + 54dba54 commit 8426107
Show file tree
Hide file tree
Showing 168 changed files with 5,846 additions and 1,673 deletions.
10 changes: 6 additions & 4 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,17 @@ plugins:
enabled: false

exclude_patterns:
- "**.txt"
- "**.json"
- "**.txt"
- ".pylintrc"
- servers/lib/src/types.ts
- "**/api/"
- "**/build/"
- "**/coverage/"
- "**/dist/"
- "**/node_modules/"
- "**/public/"
- client/config/
- servers/lib/src/types.ts
- "**/script/"
- "client/config/"
- "deploy/config/client/env*.js"
- .pylintrc
- "files/"
37 changes: 22 additions & 15 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
{
"name": "Digital Twin as a Service",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye",
"image": "mcr.microsoft.com/devcontainers/typescript-node:22-bullseye",
"features": {
"ghcr.io/devcontainers-contrib/features/apt-get-packages:1": {
"ghcr.io/devcontainers-extra/features/apt-get-packages:1": {
"version": "latest",
"clean_ppas": true,
"preserve_apt_list": true,
"packages": "curl graphviz htop net-tools powerline"
},
"ghcr.io/devcontainers/features/common-utils:2": {
"version": "latest",
"installZsh": true,
"configureZshAsDefaultShell": true,
"installOhMyZsh": true,
Expand All @@ -19,40 +21,45 @@
"userUid": "1001",
"userGid": "automatic"
},
"ghcr.io/devcontainers-contrib/features/exa:1": {
"ghcr.io/devcontainers-extra/features/exa:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "os-provided"
},
"ghcr.io/devcontainers-contrib/features/markdownlint-cli:1": {
"ghcr.io/devcontainers-extra/features/markdownlint-cli:1": {
"version": "latest"
},
"ghcr.io/devcontainers-contrib/features/mkdocs:2": {
"ghcr.io/devcontainers-extra/features/mkdocs:2": {
"version": "latest",
"plugins": "mkdocs-material pymdown-extensions mkdocstrings[crystal,python] mkdocs-monorepo-plugin mkdocs-pdf-export-plugin mkdocs-awesome-pages-plugin python-markdown-math mkdocs-open-in-new-tab mkdocs-with-pdf qrcode"
},
"ghcr.io/devcontainers-contrib/features/nestjs-cli:2": {
"ghcr.io/devcontainers-extra/features/nestjs-cli:2": {
"version": "latest"
},
"ghcr.io/devcontainers-contrib/features/npm-package:1": {
"ghcr.io/devcontainers-extra/features/npm-package:1": {
"package": "madge"
},
"ghcr.io/devcontainers-contrib/features/pipx-package:1": {},
"ghcr.io/devcontainers-contrib/features/poetry:2": {
"ghcr.io/devcontainers-extra/features/pipx-package:1": {
"version": "latest"
},
"ghcr.io/devcontainers-extra/features/poetry:2": {
"version": "latest"
},
"ghcr.io/devcontainers-contrib/features/pre-commit:2": {
"ghcr.io/devcontainers-extra/features/pre-commit:2": {
"version": "latest"
},
"ghcr.io/devcontainers-contrib/features/tmux-apt-get:1": {},
"ghcr.io/devcontainers-contrib/features/typescript:2": {
"ghcr.io/devcontainers-extra/features/tmux-apt-get:1": {
"version": "latest"
},
"ghcr.io/devcontainers-contrib/features/vercel-serve:1": {
"ghcr.io/devcontainers-extra/features/typescript:2": {
"version": "latest"
},
"ghcr.io/devcontainers-contrib/features/zsh-plugins:0": {
"ghcr.io/devcontainers-extra/features/vercel-serve:1": {
"version": "latest"
},
"ghcr.io/devcontainers-extra/features/zsh-plugins:0": {
"version": "latest",
"plugins": "ssh-agent npm zsh-autosuggestions",
"omzPlugins": "https://github.com/zsh-users/zsh-autosuggestions",
"username": "node"
Expand Down Expand Up @@ -105,4 +112,4 @@
]
}
// Execute after login:
// source /usr/share/powerline/bindings/zsh/powerline.zsh
// source /usr/share/powerline/bindings/zsh/powerline.zsh
13 changes: 0 additions & 13 deletions .eslintignore

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
yarn test:unit
yarn test:preview:unit
yarn test:preview:int
yarn test:coverage:int-unit
- name: Upload unit and integration test coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,9 @@ runner.yml
servers/execution/runner/lifecycle*

# certs
*.pem
*.pem

# gitlab service data
deploy/services/gitlab/logs/
deploy/services/gitlab/data/
deploy/services/gitlab/config/
2 changes: 1 addition & 1 deletion client/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,5 +218,5 @@ and tested using the following yarn commands.
```bash
yarn test:preview:int
yarn test:preview:unit
yarn test:coverage:int-unit
```

1 change: 1 addition & 0 deletions client/config/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if (typeof window !== 'undefined') {
REACT_APP_WORKBENCHLINK_VSCODE: '/tools/vscode/',
REACT_APP_WORKBENCHLINK_JUPYTERLAB: '/lab',
REACT_APP_WORKBENCHLINK_JUPYTERNOTEBOOK: '',
REACT_APP_WORKBENCHLINK_DT_PREVIEW: '/preview/digitaltwins',

REACT_APP_CLIENT_ID: '1be55736756190b3ace4c2c4fb19bde386d1dcc748d20b47ea8cfb5935b8446c',
REACT_APP_AUTH_AUTHORITY: 'https://gitlab.com/',
Expand Down
8 changes: 0 additions & 8 deletions client/jest.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@
"config"
],
"coverageDirectory": "<rootDir>/coverage/",
"coverageThreshold": {
"global": {
"branches": 20,
"functions": 30,
"lines": 50,
"statements": 50
}
},
"globals": {
"window.ENV.SERVER_HOSTNAME": "localhost",
"window.ENV.SERVER_PORT": 3500
Expand Down
11 changes: 6 additions & 5 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@into-cps-association/dtaas-web",
"version": "0.6.1",
"version": "0.7.0",
"description": "Web client for Digital Twin as a Service (DTaaS)",
"main": "index.tsx",
"author": "prasadtalasila <[email protected]> (http://prasad.talasila.in/)",
Expand Down Expand Up @@ -31,10 +31,11 @@
"test:all": "yarn test:unit && yarn test:int && yarn test:e2e",
"test:e2e:ext": "cross-env ext=true yarn test:e2e",
"test:e2e": "yarn config:test && playwright test -c ./playwright.config.ts",
"test:int": "jest -c ./jest.config.json ../test/integration --setupFilesAfterEnv ./test/integration/jest.setup.ts",
"test:unit": "jest -c ./jest.config.json ../test/unit --setupFilesAfterEnv ./test/unit/jest.setup.ts",
"test:preview:int": "jest -c ./jest.config.json ../test/preview/integration --setupFilesAfterEnv ./test/preview/integration/jest.setup.ts",
"test:preview:unit": "jest -c ./jest.config.json ../test/preview/unit --setupFilesAfterEnv ./test/preview/unit/jest.setup.ts"
"test:coverage:int-unit": "npx istanbul-combine -d coverage/all -r lcov -r json -r text coverage/unit/coverage-final.json coverage/int/coverage-final.json coverage/preview/unit/coverage-final.json coverage/preview/int/coverage-final.json",
"test:int": "jest -c ./jest.config.json jest --coverage --coverageDirectory=coverage/int ../test/integration --setupFilesAfterEnv ./test/integration/jest.setup.ts",
"test:unit": "jest -c ./jest.config.json --coverageDirectory=coverage/unit ../test/unit --setupFilesAfterEnv ./test/unit/jest.setup.ts",
"test:preview:int": "jest -c ./jest.config.json --coverageDirectory=coverage/preview/int ../test/preview/integration --setupFilesAfterEnv ./test/preview/integration/jest.setup.ts",
"test:preview:unit": "jest -c ./jest.config.json --coverageDirectory=coverage/preview/unit ../test/preview/unit --setupFilesAfterEnv ./test/preview/unit/jest.setup.ts"
},
"eslintConfig": {
"extends": [
Expand Down
14 changes: 11 additions & 3 deletions client/src/preview/components/asset/AssetBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { Grid } from '@mui/material';
import { useSelector, useDispatch } from 'react-redux';
import { RootState } from 'store/store';
import { deleteAsset } from 'preview/store/assets.slice';
import { AssetCardExecute, AssetCardManage } from './AssetCard';
import { fetchAssets } from 'preview/util/init';
import { Asset } from './Asset';
import { AssetCardExecute, AssetCardManage } from './AssetCard';

const outerGridContainerProps = {
container: true,
Expand All @@ -19,7 +20,6 @@ const outerGridContainerProps = {

interface AssetBoardProps {
tab: string;
error: string | null;
}

const AssetGridItem: React.FC<{
Expand All @@ -44,10 +44,18 @@ const AssetGridItem: React.FC<{
</Grid>
);

const AssetBoard: React.FC<AssetBoardProps> = ({ tab, error }) => {
const AssetBoard: React.FC<AssetBoardProps> = ({ tab }) => {
const assets = useSelector((state: RootState) => state.assets.items);
const [error, setError] = React.useState<string | null>(null);
const dispatch = useDispatch();

React.useEffect(() => {
const fetchData = async () => {
await fetchAssets(dispatch, setError);
};
fetchData();
}, [dispatch]);

const handleDelete = (deletedAssetPath: string) => {
dispatch(deleteAsset(deletedAssetPath));
};
Expand Down
2 changes: 1 addition & 1 deletion client/src/preview/components/asset/AssetCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import CardContent from '@mui/material/CardContent';
import Typography from '@mui/material/Typography';
import { AlertColor, CardActions, Grid } from '@mui/material';
import styled from '@emotion/styled';
import { formatName } from 'preview/util/gitlabDigitalTwin';
import { formatName } from 'preview/util/digitalTwin';
import CustomSnackbar from 'preview/route/digitaltwins/Snackbar';
import { useSelector } from 'react-redux';
import { selectDigitalTwinByName } from 'preview/store/digitalTwin.slice';
Expand Down
2 changes: 1 addition & 1 deletion client/src/preview/components/asset/DetailsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Dispatch, SetStateAction } from 'react';
import { Button } from '@mui/material';
import { useSelector } from 'react-redux';
import { selectDigitalTwinByName } from '../../store/digitalTwin.slice';
import DigitalTwin from '../../util/gitlabDigitalTwin';
import DigitalTwin from '../../util/digitalTwin';

interface DialogButtonProps {
assetName: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { ITabs } from 'route/IData';
const tabs: ITabs[] = [
{
label: 'Create',
body: `Create digital twins from tools provided within user workspaces. Each digital twin will have one directory. It is suggested that user provide one bash shell script to run their digital twin. Users can create the required scripts and other files from tools provided in Workbench page.`,
body: `Create and save new digital twins. The new digital twins are saved in the linked gitlab repository. Remember to add valid '.gitlab-ci.yml' configuration as it is used for execution of digital twin.`,
},
{
label: 'Manage',
body: `Read the complete description of digital twins. If necessary, users can delete a digital twin, removing it from the workspace with all its associated data. Users can also reconfigure the digital twin.`,
body: `Explore, edit and delete existing digital twins. The changes get saved in the linked gitlab repository.`,
},
{
label: 'Execute',
body: 'Execute the Digital Twins using Gitlab CI/CD workflows.',
body: 'Execute existing digital twins using CI/CD pipelines of the linked gitlab repository. Availability of gitlab runners is required for execution of digital twins.',
},
{
label: 'Analyze',
Expand Down
Loading

0 comments on commit 8426107

Please sign in to comment.