canonical / maas-dev-setup

Think of this as a one click installer for your MAAS environment.
9 stars 8 forks source link

Feedback on the README usage #9

Open taurus-forever opened 5 months ago

taurus-forever commented 5 months ago

Hi,

1) Please update the Discource link in a README file: https://discourse.maas.io/t/setting-up-a-minimal-dev-environment-with-lxd/6318 (404 there).

2) Consider to add --yes to apt command, otherwise the script stops waiting for the confirmation to install git+make (for no reason, IMHO): https://github.com/canonical/maas-dev-setup/blob/main/setup-dev-env.sh#L85

3) there is an error in the stript:

multipass launch -d 50GB -c 8 -m 12GB -n maas 22.04
multipass shell maas
git clone https://github.com/canonical/maas-dev-setup && cd maas-dev-setup
./setup-dev-env.sh --ok
...
Submodule path 'src/maasui/src': checked out 'a0347b47c76615a767748391b379180162962519'
..done
./setup-dev-env.sh: 104: [: !=: unexpected operator
..done

The fix is if [ -n "${MAAS_LAUNCHPAD_ID}" ]; then. P.S. shellcheck detects it (and a bit more warnings):

sudo snap install shellcheck
shellcheck setup-dev-env.sh
...
In setup-dev-env.sh line 104:
  if [ ${MAAS_LAUNCHPAD_ID} != "" ]; then
       ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
  1. This is printed to STDERR/STDOUT and scary a bit:
    cat: /home/ubuntu/.ssh/id_rsa.pub: No such file or directory

    Should RSA key be generated if missing? Or requested as a precondition?

and actually it has failed:

################################################################
SSHing into maas-dev (10.10.0.27) development and setting it up
Warning: Permanently added '10.10.0.27' (ED25519) to the list of known hosts.
ubuntu@10.10.0.27: Permission denied (publickey).
ubuntu@maas:~/maas-dev-setup$ echo $?
255

Reinstalling as the script restart is not possible :-D

#######################
Setting up LXD networks
Error: The network already exists

Thank you for the great automation here! We will use it as a playground hint for Data Platform charms installation on MAAS. Tnx!

taurus-forever commented 5 months ago

And still no luck on the second try... after 20 mins of building/installed:

##########################
Creating a MAAS admin user

###########################
Login using admin profile
usage: maas [-h] COMMAND ...

options:
  -h, --help      show this help message and exit

drill down:
  COMMAND
    login         Log in to a remote API, and remember its description and
                  credentials.
    logout        Log out of a remote API, purging any stored credentials.
    list          List remote APIs that have been logged-in to.
    refresh       Refresh the API descriptions of all profiles.
    init          Initialise MAAS in the specified run mode.
    config        View or change controller configuration.
    status        Status of controller services.
    migrate       Perform migrations on connected database.
    apikey        Used to manage a user's API keys. Shows existing keys unless
                  --generate or --delete is passed.
    configauth    Configure external authentication.
    config-tls    Configure MAAS Region TLS.
    config-vault  Configure MAAS Region Vault integration.
    createadmin   Create a MAAS administrator account.
    changepassword
                  Change a MAAS user's password.

https://maas.io/

[Errno 111] Connection refused

I am not sure how to proceed from here. :-(

taurus-forever commented 5 months ago

I have managed to bootstrap MAAS using the script (and reproduced Data Team issue ).

The last missing bit was to add some sleep delay before "Login using admin profile", otherwise the connection issue above. I did sleep 60 and MAAS bootstrapped succesfully.

Summary:

Tnx!