c0c0n3 / kitt4sme.live

On a mission to bring AI to the shop floor: https://kitt4sme.eu/
MIT License
1 stars 28 forks source link

Fix SADS offline route #239

Closed c0c0n3 closed 1 year ago

c0c0n3 commented 1 year ago

This PR makes SADS "offline" available to external clients at https://<cloud-host>/sads-offline, fixing #238.

Implementation note

The SADS "offline" routing rule must come before the one for SADS classic. This is because we're using a prefix match in both cases: /sads-offline and /sads. So if we invert the order, both routes will hit SADS classic---see #238. Why not use a regex match? In principle it's a better option since it avoids reliance on Istio match order, which is a bit of a hack. For example,

   - match:
     - uri:
         regex: /(sads$|sads[^-])

should match /sads, /sads/, /sads/wada-wada but not /sads-offline. Unfortunately, that regex doesn't work with Istio 1.11.4. Hence the hack.

c0c0n3 commented 1 year ago

Demo

  1. Browse to https://kitt4sme.collab-cloud.eu/sads-offline/
  2. The SADS "offline" service's UI should load in your browser.
  3. Browse to https://kitt4sme.collab-cloud.eu/sads-offline (notice the missing trailing slash)
  4. The SADS offline service's UI should load in your browser.
  5. Browse to https://kitt4sme.collab-cloud.eu/sads/
  6. The SADS "classic" service's UI should load in your browser.
  7. Browse to https://kitt4sme.collab-cloud.eu/sads (notice the missing trailing slash)
  8. The SADS classic service's UI should load in your browser.