GithubHelp home page GithubHelp logo

ispyb-client's Introduction

ISPyB Project

  1. Installing
  2. Database creation and update
  3. Database schema

Installing

  1. Clone the ISPyB repository:

    git clone https://github.com/ispyb/ISPyB.git
    
  2. ISPyB needs the third-party libraries provided in the dependencies directory. These don't exist in a public repository, so install them to the local Maven repository so that Maven can find them:

    cd dependencies && mvn initialize
    
  3. Build ISPyB using Maven:

    mvn clean install
    

    By default, ISPyB builds for the GENERIC site and the development environment. These can be changed with the ispyb.site and ispyb.env system properties. For example, to build for the ESRF site and the test environment:

    mvn -Dispyb.site=ESRF -Dispyb.env=test clean install
    

    If the build succeeds, a summary message will be printed like this:

    [INFO] Reactor Summary:
    [INFO]
    [INFO] ispyb-parent ...................................... SUCCESS [0.251s]
    [INFO] ispyb-ejb3 ........................................ SUCCESS [10.243s]
    [INFO] ispyb-ws .......................................... SUCCESS [1.751s]
    [INFO] ispyb-ui .......................................... SUCCESS [7.212s]
    [INFO] ispyb-ear ......................................... SUCCESS [5.048s]
    [INFO] ispyb-bcr ......................................... SUCCESS [2.217s]
    [INFO] ispyb-bcr-ear ..................................... SUCCESS [1.806s]
    

Database creation and update

Run the following creation scripts from the ispyb-ejb module (note that this requires the pxadmin database user to exist and have full permissions):

  1. ispyb-ejb/db/scripts/pyconfig.sql: This corresponds to the menu options and contains both structure and data.

  2. ispyb-ejb/db/scripts/pydb.sql: This corresponds to the ISPyB metadata and contains only the database structure.

  3. ispyb-ejb/db/scripts/schemastatus.sql: This corresponds to the SchemaStatus table and contains both structure and data. The entries indicate which update scripts have been run.

  4. ispyb-ejb/db/scripts/ispybAutoprocAttachment.sql: This corresponds to the type and names of different autoPROC attachments.

The creation scripts are normally updated for each tag, but if you are using the master branch, you may have to run the update scripts in ispyb-ejb/db/scripts/ahead.

Check the entries in the SchemaStatus table to know which scripts to execute. The scripts already run for the current tag are in ispyb-ejb/db/scripts/passed.

Creating an update script

The first line must be:

insert into SchemaStatus (scriptName, schemaStatus) values ('2017_06_06_blabla.sql','ONGOING');

Then comes the actual updates of the script:

-- SQL statements here

And the last line must be:

update SchemaStatus set schemaStatus = 'DONE' where scriptName = '2017_06_06_blabla.sql';

The last line updates the SchemaStatus table to mark the script as having been run.

Database schema

A patch or commit that changes the database schema must be accompanied by a corresponding change to the schema file to keep it up to date. This file can be edited using MySQL Workbench (a free tool from MySQL).

ispyb-client's People

Contributors

antolinos avatar delageniere avatar hormiai76 avatar ispyb avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ispyb-client's Issues

Example of shipment creation

By using the SOAP webservices this script will create a shipment in ISPyB. This shipment contains a dewar, container and a sample and result can be seen in EXI and ISPyB UI:

download

Column 'bltimeStamp' cannot be null

Hello. I'm getting this error about bltimeStamp cannot be null when attempting to load up the example information.

Here is the output from ispyb.log

16:22:17,909 INFO  [stdout] (default task-95) [
16:22:17,909 INFO  [stdout] (default task-95)    {
16:22:17,909 INFO  [stdout] (default task-95)       "categoryCode":"MX",
16:22:17,909 INFO  [stdout] (default task-95)       "categoryCounter":415,
16:22:17,909 INFO  [stdout] (default task-95)       "labAddress":[
16:22:17,909 INFO  [stdout] (default task-95)          null,
16:22:17,909 INFO  [stdout] (default task-95)          "71 avenue des Martyrs",
16:22:17,909 INFO  [stdout] (default task-95)          "CS 40220",
16:22:17,909 INFO  [stdout] (default task-95)          null,
16:22:17,909 INFO  [stdout] (default task-95)          "38043"
16:22:17,909 INFO  [stdout] (default task-95)       ],
16:22:17,909 INFO  [stdout] (default task-95)       "labAddress1":"71 avenue des Martyrs",
16:22:17,909 INFO  [stdout] (default task-95)       "labAddress2":"CS 40220",
16:22:17,909 INFO  [stdout] (default task-95)       "labCity":"GRENOBLE",
16:22:17,910 INFO  [stdout] (default task-95)       "labCountryCode":"ESRF",
16:22:17,910 INFO  [stdout] (default task-95)       "labName":"ESRF",
16:22:17,910 INFO  [stdout] (default task-95)       "labPostalCode":"38043",
16:22:17,910 INFO  [stdout] (default task-95)       "laboratoryPk":200450,
16:22:17,910 INFO  [stdout] (default task-95)       "mainProposer":true,
16:22:17,910 INFO  [stdout] (default task-95)       "pk":181482,
16:22:17,910 INFO  [stdout] (default task-95)       "proposalGroup":103,
16:22:17,910 INFO  [stdout] (default task-95)       "proposalPk":31529,
16:22:17,910 INFO  [stdout] (default task-95)       "proposalTitle":"TEST",
16:22:17,910 INFO  [stdout] (default task-95)       "proposalType":3,
16:22:17,910 INFO  [stdout] (default task-95)       "proposer":true,
16:22:17,910 INFO  [stdout] (default task-95)       "scientistEmail":"[email protected]",
16:22:17,910 INFO  [stdout] (default task-95)       "scientistFirstName":"Stéphanie",
16:22:17,910 INFO  [stdout] (default task-95)       "scientistName":"MONACO",
16:22:17,910 INFO  [stdout] (default task-95)       "scientistPk":225239,
16:22:17,910 INFO  [stdout] (default task-95)       "scientistTitle":"Dr",
16:22:17,910 INFO  [stdout] (default task-95)       "siteId":17074,
16:22:17,910 INFO  [stdout] (default task-95)       "user":true
16:22:17,910 INFO  [stdout] (default task-95)    }
16:22:17,910 INFO  [stdout] (default task-95) ]
16:22:17,910 INFO  [stdout] (default task-95) 
16:22:17,915 INFO  [ispyb.server.smis.UpdateFromSMIS] (default task-95) Nb of proposers found : 1
16:22:17,915 INFO  [ispyb.server.smis.UpdateFromSMIS] (default task-95) Nb of sessions found : 4
16:22:17,915 INFO  [ispyb.server.smis.UpdateFromSMIS] (default task-95) Nb of samplesheets found : 40
16:22:17,915 INFO  [ispyb.server.smis.UpdateFromSMIS] (default task-95) Nb of labcontacts found : 1
16:22:17,916 INFO  [ispyb.server.smis.UpdateFromSMIS] (default task-95) Loading proposers ... 
16:22:17,949 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-95) SQL Error: 1048, SQLState: 23000
16:22:17,949 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-95) Column 'bltimeStamp' cannot be null
16:22:17,950 ERROR [org.jboss.as.ejb3.invocation] (default task-95) WFLYEJB0034: EJB Invocation failed on component Proposal3ServiceBean for method public abstract ispyb.server.common.vos.proposals.Proposal3VO ispyb.server.common.services.proposals.Proposal3Service.create(ispyb.server.common.vos.proposals.Proposal3VO) throws java.lang.Exception: javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement
	at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:187)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.