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

[FLINK-32834] Ease local use of tools/ci/compile.sh #23195

Merged
merged 15 commits into from
Aug 17, 2023
Merged

Conversation

zentol
Copy link
Contributor

@zentol zentol commented Aug 11, 2023

This PR allows devs to run this script locally, just like that. Lower-level scripts are also easier to use.

The commits are quite granular and all have a commit message explaining the change.

- make it easier to work with relative paths
  - specifically, useful to have the scripts rely on mvnv by default (follow-up)
- support repeated usages of the scripts
- prevent files from being picked up by git/rat
- don't use <root>/target because mvn clean would interfere
- tmp dirs under tools/ci would be neat, but we lack a central place to create it
The current quoting scheme wasn't compatible if run_mvn points directly to maven.
This both blocks a follow-up where we skip maven-utils entirely in local runs, and makes it easier to copy&paste commands to/from the command-line.
It was also not really intuitive. At all.

This comes with a slight maintenance cost to maven-utils.sh#run_mvn, but given that we'll likely throw this out in 1.19 anyway (because there are better ways to implement this on later maven versions), we can bear that cost.
Ease direct manual usage by reducing the number of parameters.
- ease usage by reducing number of parameters
- avoid CI-exclusive maven-utils
- use mvnw by default
Copied from the Flink connector release scripts
- run directly against maven by default
- avoid CI-exclusive maven-utils
For example: 'tools/ci/compile.sh -Dfast'
@zentol zentol requested a review from XComp August 11, 2023 12:07
@flinkbot
Copy link
Collaborator

flinkbot commented Aug 11, 2023

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

Copy link
Contributor

@XComp XComp left a comment

Choose a reason for hiding this comment

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

Thanks for the change. That make running the CI checks way easier. I have a few minor comments. Additionally, I would like to have a separate section (maybe ## Continuous Integration?) next to ## Building Apache Flink from Source in Flink's README.md. WDYT?

tools/ci/maven-utils.sh Show resolved Hide resolved
tools/ci/compile.sh Show resolved Hide resolved
tools/ci/compile.sh Show resolved Hide resolved
tools/ci/compile.sh Show resolved Hide resolved
tools/ci/compile.sh Show resolved Hide resolved
tools/ci/compile_ci.sh Show resolved Hide resolved
@zentol
Copy link
Contributor Author

zentol commented Aug 15, 2023

Additionally, I would like to have a separate section (maybe ## Continuous Integration?) next to ## Building Apache Flink from Source in Flink's README.md. WDYT?

I think that we need to come up with a clear place for developer documentation. I didn't think of the README.md at all personally, and was wondering whether it should be added to the flinkDev/building.md docs, but they are also woefully unclear as to what their audience is (users vs dev), and so decided against it.
Realistically you ain't gonna look at "build from source docs" when trying to replicate CI.

Copy link
Contributor

@XComp XComp left a comment

Choose a reason for hiding this comment

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

Ok, it took me a while to figure that one out. But there we go: The dependency tree parsing relies on the proper order of lines in the Maven output. I had -T1C set by default which screwed up the script execution.

tools/ci/license_check.sh Outdated Show resolved Hide resolved
tools/ci/license_check.sh Show resolved Hide resolved
tools/ci/verify_bundled_optional.sh Outdated Show resolved Hide resolved
tools/ci/verify_bundled_optional.sh Outdated Show resolved Hide resolved
tools/ci/verify_scala_suffixes.sh Outdated Show resolved Hide resolved
tools/ci/verify_scala_suffixes.sh Outdated Show resolved Hide resolved
tools/ci/verify_bundled_optional.sh Outdated Show resolved Hide resolved
tools/ci/verify_scala_suffixes.sh Outdated Show resolved Hide resolved
@zentol zentol requested a review from XComp August 17, 2023 10:09
Copy link
Contributor

@XComp XComp left a comment

Choose a reason for hiding this comment

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

LGTM 👍 some minor comments. But generally, it's good to go.

tools/ci/compile.sh Show resolved Hide resolved
tools/ci/compile.sh Show resolved Hide resolved
tools/ci/verify_scala_suffixes.sh Show resolved Hide resolved
tools/ci/verify_bundled_optional.sh Show resolved Hide resolved
tools/ci/compile.sh Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants