Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

omego install #36

Merged
merged 6 commits into from
May 5, 2014
Merged

omego install #36

merged 6 commits into from
May 5, 2014

Conversation

manics
Copy link
Member

@manics manics commented Apr 23, 2014

As pointed out by @pwalczysko the current behaviour of omego upgrade automatically creating an OMERO-CURRENT symlink if it doesn't exist is annoying if you inadvertently run omego from the wrong directory. This PR just moves that behaviour into a new omego install command (optionally with --initdb).

install and upgrade should also check straight away for the presence/absence of the OMERO-CURRENT symlink

Other than this omero install is identical to the previous omego upgrade behaviour, i.e. not yet a proper installer.

In addition travis has been split into two sub-builds, the old wget+upgrade and a new install, though if you trust the install command enough it could replace the wget and setup commands, and we'd be back at a single build. The upgrade test now checks a multi-stage db upgrade works (4.4->5.1DEV)

Example commands are in .travis.yml
e.g.
omego install --initdb --dbhost localhost --dbname omero -v http://downloads.openmicroscopy.org/omero/5.0.0-rc1/artifacts/OMERO.server-5.0.0-rc1-ice34-b10.zip
omego upgrade --branch=OMERO-5.1-latest --labels=ICE=3.4 --upgradedb --dbhost localhost --dbname omero -v

manics added 6 commits April 23, 2014 08:08
Upgrade* classes renamed Install*
Add a parameter and conditional to control whether an upgrade or new install is performed

Separate --upgradedb (upgrade) or --initdb (new) params for database
Maintains backwards compatibility for now, will probably change to a common argument when the command line args are refactored
Also rearrange log messages
@pwalczysko
Copy link
Member

I got ERRROR: symlink already exists after the first example. Symlink really already exists. Is it expected behaviour ?

[petr@ls25165 ~/Work/omero5-server]$ ~/Work/omero-setup/omego/main.py  install --initdb --dbhost localhost --dbname omero -v http://downloads.openmicroscopy.org/omero/5.0.0-rc1/artifacts/OMERO.server-5.0.0-rc1-ice34-b10.zip
2014-04-24 19:18:11,494 [omego.upgrad] DEBUG              address => ls25165.dyn.lifesci.dundee.ac.uk
2014-04-24 19:18:11,494 [omego.upgrad] DEBUG               branch => OMERO-trunk
2014-04-24 19:18:11,494 [omego.upgrad] DEBUG                build => http://ci.openmicroscopy.org/job/OMERO-trunk/lastSuccessfulBuild/
2014-04-24 19:18:11,494 [omego.upgrad] DEBUG                  cfg => /Users/petr/config.xml
2014-04-24 19:18:11,494 [omego.upgrad] DEBUG                   ci => ci.openmicroscopy.org
2014-04-24 19:18:11,494 [omego.upgrad] DEBUG               dbhost => localhost
2014-04-24 19:18:11,494 [omego.upgrad] DEBUG               dbname => omero
2014-04-24 19:18:11,494 [omego.upgrad] DEBUG               dbpass => omero
2014-04-24 19:18:11,494 [omego.upgrad] DEBUG               dbuser => omero
2014-04-24 19:18:11,494 [omego.upgrad] DEBUG             hostname => ls25165.dyn.lifesci.dundee.ac.uk
2014-04-24 19:18:11,495 [omego.upgrad] DEBUG               labels => ICE=3.5
2014-04-24 19:18:11,495 [omego.upgrad] DEBUG                  mem => Xmx1024M
2014-04-24 19:18:11,495 [omego.upgrad] DEBUG                 name => ls25165.dyn.lifesci.dundee.ac.uk
2014-04-24 19:18:11,495 [omego.upgrad] DEBUG             omerosql => omero.sql
2014-04-24 19:18:11,495 [omego.upgrad] DEBUG            overwrite => keep
2014-04-24 19:18:11,495 [omego.upgrad] DEBUG           recipients => [email protected]
2014-04-24 19:18:11,495 [omego.upgrad] DEBUG             registry => 4061
2014-04-24 19:18:11,495 [omego.upgrad] DEBUG             rootpass => omero
2014-04-24 19:18:11,495 [omego.upgrad] DEBUG             savevars => ICE_HOME PATH DYLD_LIBRARY_PATH LD_LIBRARY_PATH PYTHONPATH
2014-04-24 19:18:11,495 [omego.upgrad] DEBUG         savevarsfile => OMERO-CURRENT/omero.envvars
2014-04-24 19:18:11,495 [omego.upgrad] DEBUG               sender => [email protected]
2014-04-24 19:18:11,495 [omego.upgrad] DEBUG               server => http://downloads.openmicroscopy.org/omero/5.0.0-rc1/artifacts/OMERO.server-5.0.0-rc1-ice34-b10.zip
2014-04-24 19:18:11,495 [omego.upgrad] DEBUG               server => http://downloads.openmicroscopy.org/omero/5.0.0-rc1/artifacts/OMERO.server-5.0.0-rc1-ice34-b10.zip
2014-04-24 19:18:11,495 [omego.upgrad] DEBUG           skipdelete => true
2014-04-24 19:18:11,495 [omego.upgrad] DEBUG        skipdeletezip => false
2014-04-24 19:18:11,496 [omego.upgrad] DEBUG            skipemail => true
2014-04-24 19:18:11,496 [omego.upgrad] DEBUG              skipweb => false
2014-04-24 19:18:11,496 [omego.upgrad] DEBUG          smtp_server => smtp.dundee.ac.uk
2014-04-24 19:18:11,496 [omego.upgrad] DEBUG                  ssl => 4064
2014-04-24 19:18:11,496 [omego.upgrad] DEBUG              subject => OMERO - ls25165.dyn.lifesci.dundee.ac.uk was upgraded
2014-04-24 19:18:11,496 [omego.upgrad] DEBUG                  sym => OMERO-CURRENT
2014-04-24 19:18:11,496 [omego.upgrad] DEBUG                  tcp => 4063
2014-04-24 19:18:11,496 [omego.upgrad] DEBUG                  web => [["localhost", 4064, "ls25165.dyn.lifesci.dundee.ac.uk"], ["gretzky.openmicroscopy.org.uk", 4064, "gretzky"], ["howe.openmicroscopy.org.uk", 4064, "howe"]]
2014-04-24 19:18:11,496 [omego.upgrad] DEBUG               weburl => http://ls25165.dyn.lifesci.dundee.ac.uk/omero/webclient/
2014-04-24 19:18:11,496 [omego.upgrad] INFO  UnixInstall: install
2014-04-24 19:18:11,496 [omego.upgrad] DEBUG Current directory: /Users/petr/Work/omero5-server
ERROR: Symlink already exists: OMERO-CURRENT
[petr@ls25165 ~/Work/omero5-server]$ ~/Work/omero-setup/omego/main.py  install --initdb --dbhost localhost --dbname omero_copy  http://downloads.openmicroscopy.org/omero/5.0.0-rc1/artifacts/OMERO.server-5.0.0-rc1-ice34-b10.zip
2014-04-24 19:20:20,715 [omego.upgrad] INFO  UnixInstall: install
ERROR: Symlink already exists: OMERO-CURRENT
[petr@ls25165 ~/Work/omero5-server]$ 

@pwalczysko
Copy link
Member

When executing the second example from a "wrong" folder, I got:

