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

Runner config from the CLI #1014

Merged
merged 17 commits into from
Apr 9, 2021
Merged

Runner config from the CLI #1014

merged 17 commits into from
Apr 9, 2021

Conversation

andreaTP
Copy link
Contributor

@andreaTP andreaTP commented Apr 5, 2021

This is the second library shared across tools and core if we start to have more we should merge back the two sbt projects.

TODO:

  • test it once more (it and runLocal)
  • go through the open TODO with @RayRoestenburg
  • regenerate the GraalVM configuration as soon as names are settled
  • fix the release process to release the correspondent artifact

@andreaTP andreaTP marked this pull request as ready for review April 6, 2021 17:17
libraryDependencies ++= Vector(JacksonScalaModule)
)
.settings(
Compile / unmanagedSourceDirectories += (ThisProject / baseDirectory).value / ".." / ".." / "tools" / "cloudflow-runner-config" / "src" / "main" / "scala",
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's chat about tools / core again ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

back to the core !

import cloudflow.blueprint.deployment.ApplicationDescriptorJsonFormat._
import cloudflow.blueprint.RunnerConfigUtils._
import cloudflow.streamlets.{ BooleanValidationType, DoubleValidationType, IntegerValidationType, StreamletExecution, StreamletLoader }
import cloudflow.runner
Copy link
Contributor

Choose a reason for hiding this comment

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

strange import?

Copy link
Contributor

Choose a reason for hiding this comment

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

ah I see now, rather just use cloudflow.runner... instead of runner... in code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -28,20 +28,26 @@ trait RunnerConfigResolver {
final val SecretConfigFile = "secret.conf"

def makeConfig: Try[Config] = Try {
val configFilePathString = Option(System.getProperty("config.file")).getOrElse(s"$ConfigMountPath/$ConfigFile")
val configFilePathString = Option(System.getProperty("config.file")).getOrElse(s"$ConfigSecretMountPath/$ConfigFile")
Copy link
Contributor

Choose a reason for hiding this comment

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

This is slightly confusing, maybe we can chat.

case (name, topic) =>
name -> runner.config.Topic(id = topic.id,
// TODO: check with Ray the default
cluster = topic.cluster.getOrElse(""),
Copy link
Contributor

Choose a reason for hiding this comment

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

default is None

val configPath = Paths.get(configFilePathString)
val secretPath = Paths.get(s"$ConfigSecretMountPath/$SecretConfigFile")

val applicationConfig = if (Files.exists(configPath)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment here that this is for backwards compat or extract a function called backwardsCompatConfig

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

},
portMappings = Option(deployment.portMappings).getOrElse(Map.empty).map {
case (name, pm) =>
// TODO: check with Ray: cluster should be "default"?
Copy link
Contributor

Choose a reason for hiding this comment

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

same, default is None

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

@JsonProperty("id")
id: String,
@JsonProperty("cluster")
cluster: String,
Copy link
Contributor

Choose a reason for hiding this comment

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

Optional

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

@RayRoestenburg RayRoestenburg left a comment

Choose a reason for hiding this comment

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

Some changes suggested.

},
portMappings = Option(deployment.portMappings).getOrElse(Map.empty).map {
case (name, pm) =>
// TODO: check with Ray: cluster should be "default"?
name -> runner.config.Topic(id = pm.id, cluster = pm.cluster.getOrElse(""), config = pm.config)
name -> cloudflow.runner.config.Topic(id = pm.id, cluster = pm.cluster.getOrElse(""), config = pm.config)
Copy link
Contributor

Choose a reason for hiding this comment

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

why still getOrElse?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is outdated

@andreaTP
Copy link
Contributor Author

andreaTP commented Apr 9, 2021

should be ready to go now @RayRoestenburg

@andreaTP andreaTP merged commit 8b736a4 into master Apr 9, 2021
@andreaTP andreaTP deleted the runnerconfig-to-cli branch April 9, 2021 09:19
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.

2 participants