From 6b27df9c48900087b92e1489594e7d3e15729f1f Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Fri, 13 Sep 2024 20:21:31 +0200 Subject: [PATCH 1/4] Fix the villas examples workflow In our workflow, docker-compose was used corresponding to v1. In the current ubuntu:latest the support for v1 has been deprecated. This commit upgrades the action to v2. Signed-off-by: Leonardo Carreras --- .github/workflows/run_villas_example.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_villas_example.yaml b/.github/workflows/run_villas_example.yaml index 3be5f25bb7..3a7891e0e0 100644 --- a/.github/workflows/run_villas_example.yaml +++ b/.github/workflows/run_villas_example.yaml @@ -32,7 +32,7 @@ jobs: path: ${{ github.workspace }}/build - name: Start containers - run: cd ${{ inputs.compose_file_path }} && docker-compose -p dpsim-compose up -d + run: cd ${{ inputs.compose_file_path }} && docker compose -p dpsim-compose up -d - name: Run container commands timeout-minutes: 5 @@ -42,4 +42,4 @@ jobs: - name: Stop containers if: ${{ always() }} - run: cd ${{ inputs.compose_file_path }} && docker-compose -p dpsim-compose down + run: cd ${{ inputs.compose_file_path }} && docker compose -p dpsim-compose down From b1af20c840dce4c255a5a5f72eb03bdb63911fef Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Fri, 13 Sep 2024 22:38:08 +0200 Subject: [PATCH 2/4] Test cache deletion for problem with the fetching Signed-off-by: Leonardo Carreras --- .github/workflows/build_test_linux_fedora.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_test_linux_fedora.yaml b/.github/workflows/build_test_linux_fedora.yaml index 4348657d33..ab7cdea114 100644 --- a/.github/workflows/build_test_linux_fedora.yaml +++ b/.github/workflows/build_test_linux_fedora.yaml @@ -53,11 +53,10 @@ jobs: with: submodules: recursive - - name: Restore build archive - uses: actions/download-artifact@v4 - with: - name: build-fedora-examples-cache-${{ github.sha }} - path: ${{ github.workspace }}/build + - name: Configure CMake + shell: bash + working-directory: ${{ github.workspace }}/build + run: cmake -DCIM_VERSION=CGMES_2.4.15_16FEB2016 $GITHUB_WORKSPACE - name: Build every target shell: bash From f979c7dac775f1c0d247a3bffa2251712a6e8533 Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Fri, 13 Sep 2024 22:54:03 +0200 Subject: [PATCH 3/4] Add a suplementary cache Signed-off-by: Leonardo Carreras --- .github/workflows/build_test_linux_fedora.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_test_linux_fedora.yaml b/.github/workflows/build_test_linux_fedora.yaml index ab7cdea114..4a33d1d7bd 100644 --- a/.github/workflows/build_test_linux_fedora.yaml +++ b/.github/workflows/build_test_linux_fedora.yaml @@ -45,7 +45,6 @@ jobs: linux-fedora-examples: name: Build Cxx examples on Fedora Linux runs-on: ubuntu-latest - needs: [linux-fedora-dpsimpy] container: sogno/dpsim:dev steps: - name: Checkout @@ -53,6 +52,15 @@ jobs: with: submodules: recursive + - name: Create Build Environment + run: mkdir build + + - name: Setup build directory cache + uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/build + key: build-fedora-dir-example-cache-${{ github.ref }} + - name: Configure CMake shell: bash working-directory: ${{ github.workspace }}/build @@ -196,7 +204,6 @@ jobs: name: Scan Sourcecode with Cppcheck runs-on: ubuntu-latest container: sogno/dpsim:dev - #needs: [linux-fedora] steps: - name: Checkout uses: actions/checkout@v4 From 2133f5670acba07104905208a7eef05601895961 Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Fri, 13 Sep 2024 23:13:06 +0200 Subject: [PATCH 4/4] Update from snake case to kebab case in names of containers for villas examples Signed-off-by: Leonardo Carreras --- .../workflows/build_test_linux_fedora.yaml | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build_test_linux_fedora.yaml b/.github/workflows/build_test_linux_fedora.yaml index 4a33d1d7bd..e4d58f21a6 100644 --- a/.github/workflows/build_test_linux_fedora.yaml +++ b/.github/workflows/build_test_linux_fedora.yaml @@ -279,10 +279,10 @@ jobs: with: compose_file_path: examples/villas/docker-compose-tests container_commands: | - docker exec dpsim-compose_dpsim_1 /bin/bash -c "pip install paho-mqtt" - docker exec dpsim-compose_mqtt_1 mosquitto_sub -t "/dpsim-mqtt" -u wildcard -v& - docker exec dpsim-compose_dpsim_1 /bin/bash -c "cd /dpsim && python3 /dpsim/examples/villas/dpsim-mqtt-producer.py"& - docker exec dpsim-compose_dpsim_1 /bin/bash -c "cd /dpsim && python3 /dpsim/examples/villas/dpsim-mqtt.py" + docker exec dpsim-compose-dpsim-1 /bin/bash -c "pip install paho-mqtt" + docker exec dpsim-compose-mqtt-1 mosquitto_sub -t "/dpsim-mqtt" -u wildcard -v& + docker exec dpsim-compose-dpsim-1 /bin/bash -c "cd /dpsim && python3 /dpsim/examples/villas/dpsim-mqtt-producer.py"& + docker exec dpsim-compose-dpsim-1 /bin/bash -c "cd /dpsim && python3 /dpsim/examples/villas/dpsim-mqtt.py" test-villas-examples-2: name: Run dpsim-mqtt-import-export VILLASnode example @@ -291,8 +291,8 @@ jobs: with: compose_file_path: examples/villas/docker-compose-tests container_commands: | - docker exec dpsim-compose_mqtt_1 mosquitto_sub -t "#" -u wildcard -v& - docker exec dpsim-compose_dpsim_1 /bin/bash -c "cd /dpsim && python3 /dpsim/examples/villas/dpsim-mqtt-import-export.py" + docker exec dpsim-compose-mqtt-1 mosquitto_sub -t "#" -u wildcard -v& + docker exec dpsim-compose-dpsim-1 /bin/bash -c "cd /dpsim && python3 /dpsim/examples/villas/dpsim-mqtt-import-export.py" test-villas-examples-3: name: Run dpsim-mqtt-import-export-MIMO VILLASnode example @@ -302,8 +302,8 @@ jobs: compose_file_path: examples/villas/docker-compose-tests continue_on_error: true container_commands: | - docker exec dpsim-compose_mqtt_1 mosquitto_sub -t "#" -u wildcard -v& - docker exec dpsim-compose_dpsim_1 /bin/bash -c "cd /dpsim && python3 /dpsim/examples/villas/dpsim-mqtt-import-export-MIMO.py" + docker exec dpsim-compose-mqtt-1 mosquitto_sub -t "#" -u wildcard -v& + docker exec dpsim-compose-dpsim-1 /bin/bash -c "cd /dpsim && python3 /dpsim/examples/villas/dpsim-mqtt-import-export-MIMO.py" test-villas-examples-4: name: Run dpsim-file VILLASnode example @@ -313,8 +313,8 @@ jobs: compose_file_path: examples/villas/docker-compose-tests continue_on_error: true container_commands: | - docker exec dpsim-compose_dpsim_1 /bin/bash -c "sleep 3 && tail -f /dpsim/logs/output.csv"& - docker exec dpsim-compose_dpsim_1 /bin/bash -c "cd /dpsim && python3 /dpsim/examples/villas/dpsim-file.py" + docker exec dpsim-compose-dpsim-1 /bin/bash -c "sleep 3 && tail -f /dpsim/logs/output.csv"& + docker exec dpsim-compose-dpsim-1 /bin/bash -c "cd /dpsim && python3 /dpsim/examples/villas/dpsim-file.py" test-villas-examples-5: name: Run mqtt-cigre-mv-pf-profiles VILLASnode example @@ -323,5 +323,5 @@ jobs: with: compose_file_path: examples/villas/docker-compose-tests container_commands: | - docker exec dpsim-compose_mqtt_1 mosquitto_sub -t "#" -u wildcard -v& - docker exec dpsim-compose_dpsim_1 /bin/bash -c "cd /dpsim && python3 /dpsim/examples/villas/dpsim-mqtt-cigre-mv-pf-profiles.py" + docker exec dpsim-compose-mqtt-1 mosquitto_sub -t "#" -u wildcard -v& + docker exec dpsim-compose-dpsim-1 /bin/bash -c "cd /dpsim && python3 /dpsim/examples/villas/dpsim-mqtt-cigre-mv-pf-profiles.py"