magao-x / MagAOX

The MagAO-X Software System

Home Page:https://magao-x.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failure to build/provision Multipass VMs

drbitboy opened this issue · comments

Multipass VM with MAGAOX_ROLE=vm

  • /setup/README.md multipass-specific instructions, as written, fail to produce properly built/provisioned system
    • Needs MAGAOX_ROLE=vm assigned and pre_provision.sh to be run
    • Needs 8GB of memory (**multipass set local..memory=8.0GiB
  • Even with a correct procedure, it still fails to build/provision on the first try
  • Invocations of sudo in setup script leave root-owned directories and files under user ubuntu's home directory

I will submit PRs to fix these problems shortly.

Brian T. Carcich
Latchmoor Services, INC.

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.

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.

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 ...

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.

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:~$ 

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.

reopening because I broke the PR.

this was merged.