[petr@ls25165 ~/Work/omero5-server/OMERO-CURRENT]$ ~/Work/omero-setup/omego/main.py upgrade --branch=OMERO-5.1-latest --labels=ICE=3.3 --upgradedb --dbhost localhost --dbname omero_copy -v
2014-04-24 19:32:00,128 [omego.upgrad] DEBUG              address => ls25165.dyn.lifesci.dundee.ac.uk
2014-04-24 19:32:00,129 [omego.upgrad] DEBUG               branch => OMERO-5.1-latest
2014-04-24 19:32:00,129 [omego.upgrad] DEBUG                build => http://ci.openmicroscopy.org/job/OMERO-5.1-latest/lastSuccessfulBuild/
2014-04-24 19:32:00,129 [omego.upgrad] DEBUG                  cfg => /Users/petr/config.xml
2014-04-24 19:32:00,129 [omego.upgrad] DEBUG                   ci => ci.openmicroscopy.org
2014-04-24 19:32:00,129 [omego.upgrad] DEBUG               dbhost => localhost
2014-04-24 19:32:00,129 [omego.upgrad] DEBUG               dbname => omero_copy
2014-04-24 19:32:00,129 [omego.upgrad] DEBUG               dbpass => omero
2014-04-24 19:32:00,129 [omego.upgrad] DEBUG               dbuser => omero
2014-04-24 19:32:00,129 [omego.upgrad] DEBUG             hostname => ls25165.dyn.lifesci.dundee.ac.uk
2014-04-24 19:32:00,129 [omego.upgrad] DEBUG               labels => ICE=3.3
2014-04-24 19:32:00,129 [omego.upgrad] DEBUG                  mem => Xmx1024M
2014-04-24 19:32:00,129 [omego.upgrad] DEBUG                 name => ls25165.dyn.lifesci.dundee.ac.uk
2014-04-24 19:32:00,129 [omego.upgrad] DEBUG             omerosql => omero.sql
2014-04-24 19:32:00,130 [omego.upgrad] DEBUG            overwrite => keep
2014-04-24 19:32:00,130 [omego.upgrad] DEBUG           recipients => [email protected]
2014-04-24 19:32:00,130 [omego.upgrad] DEBUG             registry => 4061
2014-04-24 19:32:00,130 [omego.upgrad] DEBUG             rootpass => omero
2014-04-24 19:32:00,130 [omego.upgrad] DEBUG             savevars => ICE_HOME PATH DYLD_LIBRARY_PATH LD_LIBRARY_PATH PYTHONPATH
2014-04-24 19:32:00,130 [omego.upgrad] DEBUG         savevarsfile => OMERO-CURRENT/omero.envvars
2014-04-24 19:32:00,130 [omego.upgrad] DEBUG               sender => [email protected]
2014-04-24 19:32:00,130 [omego.upgrad] DEBUG           skipdelete => true
2014-04-24 19:32:00,130 [omego.upgrad] DEBUG        skipdeletezip => false
2014-04-24 19:32:00,130 [omego.upgrad] DEBUG            skipemail => true
2014-04-24 19:32:00,130 [omego.upgrad] DEBUG              skipweb => false
2014-04-24 19:32:00,130 [omego.upgrad] DEBUG          smtp_server => smtp.dundee.ac.uk
2014-04-24 19:32:00,130 [omego.upgrad] DEBUG                  ssl => 4064
2014-04-24 19:32:00,130 [omego.upgrad] DEBUG              subject => OMERO - ls25165.dyn.lifesci.dundee.ac.uk was upgraded
2014-04-24 19:32:00,130 [omego.upgrad] DEBUG                  sym => OMERO-CURRENT
2014-04-24 19:32:00,131 [omego.upgrad] DEBUG                  tcp => 4063
2014-04-24 19:32:00,131 [omego.upgrad] DEBUG                  web => [["localhost", 4064, "ls25165.dyn.lifesci.dundee.ac.uk"], ["gretzky.openmicroscopy.org.uk", 4064, "gretzky"], ["howe.openmicroscopy.org.uk", 4064, "howe"]]
2014-04-24 19:32:00,131 [omego.upgrad] DEBUG               weburl => http://ls25165.dyn.lifesci.dundee.ac.uk/omero/webclient/
2014-04-24 19:32:00,131 [omego.upgrad] INFO  UnixInstall: upgrade
2014-04-24 19:32:00,131 [omego.upgrad] DEBUG Current directory: /Users/petr/Work/omero5-server/OMERO.server-5.1.0-m0.2-124-7a49a67-ice33-b113
ERROR: Symlink is missing: OMERO-CURRENT
[petr@ls25165 ~/Work/omero5-server/OMERO-CURRENT]$ 

Expected ?

@pwalczysko
Copy link
Member

What does -v option do ? What is it supposed to do ?

