Skip to content
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

Software In Loop Simulation Script Not Found #47

Closed
louisg1337 opened this issue May 31, 2024 · 5 comments · Fixed by #49
Closed

Software In Loop Simulation Script Not Found #47

louisg1337 opened this issue May 31, 2024 · 5 comments · Fixed by #49

Comments

@louisg1337
Copy link
Contributor

After the newest changes to everest-demo/main last night (found here), running the demo-iso15118-2-ac-plus-ocpp.sh command now returns this error:

Starting software in the loop simulation

sh: can't open '/workspace/build/run-scripts/run-sil-ocpp201-pnc.sh': No such file or directory
@shankari
Copy link
Collaborator

This is almost certainly due to the changes in #39 since I bumped up the .env version last night to incorporate them.

It looks like when @couryrr-afs was making the changes in 4fb6194, he forgot this particular docker-compose file

@drmrd @wjmp for visibility

@louisg1337 instead of waiting for the whole sprint planning cycle, can you just create a new PR to fix this in the same way as the others?

@shankari
Copy link
Collaborator

Made the obvious changes to replace /workspace/ with /ext/source/

diff --git a/demo-iso15118-2-ac-plus-ocpp.sh b/demo-iso15118-2-ac-plus-ocpp.sh
index d704df3..9dd5f92 100755
--- a/demo-iso15118-2-ac-plus-ocpp.sh
+++ b/demo-iso15118-2-ac-plus-ocpp.sh
@@ -342,7 +342,7 @@ pushd everest-demo || exit 1
 docker compose --project-name everest-ac-demo --file "${DEMO_COMPOSE_FILE_NAME}" up -d --wait
 docker cp config-sil-ocpp201-pnc.yaml  everest-ac-demo-manager-1:/ext/source/config/config-sil-ocpp201-pnc.yaml
 if [[ "$DEMO_VERSION" =~ sp2 || "$DEMO_VERSION" =~ sp3 ]]; then
-  docker cp manager/cached_certs_correct_name_emaid.tar.gz everest-ac-demo-manager-1:/workspace/
+  docker cp manager/cached_certs_correct_name_emaid.tar.gz everest-ac-demo-manager-1:/ext/source/
   docker exec everest-ac-demo-manager-1 /bin/bash -c "tar xf cached_certs_correct_name_emaid.tar.gz"
 
   echo "Configured everest certs, validating that the chain is set up correctly"
@@ -355,19 +355,19 @@ else
   if [[ "$DEMO_VERSION" =~ sp1 ]]; then
     echo "Copying device DB, configured to SecurityProfile: 1"
     docker cp manager/device_model_storage_maeve_sp1.db \
-      everest-ac-demo-manager-1:/workspace/dist/share/everest/modules/OCPP201/device_model_storage.db
+      everest-ac-demo-manager-1:/ext/source/dist/share/everest/modules/OCPP201/device_model_storage.db
   elif [[ "$DEMO_VERSION" =~ sp2 ]]; then
     echo "Copying device DB, configured to SecurityProfile: 2"
     docker cp manager/device_model_storage_maeve_sp2.db \
-      everest-ac-demo-manager-1:/workspace/dist/share/everest/modules/OCPP201/device_model_storage.db
+      everest-ac-demo-manager-1:/ext/source/dist/share/everest/modules/OCPP201/device_model_storage.db
   elif [[ "$DEMO_VERSION" =~ sp3 ]]; then
     echo "Copying device DB, configured to SecurityProfile: 3"
     docker cp manager/device_model_storage_maeve_sp3.db \
-      everest-ac-demo-manager-1:/workspace/dist/share/everest/modules/OCPP201/device_model_storage.db
+      everest-ac-demo-manager-1:/ext/source/dist/share/everest/modules/OCPP201/device_model_storage.db
   fi
 fi

 
 if [[ "$DEMO_VERSION" =~ v2.0.1 ]]; then
   echo "Starting software in the loop simulation"
