Skip to content

Commit

Permalink
Remove k3d and dapr (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
BjoernAtBosch committed Mar 22, 2024
1 parent 9639248 commit ffc8b95
Show file tree
Hide file tree
Showing 52 changed files with 132 additions and 1,199 deletions.
31 changes: 0 additions & 31 deletions .dapr/components/pubsub.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions .dapr/config.yaml

This file was deleted.

7 changes: 1 addition & 6 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@
#
# SPDX-License-Identifier: Apache-2.0

FROM ghcr.io/eclipse-velocitas/devcontainer-base-images/python:v0.2

# Force dapr to use localhost traffic
ENV DAPR_HOST_IP="127.0.0.1"
# Add daprd to the path for the VS Code Dapr extension.
ENV PATH=$PATH:/home/vscode/.dapr/bin
FROM ghcr.io/eclipse-velocitas/devcontainer-base-images/python:v0.3

ENV DOCKER_BUILDKIT=1

Expand Down
2 changes: 0 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-azuretools.vscode-dapr",
"ms-azuretools.vscode-docker",
"rpdswtk.vsmqtt",
"dotjoshjohnson.xml",
"ms-kubernetes-tools.vscode-kubernetes-tools",
"matangover.mypy",
"anweber.vscode-httpyac",
"ms-python.mypy-type-checker",
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,10 @@ jobs:
- name: Run Linters
uses: pre-commit/[email protected]

- name: Run the daparized databroker binary
- name: Run the databroker binary
run: |
./.vscode/scripts/ensure-dapr.sh DAPR --task
./.vscode/scripts/run-mosquitto.sh --task &
./.vscode/scripts/run-vehicledatabroker.sh DAPR --task &
./.vscode/scripts/run-vehicledatabroker.sh --task &
sleep 10s
- name: Run unit and integration tests
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/project-creation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
with:
repository: eclipse-velocitas/cli
path: cli
ref: v0.6.3
ref: v0.7.0

- name: Checkout SDK repo
uses: actions/checkout@v4
Expand All @@ -60,6 +60,13 @@ jobs:
cd cli
npm i && npm run build && npx oclif manifest && npm i -g .
- name: Checkout vehicle-app-template
uses: actions/checkout@v4
with:
repository: eclipse-velocitas/vehicle-app-template
path: vehicle-app-template
ref: main

- name: Create project
shell: bash
run: |
Expand All @@ -76,12 +83,12 @@ jobs:
velocitas
# copy "full" package-index.json from CLI repo
cp ../cli/testbench/test-create/vehicle-app-template/package-index.json ./package-index.json
cp ../vehicle-app-template/package-index.json ./package-index.json
CREATE_ARGS="-n MyApp"
if [ "${{ matrix.example }}" != "no-example" ]; then
CREATE_ARGS="-e ${{ matrix.example }}"
fi
velocitas create -l python $CREATE_ARGS
velocitas create -c vapp-core-python $CREATE_ARGS
- name: Install dependencies
shell: bash
Expand All @@ -108,7 +115,6 @@ jobs:
pre-commit run --all-files && \
pip3 install -r .devcontainer/tests/automated_tests/requirements.txt && \
cat app/AppManifest.json && \
velocitas exec grpc-interface-support generate-sdk && \
pytest -sx .devcontainer/tests/automated_tests
- name: Upload logs
Expand Down
10 changes: 3 additions & 7 deletions .project-creation/.skeleton/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,14 @@
# syntax=docker/dockerfile:1.2

# Build stage, to create the executable
FROM --platform=$TARGETPLATFORM ghcr.io/eclipse-velocitas/devcontainer-base-images/python:v0.2 as builder
FROM --platform=$TARGETPLATFORM ghcr.io/eclipse-velocitas/devcontainer-base-images/python:v0.3 as builder
ARG TARGETARCH

RUN apt-get update && apt-get install -y python3-dev

COPY ./.velocitas.json /workspace/.velocitas_org.json
COPY ./.velocitas.json /workspace/.velocitas.json
COPY ./app /workspace/app

# FIXME: For build tooling we only need "devenv-devcontainer-setup", we should be able to
# filter this without manual jq intervention...
RUN cat ./workspace/.velocitas_org.json | jq 'del(.packages[] | select(.name|test(".*devenv-devcontainer-setup.*")|not))' > ./workspace/.velocitas.json

# Remove this installation for Arm64 once staticx has a prebuilt wheel for Arm64
RUN /bin/bash -c 'set -ex && \
ARCH=`uname -m` && \
Expand All @@ -44,7 +40,7 @@ RUN pip3 install --no-cache-dir pyinstaller==5.9.0 \

WORKDIR /workspace

RUN velocitas init
RUN velocitas init -v

WORKDIR /workspace/app

Expand Down
2 changes: 1 addition & 1 deletion .project-creation/.skeleton/requirements-velocitas.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
velocitas-sdk==0.13.1
velocitas-sdk==0.14.0
1 change: 0 additions & 1 deletion .project-creation/.skeleton/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@

grpcio==1.59.0
protobuf==4.24.4
dapr==1.11.0
cloudevents==1.10.0
aiohttp==3.9.3
20 changes: 3 additions & 17 deletions .project-creation/.skeleton/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
# pip-compile
#
aiohttp==3.9.3
# via
# -r requirements.in
# dapr
# via -r requirements.in
aiosignal==1.3.1
# via aiohttp
async-timeout==4.0.3
Expand All @@ -16,18 +14,14 @@ attrs==23.1.0
# via aiohttp
cloudevents==1.10.0
# via -r requirements.in
dapr==1.11.0
# via -r requirements.in
deprecation==2.1.0
# via cloudevents
frozenlist==1.4.0
# via
# aiohttp
# aiosignal
grpcio==1.59.0
# via
# -r requirements.in
# dapr
# via -r requirements.in
idna==3.4
# via yarl
multidict==6.0.4
Expand All @@ -37,14 +31,6 @@ multidict==6.0.4
packaging==23.2
# via deprecation
protobuf==4.24.4
# via
# -r requirements.in
# dapr
python-dateutil==2.8.2
# via dapr
six==1.16.0
# via python-dateutil
typing-extensions==4.8.0
# via dapr
# via -r requirements.in
yarl==1.9.2
# via aiohttp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ def _set_env(self, runtime: str) -> None:
mqtt_port = 1883
vdb_port = 55555

if runtime == "runtime_k3d":
mqtt_port = 31883
vdb_port = 30555

os.environ["MQTT_PORT"] = f"{mqtt_port}"
os.environ["VDB_PORT"] = f"{vdb_port}"

Expand All @@ -53,7 +49,7 @@ def _disable_mocking(self) -> None:
"""
)

@parameterized.expand(["runtime_k3d", "runtime_kanto"])
@parameterized.expand(["runtime_kanto"])
def test_runtime(self, runtime):
self._set_env(runtime)
self._disable_mocking()
Expand Down
9 changes: 3 additions & 6 deletions .project-creation/templates/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@
"name": "VehicleApp",
"program": "${workspaceFolder}/app/src/main.py",
"console": "integratedTerminal",
"preLaunchTask": "dapr-sidecar-start",
"postDebugTask": "dapr-sidecar-stop",
"env": {
"APP_PORT": "50008",
"DAPR_HTTP_PORT": "3500",
"DAPR_GRPC_PORT": "50001",
"VEHICLEDATABROKER_DAPR_APP_ID": "vehicledatabroker"
"SDV_MIDDLEWARE_TYPE": "native",
"SDV_VEHICLEDATABROKER_ADDRESS": "grpc://127.0.0.1:55555",
"SDV_MQTT_ADDRESS": "mqtt://127.0.0.1:1883"
}
}
]
Expand Down
Loading

0 comments on commit ffc8b95

Please sign in to comment.