Skip to content

Commit

Permalink
Velocitas offline (#89)
Browse files Browse the repository at this point in the history
Prepare Velocitas offline mode (enabling Python venv usage)
  • Loading branch information
BjoernAtBosch authored Sep 4, 2024
1 parent 4e67e3e commit 5ec28c1
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 90 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,6 @@ jobs:
export VELOCITAS_COMPONENT_PATH=${VELOCITAS_PACKAGE_REPO_PATH}/${{ matrix.component }}
cd $VELOCITAS_PACKAGE_REPO_PATH
python -m pip install -r ./${{ matrix.component }}/test/requirements.txt
python -m pip install -r ./${{ matrix.component }}/requirements.txt
python3 -m pip install -r ./${{ matrix.component }}/test/requirements.txt
python3 -m pip install -r ./${{ matrix.component }}/requirements.txt
pytest -s ./${{ matrix.component }}/test/integration
2 changes: 1 addition & 1 deletion build-system/cpp-cmake-conan/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
velocitas-lib==0.0.11
velocitas-lib==0.0.12
1 change: 1 addition & 0 deletions conan-setup/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
velocitas-lib==0.0.12
2 changes: 1 addition & 1 deletion grpc-interface-support/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
velocitas-lib==0.0.11
velocitas-lib==0.0.12
proto-schema-parser==1.3.4
4 changes: 2 additions & 2 deletions grpc-interface-support/src/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def __init__(
def __invoke_code_generator(self) -> None:
subprocess.check_call(
[
"python",
"python3",
"-m",
"grpc_tools.protoc",
f"-I{self.__proto_include_path}",
Expand All @@ -136,7 +136,7 @@ def __invoke_code_generator(self) -> None:
for element in imports:
path = os.path.join(self.__proto_include_path, element)
args = [
"python",
"python3",
"-m",
"grpc_tools.protoc",
f"-I{self.__proto_include_path}",
Expand Down
54 changes: 44 additions & 10 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,25 @@
"programs": [
{
"id": "install-deps",
"executable": "python",
"executable": "python3",
"args": [
"./src/install_deps.py"
"-m",
"pip",
"install",
"-r",
"./requirements.txt"
]
},
{
"id": "download-vspec",
"executable": "python",
"executable": "python3",
"args": [
"./src/download_vspec.py"
]
},
{
"id": "generate-model",
"executable": "python",
"executable": "python3",
"args": [
"./src/generate_model.py"
]
Expand Down Expand Up @@ -111,6 +115,17 @@
"description": "Sets up the conan client to connect to different remotes with credentials.",
"basePath": "./conan-setup",
"programs": [
{
"id": "install-deps",
"executable": "python3",
"args": [
"-m",
"pip",
"install",
"-r",
"./requirements.txt"
]
},
{
"id": "run",
"executable": "python3",
Expand All @@ -120,6 +135,9 @@
}
],
"onPostInit": [
{
"ref": "install-deps"
},
{
"ref": "run"
}
Expand All @@ -139,7 +157,7 @@
"programs": [
{
"id": "install-deps",
"executable": "python",
"executable": "python3",
"args": [
"-m",
"pip",
Expand All @@ -150,7 +168,7 @@
},
{
"id": "run",
"executable": "python",
"executable": "python3",
"args": [
"./src/run.py"
]
Expand Down Expand Up @@ -209,7 +227,7 @@
"programs": [
{
"id": "install-deps",
"executable": "python",
"executable": "python3",
"args": [
"-m",
"pip",
Expand All @@ -221,7 +239,7 @@
{
"id": "generate-sdk",
"description": "Generates service client SDKs to be used in business logic.",
"executable": "python",
"executable": "python3",
"args": [
"./src/main.py"
]
Expand All @@ -231,19 +249,35 @@
{
"id": "build-system",
"basePath": "build-system",
"onPostInit": [
{
"ref": "install-deps"
}
],
"programs": [
{
"id": "install-deps",
"executable": "python3",
"args": [
"-m",
"pip",
"install",
"-r",
"./cpp-cmake-conan/requirements.txt"
]
},
{
"id": "install",
"description": "Installs all necessary dependencies / packages for the application",
"executable": "python",
"executable": "python3",
"args": [
"./cpp-cmake-conan/src/install_deps.py"
]
},
{
"id": "build",
"description": "Builds the application",
"executable": "python",
"executable": "python3",
"args": [
"./cpp-cmake-conan/src/build.py"
]
Expand Down
2 changes: 1 addition & 1 deletion sdk-installer/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
velocitas-lib==0.0.11
velocitas-lib==0.0.12
cloudevents # FIXME: this dep is missing in SDK!
2 changes: 1 addition & 1 deletion sdk-installer/src/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def get_required_package_version(self, package_name: str) -> Optional[str]:

def install_local_package(self, path: str) -> None:
subprocess.check_call(
["python", "-m", "pip", "install", "."],
["python3", "-m", "pip", "install", "."],
stdout=subprocess.DEVNULL if not self._verbose_logging else None,
cwd=path,
)
Expand Down
2 changes: 1 addition & 1 deletion setup/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
velocitas-lib==0.0.11
velocitas-lib==0.0.12
2 changes: 2 additions & 0 deletions setup/src/common/scripts/onCreateCommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ sudo chown -R $(whoami) $HOME
if [[ -z "${VELOCITAS_OFFLINE}" ]]; then
.devcontainer/scripts/configure-codespaces.sh
.devcontainer/scripts/upgrade-cli.sh
elif [[ -x .devcontainer/scripts/local-setup.sh ]]; then
.devcontainer/scripts/local-setup.sh
fi

echo "#######################################################"
Expand Down
2 changes: 1 addition & 1 deletion vehicle-model-lifecycle/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
velocitas-lib==0.0.11
velocitas-lib==0.0.12
velocitas-model-generator==0.7.1
types-requests
requests
70 changes: 0 additions & 70 deletions vehicle-model-lifecycle/src/install_deps.py

This file was deleted.

0 comments on commit 5ec28c1

Please sign in to comment.