You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@usergrid.apache.org by "John D. Ament" <jo...@gmail.com> on 2014/09/08 18:55:56 UTC

How to build and run

Hi

So, I'm starting to play around with usergrid, and was wondering how
exactly do you build and run it? For one, it looks like there's no binary
release which is fine, but even then the source release seems a little out
of date.

When I look at [1], it says to run mvn (I assume from the top level), but
there is no pom at the top level.  I'm assuming it's the stack folder based
on a few other areas of your documentation. When I do build stack, and try
running this:

cd launcher; java -jar target/usergrid-launcher-*.jar

I get this output:

Johns-MacBook-Pro:stack johnament$ cd launcher; java -jar
target/usergrid-launcher-*.jar

Error: Could not find or load main class
org.apache.usergrid.launcher.JarMain

I think this happens because of


Johns-MacBook-Pro:launcher johnament$ ls -ltr target/usergrid-launcher-*.jar

-rw-r--r--  1 johnament  staff  49327291 Sep  8 12:52
target/usergrid-launcher-1.0.0.jar

-rw-r--r--  1 johnament  staff     13028 Sep  8 12:52
target/usergrid-launcher-1.0.0-tests.jar


so it's probably grabbing the tests jar instead.  When I switch to use the
app jar, it starts but then it's prompting me to use a apigee portal.  Can
I run the portal locally? Is that the portal directory?


John


[1]:
http://usergrid.incubator.apache.org/docs/getting-up-and-running-locally/

Re: How to build and run

Posted by Dave <sn...@gmail.com>.
If you are still interested, you may want to try again with the my latest
usergrid-vagrant.

I had some updates in my workspace and then main one, updating to Ubuntu
14.04, should solve the npm and grunt issues you experienced.

- Dave



On Tue, Sep 9, 2014 at 7:47 AM, Dave <sn...@gmail.com> wrote:

> On Mon, Sep 8, 2014 at 4:47 PM, John D. Ament <jo...@gmail.com>
> wrote:
>
>> Ok, I reran bootstrap.  I saw this at the very end
>>
>> cp: cannot stat ‘usergrid/stack/rest/src/test/resources/log4j.properties’:
>> No such file or directory
>>
>> ./build.sh: line 26: npm: command not found
>>
>> pass e2e to run e2e tests
>>
>>
>> grunt
>>
>>
>> ./build.sh: line 22: ./node_modules/grunt-cli/bin/grunt: No such file or
>> directory
>>
>>
>> The Admin Portal has been built and delivered to /dist
>>
>> deploy the contents directory to your webserver
>>
>> or run it now using the following command:
>>
>> grunt dev
>
>
>
> Sounds like multiple things went wrong. Somehow npm did not get installed
> correctly which may have caused the grunt install to fail. Then something
> must have gone wrong with the git clone because that log4j.properties file
> was not found.
>
> - Dave
>
>

Re: How to build and run

Posted by Dave <sn...@gmail.com>.
On Mon, Sep 8, 2014 at 4:47 PM, John D. Ament <jo...@gmail.com>
wrote:

> Ok, I reran bootstrap.  I saw this at the very end
>
> cp: cannot stat ‘usergrid/stack/rest/src/test/resources/log4j.properties’:
> No such file or directory
>
> ./build.sh: line 26: npm: command not found
>
> pass e2e to run e2e tests
>
>
> grunt
>
>
> ./build.sh: line 22: ./node_modules/grunt-cli/bin/grunt: No such file or
> directory
>
>
> The Admin Portal has been built and delivered to /dist
>
> deploy the contents directory to your webserver
>
> or run it now using the following command:
>
> grunt dev



Sounds like multiple things went wrong. Somehow npm did not get installed
correctly which may have caused the grunt install to fail. Then something
must have gone wrong with the git clone because that log4j.properties file
was not found.

- Dave

Re: How to build and run

Posted by "John D. Ament" <jo...@gmail.com>.
Ok, I reran bootstrap.  I saw this at the very end

cp: cannot stat ‘usergrid/stack/rest/src/test/resources/log4j.properties’:
No such file or directory

./build.sh: line 26: npm: command not found

pass e2e to run e2e tests


grunt


./build.sh: line 22: ./node_modules/grunt-cli/bin/grunt: No such file or
directory


The Admin Portal has been built and delivered to /dist

deploy the contents directory to your webserver

or run it now using the following command:

grunt dev


Happy Usergriding!

./install_usergrid.sh: line 55: cd: dist: No such file or directory

