Commit fd102ad9 authored by Ian Johnson's avatar Ian Johnson Committed by Trevor Conn

snap/hooks/install: disable sec-api-gateway on arm64

See https://github.com/edgexfoundry/blackbox-testing/issues/185 for more
details, but basically Kong isn't meant to work properly on arm64 until
it is updated to use OpenResty 1.15 so until that point we just always
disable the security-api-gateway services on arm64 in the install hook.

Note that due to another snapd bug where all services are restarted on 
refresh, we also need to implement a workaround in the kong service 
itself because it will be started up on refresh and we still don't want
kong to really run on arm64 even in the event it is erroneously started.
Returning from the kong-daemon.sh script like this will result in 
systemd initially assuming that the process started and proceeding to 
start other dependent services, but shortly thereafter realizing there
are not children processes and thus marking the service as "inactive".
Signed-off-by: default avatarIan Johnson <ian.johnson@canonical.com>
parent 52e458af
......@@ -159,3 +159,15 @@ for svc in export-distro export-client support-notifications support-scheduler s
# stop them afterwards
snapctl stop --disable "$SNAP_NAME.$svc"
done
# if we are on arm64, disable the security-api-gateway because kong isn't
# properly supported on arm64 due to incorrect memory pointers used by lua and
# openresty
# see https://github.com/edgexfoundry/blackbox-testing/issues/185 for more
# details
if [ "$SNAP_ARCH" == "arm64" ]; then
snapctl set security-api-gateway=off
snapctl stop --disable "$SNAP_NAME.cassandra"
snapctl stop --disable "$SNAP_NAME.kong-daemon"
snapctl stop --disable "$SNAP_NAME.edgexproxy"
fi
#!/bin/bash -e
# this is a workaround to prevent kong from running on arm64 until kong
# upstream supports running on arm64 properly, see
# https://github.com/edgexfoundry/blackbox-testing/issues/185 for more details
# also note that we disable kong from the install hook, but that is only
# valid on first install, any refreshes will trigger it to be restarted due to
# https://bugs.launchpad.net/snapd/+bug/1818306 , hence this workaround
if [ "$SNAP_ARCH" = "arm64" ]; then
exit 0
fi
# the kong wrapper script from $SNAP
export KONG_SNAP="$SNAP/bin/kong-wrapper.sh"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment