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

Rename engineConfig to deploymentConfig #1926

Merged
merged 3 commits into from
Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ jobs:
CYPRESS_BASE_URL: http://localhost:8083
shell: bash
run: |
docker run -d -p 8083:8080 -e CONFIG_FORCE_scenarioTypes_streaming_engineConfig_type=stub -e NUSSKNACKER_CONFIG_FILE=/opt/nussknacker/conf/dev-application.conf --name nussknacker_e2e_fe touk/nussknacker:$NUSSKNACKER_VERSION
docker run -d -p 8083:8080 -e CONFIG_FORCE_scenarioTypes_streaming_deploymentConfig_type=stub -e NUSSKNACKER_CONFIG_FILE=/opt/nussknacker/conf/dev-application.conf --name nussknacker_e2e_fe touk/nussknacker:$NUSSKNACKER_VERSION
cd ui/client
npx wait-on $CYPRESS_BASE_URL && npm run test:e2e
docker kill nussknacker_e2e_fe
Expand Down
5 changes: 4 additions & 1 deletion docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ Nussknacker versions
* [#1357](https://github.com/TouK/nussknacker/pull/1357) Add run mode to nodes to be able to determine if we are inside e.g. test process run.
Run mode is can be declared as a dependency in generic node transformations. Nodes created via `@MethodToInvoke` can declare `RunMode` as an implicit parameter.
`RunMode` is also available in `FlinkCustomNodeContext`.
* [#1911](https://github.com/TouK/nussknacker/pull/1911) Rename `process` to `scenario`, `subprocess` to `fragment` in messages at backend and some test cases names
* Various naming changes:
* [#1917](https://github.com/TouK/nussknacker/pull/1917) configuration of `engineConfig` to `deploymentConfig`
* [#1911](https://github.com/TouK/nussknacker/pull/1911) Rename `process` to `scenario`, `subprocess` to `fragment` in messages at backend and some test cases names


0.3.1 (not released yet)
------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ attachmentsPath: "/tmp/touk/esp-frontend/attachments"

scenarioTypes {
streaming {
engineConfig {
deploymentConfig {
type: "flinkStreaming"
restUrl: "http://localhost:8081"
parallelism: 4
Expand Down
6 changes: 4 additions & 2 deletions docs/MigrationGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ that will be hidden before parameter's evaluation
- Removed: `getClusterClient` from `FlinkMiniClusterHolder` interface, because of flink compatibility at Flink 1.9
- Renamed: `FlinkStreamingProcessRegistrar` to `FlinkProcessManager`
* [#1303](https://github.com/TouK/nussknacker/pull/1303) TypedObjectTypingResult has a new field: additionalInfo
* Various naming changes:
* [#1917](https://github.com/TouK/nussknacker/pull/1917) configuration of `engineConfig` to `deploymentConfig`

## In version 0.2.0

Expand Down Expand Up @@ -336,7 +338,7 @@ Be aware that we are using avro 1.9.2 instead of default Flink's 1.8.2 (for java
```
processTypes {
"type e.g. streaming" {
engineConfig {
deploymentConfig {
type: "flinkStreaming"
PUT HERE PROPERTIES OF flinkConfig FROM OLD CONFIG
}
Expand Down Expand Up @@ -378,7 +380,7 @@ Be aware that we are using avro 1.9.2 instead of default Flink's 1.8.2 (for java
* [#588](https://github.com/TouK/nussknacker/pull/588) [#882](https://github.com/TouK/nussknacker/pull/882) `FlinkSource` API changed, current implementation is now `BasicFlinkSource`
* [#839](https://github.com/TouK/nussknacker/pull/839) [#882](https://github.com/TouK/nussknacker/pull/882) `FlinkSink` API changed, current implementation is now `BasicFlinkSink`
* [#841](https://github.com/TouK/nussknacker/pull/841) `ProcessConfigCreator` API changed; note that currently all process objects are invoked with `ProcessObjectDependencies` as a parameter. The APIs of `KafkaSinkFactory`, `KafkaSourceFactory`, and all their implementations were changed. `Config` is available as property of `ProcessObjectDependencies` instance.
* [#863](https://github.com/TouK/nussknacker/pull/863) `restUrl` in `engineConfig` need to be preceded with protocol. Host with port only is not allowed anymore.
* [#863](https://github.com/TouK/nussknacker/pull/863) `restUrl` in `deploymentConfig` need to be preceded with protocol. Host with port only is not allowed anymore.
* Rename `grafanaSettings` to `metricsSettings` in configuration.

## In version 0.0.12
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ additionalPropertiesConfig {
]
}
numberOfThreads: {
label: "Number of theards"
label: "Number of threads"
editor: {
type: "FixedValuesParameterEditor",
possibleValues: [
Expand Down
2 changes: 1 addition & 1 deletion engine/flink/management/src/it/resources/application.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

engineConfig {
deploymentConfig {
type: "test"
restUrl: "http://localhost:8081"
queryableStateProxyUrl: "localhost:9069"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ trait DockerTest extends DockerTestKit with ExtremelyPatientScalaFutures with La
}

def config: Config = ConfigFactory.load()
.withValue("engineConfig.restUrl", fromAnyRef(s"http://${jobManagerContainer.getIpAddresses().futureValue.head}:$FlinkJobManagerRestPort"))
.withValue("deploymentConfig.restUrl", fromAnyRef(s"http://${jobManagerContainer.getIpAddresses().futureValue.head}:$FlinkJobManagerRestPort"))
.withValue("modelConfig.classPath", ConfigValueFactory.fromIterable(Collections.singletonList(classPath)))
.withFallback(additionalConfig)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ object FlinkStreamingProcessManagerProvider {

def defaultProcessManager(config: Config): ProcessManager = {
val typeConfig = ProcessingTypeConfig.read(config)
new FlinkStreamingProcessManagerProvider().createProcessManager(typeConfig.toModelData, typeConfig.engineConfig)
new FlinkStreamingProcessManagerProvider().createProcessManager(typeConfig.toModelData, typeConfig.deploymentConfig)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ object ProcessingTypeConfig {

def read(config: Config): ProcessingTypeConfig =
ProcessingTypeConfig(
config.getString("engineConfig.type"),
config.getString("deploymentConfig.type"),
config.as[List[URL]]("modelConfig.classPath"),
config.getConfig("engineConfig"),
config.getConfig("deploymentConfig"),
config.getConfig("modelConfig")
)
}

case class ProcessingTypeConfig(engineType: String,
classPath: List[URL],
engineConfig: Config,
deploymentConfig: Config,
modelConfig: Config) {

def toModelData: ModelData = ModelData(modelConfig, ModelClassLoader(classPath))
Expand All @@ -75,7 +75,7 @@ object ProcessingTypeData {

def createProcessingTypeData(processManagerProvider: ProcessManagerProvider, processTypeConfig: ProcessingTypeConfig): ProcessingTypeData = {
val modelData = processTypeConfig.toModelData
val managerConfig = processTypeConfig.engineConfig
val managerConfig = processTypeConfig.deploymentConfig
createProcessingTypeData(processManagerProvider, modelData, managerConfig)
}
}
4 changes: 2 additions & 2 deletions nussknacker-dist/src/universal/conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ categoriesConfig: {

scenarioTypes {
"streaming": {
engineConfig: ${flinkEngineConfig}
deploymentConfig: ${flinkDeploymentConfig}
modelConfig: {
classPath: ["model/genericModel.jar"]
classPath: ${?MODEL_CLASS_PATH}
Expand All @@ -22,7 +22,7 @@ scenarioTypes {
}
}

flinkEngineConfig {
flinkDeploymentConfig {
jobManagerTimeout: 1m
type: "flinkStreaming"
restUrl: "http://jobmanager:8081"
Expand Down
8 changes: 4 additions & 4 deletions nussknacker-dist/src/universal/conf/dev-application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ standaloneModelDir: ${?STANDALONE_MODEL_DIR}
standaloneManagmentUrl: "http://localhost:8070"
standaloneManagmentUrl: ${?STANDALONE_MANAGMENT_URL}

flinkEngineConfig {
flinkDeploymentConfig {
type: "flinkStreaming"
restUrl: "http://jobmanager:8081"
restUrl: ${?FLINK_REST_URL}
Expand All @@ -32,7 +32,7 @@ flinkEngineConfig {

scenarioTypes {
"streaming": {
engineConfig: ${flinkEngineConfig}
deploymentConfig: ${flinkDeploymentConfig}
modelConfig: {
classPath: [ ${managementModelDir}"/managementSample.jar" ]
rocksDB: {
Expand All @@ -41,7 +41,7 @@ scenarioTypes {
}
}
"streaming-generic": {
engineConfig: ${flinkEngineConfig}
deploymentConfig: ${flinkDeploymentConfig}
modelConfig: {
classPath: [ ${genericModelDir}"/genericModel.jar" ]
rocksDB: {
Expand All @@ -50,7 +50,7 @@ scenarioTypes {
}
}
"request-response": {
engineConfig {
deploymentConfig {
type: "requestResponseStandalone"
managementUrl: ${standaloneManagmentUrl}
}
Expand Down
5 changes: 3 additions & 2 deletions ui/client/components/graph/node-modal/NodeDetailsContent.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import classNames from "classnames"
import _ from "lodash"
import _, {sortBy} from "lodash"
import React from "react"
import {connect} from "react-redux"
import {v4 as uuid4} from "uuid"
Expand Down Expand Up @@ -435,7 +435,8 @@ export class NodeDetailsContent extends React.Component {
null,
"query-path",
)]
const additionalFields = Object.entries(this.props.additionalPropertiesConfig).map(
//we sort by name, to have predictable order of properties (should be replaced by defining order in configuration)
const additionalFields = sortBy(Object.entries(this.props.additionalPropertiesConfig), e => e[0]).map(
([propName, propConfig]) => (
<AdditionalProperty
key={propName}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions ui/client/cypress/integration/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ describe("Process", () => {
cy.contains(/^properties/i).should("be.enabled").click()
cy.get("[data-testid=node-modal]").should("be.visible").find("input").within(inputs => {
cy.wrap(inputs).first().click().type("-renamed")
//this is idx of "Max events", which should be int
cy.wrap(inputs).eq(6).click().type("wrong data")
})
cy.contains(/^apply/i).should("be.enabled").click()
Expand Down
2 changes: 1 addition & 1 deletion ui/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"start:backend-docker": "npm run clean-translations && start-server-and-test start-backend:docker http-get://localhost:8080/static/main.html start",
"start:backend-staging": "npm run clean-translations && BACKEND_DOMAIN=https://staging.nussknacker.io webpack serve",
"start:backend-demo": "npm run clean-translations && BACKEND_DOMAIN=https://demo.nussknacker.io webpack serve",
"start-backend:docker": "docker run -i -p 8080:8080 -e CONFIG_FORCE_scenarioTypes_streaming_engineConfig_type=stub -e NUSSKNACKER_CONFIG_FILE=/opt/nussknacker/conf/dev-application.conf --pull always -P touk/nussknacker:staging-latest",
"start-backend:docker": "docker run -i -p 8080:8080 -e CONFIG_FORCE_scenarioTypes_streaming_deploymentConfig_type=stub -e NUSSKNACKER_CONFIG_FILE=/opt/nussknacker/conf/dev-application.conf --pull always -P touk/nussknacker:staging-latest",
"pretest": "npm run check",
"test:unit": "jest",
"test:e2e": "cypress run",
Expand Down
2 changes: 1 addition & 1 deletion ui/server/src/test/resources/ui.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ customProcesses {

scenarioTypes {
"streaming" {
engineConfig {
deploymentConfig {
restUrl: "http://localhost:8081"
queryableStateProxyUrl: "localhost:9123"
jobManagerTimeout: 1m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class BaseFlowTest extends FunSuite with ScalatestRouteTest with FailFastCirceSu
Some("1"),
FixedValuesParameterEditor(fixedPossibleValues),
List(FixedValuesValidator(fixedPossibleValues)),
Some("Number of theards")
Some("Number of threads")
)
)

Expand All @@ -186,7 +186,7 @@ class BaseFlowTest extends FunSuite with ScalatestRouteTest with FailFastCirceSu
entity should include("Configured property environment (Environment) is missing")
entity should include("This field value has to be an integer number")
entity should include("Unknown property unknown")
entity should include("Property numberOfThreads (Number of theards) has invalid value")
entity should include("Property numberOfThreads (Number of threads) has invalid value")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ProcessingTypeDataConfigurationReaderSpec extends FunSuite {
"""
|processTypes {
| "streaming" {
| engineConfig {
| deploymentConfig {
| jobManagerTimeout: 1m
| restUrl: "http://localhost:8081"
| queryableStateProxyUrlMissing: "localhost:9123"
Expand Down Expand Up @@ -53,7 +53,7 @@ class ProcessingTypeDataConfigurationReaderSpec extends FunSuite {
"""
|scenarioTypes {
| "streaming" {
| engineConfig {
| deploymentConfig {
| restUrl: "http://localhost:8081"
| typeMissing: "flinkStreaming"
| }
Expand All @@ -70,7 +70,7 @@ class ProcessingTypeDataConfigurationReaderSpec extends FunSuite {

intercept[typesafe.config.ConfigException] {
ProcessingTypeDataConfigurationReader.readProcessingTypeConfig(config)
}.getMessage should include("No configuration setting found for key 'engineConfig.type'")
}.getMessage should include("No configuration setting found for key 'deploymentConfig.type'")
}

test("should throw when no configuration is provided") {
Expand Down