Question about installing/running the new server

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about installing/running the new server

Daniel
Hi,

I succeeded to download/build/install the updated server's dev version, but I am having problems with running it:
It seems that the version being run when entering server-distribution and calling 'mvn -Pcli...' is different then the version being installed when running 'mvn clean install' under powertac-server.
Just in case it matters, please note that I cloned 'common' and 'server-distribution' to sit under powertac-server.

I am probably missing something regarding how maven operates, but so far I haven't found a decent documentation/Q&A for maven.

Does something obvious comes to mind regarding what I am doing wrong?

Thanks,
Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Question about installing/running the new server

grampajohn
Administrator
Daniel wrote
It seems that the version being run when entering server-distribution and calling 'mvn -Pcli...' is different then the version being installed when running 'mvn clean install' under powertac-server.
Just in case it matters, please note that I cloned 'common' and 'server-distribution' to sit under powertac-server.

I am probably missing something regarding how maven operates, but so far I haven't found a decent documentation/Q&A for maven.
Hi, Daniel -

Maven is indeed a bit complicated, but it's the least complicated way I've found yet to manage and build a system of the complexity of Power TAC. But you do have to have an idea of what it does, I suspect. It might be worth your time to go to the apache maven site and work through the basic tutorials. Basically, maven does both build automation and dependency management. The dependency-management part is what's giving you trouble, I suspect.

First, the pom.xml in powertac-server does not work, and it is badly out of date. I am surprised it does not just crash immediately. I have not removed it because I have hopes of sometime coming back and getting it to work correctly. I believe there's a strongly-worded comment at the top suggesting that you not use it.

On the other hand, your question prompted me to go back and make sure server-distribution was correct for the 1.0.0-SNAPSHOT, and it was not. I neglected to update it after the version update. I guess my testing was using STS. So if you download the server-distribution HEAD again you will get server-distribution:1.0.0-SNAPSHOT.

This failure on my part would have caused a broker compiled against 1.0.0-SNAPSHOT to fail against a server running under the latest server-distribution. That is now fixed.

Please let me know if this does not fix your problem.

John
Reply | Threaded
Open this post in threaded view
|

Re: Question about installing/running the new server

Daniel
grampajohn wrote
Daniel wrote
It seems that the version being run when entering server-distribution and calling 'mvn -Pcli...' is different then the version being installed when running 'mvn clean install' under powertac-server.
Just in case it matters, please note that I cloned 'common' and 'server-distribution' to sit under powertac-server.

I am probably missing something regarding how maven operates, but so far I haven't found a decent documentation/Q&A for maven.
Hi, Daniel -

Maven is indeed a bit complicated, but it's the least complicated way I've found yet to manage and build a system of the complexity of Power TAC. But you do have to have an idea of what it does, I suspect. It might be worth your time to go to the apache maven site and work through the basic tutorials. Basically, maven does both build automation and dependency management. The dependency-management part is what's giving you trouble, I suspect.
Hi John,

I actually think Maven does a very good job and I like it - it just lacks some documentation. I'll check the tutorials you pointed me to. Regarding my question, perhaps I should clarify a bit:
When running "mvn -Pcli..." from under 'server-distribution', what exactly tells maven to use the executables that were compiled and installed from under 'powertac-server'? does this information appear in 'server-distribution's pom file? my problem was that when changing the source code, and  building/installing from under 'powertac-server', no effect was seen when running the server from under 'server-distribution'

grampajohn wrote
First, the pom.xml in powertac-server does not work, and it is badly out of date. I am surprised it does not just crash immediately. I have not removed it because I have hopes of sometime coming back and getting it to work correctly. I believe there's a strongly-worded comment at the top suggesting that you not use it.
It actually crash immidiately when trying to run 'mvn -Pcli' under it. However, I didn't do that - only called 'mvn install' from here.

grampajohn wrote
On the other hand, your question prompted me to go back and make sure server-distribution was correct for the 1.0.0-SNAPSHOT, and it was not. I neglected to update it after the version update. I guess my testing was using STS. So if you download the server-distribution HEAD again you will get server-distribution:1.0.0-SNAPSHOT.

This failure on my part would have caused a broker compiled against 1.0.0-SNAPSHOT to fail against a server running under the latest server-distribution. That is now fixed.

Please let me know if this does not fix your problem.
OK - I'll let you know - Thanks!
Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Question about installing/running the new server

grampajohn
Administrator
Daniel wrote
When running "mvn -Pcli..." from under 'server-distribution', what exactly tells maven to use the executables that were compiled and installed from under 'powertac-server'? does this information appear in 'server-distribution's pom file? my problem was that when changing the source code, and  building/installing from under 'powertac-server', no effect was seen when running the server from under 'server-distribution'
Maven finds modules through a hierarchy of "repositories", starting with ~/.m2/repository. For snapshots, it goes to the Sonatype OSS repo, and for releases it goes to maven central. So if you want maven to find a locally-compiled module, it has to be in ~/.m2/repository. That's what mvn install does. But note that periodically it checks to see whether the local ones are up-to-date by comparing with the appropropriate public repo. This happens once/day by default.

One consequence of this is that the directory layout between modules in your local system is basically inconsequential, except that powertac-server also carries a "git submodule" structure that will automatically populate the server modules from github. Also, the "bundle pom" in powertac-server expects its bundle components to be in subdirectories. That would matter if the bundle scheme worked, but so far it does not. I'll try to take a look at that soon, but my workload is likely to ramp up this month. I would welcome a volunteer to take a look at this.

Cheers -

John
Reply | Threaded
Open this post in threaded view
|

Re: Question about installing/running the new server

Daniel
Hi John,

Thanks for the clarification.

Best,
Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Question about installing/running the new server

grampajohn
Administrator
In reply to this post by Daniel
Daniel and all -

Daniel wrote
It seems that the version being run when entering server-distribution and calling 'mvn -Pcli...' is different then the version being installed when running 'mvn clean install' under powertac-server.
I have cleaned up powertac-server/pom.xml, so the process Daniel was attempting here now works. In other words, maven will now do a correct local installation of the 1.0.0-SNAPSHOT version, so you do not need to manually iterate through the modules in a particular order to get the dependencies right.

In the process, I incorporated visualizer as a submodule of powertac-server. If you are using a server source environment, this requires that visualizer be installed in a subdirectory of powertac-server.

So if you update powertac-server, here's what you can now do:

'git submodule foreach git pull' will now update all the server modules, including visualizer.

'mvn clean install' will now re-compile, test, and locally install all the server modules, in proper dependency order.

I will update the instructions in the getting-started page later today.

Cheers -

John