-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Windows platform #91
Comments
it will be awesome if windows support can be worked out at least in the agent. I tried to make the agent work on windows but there's some weird path problem that i can't pin down where it comes from. i believe the main problem (there may be more small issue on windows) is something along these lines: if let's say "glu.agent.apps" is set to c:/deployment and than i want to deploy something for which i set the mountpoint "/myapp" glu will try to create folders in : c:/deployment/c:/myapp which of course is invalid. any clue why is going this?. i'm not a groovy expert but i will be happy to pitch in if is something simple.. Thanks, |
Under the cover the agent uses a class called ShellImpl (which is tested here: https://github.com/linkedin/glu/blob/master/agent/org.linkedin.glu.agent-impl/src/test/groovy/test/agent/impl/TestCapabilities.groovy) which in turn uses a class called FileSystemImpl (from a different project and tested here: https://github.com/linkedin/linkedin-utils/blob/master/org.linkedin.util-groovy/src/test/groovy/test/util/io/fs/TestFileSystem.groovy) It would probably help if you could try to run those tests on a windows platform and see if/how they break. The fix may be easy... Thanks |
the tests are indeed failing (i don't see any way here to attach a zip file with the test report). for example testFileSystemStorage fails with: java.io.IOException: Unable to rename C:\tmp\FileSystemImpl1388151843++tmp._a_b_c.484b14f1-100d-4e16-b91f-9d775cd4885f.tmp++ to C:\tmp\FileSystemImpl1388151843_a_b_c |
i made some more progress on this issue, i have now an agent running on windows that starts just fine. I used the tutorial for testing and the windows agent can actually deploy the jetty sample app (the start phase fails because is not finding bash which is totally fine for windows. i can of course go around this by changing the groovy script to start jetty windows way, bottom line: the start phase doesn't work because the glu script is written for linux not because the agent doesn't work on windows properly) what doesn't work: pretty much the logs are unavailable in the console web page. in the console when in click on "more" on the agent page i get this exception (my agent in on the C drive): Error Details Error 500: Executing action [fileContent] of controller [org.linkedin.glu.console.controllers.AgentsController] caused exception: org.linkedin.glu.agent.api.AgentException: unexpected exception java.net.MalformedURLException: unknown protocol: c
i'm guessing the file path is something like: /C:/... and the URI is freaking out or something. I haven't dug into this problem yet. now, what did i had to change to make all these work: the problems i found so far are in linkedin-util packages. My code here is a little bit hackish, i'm hoping is going to get the idea across of what the problems are. I've also added a new dependency in org.linkedin.util-core to commons-io to make the file renames lot easier to write. file rename on windows behaves differently and this is the main cause of the agent problems. here's the list of changed files from my local git repository:
diff --git a/org.linkedin.util-core/src/main/java/org/linkedin/util/io/IOUtils.java b/org.linkedin.util-core/src/main/java/org/linkedin/util/io/IOUtils.java +import org.apache.commons.io.FileUtils;
diff --git a/org.linkedin.util-core/src/main/java/org/linkedin/util/io/resource/FileResource.java b/org.linkedin.util-core/src/main/java/org/linkedin/util/io/resource/FileResource.java
diff --git a/org.linkedin.util-core/src/main/java/org/linkedin/util/io/resource/internal/AbstractResourceProvider.java b/org.linkedin.util-core/src/main/java/org/linkedin/util/io/resource/internal/AbstractResourceProvider.jindex 03d8676..b2d8999 100644 package org.linkedin.util.io.resource.internal; -import org.linkedin.util.io.PathUtils; -import org.linkedin.util.io.resource.ResourceFilter;import java.io.File; +import org.apache.tools.ant.util.FileUtils;
URI relativeURI = URI.create(relativePath).normalize(); // normalize removes leading . if(relativeURI.isAbsolute())
diff --git a/org.linkedin.util-groovy/src/main/groovy/org/linkedin/groovy/util/io/GroovyIOUtils.groovy b/org.linkedin.util-groovy/src/main/groovy/org/linkedin/groovy/util/io/GroovyIOUtils.groovy
diff --git a/org.linkedin.util-groovy/src/main/groovy/org/linkedin/groovy/util/io/fs/SerializableFileResource.groovy b/org.linkedin.util-groovy/src/main/groovy/org/linkedin/groovy/util/io/fs/SerializableFileResource.groovy
return true |
A couple of comments:
In other words, I strongly believe that GroovyIOUtils.toFile(new File("c:\myfile.txt").toURI().toString()) should be equivalent to new File("c:\myfile.txt"). So if we change the console to provide URIs instead of path I think it will work... (you can experiment by modifying the following file https://github.com/linkedin/glu/blob/master/console/org.linkedin.glu.console-webapp/grails-app/views/agents/view.gsp#L38) and replacing
by
|
Thank you very much for your comments.
|
is not working (the URI trick), i get the same error when i use this: id="${model.agent.agentName}" params="[location: new File(model.agent.agentProperties['glu.agent.logDir']).toURI()]">more... |
Can you post the script you're using to start it on windows? i've had no luck |
i'm using this to start my java apps on windows http://wrapper.tanukisoftware.com/doc/english/download.jsp |
I'm interested in using glu for our company's deployment system but also require a Window's agent as some of the systems are (unfortunately) Windows servers. Did you ever manage to get the Agent running under Windows? |
yes, i have. the agent (with the code changes that i outlined here) starts up and mostly works. I can deploy stuff just fine, the parts that are a bit iffy is viewing the logs. glu is using linux tail for that some of the glu shell commands are a big different on windows, mostly around renaming folders/files. At least that's what i found so far in my limited testing |
Great. Would it be possible for you to commit / send me your changes for the agent? |
Alins, did you get any further with this? Going to start looking into it myself. |
+1 for support for windows. I'm evaluating GLU at the moment and windows support would be useful. I use unix where possible, but some third party tools must be deployed to windows. So only need the agent to run on windows. |
I, as well as many of my industry colleagues, would also greatly enjoy deploying to Windows. I'll try to make the changes that were mangled by github's post formatter and commit them to a branch. I'll see if I can build, and if so, share results... |
Did anyone happen to submit a pull request for these changes, or if not, can point to a clone where those interested in windows agents functionality and further development can contribute? A link to a repo or reference to a branch on this one is greatly appreciated :) |
AFAIK there isn't one, but I would gladly take pull requests :) |
ok I'll fork and try to apply the diffs listed by alins above and then get things like the tanuki wrapper conf figured out and apply pull requests as I confirm they're working. :) |
@prelegalwonder Did you manage to get anywhere with this fork? |
no, I apologize I got behind in some other deliverables and haven't spent I'm currently on holiday but will digg in when I get back.
|
+1 for me as well, at least for the GLU agent. We're investigating commercial tools, but would much prefer something open source like GLU. We, like most big companies, have a mix of technologies/platforms to support. I would guess a decision to stick to *nix only is significantly limiting use of GLU in larger operations. |
It's not by main priority, but I'm trying to spend a little time getting the agent running on windows. Problems so far. Similar to @AlinS, I got the Changing the config parameter to The agent is currently failing to start when it attempts to install the root mountpoint. Not sure where the logic is that's build that directory name. I'll try grabbing these changes https://github.com/whatisdot/linkedin-utils/commit/45ba789ef027feaf437008f2e1385073cd87b5e1 to see if that fixes. For now though I need to get back to other work. |
I've tracked down the issue during the install phase of the RootScript to When installing the root mountPoint, s.toString returns In other places in the code base there is special handling of the root path which then breaks on windows. I've not had a chance yet to make / test any changes to this. |
@prelegalwonder where can we find the changes you made for windows? |
@lukestephenson In two weeks (one more sprint to finish up!), I will have time to help out with this. Is there a good way for me to help? Is there any implementation direction defined anywhere (i.e. native windows or cygwin)? |
I don't think cygwin will be an option for me long term. I'd like the agent to run as a windows service so that it starts when the host starts and doesn't require a user to login. That's probably possible with cygwin as well, but I don't want cygwin to be a barrier to entry. I've got the agent starting on windows now, haven't done much testing as yet. The changes I needed to make are on my fork of https://github.com/lukestephenson/glu and https://github.com/lukestephenson/utils-misc (on a branch). For now I've gone down the cygwin path as it was much quicker to get running. I'm still waiting for some teams that deploy to windows to create some glu scripts and actually attempt a deployment, so I expect there will be issues to resolve still. |
Is this feature request abandoned? How are you guys doing continuous deployment to Windows machines? |
Hi Ryan, We ended up going with XL Deploy from Xebia Labs. So this can be abandoned from my perspective. Thanks! From: Ryan Hoegg [mailto:notifications@github.com] Is this feature request abandoned? How are you guys doing continuous deployment to Windows machines? — The information contained in this message may be privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify your representative immediately and delete this message from your computer. Thank you. |
There is a feature request to add support for Windows in addition to Unix platforms.
The text was updated successfully, but these errors were encountered: