magao-x / MagAOX

The MagAO-X Software System
https://magao-x.org/
GNU General Public License v3.0
10 stars 10 forks source link

Failure to build/provision Multipass VMs #154

Closed drbitboy closed 3 months ago

drbitboy commented 6 months ago

Multipass VM with MAGAOX_ROLE=vm

I will submit PRs to fix these problems shortly.

Brian T. Carcich Latchmoor Services, INC.

joseph-long commented 6 months ago

Thanks for the report. Unfortunately the multipass setup is too magic and hasn’t been working consistently. As a tool, if it’s not saving people time, we should ditch it.

I am in the process of revising the handbook to describe setting up a “normal” VM in a tool-agnostic way. Setting up a normal VM and following the workstation provisioning procedure is more likely to work, but i haven’t had the time to test these changes. The way we use user accounts and unix permissions is incompatible with the preexisting user accounts from the Canonical images and the attempts to work around it are hacks. We should just make an xsup account.

jaredmales commented 6 months ago

I think the readme.md instructions don't work. Following the handbook seems to work better. I have been getting it to run straight through to provisioning complete.

On Fri, May 10, 2024, 11:43 Joseph D. Long @.***> wrote:

Thanks for the report. Unfortunately the multipass setup is too magic and hasn’t been working consistently. As a tool, if it’s not saving people time, we should ditch it.

I am in the process of revising the handbook to describe setting up a “normal” VM in a tool-agnostic way. Setting up a normal VM and following the workstation provisioning procedure is more likely to work, but i haven’t had the time to test these changes. The way we use user accounts and unix permissions is incompatible with the preexisting user accounts from the Canonical images and the attempts to work around it are hacks. We should just make an xsup account.

— Reply to this email directly, view it on GitHub https://github.com/magao-x/MagAOX/issues/154#issuecomment-2104830091, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZFZCEHKWGLIU5KLE3A5N3ZBTTLNAVCNFSM6AAAAABHQZ7SS2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBUHAZTAMBZGE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

drbitboy commented 6 months ago

Record of following the /setup/README.md procedure:

$ multipass launch -n issue154 -c 4 -m 8.0GiB -d 20GiB 22.04
Launched: issue154
$ cd ~/devel/MagAOX/
$ git remote -v
origin  https://github.com/magao-x/MagAOX.git (fetch)
origin  https://github.com/magao-x/MagAOX.git (push)
$ git pull
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Total 4 (delta 3), reused 4 (delta 3), pack-reused 0
Unpacking objects: 100% (4/4), 406 bytes | 101.00 KiB/s, done.
From https://github.com/magao-x/MagAOX
   d42369a4..b87967be  dev        -> origin/dev
Updating d42369a4..b87967be
Fast-forward
 Make/common.mk | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
$ multipass mount ~/devel/MagAOX/ issue154:/opt/MagAOX/source/MagAOX
$ multipass exec issue154 -- touch .hushlogin
$ multipass shell issue154
ubuntu@issue154:~$ cd /opt/MagAOX/source/MagAOX/
ubuntu@issue154:/opt/MagAOX/source/MagAOX$ ls
ls: reading directory '.': Permission denied

So the mount thing is not reliable; I suspect the issue is that the multipass account on the VM host does not have permissions into the /home/me/ directory where those data reside. No big deal; there are other, more reliable, ways to get the source onto the VM guest.

drbitboy commented 6 months ago

I think the readme.md instructions don't work. Following the handbook seems to work better. I have been getting it to run straight through to provisioning complete.

Okay, I'll try that ...

drbitboy commented 6 months ago

Same using the start of the procedure from https://magao-x.org/docs/handbook/compute/remote_operation.html:

linux-host$ multipass launch -n issue154 -c 4 -m 8.0GiB -d 20GiB 22.04
Launched: issue154

linux-host$ multipass mount $HOME issue154:/home/ubuntu/Home

linux-host$ multipass exec issue154  -- touch /home/ubuntu/.hushlogin

linux-host$ multipass shell issue154

ubuntu@issue154:~$ ls ~/Home/
ls: reading directory '/home/ubuntu/Home/': Permission denied

ubuntu@issue154:~$ sudo ls ~/Home/
ls: reading directory '/home/ubuntu/Home/': Permission denied

But again, getting a branch from the git@github:magao-x/MagAOX is the least of our problems; if the multipass mount ... guest:/home/ubuntu/Home/ is unreliable, we can find a more reliable way.

drbitboy commented 6 months ago

I got a successful build/provisioning using the procedure from https://magao-x.org/docs/handbook/compute/remote_operation.html.

But it still leaves root-owned cruft under /home/ubuntu/:

ubuntu@issue154:~$ find ~ -ls | grep root | sort -k11
   805226      4 drwxr-xr-x   3 root     root         4096 May 10 18:55 /home/ubuntu/.cache/conda
   805229      4 drwxr-xr-x   2 root     root         4096 May 10 18:55 /home/ubuntu/.cache/conda/notices
   805235      0 -rw-r--r--   1 root     root            0 May 10 18:55 /home/ubuntu/.cache/conda/notices/notices.cache
   786260      4 drwxr-xr-x   3 root     root         4096 May 10 18:50 /home/ubuntu/.cmake
   786264      4 drwxr-xr-x   3 root     root         4096 May 10 18:50 /home/ubuntu/.cmake/packages
   786265      4 drwxr-xr-x   2 root     root         4096 May 10 18:50 /home/ubuntu/.cmake/packages/Eigen3
   786266      4 -rw-r--r--   1 root     root           38 May 10 18:50 /home/ubuntu/.cmake/packages/Eigen3/ab180de1e754d8e7df17598fcfafb882
   819661      4 drwxr-xr-x   2 root     root         4096 May 10 18:57 /home/ubuntu/.conda
   847892      4 -rw-r--r--   1 root     root           11 May 10 18:57 /home/ubuntu/.conda/environments.txt
ubuntu@issue154:~$ 
drbitboy commented 6 months ago

Except for the root-cruft bug above, the handbook procedure now works i.e.

On host-OS:

multipass launch -n issue154 -c 4 -m 8.0GiB -d 20GiB 22.04
multipass exec issue154 -- touch /home/ubuntu/.hushlogin
multipass shell issue154

On guest-OS:

mkdir githubalt
git clone -b dev -q https://github.com/drbitboy/MagAOX.git githubalt/MagAOX/
cd githubalt/MagAOX/setup/
bash -lx provision.sh

Submitted PR #155; will close this issue now.

drbitboy commented 6 months ago

reopening because I broke the PR.

jaredmales commented 3 months ago

this was merged.