-  docker exec everest-ac-demo-manager-1 sh /workspace/build/run-scripts/run-sil-ocpp201-pnc.sh
+  docker exec everest-ac-demo-manager-1 sh /ext/source/build/run-scripts/run-sil-ocpp201-pnc.sh
 fi

@shankari
Copy link
Collaborator

shankari commented May 31, 2024

Issue #1: The patches are not working

When I run the script, I get

Setting up maeve
Patching the CSMS to disable load balancer
patching file docker-compose.yml
Reversed (or previously applied) patch detected! Assume -R? [y] n
Apply anyway? [n] n
4 out of 4 hunks ignored--saving rejects to docker-compose.yml.rej
...
Patching the CSMS to enable local mo root
patching file 'manager/handlers/ocpp201/authorize.go'
2 out of 2 hunks failed--saving rejects to 'manager/handlers/ocpp201/authorize.go.rej'

The commit that we have configured is the same
6cad080

- MAEVE_REPO="https://github.com/thoughtworks/maeve-csms.git"
- MAEVE_BRANCH="b990d0eddf2bf80be8d9524a7b08029fbb305c7d" # patch files are based on this commit
+ CSMS_REPO="https://github.com/thoughtworks/maeve-csms.git"
+ CSMS_BRANCH="b990d0eddf2bf80be8d9524a7b08029fbb305c7d" # patch files are based on this commit
+ CSMS="maeve"

The most likely explanation is that we are not resetting properly.
Bingo! In 6cad080#diff-d342743ec0e9fbd3afe02d5923219c40cb69710d22ea81d57138678e42366110R94 we are resetting to the CSMS_BRANCH before cloning.

@louisg1337 for visibility

@shankari
Copy link
Collaborator

shankari commented Jun 1, 2024

**Issue #2: ** EVerest is not configured properly

                                             Successfully copied 6.66kB to everest-ac-demo-manager-1:/ext/source/config/config-sil-ocpp201-pnc.yaml
                                             Successfully copied 29.2kB to everest-ac-demo-manager-1:/ext/source/
tar: can't open 'cached_certs_correct_name_emaid.tar.gz': No such file or directory
Configured everest certs, validating that the chain is set up correctly
Could not open file or uri for loading certs of untrusted certificates from dist/etc/everest/certs/ca/csms/CPO_SUB_CA1.pem
485B5394777F0000:error:16000069:STORE routines:ossl_store_get0_loader_int:unregistered scheme:crypto/store/store_register.c:237:scheme=file
485B5394777F0000:error:80000002:system library:file_open:No such file or directory:providers/implementations/storemgmt/file_store.c:267:calling stat(dist/etc/everest/certs/ca/csms/CPO_SUB_CA1.pem)
Copying device DB, configured to SecurityProfile: 3
                                             Successfully copied 84.5kB to everest-ac-demo-manager-1:/ext/source/dist/share/everest/modules/OCPP201/device_model_storage.db
Error response from daemon: Could not find the file /ext/source/dist/share/everest/modules/OCPP201 in container everest-ac-demo-manager-1

And it still connects to SP1.

2024-05-31 23:51:56.038721 [INFO] ocpp:OCPP201     :: All EVSE ready. Starting OCPP2.0.1 service
2024-05-31 23:51:56.168104 [INFO] ocpp:OCPP201     :: Connecting to plain websocket at uri: ws://localhost:9000/cp001 with security profile: 1

@shankari
Copy link
Collaborator

shankari commented Jun 1, 2024

The new location is in /ext/source/build/dist, not just /ext/source/dist

# find / -name \*certs
/ext/source/build/dist/etc/everest/certs

# find / -name device_model_storage.db
/ext/source/build/_deps/libocpp-build/config/v201/device_model_storage.db
/ext/source/build/dist/share/everest/modules/OCPP201/device_model_storage.db
/workspace/dist/share/everest/modules/OCPP201/device_model_storage.db

