Hi forum – I’m trying to use my NVIDIA Jetson TX2 to build a snap for ARM64. Virtualization/KVM is not available (and so neither is Multipass) on the TX2, so I’m trying to use LXD as my build environment.
As an FYI, the snap in question builds fine for amd64, also using LXD, but my problems occur before the build step of my snap begins.
LXD is installed as a snap from latest/stable (v4.0.1).
First try: I installed snapcraft from the latest/stable track (v3.11) and snapcraft --use-lxd returns the error “An error occured with the instance when trying to launch ‘LXD’: Create instance: Requested architecture isn’t supported by this host.”
Decided to try freshing snapcraft to the channel latest/candidate (v4.0) and I get much further – an LXD container is created. It’s assigned an IP and apt-get update appears to execute just fine. However the next challenge is:
An error occured when trying to execute 'apt-get dist-upgrade --yes' with 'LXD': returned exit code 100.
Immediately preceding this error, there’s lots of messages involving ‘Temporary failure resolving ports.ubuntu.com’.
I also appear to be unable to drop in to a shell with ‘–debug’ at this phase. Any help greatly appreciated.
The bootstrapping failed due to network errors so not at a point to get debug going just yet. Can you please try edge and see if the issue persists? Are you behind a proxy? Can you try and use SNAPCRAFT_BUILD_ENVIRONMENT_NAMESERVER with the IP of your DNS server? Snapcraft defaults to the one on the host.
Working on trying these suggestions; will get back to you shortly.
In the meantime – correct, I’m not building on core at the moment. HOWEVER I will need to build on Core in the near future so this is all great information
@sergiusens – this does still reproduce on edge. I’ve tried to set the variable via export SNAPCRAFT_BUILD_ENVIRONMENT_NAMESERVER=8.8.8.8 and this does not resolve the issue. I should also note I’ve had some issues with LXD on Linux for Tegra being able to get an IP address – not sure if there’s some strange networking configuration on this image, and frankly I’m not experienced enough at Linux Networking to be able to tell.
@ogra – I was optimistic but when I run snapcraft --destructive-mode inside the container, it appears to hang. That, or the build output I’ve expected isn’t redirected to stdout. Thoughts?
The host is Linux for Tegra which is derived from Ubuntu 18.04.
On IP addresses: yes and no. If I run lxc launch ubuntu:18.04 there is not an IP address assigned. Further more if I run ping from within the newly created container I get ping: socket: Operation not permitted. If I set the container to be privileged via lxc config set <name> security.privileged true && lxc restart <name> then I do see IPv4 and IPv6 addresses assigned to the container. Pings are also successful from within the container.
On the other hand, running sudo snapcraft --use-lxd generates a container which does get an IPv4 address, but not an IPv6 address. Based on the output, apt-get update appears to hit the targets successfully and pull down updates. It later fails on the apt-get dist-upgrade step as described in my original post.
Some background the L4T kernel is version 4.9 I am curious what the lxd.check-kernel command @ogra pointed out will return. Maybe another option could be running the destructive mode inside a Docker container https://snapcraft.io/docs/build-on-docker As far as I know Nvidia is supporting Docker on the L4T distribution.
I skipped the L4T stuff pulled out a Raspberry PI 3 and installed Ubuntu Core there. Maybe this can be used as a build platform for the snap.
As @ogra said up thread, you’ll have trouble building snaps on an Ubuntu Core system. One alternative would be to install classic Ubuntu Server on the Pi instead:
The usual way to build a snap with LXD is to install Snapcraft on the host system and run snapcraft --use-lxd. Snapcraft will then spin up an ephemeral container with a clean environment to build your snap, and discard it when done.
The problem is that the snapcraft snap uses classic confinement, which are not installable Ubuntu Core systems. The Ubuntu Server systems should work fine though.
i’m personally owning 50+ different arm boards, none of them has seen ubuntu classic installs for the last 4 years, the powerful ones are all build machines using lxd in the way i described above …
what i’d really like to know is the output of lxd.check-kernel from @theseankelly. i suspect the kernel simply misses config options lxd requires …