cp: cannot stat ‘usergrid-portal/*’: No such file or directory

sed: can't read /var/lib/tomcat7/webapps/portal/config.js: No such file or
directory

 * Starting Tomcat servlet engine tomcat7

On Mon, Sep 8, 2014 at 4:34 PM, Dave <sn...@gmail.com> wrote:

> On Mon, Sep 8, 2014 at 4:23 PM, John D. Ament <jo...@gmail.com>
> wrote:
>
> > Is there a way to re-run it? I tried vagrant provision to re-run.
>
>
> I guess you could "vagrant ssh" in and run the bootstrap.sh script, but I
> have not tried that myself.
>
> - Dave
>

Re: How to build and run

Posted by Dave <sn...@gmail.com>.
On Mon, Sep 8, 2014 at 4:23 PM, John D. Ament <jo...@gmail.com>
wrote:

> Is there a way to re-run it? I tried vagrant provision to re-run.


I guess you could "vagrant ssh" in and run the bootstrap.sh script, but I
have not tried that myself.

- Dave

Re: How to build and run

Posted by "John D. Ament" <jo...@gmail.com>.
Is there a way to re-run it? I tried vagrant provision to re-run.

On Mon, Sep 8, 2014 at 4:19 PM, Dave <sn...@gmail.com> wrote:

> On Mon, Sep 8, 2014 at 4:12 PM, John D. Ament <jo...@gmail.com>
> wrote:
>
> > Ok, so I tried setting up the vagrant machine.  The one issue I see is
> that
> > the portal is empty
> >
> > vagrant@ug:/var/lib/tomcat7/webapps/portal$ pwd
> >
> > /var/lib/tomcat7/webapps/portal
> >
> > vagrant@ug:/var/lib/tomcat7/webapps/portal$ ll
>
>
> Something must have gone wrong with the bootstrapping. The bootstrap script
> gets the source code for Usergrid, builds the stack, builds the portal and
> deploys. It's possible that something changed that broke the bootstrap
> script -- but I did start a machine successfully last week with it.  Can
> you see anything in the log produced by Vagrant on startup?
>
> - Dave
>

Re: How to build and run

Posted by Dave <sn...@gmail.com>.
On Mon, Sep 8, 2014 at 4:12 PM, John D. Ament <jo...@gmail.com>
wrote:

> Ok, so I tried setting up the vagrant machine.  The one issue I see is that
> the portal is empty
>
> vagrant@ug:/var/lib/tomcat7/webapps/portal$ pwd
>
> /var/lib/tomcat7/webapps/portal
>
> vagrant@ug:/var/lib/tomcat7/webapps/portal$ ll


Something must have gone wrong with the bootstrapping. The bootstrap script
gets the source code for Usergrid, builds the stack, builds the portal and
deploys. It's possible that something changed that broke the bootstrap
script -- but I did start a machine successfully last week with it.  Can
you see anything in the log produced by Vagrant on startup?

- Dave

Re: How to build and run

Posted by "John D. Ament" <jo...@gmail.com>.
Ok, so I tried setting up the vagrant machine.  The one issue I see is that
the portal is empty

vagrant@ug:/var/lib/tomcat7/webapps/portal$ pwd

/var/lib/tomcat7/webapps/portal

vagrant@ug:/var/lib/tomcat7/webapps/portal$ ll

total 8

drwxr-xr-x 2 root    root    4096 Sep  8 20:07 *.*/

drwxrwxr-x 4 tomcat7 tomcat7 4096 Sep  8 20:07 *..*/

On Mon, Sep 8, 2014 at 3:20 PM, John D. Ament <jo...@gmail.com>
wrote:

>
>
> On Mon, Sep 8, 2014 at 3:06 PM, Dave <sn...@gmail.com> wrote:
>
>> On Mon, Sep 8, 2014 at 2:57 PM, John D. Ament <jo...@gmail.com>
>> wrote:
>>
>> > What should be in the URL field of the launcher GUI?  The default one
>> > points to a github.io page that gives back a 404.
>> >
>>
>> Crap. I thought we actually included the Portal in the Launcher. We use to
>> have a hosted version at the above URL, not sure why we do not anymore.
>>
>> If you follow the instructions in the portal directory and run the
>> build.sh
>> there, you will get a zip file containing the portal. You can put that in
>> the root of your favorite web server, HTTPD, Tomcat whatever and access it
>> there -- is is all static HTML and JS code. You may have to edit the
>> config.js file in the portal to set your root directory.
>>
>> We've got some work to do to make the launcher a pleasant experience
>> again.
>>
>
> That's fine.  I'm working with the vagrant image at this point, until I
> get npm running locally.
>
>
>>
>> - Dave
>>
>
>

Re: How to build and run

Posted by "John D. Ament" <jo...@gmail.com>.
On Mon, Sep 8, 2014 at 3:06 PM, Dave <sn...@gmail.com> wrote:

> On Mon, Sep 8, 2014 at 2:57 PM, John D. Ament <jo...@gmail.com>
> wrote:
>
> > What should be in the URL field of the launcher GUI?  The default one
> > points to a github.io page that gives back a 404.
> >
>
> Crap. I thought we actually included the Portal in the Launcher. We use to
> have a hosted version at the above URL, not sure why we do not anymore.
>
> If you follow the instructions in the portal directory and run the build.sh
> there, you will get a zip file containing the portal. You can put that in
> the root of your favorite web server, HTTPD, Tomcat whatever and access it
> there -- is is all static HTML and JS code. You may have to edit the
> config.js file in the portal to set your root directory.
>
> We've got some work to do to make the launcher a pleasant experience again.
>

That's fine.  I'm working with the vagrant image at this point, until I get
npm running locally.


>
> - Dave
>

Re: How to build and run

Posted by Dave <sn...@gmail.com>.
On Mon, Sep 8, 2014 at 2:57 PM, John D. Ament <jo...@gmail.com>
wrote:

> What should be in the URL field of the launcher GUI?  The default one
> points to a github.io page that gives back a 404.
>

Crap. I thought we actually included the Portal in the Launcher. We use to
have a hosted version at the above URL, not sure why we do not anymore.

If you follow the instructions in the portal directory and run the build.sh
there, you will get a zip file containing the portal. You can put that in
the root of your favorite web server, HTTPD, Tomcat whatever and access it
there -- is is all static HTML and JS code. You may have to edit the
config.js file in the portal to set your root directory.

We've got some work to do to make the launcher a pleasant experience again.

- Dave

Re: How to build and run

Posted by "John D. Ament" <jo...@gmail.com>.
What should be in the URL field of the launcher GUI?  The default one
points to a github.io page that gives back a 404.

On Mon, Sep 8, 2014 at 2:53 PM, Dave <sn...@gmail.com> wrote:

> On Mon, Sep 8, 2014 at 1:53 PM, John D. Ament <jo...@gmail.com>
> wrote:
>
> > Yes, that's the simple part.  I can even send you a PR to fix the doc,
> if I
> > can figure out where to find your docs.
> >
>
> Once the little launcher GUI starts up you should be able to click on the
> little browser icon and get the Portal.
>
> - Dave
>

Re: How to build and run

Posted by Dave <sn...@gmail.com>.
On Mon, Sep 8, 2014 at 1:53 PM, John D. Ament <jo...@gmail.com>
wrote:

> Yes, that's the simple part.  I can even send you a PR to fix the doc, if I
> can figure out where to find your docs.
>

Once the little launcher GUI starts up you should be able to click on the
little browser icon and get the Portal.

- Dave

Re: How to build and run

Posted by "John D. Ament" <jo...@gmail.com>.
Yes, that's the simple part.  I can even send you a PR to fix the doc, if I
can figure out where to find your docs.


What about the portal?

On Mon, Sep 8, 2014 at 1:37 PM, Dave <sn...@gmail.com> wrote:

> On Mon, Sep 8, 2014 at 1:29 PM, John D. Ament <jo...@gmail.com>
> wrote:
>
> > > > cd launcher; java -jar target/usergrid-launcher-*.jar
> >
>
> I think that asterisk is the problem.
>
> Try "java -jar target/usergrid-launcher-1.0.0.jar" instead. That works for
> me.
>
> - Dave
>

Re: How to build and run

Posted by Dave <sn...@gmail.com>.
On Mon, Sep 8, 2014 at 1:29 PM, John D. Ament <jo...@gmail.com>
wrote:

> > > cd launcher; java -jar target/usergrid-launcher-*.jar
>

I think that asterisk is the problem.

Try "java -jar target/usergrid-launcher-1.0.0.jar" instead. That works for
me.

- Dave

Re: How to build and run

Posted by "John D. Ament" <jo...@gmail.com>.
On Mon, Sep 8, 2014 at 1:06 PM, Dave <sn...@gmail.com> wrote:

> On Mon, Sep 8, 2014 at 12:55 PM, John D. Ament <jo...@gmail.com>
> wrote:
>
> > Hi
> >
> > So, I'm starting to play around with usergrid, and was wondering how
> > exactly do you build and run it? For one, it looks like there's no binary
> > release which is fine, but even then the source release seems a little
> out
> > of date.
> >
> > When I look at [1], it says to run mvn (I assume from the top level), but
> > there is no pom at the top level.  I'm assuming it's the stack folder
> based
> > on a few other areas of your documentation. When I do build stack, and
> try
> > running this:
> >
> > cd launcher; java -jar target/usergrid-launcher-*.jar
> >
> > I get this output:
> >
> > Johns-MacBook-Pro:stack johnament$ cd launcher; java -jar
> > target/usergrid-launcher-*.jar
> >
> > Error: Could not find or load main class
> > org.apache.usergrid.launcher.JarMain
> >
> > I think this happens because of
> >
> >
> > Johns-MacBook-Pro:launcher johnament$ ls -ltr
> > target/usergrid-launcher-*.jar
> >
> > -rw-r--r--  1 johnament  staff  49327291 Sep  8 12:52
> > target/usergrid-launcher-1.0.0.jar
> >
> > -rw-r--r--  1 johnament  staff     13028 Sep  8 12:52
> > target/usergrid-launcher-1.0.0-tests.jar
> >
>
> If you do a "mvn install" in the stack directory, the launcher should work
> and it includes the portal as well as embedded Cassandra and the Grizzly
> web container. The launcher is designed to make it easy to experiment with
> Usergrid on your desktop computer.
>

Like I was mentioning, I think the main issue is that it is also generating
a test jar, which seems to get picked up by the java -jar command.  It
might be as simple as not doing a test jar.  If I wanted to launch the
portal, what would be the URL?

John


>
> If you want to build for a more production like environment, the basic
> steps are to do a Maven build in the stack directory and run the build.sh
> script in the portal directory. Then deploy stack/rest/target/ROOT.war and
> portal/dist/usergrid-portal to Tomcat and add a
> usergrid-deployment.properties file to the Tomcat classpath to tell
> Usergrid how to find Cassandra. There are some docs here:
> http://usergrid.incubator.apache.org/docs/deploy-local/
>


> Another way to get up and running is to use Vagrant. There are a couple of
> Vagrant setups for Usergrid. I've got my own here:
> https://github.com/snoopdave/usergrid-vagrant
>
> Hope that helps...
>
> - Dave
>

Re: How to build and run

Posted by Dave <sn...@gmail.com>.
On Mon, Sep 8, 2014 at 12:55 PM, John D. Ament <jo...@gmail.com>
wrote:

> Hi
>
> So, I'm starting to play around with usergrid, and was wondering how
> exactly do you build and run it? For one, it looks like there's no binary
> release which is fine, but even then the source release seems a little out
> of date.
>
> When I look at [1], it says to run mvn (I assume from the top level), but
> there is no pom at the top level.  I'm assuming it's the stack folder based
> on a few other areas of your documentation. When I do build stack, and try
> running this:
>
> cd launcher; java -jar target/usergrid-launcher-*.jar
>
> I get this output:
>
> Johns-MacBook-Pro:stack johnament$ cd launcher; java -jar
> target/usergrid-launcher-*.jar
>
> Error: Could not find or load main class
> org.apache.usergrid.launcher.JarMain
>
> I think this happens because of
>
>
> Johns-MacBook-Pro:launcher johnament$ ls -ltr
> target/usergrid-launcher-*.jar
>
> -rw-r--r--  1 johnament  staff  49327291 Sep  8 12:52
> target/usergrid-launcher-1.0.0.jar
>
> -rw-r--r--  1 johnament  staff     13028 Sep  8 12:52
> target/usergrid-launcher-1.0.0-tests.jar
>

If you do a "mvn install" in the stack directory, the launcher should work
and it includes the portal as well as embedded Cassandra and the Grizzly
web container. The launcher is designed to make it easy to experiment with
Usergrid on your desktop computer.

If you want to build for a more production like environment, the basic
steps are to do a Maven build in the stack directory and run the build.sh
script in the portal directory. Then deploy stack/rest/target/ROOT.war and
portal/dist/usergrid-portal to Tomcat and add a
usergrid-deployment.properties file to the Tomcat classpath to tell
Usergrid how to find Cassandra. There are some docs here:
http://usergrid.incubator.apache.org/docs/deploy-local/

Another way to get up and running is to use Vagrant. There are a couple of
Vagrant setups for Usergrid. I've got my own here:
https://github.com/snoopdave/usergrid-vagrant

Hope that helps...

- Dave