Bug 439871 - Sirius Headless Support
Summary: Sirius Headless Support
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: 1.0.0   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on: 463761 475829
Blocks:
  Show dependency tree
 
Reported: 2014-07-18 05:15 EDT by Cedric Brun CLA
Modified: 2015-08-27 03:57 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cedric Brun CLA 2014-07-18 05:15:38 EDT
One of outcomes which are expected by improving Sirius's modularization is to allow usage of the core APIs 
in slightly different contexts. Being able to work with Sirius headless - aka with no UI - is one of those contexts. 
Standalone - aka without OSGi - is another interesting target, some consummers are already using parts of the APIs but have
to jump through several hoops.

We want the core services of Sirius to be able to work in these contexts, first priority being headless.
 
This will also enable us to write faster tests that don't need any UI.

I started a spec document, will push it under review pretty soon.

At this point it is more about experimenting and assessing what we could do for 2.0.
Comment 1 Cedric Brun CLA 2014-07-18 06:02:42 EDT
Here is the spec  https://git.eclipse.org/r/#/c/30112/

The "detailled specification" is fairly light but right now I
need to gather comments :
- are there other choices and tradeoffs you are aware of ?
- do you foresee any issue with the choices being made here ?
- other missing piece or concern ?
Comment 2 Cedric Brun CLA 2014-07-22 03:01:44 EDT
Some tests results:

On top of the ancestor of the headless branch (commit 3de673038d0e554d05c57f60951091dfb72b4cdc - https://github.com/cbrun/org.eclipse.sirius/commits/headless)

6 failures :
org.eclipse.sirius.tests.swtbot.RefreshAfterViewCreationTest.testEdgeCreationOnNodeInContainerCreationWithoutAutoRefresh
org.eclipse.sirius.tests.swtbot.sequence.MessageExtensionTest.testSessionSyncOnDiagramWithEdgemappingImportOpening
org.eclipse.sirius.tests.swtbot.sequence.ExternalModificationsTests.testExecutionReparent
org.eclipse.sirius.tests.swtbot.sequence.SyncCallTest.test_SyncCall_Resize_Zoom
org.eclipse.sirius.tests.swtbot.sequence.InstanceRoleOrderingTests.testInstanceRoleReorderingAtDiagramOpening
org.eclipse.sirius.tests.unit.api.convert.ConvertProjectToModelingProjectTest.testConvertToModelingProjectWithoutRepresentationFileButSemanticResources 


On top of the headless branch (commit eced51d4c1deb50b030748240963979f05c219ea)
5 failures :

org.eclipse.sirius.tests.swtbot.sequence.MessageExtensionTest.testSessionSyncOnDiagramWithEdgemappingImportOpening
org.eclipse.sirius.tests.swtbot.sequence.ExternalModificationsTests.testExecutionReparent
org.eclipse.sirius.tests.swtbot.sequence.SyncCallTest.test_SyncCall_Resize_Zoom
org.eclipse.sirius.tests.swtbot.sequence.InstanceRoleOrderingTests.testInstanceRoleReorderingAtDiagramOpening
org.eclipse.sirius.tests.unit.api.convert.ConvertProjectToModelingProjectTest.testConvertToModelingProjectWithoutRepresentationFileButSemanticResources

Looks not too bad so far...
Comment 3 Cedric Brun CLA 2014-07-29 08:25:03 EDT
A chain of changes is submitted for review, it starts with this one :

https://git.eclipse.org/r/#/c/30650/
Comment 4 Felix Dorner CLA 2014-09-24 05:51:33 EDT
Would be possible do a diagram export as image in this headless mode?
Comment 5 Cedric Brun CLA 2014-09-24 06:05:24 EDT
Technically that's feasible thanks to the OffScreenEditPart & co.

It's not part of the tests used by this "chain of changes" though so there is probably more work to do after that.
Comment 6 Pierre-Charles David CLA 2014-10-10 06:24:21 EDT
Some work related to this has been done and already merged under this ticket's umbrella (the commits reference it). This first part will be in the soon to be released Sirius 2.0.0, but this ticket has a much larger scope.

Ideally we should have created sub-tickets for specific tasks, so that the part which will be in Sirius 2.0 could be marked as such, but it's too late now.

What has been done for now (mostly by Cédric) is moving large parts of the diagram "refresh" logic out of the diagram.ui plug-in and into the core oes.diagram one. The oes.table plug-in also had a UI dependency which could be released easily. With these changes done, the org.eclipse.sirius.runtime feature now contains the core plug-ins of the 3 default dialects, with no UI dependencies.

A new repository org.eclipse.sirius.headless.update is now also built (but not promoted) as part of the normal build; it contains only the features which have no UI dependencies. The next iterations will move more and more of the code and plug-ins into this update-site.

A new target platform with a minimum set of dependencies to build the headless features has been added in releng/org.eclipse.sirius.targets/headless (only for Luna), and the Maven/Tycho build has been adapted so that one can request a headless build like this:

  % mvn -P!full clean package

NB: you may need to escape the "!" with "\!" depending on your shell.

This builds only the subset of features which are needed to produce the org.eclipse.sirius.headless.update repository, and uses the headless target platform to do so. The new Hudson job https://hudson.eclipse.org/sirius/view/gerrit/job/sirius.headless-master/ uses this to validate that what is in this repo can indeed be built without error with the headless target platform. This job is rather fast (Luna only, builds only a subset of Sirius and uses a small TP), so it will be configured as an additional Gerrit trigger, so that any change proposed through gerrit will be blocked if they break the headless build.