Skip to content

Commit

Permalink
♻️ 🐛 Ensure that the demo code does not silently fail
Browse files Browse the repository at this point in the history
Several of the options in the demo do not actually work

For example:
- Citrine fails to build (even on main)
- SP1 (and SP2) won't work with TLS
EVerest#78 (comment)

Fixes:
- Error out before Citrine build with a message indicating
  that it is not supported
- Patch the config for SP1 and SP2 to disable TLS

Testing done:

- Citrine

```
Cloning citrineos CSMS from https://github.com/citrineos/citrineos-core.git into /var/folders/y5/cx3cfzrd2q116myv9ly86sw1rnlmdj/T/tmp.I8ClXLLd/citrineos-csms and starting it
Cloning into 'citrineos-csms'...
remote: Enumerating objects: 16467, done.
remote: Counting objects: 100% (303/303), done.
remote: Compressing objects: 100% (221/221), done.
remote: Total 16467 (delta 139), reused 161 (delta 70), pack-reused 16164 (from 1)
Receiving objects: 100% (16467/16467), 5.07 MiB | 969.00 KiB/s, done.
Resolving deltas: 100% (10346/10346), done.
/var/folders/y5/cx3cfzrd2q116myv9ly86sw1rnlmdj/T/tmp.I8ClXLLd/citrineos-csms /var/folders/y5/cx3cfzrd2q116myv9ly86sw1rnlmdj/T/tmp.I8ClXLLd
Copying certs into /var/folders/y5/cx3cfzrd2q116myv9ly86sw1rnlmdj/T/tmp.I8ClXLLd/citrineos-csms/Server/data/certificates
Validating that the certificates are set up correctly
Server/data/certificates/certChain.pem: OK
Chain:
depth=0: CN=host.docker.internal, O=EVerest, C=DE, DC=CPO (untrusted)
depth=1: CN=CPOSubCA2, O=EVerest, C=DE, DC=V2G (untrusted)
depth=2: CN=CPOSubCA1, O=EVerest, C=DE, DC=V2G (untrusted)
depth=3: CN=V2GRootCA, O=EVerest, C=DE, DC=V2G
No patches to apply
Build and run
CitrineOS does not currently build due to issues with npm dependencies. It is disabled until we roll forward. Apologies for the inconvenience!

```

- Maeve

```
                                             Successfully copied 84.5kB to everest-ac-demo-manager-1:/ext/source/build/dist/share/everest/modules/OCPP201/device_model_storage.db
                                             Successfully copied 3.07kB to everest-ac-demo-manager-1:/tmp/
/ext/source /workspace
patching file config/config-sil-ocpp201-pnc.yaml
```

And then charging with EIM was successful

Signed-off-by: Shankari <[email protected]>
  • Loading branch information
shankari committed Nov 12, 2024
1 parent 20d0d3b commit 940a158
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions citrineos/build-and-run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
echo "Build and run"

echo "CitrineOS does not currently build due to issues with npm dependencies. It is disabled until we roll forward. Apologies for the inconvenience!"
exit 1

pushd Server || exit 1

docker compose build
Expand Down
4 changes: 4 additions & 0 deletions demo-iso15118-2-ocpp-201.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,14 @@ if [[ "$DEMO_VERSION" =~ sp1 ]]; then
echo "Copying device DB, configured to SecurityProfile: 1"
docker cp manager/device_model_storage_${DEMO_CSMS}_sp1.db \
everest-ac-demo-manager-1:/ext/source/build/dist/share/everest/modules/OCPP201/device_model_storage.db
docker cp manager/disable_iso_tls.patch everest-ac-demo-manager-1:/tmp/
docker exec everest-ac-demo-manager-1 /bin/bash -c "pushd /ext/source && patch -p0 -i /tmp/disable_iso_tls.patch"
elif [[ "$DEMO_VERSION" =~ sp2 ]]; then
echo "Copying device DB, configured to SecurityProfile: 2"
docker cp manager/device_model_storage_${DEMO_CSMS}_sp2.db \
everest-ac-demo-manager-1:/ext/source/build/dist/share/everest/modules/OCPP201/device_model_storage.db
docker cp manager/disable_iso_tls.patch everest-ac-demo-manager-1:/tmp/
docker exec everest-ac-demo-manager-1 /bin/bash -c "pushd /ext/source && patch -p0 -i /tmp/disable_iso_tls.patch"
elif [[ "$DEMO_VERSION" =~ sp3 ]]; then
echo "Copying device DB, configured to SecurityProfile: 3"
docker cp manager/device_model_storage_${DEMO_CSMS}_sp3.db \
Expand Down
11 changes: 11 additions & 0 deletions manager/disable_iso_tls.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- /tmp/config-sil-ocpp201-pnc.yaml
+++ config/config-sil-ocpp201-pnc.yaml
@@ -14,7 +14,7 @@
config_module:
device: auto
supported_ISO15118_2: true
- tls_active: true
+ tls_active: false
is_cert_install_needed: false
evse_manager_1:
module: EvseManager

0 comments on commit 940a158

Please sign in to comment.