Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #2306 (closed)

Opened 14 years ago

Closed 14 years ago

Script-writing workflows

Reported by: wmoore Owned by: wmoore
Priority: minor Milestone: OMERO-Beta4.2
Component: General Version: n.a.
Keywords: n.a. Cc:
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: n.a.
Sprint: 2010-04-30 (8)

Description (last modified by wmoore)

Document typical script-writing workflows for admins and users. Both for our use in developing and testing the workflow, and for web-site documentation.

Intro

Life-cycle of a script

  • Script is written
  • Script uploaded to server
  • Script is parsed by a Processor running on the server or another machine
  • Client searches for the script by name
  • Client retrieves script parameter details from server
  • User enters parameter values - parsed to server to run script
  • Script runs...

If you are planning to spend a significant amount of time developing scripts to run on an OMERO server, you may find it worthwhile to install an instance of the server on your own machine. This will give you to test scripts under 'user' or 'admin' privileges, and allow you direct access to the various files generated on the server by the scripting service.

Admins - Official Scripts

It is assumed that scripts written by a server admin are "trusted" to run on the server without causing any disruption or security risks. Also, official scripts are available to all regular users of the server.

  • Write script
  • Make sure all required package imports are available on server
  • Upload as 'official' script:

scriptService.uploadOfficialScript(scriptPath, scriptText)

  • Run script (identify by path)

scriptIds = [s.id.val for s in scriptService.getScripts() if s.path.val == scriptPath]

  • If necessary, check recent files under /OMERO/Files/ for any std-out or std-err output generated by the script.


Users

If you are using a server for which you do not have admin access, you must upload scripts as 'user' scripts, which are not trusted to run on the server machine. The OMERO scripting service will still execute these scripts in a similar manner to official 'trusted' scripts but 'behind the scenes' it uses the client machine to execute the script. This means that any package imports required by the script should be available on the client machine.

Before running the script, the Processor on which the script will run will have to be started (by the server admin?). However, the script can be uploaded before the user-processor is running. In this case the script will not be validated, parameters determined etc.

  • Write script
  • Upload script to server (path not unique) with

scriptService.uploadScript(scriptPath, scriptText)

OR

dist will$ bin/omero -s localhost -u root script upload ../examples/ScriptingService/HelloWorld.py
  • Run script (identified as most recent with specified path).

scriptService.getUserScripts([])

  • Check returned results for std-err (and std-out)
  • Retrieve any std-err and std-out files from the server

Change History (7)

comment:1 Changed 14 years ago by wmoore

  • Description modified (diff)
  • Owner set to wmoore

comment:2 Changed 14 years ago by wmoore

  • Description modified (diff)

comment:3 Changed 14 years ago by wmoore

  • Description modified (diff)

comment:4 Changed 14 years ago by wmoore

  • Status changed from new to assigned

comment:5 Changed 14 years ago by wmoore

  • Description modified (diff)

comment:6 Changed 14 years ago by wmoore

  • Description modified (diff)

comment:7 Changed 14 years ago by wmoore

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.70006 sec.)

We're Hiring!