# ls -al /ext/source/build/dist/share/everest/modules/OCPP201/
total 132
drwxr-xr-x    1 root     root          4096 May 27 16:44 .
drwxr-xr-x    1 root     root          4096 May 27 16:44 ..
-rw-r--r--    1 root     root         25415 May 27 16:22 config.json
-rw-r--r--    1 root     root         81920 May 27 16:22 device_model_storage.db
-rw-r--r--    1 root     root          2517 May 27 16:22 init_core.sql
-rw-r--r--    1 root     root           749 May 27 16:22 logging.ini

/workspace # ls -al /workspace/dist/share/everest/modules/OCPP201/
total 116
drwxr-xr-x    1 root     root          4096 May 27 16:45 .
drwxr-xr-x    1 root     root          4096 May 27 16:45 ..
-rw-r--r--    1 root     root         25249 May 27 16:20 config.json
-rw-r--r--    1 root     root         81920 May 27 16:20 device_model_storage.db

Fixing the paths...

shankari added a commit to US-JOET/everest-demo that referenced this issue Jun 1, 2024
This should fix
EVerest#47 (comment)

Testing done:

Made a change to copy the everest demo instead of cloning it.

```
$ bash demo-iso15118-2-ac-plus-ocpp.sh -r /.../everest-demo -3
...
HEAD is now at b990d0e fix: make lb depend on services in compose
...
Patching the CSMS to enable EVerest organization
patching file docker-compose.yml
Patching the CSMS to enable local mo root
patching file 'config/manager/config.toml'
Patching the CSMS to enable local mo root
patching file 'manager/handlers/ocpp201/authorize.go'
Starting the CSMS
```
shankari added a commit to US-JOET/everest-demo that referenced this issue Jun 1, 2024
This should fix
EVerest#47 (comment)

Testing done:

Made a change to copy the everest demo instead of cloning it.

```
$ bash demo-iso15118-2-ac-plus-ocpp.sh -r /.../everest-demo -3
/var/folders/y5/cx3cfzrd2q116myv9ly86sw1rnlmdj/T/tmp.4wcbFf1P/maeve-csms /var/folders/y5/cx3cfzrd2q116myv9ly86sw1rnlmdj/T/tmp.4wcbFf1P
HEAD is now at b990d0e fix: make lb depend on services in compose
...
Patching the CSMS to enable EVerest organization
patching file docker-compose.yml
Patching the CSMS to enable local mo root
patching file 'config/manager/config.toml'
Patching the CSMS to enable local mo root
patching file 'manager/handlers/ocpp201/authorize.go'
Starting the CSMS
```
shankari added a commit to US-JOET/everest-demo that referenced this issue Jun 1, 2024
This fixes:
EVerest#47 (comment)
by implementing
EVerest#47 (comment)

Testing done:
- Ran the script
- Station was connected to CSMS
- Plugged in car with both EIM and PnC, both worked
shankari added a commit to US-JOET/everest-demo that referenced this issue Jun 1, 2024
This should fix
EVerest#47 (comment)

Testing done:

Made a change to copy the everest demo instead of cloning it.

```
$ bash demo-iso15118-2-ac-plus-ocpp.sh -r /.../everest-demo -3
/var/folders/y5/cx3cfzrd2q116myv9ly86sw1rnlmdj/T/tmp.4wcbFf1P/maeve-csms /var/folders/y5/cx3cfzrd2q116myv9ly86sw1rnlmdj/T/tmp.4wcbFf1P
HEAD is now at b990d0e fix: make lb depend on services in compose
...
Patching the CSMS to enable EVerest organization
patching file docker-compose.yml
Patching the CSMS to enable local mo root
patching file 'config/manager/config.toml'
Patching the CSMS to enable local mo root
patching file 'manager/handlers/ocpp201/authorize.go'
Starting the CSMS
```

Signed-off-by: Shankari <[email protected]>
shankari added a commit to US-JOET/everest-demo that referenced this issue Jun 1, 2024
This fixes:
EVerest#47 (comment)
by implementing
EVerest#47 (comment)

Testing done:
- Ran the script
- Station was connected to CSMS
- Plugged in car with both EIM and PnC, both worked

Signed-off-by: Shankari <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants