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

Add concept of global resources which can be shared across applications #80

Merged
merged 8 commits into from Dec 24, 2019

Conversation

lceleban-dd
Copy link
Contributor

No description provided.

@lceleban-dd lceleban-dd reopened this Dec 20, 2019
@coveralls
Copy link

coveralls commented Dec 20, 2019

Coverage Status

Coverage decreased (-0.9%) to 78.385% when pulling 3311461 on ramencloud:global_resources into ad4feb0 on izeigerman:master.

Copy link
Owner

@izeigerman izeigerman left a comment

Choose a reason for hiding this comment

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

Thanks, @lceleban-dd, this is an awesome update 👍 A few minor comments and let's ship it.


lazy val globalResources: Seq[AkkeeperResource] = {
if (akkeeperConfig.hasPath("globalResources")) {
akkeeperConfig.getConfigList("globalResources").asScala.map(akkeeperResourceFromConfig)
Copy link
Owner

Choose a reason for hiding this comment

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

Can we please name this global-resources to be consistent with other property names.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, done

private[config] def akkeeperResourceFromConfig(config: Config): AkkeeperResource = {
AkkeeperResource(
new URI(config.getString("uri")),
config.getString("localPath"),
Copy link
Owner

Choose a reason for hiding this comment

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

Same as above: local-path.

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

val dst = copyResourceToStagingDir(dstFs, srcStream, dstPath)
val dstStatus = dstFs.getFileStatus(dst)
create(dstFs, dstStatus)
val dst = copyResourceToStagingDir(srcStream, dstPath)
Copy link
Owner

Choose a reason for hiding this comment

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

[Thought|Optional] Perhaps it makes sense to rename all createLocalResource methods to uploadLocalResource to draw a clear line between the case when we copy the resource and when we use the original source instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed

@@ -19,6 +19,7 @@ private[akkeeper] object LocalResourceNames {
val AkkeeperJarName = "akkeeper.jar"
val UserJarName = "user.jar"
val UserConfigName = "user_config.conf"
val LauncherConfigName = "launcher_config.conf"
Copy link
Owner

Choose a reason for hiding this comment

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

I wouldn't say it's a launcher config per se. More like application or akkeeper config.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed to application.conf

@@ -19,6 +19,7 @@ private[akkeeper] object LocalResourceNames {
val AkkeeperJarName = "akkeeper.jar"
val UserJarName = "user.jar"
val UserConfigName = "user_config.conf"
val LauncherConfigName = "application.conf"
Copy link
Owner

Choose a reason for hiding this comment

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

Shall we rename the constant as well?

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
Owner

@izeigerman izeigerman left a comment

Choose a reason for hiding this comment

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

Thanks, Lukasz, great job 👍

@izeigerman izeigerman merged commit 547f64e into izeigerman:master Dec 24, 2019
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.

None yet

4 participants