@pwalczysko
Copy link
Member

hmmm

Waiting on startup. Use CTRL-C to exit
2014-04-24 19:34:46,253 [omego.upgrad] INFO  Starting web
2014-04-24 19:34:46,254 [omego.extern] INFO  Invoking CLI [current environment]: web start
Traceback (most recent call last):
  File "manage.py", line 38, in <module>
    import settings
  File "/Users/petr/Work/omero5-server/OMERO.server-5.1.0-m0.2-124-7a49a67-ice33-b113/lib/python/omeroweb/settings.py", line 154, in <module>
    raise exctype, value
TypeError: __init__() got an unexpected keyword argument 'read_only'
Traceback (most recent call last):
  File "/Users/petr/Work/omero-setup/omego/main.py", line 59, in <module>
    entry_point()
  File "/Users/petr/Work/omero-setup/omego/main.py", line 49, in entry_point
    (Version.NAME, Version)])
  File "/Users/petr/Work/omero-setup/omego/framework.py", line 185, in main
    ns.func(ns)
  File "/Users/petr/Work/omero-setup/omego/upgrade.py", line 415, in __call__
    UnixInstall(self.NAME, args)
  File "/Users/petr/Work/omero-setup/omego/upgrade.py", line 105, in __init__
    self.start()
  File "/Users/petr/Work/omero-setup/omego/upgrade.py", line 202, in start
    self.startweb()
  File "/Users/petr/Work/omero-setup/omego/upgrade.py", line 234, in startweb
    self.run("web start")
  File "/Users/petr/Work/omero-setup/omego/upgrade.py", line 213, in run
    self.external.omero_cli(command)
  File "/Users/petr/Work/omero-setup/omego/external.py", line 130, in omero_cli
    self.cli.invoke(command, strict=True)
  File "/Users/petr/Work/omero5-server/OMERO.server-5.1.0-m0.2-124-7a49a67-ice33-b113/lib/python/omero/cli.py", line 752, in invoke
    self.assertRC()
  File "/Users/petr/Work/omero5-server/OMERO.server-5.1.0-m0.2-124-7a49a67-ice33-b113/lib/python/omero/cli.py", line 741, in assertRC
    raise NonZeroReturnCode(self.rv, "assert failed")
omero.cli.NonZeroReturnCode: assert failed
[petr@ls25165 ~/Work/omero5-server]$ 

@pwalczysko
Copy link
Member

Will continue tomorrow - definitely confused, need some explanation

@manics
Copy link
Member Author

manics commented Apr 25, 2014

I got ERRROR: symlink already exists after the first example. Symlink really already exists. Is it expected behaviour ?

...

When executing the second example from a "wrong" folder, I got:
...
ERROR: Symlink is missing: OMERO-CURRENT

Yes, that's the purpose of this PR. You should only use omero install to setup a new server in the current directory, and omero upgrade to upgrade an existing server in the current directory. It's to avoid the problems you were having when you inadvertently ran omero upgrade from a directory other than the one containing your OMERO-CURRENT server, and discovering that omego had isntead tried to setup a completely new server.

2014-04-24 19:34:46,253 [omego.upgrad] INFO  Starting web
2014-04-24 19:34:46,254 [omego.extern] INFO  Invoking CLI [current environment]: web start
Traceback (most recent call last):
  File "manage.py", line 38, in <module>
    import settings
  File "/Users/petr/Work/omero5-server/OMERO.server-5.1.0-m0.2-124-7a49a67-ice33-b113/lib/python/omeroweb/settings.py", line 154, in <module>
    raise exctype, value
TypeError: **init**() got an unexpected keyword argument 'read_only'

This looks like a error in OMERO.web. Try running bin/omero web start manually to check.

@pwalczysko
Copy link
Member

Works as expected. Ready to merge. See my ramblings on #39.

joshmoore added a commit that referenced this pull request May 5, 2014
@joshmoore joshmoore merged commit 5cb45c0 into ome:master May 5, 2014
@manics manics deleted the server_init branch November 14, 2014 11:48
@sbesson sbesson added this to the 0.2.0 milestone Dec 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants