Skip to content

Conversation

@bowenliang123
Copy link
Contributor

@bowenliang123 bowenliang123 commented Feb 8, 2023

Why are the changes needed?

Motivation:

Changes in this PR:

  • introducing mvnd by adding build/mvnd script
  • use mvnd version 0.9.0 which embeds maven 3.8.7. The maven version embedded in mvnd is also check and guaranteed the same as maven version required in pom by build/mvnd script.
  • use mvnd in CI jobs of Depedency Check and Style Check

Comparision

  • CI jobs
    (both with maven dependencies cached in local repo)
Job with build/mvn with build/mvnd
Dependency Check 9min1sec;see log 6min 46 sec ; see log
Style Check 10min32sec ; see log 7min50s ; see log
Licence Check 32s ; see log 21s ; see log
  • building entire maven project on local machine (skipping test running and style checking with fast profile)

build/mvnd clean install -Pfast
Pasted Graphic

build/mvn clean install -Pfast
Pasted Graphic 1

How was this patch tested?

  • Add some test cases that check the changes thoroughly including negative and positive cases if possible

  • Add screenshots for manual tests if appropriate

  • Run test locally before make a pull request

@github-actions github-actions bot added kind:infra license, community building, project builds, asf infra related, etc. kind:build labels Feb 8, 2023
@bowenliang123 bowenliang123 changed the title [DRAFT-DO-NOT-MERGE] introduce and use mvnd in CI [DRAFT-DO-NOT-MERGE] Introduce and Use mvnd in Dependency Check CI job Feb 8, 2023
@bowenliang123 bowenliang123 changed the title [DRAFT-DO-NOT-MERGE] Introduce and Use mvnd in Dependency Check CI job [DRAFT-DO-NOT-MERGE] Introduce and Use mvnd in Dependency and Style Checking CI job Feb 8, 2023
@bowenliang123 bowenliang123 changed the title [DRAFT-DO-NOT-MERGE] Introduce and Use mvnd in Dependency and Style Checking CI job [INFRA] Introduce and Use mvnd in Dependency and Style Checking CI job Feb 8, 2023
@bowenliang123 bowenliang123 marked this pull request as ready for review February 8, 2023 16:18
@codecov-commenter
Copy link

codecov-commenter commented Feb 9, 2023

Codecov Report

Merging #4274 (97becc0) into master (3f5121a) will decrease coverage by 0.06%.
The diff coverage is n/a.

❗ Current head 97becc0 differs from pull request most recent head bc8da13. Consider uploading reports for the commit bc8da13 to get more accurate results

@@             Coverage Diff              @@
##             master    #4274      +/-   ##
============================================
- Coverage     53.42%   53.36%   -0.06%     
  Complexity       13       13              
============================================
  Files           560      560              
  Lines         30571    30571              
  Branches       4140     4140              
