-
Notifications
You must be signed in to change notification settings - Fork 90
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
Conversation
libraryDependencies ++= Vector(JacksonScalaModule) | ||
) | ||
.settings( | ||
Compile / unmanagedSourceDirectories += (ThisProject / baseDirectory).value / ".." / ".." / "tools" / "cloudflow-runner-config" / "src" / "main" / "scala", |
There was a problem hiding this comment.
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 ;-)
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strange import?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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(""), |
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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"? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same, default is None
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why still getOrElse?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is outdated
9ee6edb
to
296f5a9
Compare
should be ready to go now @RayRoestenburg |
This is the second library shared across
tools
andcore
if we start to have more we should merge back the two sbt projects.TODO: