Code Monkey home page Code Monkey logo

devenv-devcontainer-setup's Issues

[Feature]: Remove Dapr middleware and K3D runtime

Description

We remove support for K3D runtime and Dapr middleware

  • Both technologies are too heavy weight for in-vehicle applications
  • Flexibility offered is not applicable in in-vehicle hardware architectures
  • Increase development effort in the Velocitas OSS team

Suggested Solution

No response

Alternatives

No response

Additional Context

No response

[Improvement] Don't use subprocess/sys.executable to call the vehicle model generator

Description

The generate_model.py is an useful script not only for setting up devcontainers but as a helper when generating the vehicle model during container build time of a vapp (e.g. Seat-Adjuster Example @ Leda - Examples).

It however uses subprocess.check_call() to run sdv.model_generator.main with the appropriate arguments as a separate shell process, one of them being sys.executable, which should be the path to the current Python executable.

sys.executable however uses argv[0] and other environment variables (e.g. PYTHONEXECUTABLE) to determine said path and might not be always reliable.

For example when building Seat-Adjuster Example @ Leda - Examples sys.executable resolves to /usr/bin/python, but the system python binary for the build host is at /usr/bin/python3, therefore requiring us to first install python-is-python3 that symlinks python to python3.

Possible improvement

Instead of calling sdv.model_generator.main as a shell sub-process, import it is a python module and call its main() function directly with the required cli arguments (running a separate shell process no longer required).

To implement this, the following modifications to sdv.model_generator.main will be required:

  1. Make main() take an optional list of arguments (default None)
def main(cli_args = None):
    ...
  1. Pass cli_args to parser.parse_args(args=cli_args) (ref: The parse_args() method):
    ...
    args = parser.parse_args(args=cli_args) # when cli_args = None, it defaults to sys.argv, otherwise it parses the provided list of arguments

    strict = args.strict

    include_dirs = ["."]
    include_dirs.extend(args.include_dir)
    ...

[Bug]: Fix unspecific error messages during model lifecycle

Severity

Medium

What release version, tag or commit-hash did you use?

v1.2.1

Current Behavior

If referencing a non-existing vss.json from the AppManifest.json and calling velocitas init -f the model lifecycle has this misleading output:

... > Running post init hook for 'vehicle-model-lifecycle'
Running 'install-deps'... done
Running 'download-vspec'... done
Running 'generate-model'... !
 ›   Error: Program returned exit code: 1

Misleading, because the download-vspec should drop the error and not the generate-model.

Also, there is unspecific message if a non-supported VSS version is used (e.g. VSS version 4.0 at the moment).

Also, if model lifecycle fails during devContainer setup, the failure is not clearly visualize and could be quite easily overseen. This seems especially the case if using GH Code Space.

Steps to Reproduce

  1. Change VSS reference in AppManifest to non-existing file
  2. Run velocitas init -f

Expected Behavior

Error messages should clearly point out what the issue is

Possible Solution

Catch specific error messages here: https://github.com/eclipse-velocitas/devenv-devcontainer-setup/blob/main/vehicle-model-lifecycle/src/download_vspec.py#L75

Additional Information

No response

Code of Conduct

  • I agree to follow this project's "Code of Conduct".

[Feature]: Execution of custom scripts on Dockerfile and devcontainer.json

Description

As developer I would like to execute custom scripts in Dockerfile and devcontainer.json to be able to localize some behavior (e.g. specific proxy handling etc).

Currently all local changes will be re-written by velocitas init

This feature based on eclipse-velocitas/devenv-runtimes#49

Suggested Solution

ON_CREATE_EXTENSION_SCRIPT = ".devcontainer/extensions/on-create.sh"

if [ -e "$ON_CREATE_EXTENSION_SCRIPT" ]; then
    bash $ON_CREATE_EXTENSION_SCRIPT
fi

Alternatives

No response

Additional Context

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.