-
Notifications
You must be signed in to change notification settings - Fork 56
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
Adds Digital Twin Runner utility #110
Adds Digital Twin Runner utility #110
Conversation
- Adds Lifecycle manager to support DT lifecycle phases. - The past invocations of DT lifecycle operations are tracked via a queue. This will eventually help with replay of operations on DT. - The invocations of lifecycle operations are completely asynchronous. It is possible to run all the phases at the same time. - The runner code is ready to be published as npm package. The README contains instructions on setting up private npm repository for development purposes. - FIX: There are no tests
- Adds skeleton invocation of ExecaCMDRunner from nestjs code - Formats code using prettier
- Sets the correct ts-jest preset for tests - Removes the incorrect npm registry setting in yarn.lock file
- Fixes eslint and jest configurations so that all yarn commands work correctly - Removes some of the lifeCycle code to make the basic code work
- Adds lifecycleManager and its dependencies - Fixes the yarn publish step. Now the package can be published successfully
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 7105 lines exceeds the maximum allowed for the inline comments feature.
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## feature/distributed-demo #110 +/- ##
============================================================
+ Coverage 64.37% 65.80% +1.42%
============================================================
Files 38 35 -3
Lines 494 424 -70
Branches 28 27 -1
============================================================
- Hits 318 279 -39
+ Misses 160 129 -31
Partials 16 16
... and 7 files with indirect coverage changes
|
@nichlaes quick questions:
Without npx NODE_OPTIONS=--experimental-vm-modules \
NODE_NO_WARNINGS=1 \
jest --coverage
npm ERR! code EINVALIDTAGNAME
npm ERR! Invalid tag name "NODE_OPTIONS=--experimental-vm-modules" of package "NODE_OPTIONS=--experimental-vm-modules": Tags may not have any characters that encodeURIComponent encodes.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/prasad/.npm/_logs/2023-09-16T08_09_38_602Z-debug-0.log |
- Completes integration tests for the codebase - Makes the execaCMDRunner catch the invalid commands - Removes get-stream dependency from execaCMDRunner - Uploads codecoverage to codecov - Adds new yarn command to watch the tests - Adds emojis to README
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 7253 lines exceeds the maximum allowed for the inline comments feature.
The two codeclimate issues are contradicting the coding idioms suggested by supertest. These two codeclimate issues need to be ignored. |
- Add OpenAPI specification for DT Runner - Updates git-hooks to check against runner as well - Adds more yarn test commands to runner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 7401 lines exceeds the maximum allowed for the inline comments feature.
@prasadtalasila |
We are currently restricted to Debian/Ubuntu. This is not a priority but the goal is to make cross-platform software. Since the DT Runner is being developed from scratch now, I am exploring an easier way of adding cross-platform support. More over, there is a definite requirement to execute DT Runner on Windows. The requirement will certainly come to us in a years' time. |
Would it be better to put powershell scripts in |
Hmm maybe a possibility would be to build it as a single executable file on both platforms? I not sure I have an understanding of what we want to do exactly, but maybe we could talk about it in person at some point? |
@prasadtalasila If we put bash -c before running the scripts in the package.json, we can remove the cross-env. The only requirement is that the windows machine has bash installed.
|
npx cross-env \ | ||
NODE_OPTIONS="$MOD_RES $EXP $EXP_RES" \ | ||
NODE_NO_WARNINGS=1 \ | ||
node dist/src/main.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it run 'main' or 'runner'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should run main.js
.
The runner.ts
was put in place to check the functionality of classes before tests were written. Also the
yarn publish
uses dist/runner.js
. That need to be changed to dist/main.js
.
I will change this and check again.
Here are some of my comments on the PR: It took me some time to grasp the whole 'phase' concept. Of course I'm still very new to the project, so maybe that is just how it is. You could consider if it would make sense to have it mention a bit further in the README or just an example. Another comment, which properly out of scope / nice-to-have. As it is now, it would not be possible to see the logs before the processes has succeeded/failed. Therefore we can't give a continuously status back to the user. I could imagine, this would be nice for the user, if the 'phase' takes a longer amount of time. Otherwise everything looks good. The code coverage is high, and the parts that are not covered are trivial. |
@nichlaes |
|
This is a relevant comment. The concept is explained in https://into-cps-association.github.io/DTaaS/version0.2/user/digital-twins/lifecycle.html (documentation). It must also be explained here as well. I will add more details in the README.
I need to change the
Ok. Thanks for the review. |
The problem with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 7479 lines exceeds the maximum allowed for the inline comments feature.
Code Climate has analyzed commit 088669a and detected 2 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
6e6b9f5
into
INTO-CPS-Association:feature/distributed-demo
This PR adds new Digital Twin Runner component to the project. This component can be run as a microservice. It can also be installed as a system utility that can be run as a regular command.
Current Status:
✔️ Working Nestjs project with useful functionality
✔️ Can be published as an npm package
✔️ Runs HTTP service and services two routes:
/phase
and/lifecycle/phase
✔️ Includes sufficient functionality for Digital Twin Lifecycle management. But not all of this functionality is available via HTTP API.
✔️ Complete integration and end-to-end tests
✔️ OpenAPI compliant-spec for DT Runner API (this yet to be implemented)
❌ Does not use dependency injection of nestjs framework
❌ Can not receive the commands over HTTP API
✖️ No unit tests
✖️ No configuration
❔ What is a good way to save the logs?
❔ Where should the configuration be saved? Can it be placed at a default location which is Operating System platform independent?