open-horizon / anax

Horizon agent control system
https://open-horizon.github.io/docs/anax/docs/
Apache License 2.0
73 stars 98 forks source link

Bug: openhorizon-agent cluster install on MicroShift RaspPi arm64 #3546

Open johnwalicki opened 2 years ago

johnwalicki commented 2 years ago

Describe the bug.

We don't have an arm64 version of the openhorizon-agent cluster container, yet agent-install tried to install it. On my Raspberry Pi4 running Fedora 36 aarch64, I installed Microshift. Then I installed Open Horizon cluster agent via

./agent-install.sh -D cluster -i 'css:'

The openhorizon-agent pod just crashloops.

$ oc get pods -A
NAMESPACE                       NAME                                  READY   STATUS             RESTARTS   AGE
kube-system                     kube-flannel-ds-v9klx                 1/1     Running            1          40m
kubevirt-hostpath-provisioner   kubevirt-hostpath-provisioner-f6wbw   1/1     Running            1          40m
openhorizon-agent               agent-5788f9dbd-qpkdj                 0/1     CrashLoopBackOff   8          20m
openshift-dns                   dns-default-2jcls                     2/2     Running            2          40m
openshift-dns                   node-resolver-sx7cr                   1/1     Running            1          40m
openshift-ingress               router-default-85bcfdd948-djwf6       1/1     Running            3          40m
openshift-service-ca            service-ca-7764c85869-fbvkx           1/1     Running            1          40m
registry                        registry-64958cf58c-c9ddt             1/1     Running            1          30m

$ ls
...
amd64_anax_k8s.tar.gz    <--- Note the wrong arch
...

$ oc logs -n openhorizon-agent agent-5788f9dbd-qpkdj
exec /home/agentuser/anax.service: exec format error

The exec format error is because the container is not for arm64, its amd64

When not running on amd64, the agent-install.sh should stop before unpacking / pushing the amd64_anax_k8s.tar.gz into the wrong arch.

Or better, we should build the arm64_anax_k8s.tar.gz so we can run Microshift on RaspPi devices.

For now, the agent-install.sh could check the remote kube cluster and only install the openhorizon-agent pod if it matches amd64 This command will tell the script what architecture is running on the kube cluster

kubectl get nodes -o json | jq '.items[0].status.nodeInfo.architecture'
"arm64"

Describe the steps to reproduce the behavior.

No response

Expected behavior.

No response

Screenshots.

No response

Operating Environment

RaspPi arm64

Additional Information

No response

johnwalicki commented 2 years ago

How hard would it be to create a openhorizon-agent for arm64? We build an arm64 anax-in-container (in upstream OH)

johnwalicki commented 2 years ago

As an initial step, the agent-install.sh should check the remote kube cluster and only install the openhorizon-agent pod if it matches amd64. Fail with an error message if the remote kube cluster is a different architecture (arm64) This command will tell the script what architecture is running on the kube cluster

kubectl get nodes -o json | jq '.items[0].status.nodeInfo.architecture'
"arm64"
johnwalicki commented 2 years ago

We should still work on building a arm64_anax_k8s.tar.gz bundle for installing the openhorizon cluster agent on ARM64 client.

johnwalicki commented 1 year ago

Once #3564 closes this issue, I will open a new issue to build an arm64_anax_k8s.tar.gz bundle for installing the openhorizon cluster agent on ARM64 based clusters.