Skip to content

New Scripting - #324

Merged
aaronchantrill merged 5 commits into
NaomiProject:naomi-devfrom
AustinCasteel:new-setup-scripting
Feb 17, 2021
Merged

aaronchantrill merged 5 commits into
NaomiProject:naomi-devfrom
AustinCasteel:new-setup-scripting

Conversation

@AustinCasteel

@AustinCasteel AustinCasteel commented Feb 6, 2021 •

Copy link
Copy Markdown
Member

Description

Retooled the setup process to allow for more user interaction, added loads of error checking, as well as clean things up.
With the new scripting when launching you are given a menu with different options allowing a user to install, reinstall, uninstall, change what release they are using, change the version, and enable/disable autoupdates all within the setup script.

Another BIG change is no longer using Bintray to host the various releases and versions. Now the script uses the github repo, branches, & head tags to handle installation, release changes, version changes, and updates.

Motivation and Context

To make the script more user friendly and give the script more purpose than a one time thing.

Related Issues

PR 318 Ability to uninstall or clean-up Naomi from the installer

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@aaronchantrill aaronchantrill left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry it's taken me so long to get to this.

I'm getting the following error messages:

installers/script.deb.sh: line 258: [: -eq: unary operator expected

I think the problem is that line 258 is

if [ $APT -eq 1 ]; then

and the $APT variable is empty. I don't see where in the script it is being set, and I'm not sure what it represents exactly. This is already the deb script, so it should have already established that it is using apt.

I tried changing the line to if [ 1 -eq 1 ]; then and that seems to have worked.

I will continue testing and let you know if I find anything else.

Thank you!

@AustinCasteel

Copy link
Copy Markdown
Member Author

Turns out I misplaced a block of code when I moved the git install before the naomi git. The block of code just checked if apt was installed and passed a 1 if it was which was something left over from the previous scripting with the mindset of if it works don't mess with it. But now it does make sense to remove that functionality since by this point your running the apt based script anyways. If the setup script doesn't catch apt but still runs through this then thats a different issue that needs addressed.

@aaronchantrill

Copy link
Copy Markdown
Contributor

Just as the script was finishing, I got a "fatal: not a git repository (or any of the parent directories): .git" error.

I'm not sure what it was doing that caused it. Other than that, everything seems to have worked. Naomi is building the pocketsphinx models now. I will test more options from the menu once Naomi is done installing.

@aaronchantrill

Copy link
Copy Markdown
Contributor

It looks like everything worked after that first issue. I used the 'S' to skip selecting a version, so the "Version" and "Update" options just give me an error about not being able to find the options file, but I assume that will be resolved by selecting a version during the install.

You don't have to use sudo to remove directories in the user's home, so you don't need to sudo rm -Rf ~/Naomi. When I ran that option, it showed me the commands but didn't actually run them. You probably want to cd back to the home directory before or after that command so you don't leave the user sitting in the now-removed ~/Naomi directory.

Finally, when I type "Quit" it asks me to press "q" to quit instead of just exiting, which seemed odd.

Thanks!

@AustinCasteel

Copy link
Copy Markdown
Member Author

I have updated the developer config json to contain all of the proper information to make sure it does not "Break" things per-say. That being said it wont let you change versions or update unless you manually change the values in the config to make it one of the presets. I have added the APT value as well as adjusted the quit form the root menu to just quit instead of asking for conformation.

@aaronchantrill

Copy link
Copy Markdown
Contributor

I'm running through this again. I just got an error (didn't stop the installation) in the Phonetisaurus setup. I couldn't see the line exactly, but I'll search for it.

Traceback (most recent call last):
  File "setup.py", line 2, in <module>
    from setuptools import setup, find_packages
ImportError: No module named setuptools

If this is actually a problem, I'll try go ahead and merge this request but create a new #phonetisaurus section in python-requirements.txt and add setuptools there. I don't see where setuptools is being installed anywhere, but it seems like one of those baseline modules that would not be surprising to have it installed by default. It may be due to the minimal Buster installs I'm doing.

@aaronchantrill

aaronchantrill commented Feb 17, 2021 •

Copy link
Copy Markdown
Contributor

It's in "Aligning lexicon" right now so I guess using setuptools to install the Phonetisaurus module isn't an issue. Come to think of it, I'm not sure we even use the Phonetisaurus python module. I think we are just calling it as command-line programs through subprocess. I'll have to look into that at some point.

@aaronchantrill aaronchantrill left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This worked perfectly for me while installing on Debian Buster x86_64 in a Virtualbox virtual machine container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants