Skip to content
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

init.sh uses go-java-launcher instead of Gradle startup scripts #85

Merged
merged 7 commits into from
Jul 6, 2016

Conversation

uschi2000
Copy link
Contributor

"Works."
Todos:

  • The check.sh script still calls the original Gralde run script. There aren't any tests for this, really, so it's not quite clear to me what this is doing. Let's discuss tomorrow.
  • Need to publish the Go binaries and pull them in from an artifact. Blocked on getting a repository.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.09%) to 99.346% when pulling cbc7a39 on rfink/go-launcher into 52761a3 on develop.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.09%) to 99.346% when pulling c4d43f1 on rfink/go-launcher into 52761a3 on develop.

}) << {
// TODO(rfink) Don't check these in, but fetch them from a published artifact?
["javalauncher-linux-amd64", "javalauncher-darwin-amd64"].each { file ->
def dest = Paths.get("${project.buildDir}/scripts/${file}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably end up in var/conf. config.sh was in the immutable section because it was a script (and thus vulnerable to tampering).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this should've been on the launch config file, not the launchers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double-checking the reasoning here: the file is really part of the binary and is not intended to be edited by anyone directly. I think it's more correct to put it in bin/. as it stands, the stuff in the var/conf directory of the distribution is exactly the contents of the var/conf directory of the source, and conversely everything in bin/ is generated; I like that separation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the launch config options need to be editable (say to safely add env variables via deployment software). Users definitely need to be able to modify heap settings as well.

Fine putting it in var/launch or some other place, but don't think it can go in the service dir, since by mandate that's not editable.

Sent from my iPhone

On Jul 6, 2016, at 10:40 AM, Robert Fink <notifications@github.commailto:notifications@github.com> wrote:

In src/main/groovy/com/palantir/gradle/javadist/JavaDistributionPlugin.groovyhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_palantir_gradle-2Djava-2Ddistribution_pull_85-23discussion-5Fr69776704&d=DQMCaQ&c=izlc9mHr637UR4lpLEZLFFS3Vn2UXBrZ4tFb6oOnmz8&r=Vp81aOxWZvuVgVK_wp-VF3pIYG92B19LcCw6XKeYC0U&m=WP78GPbLtpuvYIwP3MU0cTu5Ks7YcCYBI_HSG6YaIEs&s=cGdCMvQ6AbO6HTPAPgynXiiWdsDzpN_Z1s3bkMiwn_c&e=:

@@ -58,19 +59,37 @@ class JavaDistributionPlugin implements Plugin {
}
}

  •    Task copyLauncherBinaries = project.tasks.create('copyLauncherBinaries', {
    
  •        group = GROUP_NAME
    
  •        description = "Creates go-java-launcher binaries."
    
  •    }) << {
    
  •        // TODO(rfink) Don't check these in, but fetch them from a published artifact?
    
  •        ["javalauncher-linux-amd64", "javalauncher-darwin-amd64"].each { file ->
    
  •            def dest = Paths.get("${project.buildDir}/scripts/${file}")
    

double-checking the reasoning here: the file is really part of the binary and is not intended to be edited by anyone directly. I think it's more correct to put it in bin/. as it stands, the stuff in the var/conf directory of the distribution is exactly the contents of the var/conf directory of the source, and conversely everything in bin/ is generated; I like that separation.


You are receiving this because you were assigned.
Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_palantir_gradle-2Djava-2Ddistribution_pull_85_files_c4d43f123e5aa09f0f0ef95acf96f33ccb0ec982-23r69776704&d=DQMCaQ&c=izlc9mHr637UR4lpLEZLFFS3Vn2UXBrZ4tFb6oOnmz8&r=Vp81aOxWZvuVgVK_wp-VF3pIYG92B19LcCw6XKeYC0U&m=WP78GPbLtpuvYIwP3MU0cTu5Ks7YcCYBI_HSG6YaIEs&s=tiIBWzyqjE8ir0YfbzNT6iaPiTDC9-9Ya5IEoa77hoY&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe_AAp3Q6rhZBB23sx6ldISZouRbx8Y-5FvSIks5qS-2DihgaJpZM4JFzUs&d=DQMCaQ&c=izlc9mHr637UR4lpLEZLFFS3Vn2UXBrZ4tFb6oOnmz8&r=Vp81aOxWZvuVgVK_wp-VF3pIYG92B19LcCw6XKeYC0U&m=WP78GPbLtpuvYIwP3MU0cTu5Ks7YcCYBI_HSG6YaIEs&s=UDAyzLjQMBRRRpIpHHJ33mkzPG54Wt8F2c3MsDiS5-w&e=.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var/launch/launcher,yml, actually

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one more thought here, we can also split the configs between things that should not be editable, saved in service/bin and things that should be editable (such as java options) in var/launcher.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main class and classpath probably should be static, for instance (the classpath thing might be debatable)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, yeah maybe. not sure this is super high priority though...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, fine leaving as a singular conf file.

@uschi2000
Copy link
Contributor Author

Changes as per comments above. Left to be done: check.sh needs to call javalauncher instead of deprecated shell script

@coveralls
Copy link

Coverage Status

Coverage increased (+0.7%) to 100.0% when pulling 5899285 on rfink/go-launcher into 52761a3 on develop.

@markelliot
Copy link
Contributor

Yep, calling javalauncher with the args provided from the config should be okay. Also fine adding "healthcheck" or "health" as an option in init.sh and having check.sh just call init.sh with that explicit arg.

We should probably also clean up init.sh, it's gotten gnarly/bad.

@markelliot
Copy link
Contributor

…but can wait on the init.sh for another PR, if you like.

init.sh # daemonizing script
config.sh # customized environment vars
[service-name] # Bash start script
[service-name.bat] # Windows start script
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we tag these as unused?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already done in the section below

}
}

private static List<String> getSlsv2RelativeClasspath(FileCollection files) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, one last nit, let's call this getServiceLibDirectory.

One interesting thing we may need to deal with here is custom classpath entries which may not necessarily live in lib, not sure how best to deal with that, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@coveralls
Copy link

Coverage Status

Coverage increased (+0.7%) to 100.0% when pulling fa39ced on rfink/go-launcher into 52761a3 on develop.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.7%) to 100.0% when pulling fa39ced on rfink/go-launcher into 52761a3 on develop.

@uschi2000
Copy link
Contributor Author

ok, I think I addresses all things

@uschi2000
Copy link
Contributor Author

binaries are still checked in, blocked on repo creation

.toFile()
.setExecutable(true)
}

// TODO(rfink) The check script should go away, or at least it should not call the Gradle start script
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer a todo?

@markelliot
Copy link
Contributor

lgtm

SERVICE="@serviceName@"
PIDFILE="var/run/$SERVICE.pid"
LAUNCHER_CONFIG="var/launch/launcher.yml"
LAUNCHER_CHECK_CONFIG="var/launch/launcher-check.yml"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I see where this gets generated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.7%) to 100.0% when pulling d29da58 on rfink/go-launcher into 52761a3 on develop.

@uschi2000 uschi2000 merged commit 850da03 into develop Jul 6, 2016
@uschi2000 uschi2000 deleted the rfink/go-launcher branch July 6, 2016 21:30
@ash211
Copy link
Contributor

ash211 commented Jul 6, 2016

Where is the source code for those checked-in Go binaries?

@uschi2000
Copy link
Contributor Author

replied offline

On Wed, Jul 6, 2016 at 3:27 PM Andrew Ash notifications@github.com wrote:

Where is the source code for those checked-in Go binaries?


You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub
#85 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AGOdwUdK37gP8Ioli7QrXwQmy5W-B6Iiks5qTCvEgaJpZM4JFzUs
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants