-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[FLINK-35736][tests] Add migration test scripts & CI workflows #3447
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
14d8da8
[FLINK-35736][tests] Add migration test scripts & CI workflows
yuxiqian 65b4be9
Address comments
yuxiqian de110d4
Add transform blocks into migration tests
yuxiqian b70c161
Add legends for migration test results
yuxiqian 59233f0
Address comments
yuxiqian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| *.sql | ||
| savepoints/** | ||
| cdc-versions/** | ||
| cache/** | ||
| .idea/** | ||
| Gemfile.lock | ||
| /logs/ | ||
| conf/temp.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Flink CDC Migration Test Utilities | ||
|
|
||
| ## Pipeline Jobs | ||
| ### Preparation | ||
|
|
||
| 1. Install Ruby (macOS has embedded it by default) | ||
| 2. (Optional) Run `gem install terminal-table` for better display | ||
|
|
||
| ### Compile snapshot CDC versions | ||
| 3. Set `CDC_SOURCE_HOME` to the root directory of the Flink CDC git repository | ||
| 4. Go to `tools/mig-test` and run `ruby prepare_libs.rb` to download released / compile snapshot CDC versions | ||
|
|
||
| ### Run migration tests | ||
| 5. Enter `conf/` and run `docker compose up -d` to start up test containers | ||
| 6. Set `FLINK_HOME` to the home directory of Flink | ||
| 7. Go back to `tools/mig-test` and run `ruby run_migration_test.rb` to start testing | ||
|
|
||
| ### Result | ||
| The migration result will be displayed in the console like this: | ||
|
|
||
| ``` | ||
| +--------------------------------------------------------------------+ | ||
| | Migration Test Result | | ||
| +--------------+-------+-------+-------+--------------+--------------+ | ||
| | | 3.0.0 | 3.0.1 | 3.1.0 | 3.1-SNAPSHOT | 3.2-SNAPSHOT | | ||
| | 3.0.0 | ❓ | ❓ | ❌ | ✅ | ✅ | | ||
| | 3.0.1 | | ❓ | ❌ | ✅ | ✅ | | ||
| | 3.1.0 | | | ✅ | ❌ | ❌ | | ||
| | 3.1-SNAPSHOT | | | | ✅ | ✅ | | ||
| | 3.2-SNAPSHOT | | | | | ✅ | | ||
| +--------------+-------+-------+-------+--------------+--------------+ | ||
| ``` | ||
|
|
||
| > ✅ - Compatible, ❌ - Not compatible, ❓ - Target version doesn't support `--from-savepoint` | ||
|
|
||
| ## DataStream Jobs | ||
|
|
||
| See `datastream/README.md`. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| # contributor license agreements. See the NOTICE file distributed with | ||
| # this work for additional information regarding copyright ownership. | ||
| # The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| # (the "License"); you may not use this file except in compliance with | ||
| # the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| version: '3' | ||
| services: | ||
| mysql: | ||
| image: mysql:8.0 | ||
| environment: | ||
| MYSQL_ALLOW_EMPTY_PASSWORD: "true" | ||
| MYSQL_DATABASE: fallen | ||
| ports: | ||
| - 3306:3306 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| # contributor license agreements. See the NOTICE file distributed with | ||
| # this work for additional information regarding copyright ownership. | ||
| # The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| # (the "License"); you may not use this file except in compliance with | ||
| # the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| source: | ||
| type: mysql | ||
| name: MySQL Source | ||
| hostname: localhost | ||
| port: 3306 | ||
| username: root | ||
| password: "" | ||
| tables: fallen.\.* | ||
| server-id: 5400-5500 | ||
| server-time-zone: UTC | ||
|
|
||
| sink: | ||
| type: values | ||
| name: Values Sink | ||
|
|
||
| pipeline: | ||
| name: ${PIPELINE_NAME} | ||
| parallelism: 1 | ||
|
|
||
| transform: | ||
| - source-table: fallen.\.* | ||
| projection: \*, 'extras' AS EXTRAS | ||
|
|
||
| route: | ||
| - source-table: fallen.\.* | ||
| sink-table: fallen.terminus |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| # contributor license agreements. See the NOTICE file distributed with | ||
| # this work for additional information regarding copyright ownership. | ||
| # The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| # (the "License"); you may not use this file except in compliance with | ||
| # the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| source: | ||
| type: mysql | ||
| name: MySQL Source | ||
| hostname: localhost | ||
| port: 3306 | ||
| username: root | ||
| password: "" | ||
| tables: fallen.\.* | ||
| server-id: 5400-5500 | ||
| server-time-zone: UTC | ||
|
|
||
| sink: | ||
| type: values | ||
| name: Values Sink | ||
|
|
||
| pipeline: | ||
| name: ${PIPELINE_NAME} | ||
| parallelism: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Flink CDC MigrationTestUtils | ||
|
|
||
| ## DataStream Jobs | ||
| ### Preparation | ||
|
|
||
| 1. Install Ruby (macOS has embedded it by default) | ||
| 2. (Optional) Run `gem install terminal-table` for better display | ||
|
|
||
| ### Compile DataStream Jobs | ||
| 3. Go to `tools/mig-test/datastream` and run `ruby compile_jobs.rb` to compile dummy DataStream jobs with specific version tags | ||
| 4. Then, run `ruby run_migration_test.rb` to start testing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| #!/usr/bin/env ruby | ||
| # frozen_string_literal: true | ||
|
|
||
| # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| # contributor license agreements. See the NOTICE file distributed with | ||
| # this work for additional information regarding copyright ownership. | ||
| # The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| # (the "License"); you may not use this file except in compliance with | ||
| # the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| JOB_VERSIONS = %w[2.4.2 3.0.0 3.0.1 3.1.0 3.1.1 3.2-SNAPSHOT] | ||
|
|
||
| JOB_VERSIONS.each do |version| | ||
| puts "Compiling DataStream job for CDC #{version}" | ||
| `cd datastream-#{version} && mvn clean package -DskipTests` | ||
| end | ||
|
|
||
| puts 'Done' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| target/ | ||
| !.mvn/wrapper/maven-wrapper.jar | ||
| !**/src/main/**/target/ | ||
| !**/src/test/**/target/ | ||
|
|
||
| ### IntelliJ IDEA ### | ||
| .idea/modules.xml | ||
| .idea/jarRepositories.xml | ||
| .idea/compiler.xml | ||
| .idea/libraries/ | ||
| *.iws | ||
| *.iml | ||
| *.ipr | ||
|
|
||
| ### Eclipse ### | ||
| .apt_generated | ||
| .classpath | ||
| .factorypath | ||
| .project | ||
| .settings | ||
| .springBeans | ||
| .sts4-cache | ||
|
|
||
| ### NetBeans ### | ||
| /nbproject/private/ | ||
| /nbbuild/ | ||
| /dist/ | ||
| /nbdist/ | ||
| /.nb-gradle/ | ||
| build/ | ||
| !**/src/main/**/build/ | ||
| !**/src/test/**/build/ | ||
|
|
||
| ### VS Code ### | ||
| .vscode/ | ||
|
|
||
| ### Mac OS ### | ||
| .DS_Store |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.