Can I use ivy to deploy my artifact?

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

Can I use ivy to deploy my artifact?

jmirc
I saw in the javadoc of the fetch method that ivy could be used to retrieve the artifact.
I tried and I got a unknown protocol: ivy exception.

Is it already implemented?

Thanks

Jérôme.
Reply | Threaded
Open this post in threaded view
|

Re: Can I use ivy to deploy my artifact?

frenchyan
Administrator
Yes it is supported. Another thing I missed in the documentation :( I added it to the ticket: https://github.com/linkedin/glu/issues/55

You need to configure it this way:

add the configuration:
glu.agent.ivySettings=<url to ivy settings file>

This configuration property can be set in the agentConfig.properties file or in the one that ends up in ZooKeeper directly.

Note that this property is pointing to a URL so it can use zookeeper:/ style url thus allowing you to store in zookeeper as well!

If you check the file under setup/zookeeper-config/config.properties there is a commented line at the bottom which give you an example:

################################
# Binary repository location
# glu.agent.ivySettings=zookeeper:${glu.agent.zookeeper.root}/agents/fabrics/${glu.agent.fabric}/config/ivysettings.xml

By making it relative to a fabric, you can reuse the same agent configuration files and simply uploads different ivy settings file in zookeeper based on the fabric. LinkedIn uses this to have different binary repos depending on the data center...

Yan
Reply | Threaded
Open this post in threaded view
|

Re: Can I use ivy to deploy my artifact?

jmirc
After added the configuration, ivy works correctly and the artifact is downloaded.

I can see the war file under the .ivy2/cache folder, however glu displays the following error message.

* [java.io.FileNotFoundException]: ivy:/com.xxx.xxx/admin/1.1.1.2-SNAPSHOT
* [org.apache.tools.ant.BuildException]: Can't get ivy:/com.xxx.xxx/admin/1.1.1.2-SNAPSHOT to /opt/glu_apps/xxx/i003/webapps/ROOT.war

How can I fix this problem?

Thanks

Jérôme.
Reply | Threaded
Open this post in threaded view
|

Re: Can I use ivy to deploy my artifact?

frenchyan
Administrator
Can you post:

1) the line in your glu script causing the problem
2) the full stack trace

Are you sure that /opt/glu_apps/xxx/i003/webapps is writable by the agent ?

Yan
Reply | Threaded
Open this post in threaded view
|

Re: Can I use ivy to deploy my artifact?

jmirc
1) the line in your glu script causing the problem

        log.info "Fetching ${webapp.war} artifact..."

        def war = shell.fetch(webapp.war, serverRoot."webapps/${name}.war")

        log.info "Fetching done..."

2) the full stack trace

Where can I get the stack trace? I didn't see any stack trace in the log file of the agent.

The latest info in the log are:

2011/05/20 15:23:19.126 INFO [/xxx/i003] Fetching ivy:/com.xxx.xxx/admin/1.1.1.2-SNAPSHOT artifact...
2011/05/20 15:23:28.680 INFO [/xxx/i003] waitForState([state:stopped, timeout:10s, mountPoint:/xxx/i003]): false

3) Are you sure that /opt/glu_apps/xxx/i003/webapps is writable by the agent ?
Yes... The script works if I use http instead of ivy

Thanks for your help.

Jérôme
Reply | Threaded
Open this post in threaded view
|

Re: Can I use ivy to deploy my artifact?

frenchyan
Administrator
Where did you copy those lines from ?

* [java.io.FileNotFoundException]: ivy:/com.xxx.xxx/admin/1.1.1.2-SNAPSHOT
* [org.apache.tools.ant.BuildException]: Can't get ivy:/com.xxx.xxx/admin/1.1.1.2-SNAPSHOT to /opt/glu_apps/xxx/i003/webapps/ROOT.war

It should be in a log file no on the agent side ?

I will try to reproduce with ivy vs http. given your script.

Yan
Reply | Threaded
Open this post in threaded view
|

Re: Can I use ivy to deploy my artifact?

jmirc
I got these lines directly from the console when I execute the plan.

Where the log file is located?

2011/5/20 frenchyan [via glu] <[hidden email]>
Where did you copy those lines from ?

* [java.io.FileNotFoundException]: ivy:/com.xxx.xxx/admin/1.1.1.2-SNAPSHOT
* [org.apache.tools.ant.BuildException]: Can't get ivy:/com.xxx.xxx/admin/1.1.1.2-SNAPSHOT to /opt/glu_apps/xxx/i003/webapps/ROOT.war

It should be in a log file no on the agent side ?

I will try to reproduce with ivy vs http. given your script.

Yan



If you reply to this email, your message will be added to the discussion below:
http://glu.977617.n3.nabble.com/Can-I-use-ivy-to-deploy-my-artifact-tp2904314p2967586.html
To unsubscribe from Can I use ivy to deploy my artifact?, click here.

Reply | Threaded
Open this post in threaded view
|

Re: Can I use ivy to deploy my artifact?

frenchyan
Administrator
Go to the agent view page and click on the view full stack trace link as shown in the screenshot:



Yan
Reply | Threaded
Open this post in threaded view
|

Re: Can I use ivy to deploy my artifact?

jmirc
Here is the stack trace


Grails Runtime Exception

Error Details

Error 500: Executing action [fullStackTrace] of controller [org.linkedin.glu.console.controllers.AgentsController] caused exception: Cannot invoke method getURI() on null object
Servlet: grails
URI: /console/grails/agents/fullStackTrace.dispatch
Exception Message: Cannot invoke method getURI() on null object 
Caused by: Cannot invoke method getURI() on null object 
Class: AgentsController 
At Line: [243] 
Code Snippet:

Stack Trace

java.lang.NullPointerException: Cannot invoke method getURI() on null object

at org.linkedin.glu.agent.tracker.AgentInfo$getURI.call(Unknown Source)
at org.linkedin.glu.orchestration.engine.agents.AgentsServiceImpl.withRemoteAgent(AgentsServiceImpl.groovy:479)
at org.linkedin.glu.orchestration.engine.agents.AgentsServiceImpl.getFullState(AgentsServiceImpl.groovy:93)
at org.linkedin.glu.orchestration.engine.agents.AgentsService$getFullState.call(Unknown Source)
at org.linkedin.glu.orchestration.engine.agents.AuditedAgentsService.getFullState(AuditedAgentsService.groovy)
at org.linkedin.glu.orchestration.engine.agents.AgentsService$getFullState.call(Unknown Source)
at org.linkedin.glu.console.controllers.AgentsController$_closure13.doCall(AgentsController.groovy:243)
at org.linkedin.glu.console.controllers.AgentsController$_closure13.doCall(AgentsController.groovy)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:534)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1351)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1322)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1322)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1322)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:473)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:516)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:929)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:403)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:184)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:864)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:285)
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:116)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1322)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1322)
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:359)
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:275)
at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:343)
at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:272)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:83)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1322)
at org.apache.shiro.grails.SavedRequestFilter.doFilter(SavedRequestFilter.java:55)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1322)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1322)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1322)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1322)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:473)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:479)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:929)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:403)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:184)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:864)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:247)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:151)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:114)
at org.eclipse.jetty.server.Server.handle(Server.java:352)
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:596)
at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1068)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:805)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)
at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:426)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:508)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.access$000(SelectChannelEndPoint.java:34)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:451)
at java.lang.Thread.run(Thread.java:662)


2011/5/21 frenchyan [via glu] <[hidden email]>
Go to the agent view page and click on the view full stack trace link as shown in the screenshot:



Yan


If you reply to this email, your message will be added to the discussion below:
http://glu.977617.n3.nabble.com/Can-I-use-ivy-to-deploy-my-artifact-tp2904314p2969094.html
To unsubscribe from Can I use ivy to deploy my artifact?, click here.

Reply | Threaded
Open this post in threaded view
|

Re: Can I use ivy to deploy my artifact?

frenchyan
Administrator
wow it looks like we are cursed there :(

The stack trace you sent is not the stack trace of the error you had in the first place but the stack trace of trying to fetch the stack trace!

Did you by any chance stop the agent itself ? I was able to reproduce this exception by doing the following:

* go to the agent view page (the screenshot of my previous comment)
* stop the agent
* then click on the 'View Full Stack Trace' link

if I restart the agent the exception goes away..

Yan
Reply | Threaded
Open this post in threaded view
|

Re: Can I use ivy to deploy my artifact?

frenchyan
Administrator
I just pushed 2.4.1 which should fix the second issue (exception while fetching stack trace). Do you mind trying again with 2.4.1 (and make sure the agent is up and running..)

Yan
Reply | Threaded
Open this post in threaded view
|

Re: Can I use ivy to deploy my artifact?

jkw1
In reply to this post by frenchyan
I realize this thread is pretty old, but I'm having some issues getting this to work in my environment.  What I have done is:

1) I've loaded the ivysettings.xml into my zookeeper, located at:
  zookeeper:/org/glu/agents/fabrics/myfab/config/ivysettings.xml

2) I've configured the agent.properties to contain the value:
glu.agent.ivySettings=zookeeper:${glu.agent.zookeeper.root}/agents/fabrics/${glu.agent.fabric}/config/ivysettings.xml

3) I restarted both console / agent

4) I've configured the model to refer to:
   url: ivy:/com.myorg/myapp/a.b.c-SNAPSHOT/

I've also tried:
   url: ivy://com.myorg/myapp/a.b.c-SNAPSHOT/

I upload my model and attempt to deploy, but get :
  org.linkedin.glu.agent.api.ScriptExecutionCauseException: [java.net.MalformedURLException]: unknown protocol: ivy

Any ideas what I might be doing wrong?
Reply | Threaded
Open this post in threaded view
|

Re: Can I use ivy to deploy my artifact?

frenchyan
Administrator
You need an ivySettingsURL in the console configuration file (glu-coonsole-webapp.groovy) which should be added accordingly to the method you use (meta model or manual).

Yan
Reply | Threaded
Open this post in threaded view
|

Re: Can I use ivy to deploy my artifact?

jkw1
Much appreciated - that fixed it.
Reply | Threaded
Open this post in threaded view
|

Re: Can I use ivy to deploy my artifact?

frenchyan
Administrator

Glad to hear. It's true that it is absent from the documentation...

Yan

Reply | Threaded
Open this post in threaded view
|

Re: Can I use ivy to deploy my artifact?

jkw1
In reply to this post by frenchyan
I'm getting the error that the other gentlemen was having earlier:


Run [install] phase for [/ddc-java] on [onrddc2] - 540ms
[+] org.linkedin.glu.agent.api.ScriptExecutionException: script=com.rgm.glu.scripts.SimpleJavaService [/foo], action=install
[+] org.linkedin.glu.agent.api.ScriptExecutionCauseException: [java.io.FileNotFoundException]: ivy:/org/module/version/config
[+] org.linkedin.glu.agent.api.ScriptExecutionCauseException: [org.apache.tools.ant.BuildException]: Can't get ivy:/org/module/version/config to /var/glu/data/tmp/foo/__tmp1475510086Dir/jar-name-here.jar

Any thoughts?  I can verify that the file being copied is indeed in the .ivy2 cache for the user running the Glu Agent.  Is this a file permissions problem?  Both the .ivy2 cache and the temp folder are owned by the same user/group and the permissions on the temp folder are drwxr-xr-x.

Reply | Threaded
Open this post in threaded view
|

Re: Can I use ivy to deploy my artifact?

frenchyan
Administrator
I am not entirely sure what is happening... I would suggest changing the log level on the agent and try to see if we can get more information. Edit the log4j.xml file and set it to "debug" instead of "warn". Stop and restart the agent. Try to reproduce the error and check the agent log file... Maybe the debug info will give us a clue

Thanks
Yan