============================================
- Hits          16333    16315      -18     
- Misses        12705    12721      +16     
- Partials       1533     1535       +2     
Impacted Files Coverage Δ
.../kyuubi/server/mysql/constant/MySQLErrorCode.scala 13.84% <0.00%> (-6.16%) ⬇️
...ache/kyuubi/server/mysql/MySQLCommandHandler.scala 77.77% <0.00%> (-4.05%) ⬇️
.../apache/kyuubi/server/api/v1/BatchesResource.scala 70.09% <0.00%> (-2.81%) ⬇️
...in/spark/authz/ranger/SparkRangerAdminPlugin.scala 64.47% <0.00%> (-2.64%) ⬇️
...ache/kyuubi/server/mysql/MySQLGenericPackets.scala 76.59% <0.00%> (-2.13%) ⬇️
...rg/apache/kyuubi/ctl/cmd/log/LogBatchCommand.scala 59.09% <0.00%> (-1.52%) ⬇️
...n/scala/org/apache/kyuubi/engine/ProcBuilder.scala 78.39% <0.00%> (-0.62%) ⬇️
...g/apache/kyuubi/operation/BatchJobSubmission.scala 75.27% <0.00%> (ø)
...apache/kyuubi/engine/JpsApplicationOperation.scala 80.64% <0.00%> (+3.22%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@bowenliang123 bowenliang123 changed the title [INFRA] Introduce and Use mvnd in Dependency and Style Checking CI job [INFRA] Introduce and use mvnd in Dependency and Style Check CI job Feb 9, 2023
# Preserve the calling directory
_CALLING_DIR="$(pwd)"
# Options used during compilation
_COMPILE_JVM_OPTS="-Xms2g -Xmx2g -XX:ReservedCodeCacheSize=1g -Xss128m"
Copy link
Contributor

Choose a reason for hiding this comment

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

Github Action limit memory: 6947m, we may increase the max heap size?

Copy link
Contributor Author

@bowenliang123 bowenliang123 Feb 9, 2023

Choose a reason for hiding this comment

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

build/mvnd is designed for the usage of both on local machine and also the GitHub action, so I would prefer to keep -Xmx here the same as in build/mvn. And we could increase the memory limit in CI jobs by passing opts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

# when pom changes
- '**/pom.xml'
# when dependency workflow changes
- .github/workflows/dep.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

unnecessary changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To verify using mvnd in dependency workflows. Changes in dep.yaml should trigger the jobs defined from the file itself.

@pan3793
Copy link
Member

pan3793 commented Feb 9, 2023

I suppose this target to 1.8?

@bowenliang123
Copy link
Contributor Author

bowenliang123 commented Feb 9, 2023

I suppose this target to 1.8?

I think mvnd works fine with Java 8 or up. And I have tried to apply mvnd to Integration Test for Trino and JDBC with Java 8 and 11, it works fine. As for compiler target option, it uses the same options in pom.
There's also an mvnd specific option -Djava.home= to set Java home for starting the daemon.

$ mvnd -h
...
mvnd specific options:
...
 -Djava.home=<path>                     Java home for starting the daemon
                                        Env. variable: JAVA_HOME
...

@pan3793
Copy link
Member

pan3793 commented Feb 9, 2023

Sorry for confusing, I mean target to Kyuubi 1.8.0

@bowenliang123
Copy link
Contributor Author

bowenliang123 commented Feb 9, 2023

Sorry for confusing, I mean target to Kyuubi 1.8.0

OK, let's wait for the 1.8.0-SNAPSHOT on master branch.
This PR brings no changes in the source code and it is not part of the distribution.

@bowenliang123 bowenliang123 self-assigned this Feb 9, 2023
@pan3793 pan3793 added this to the v1.8.0 milestone Feb 9, 2023
@bowenliang123 bowenliang123 changed the title [INFRA] Introduce and use mvnd in Dependency and Style Check CI job [INFRA] Introduce mvnd to speed up CI jobs of Dependency, Licence and Style Check Feb 9, 2023
@pan3793
Copy link
Member

pan3793 commented Feb 10, 2023

Thanks, merged to master for 1.8

@pan3793 pan3793 closed this in d862272 Feb 10, 2023
@bowenliang123 bowenliang123 deleted the ci-mvnd branch February 10, 2023 16:25
bowenliang123 added a commit that referenced this pull request Mar 2, 2023
…mvnd in CI jobs

### _Why are the changes needed?_

- concurrent execution and smart builder is shipped with `mvnd`, but the CI log shows they are not activated
- increase maximum degree of concurrency and utilize `SmartBuilder` feature in `mvnd`. `-Dmvnd.minThreads` is set as fallback and it will be ignored if `--threads` or `-Dmvnd.threads` is used.

#### Before:
(https://github.com/apache/kyuubi/actions/runs/4276652363/jobs/7444896450#step:6:64)
```
[INFO] Build maximum degree of concurrency is 1
```

#### After:
(https://github.com/apache/kyuubi/actions/runs/4279322563/jobs/7449912132#step:8:64)
```
[INFO] Using the SmartBuilder implementation with a thread count of 4
[INFO] Build maximum degree of concurrency is 4
```
(https://github.com/apache/kyuubi/actions/runs/4279322563/jobs/7449912132#step:8:553)
```
[INFO] Segment walltime 13 s, segment projects service time 36 s, effective/maximum degree of concurrency 2.63/4
```

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #4420 from bowenliang123/mvnd-smart.

Closes #4274

64f0cc5 [liangbowen] update
391da26 [liangbowen] quite in dep and style jobs
c776356 [liangbowen] use -Dmvnd.minThreads
d10bfb7 [liangbowen] use -Dmvnd.minThreads
f793d2b [liangbowen] warn
bbb929f [liangbowen] quiet
a5e6d49 [liangbowen] logging warn level
3cfbaad [liangbowen] enable quite option and cancel redirect stderr
09442ff [liangbowen] update
ca5f855 [liangbowen] try to redirect stderr
0ebdd18 [liangbowen] set completion and print MAVEN_CLI_OPTS
d3b2c96 [liangbowen] revert explicitly setting `mvnd.noBuffering`
e2eca01 [liangbowen] revert explicitly setting `mvnd.noBuffering`
dba25e3 [liangbowen] explicitly set `mvnd.noBuffering` to false prevent displaying events continuously
b7583f9 [liangbowen] shell
d60ebd0 [liangbowen] change mvnd cache key
2cc576e [liangbowen] dep
bbd6414 [liangbowen] move multithread setting to mvnd's MAVEN_CLI_OPTS
347b58c [liangbowen] increase concurrency for spotless check
15c5519 [liangbowen] increase concurrency

Authored-by: liangbowen <liangbowen@gf.com.cn>
Signed-off-by: liangbowen <liangbowen@gf.com.cn>
pan3793 added a commit that referenced this pull request Apr 12, 2023
pan3793 added a commit that referenced this pull request Apr 12, 2023
…f Dependency, Licence and Style Check"

This reverts commit d862272.
@aaime
Copy link

aaime commented Nov 30, 2025

Hi, I'm considering using mvnd in github actions too. I see mvnd usage was eventually reverted in this commit, and I'm wondering what was the reason? I would like to find out about drawbacks of mvnd adoption in github actions before I have to learn the hard way 🤣

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:build kind:infra license, community building, project builds, asf infra related, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants