[ 
https://issues.apache.org/jira/browse/S2GRAPH-73?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15297417#comment-15297417
 ] 

Jong Wook Kim commented on S2GRAPH-73:
--------------------------------------

I have implemented the SBT task in {{project/Packager.scala}}. Executing 
{{activator clean package}} will create a directory {{target/deploy}} which 
contains the directory layout as described above.

{{bin/s2graph-daemon.sh}} is the internal script that can be used to start and 
stop a JVM process as a daemon process: the process will run in the background, 
and it will not stop when the terminal is closed. 

Currently, s2rest_play application can be launched as a service, like this:

{code}
bin/s2graph-daemon.sh start s2rest_play
bin/s2graph-daemon.sh stop s2rest_play
{code}

I've tested it running with a local mysql and hbase servers that I manually 
launched. Once the other subtasks 
([S2GRAPH-74|https://issues.apache.org/jira/browse/S2GRAPH-74], 
[S2GRAPH-75|https://issues.apache.org/jira/browse/S2GRAPH-75]) are addressed, 
I'll be able to add end-user facing scripts like {{start-s2graph.sh}} and 
{{stop-s2graph.sh}} that will launch the databases and servers in the proper 
order.

This script can as well be, and should be used for other service-like 
applications - s2loader, s2counter, and s2rest_netty. But I'll concentrate on 
making s2rest_play fully working for now.

You can see the diff here: 
https://github.com/apache/incubator-s2graph/compare/0841ecc...jongwook:b595bc9 
While I don't think it is pull request-ready yet, please feel free to comment 
on anything in the diff.

We still need to figure out how we will configure logging in an elegant way. 
Currently it is messed up; Play! framework makes it complicated by having its 
own {{logback.xml}} in its jar and expects users to write {{logger.xml}} so 
that Play! can reload it whenever it wants, and log4j is sneaked in the 
dependency hell. - Ideally, users should be able to use ONE file that controls 
all logging, and in the default configuration, {{ConsoleAppender}} should be 
avoided. [Logback's groovy 
configuration|http://logback.qos.ch/manual/groovy.html] might be a viable 
option if we want to get away from any XML.

> Add an SBT task and relevant scripts to construct a package for distribution
> ----------------------------------------------------------------------------
>
>                 Key: S2GRAPH-73
>                 URL: https://issues.apache.org/jira/browse/S2GRAPH-73
>             Project: S2Graph
>          Issue Type: Sub-task
>            Reporter: Jong Wook Kim
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> This subtask is to add a function to make a package for distribution, which 
> has a directory layout like usual unix-based projects:
> {code}
> /
> ┣ bin/     # executable bash scripts to start/stop daemon processes
> ┣ conf/   # templates of configuration files
> ┣ lib/      # all jar files to be included in the classpath
> └ logs/   # an empty directory, where logs will be saved
> {code}
> When an official release is made, this directory will be compressed into a 
> {{tar.gz}} file which the users will download from the website.
> Currently this is being done using the {{stage}} task that is a part of Play! 
> framework, but the startup script provided by it is functionally very limited 
> and not easy to tweak. 
> We would like to add the flexibility to add various bash scripts and make it 
> easy for users to run and configure s2graph, and check the logs.
> Specifically, an SBT task will be made that resembles what Play! framework's 
> one does, and also will a few bash scripts that call the SBT task will be 
> made as necessary.
> In order for this to happen, I suggest to make changes to a few top-level 
> directories as follows:
> * move the old {{/bin}} to {{/dev}} which contains scripts used during 
> development; there is only one bash script for release auditing now, and more 
> bash scripts should be added here.
> * make a new {{/bin}} which contains the bash scripts that go to the 
> distribution package, and thus the users will use.
> * make a new {{/conf}} which contains the templates for configurations, like 
> {{hbase-site.xml}}, {{application.conf.template}}, {{logback.xml.template}}, 
> etc.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to