Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Exclude external dependencies from MXNet JAR. #15361

Merged
merged 1 commit into from
Jul 1, 2019

Conversation

tklein23
Copy link

@tklein23 tklein23 commented Jun 25, 2019

Description

The current MXNet build process adds external dependencies to the JAR, which may conflict with local dependencies on the classpath. In my case commons-io was replaced by MXNet and caused some method-not-found errors.

Please find my proposed change in the PR. It's work in progress and I'm happy to iterate if we agree on the the general direction. I have seen a similar change on the 1.5.x branch, so I assume we can apply a similar change here.

No testing was done locally and I hope Travis will catch obvious problems.

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Comments

  • If this change is a backward incompatible change, why must this change be made.
  • Interesting edge cases to note here

@lanking520
Copy link
Member

Thanks for your contribution @tklein23 . Please try to refer this PR: c6b1fd5 to add these dependencies in the deploy section

@lanking520 lanking520 added Java Label to identify Java API component Scala labels Jun 26, 2019
@lanking520
Copy link
Member

To make it clear, all you need to do is to add your removed dependencies in scala-package/deploy/src/main/deploy/deploy.xml and that should solve the Clojure problem

@tklein23
Copy link
Author

@lanking520 - Thanks, I updated a few POM files similar to the PR you mentioned. Except, there's no scala-package/deploy in 1.4.x. New revision compiles and passes integration tests locally. However, release failed due to GPG issues.

@lanking520
Copy link
Member

lanking520 commented Jun 28, 2019

Don't worry much on the GPG end. Let's try to fix the Clojure part first.
https://github.com/apache/incubator-mxnet/blob/v1.4.x/scala-package/assembly/osx-x86_64-cpu/pom.xml#L33-L50
https://github.com/apache/incubator-mxnet/blob/v1.4.x/scala-package/assembly/linux-x86_64-cpu/pom.xml#L33-L50

In here try to add the dependencies from master. This is the configuration pom file for the final package publishing.

The core problem currently we have is that the descriptor file (pom file) that we generate did not inlcude the depedencies we exclude. By adding these dependencies in the pom, Clojure would try to fetch the packages and that should resolve the dependencies not found problem

@tklein23 tklein23 requested a review from gigasquid as a code owner June 28, 2019 22:33
@tklein23
Copy link
Author

Since I cannot reproduce the failing build locally, doing a bit of trial-and-error now: Adding the dependencies to clojure, since this is what's failing.

@tklein23
Copy link
Author

tklein23 commented Jul 1, 2019

Thanks all for your comments. CI is green now. Will squash the commits so that it can be pushed.

@lanking520 lanking520 changed the title [WIP] Exclude external dependencies from MXNet JAR. Exclude external dependencies from MXNet JAR. Jul 1, 2019
@tklein23
Copy link
Author

tklein23 commented Jul 1, 2019

CI is green. Two checks are stuck in the UI, but are completed successfully when checking the details.

@lanking520
Copy link
Member

Thanks for your contribution, get it shipped

@lanking520 lanking520 merged commit e368ea2 into apache:v1.4.x Jul 1, 2019
@gigasquid
Copy link
Member

This was merged in the 1.4 branch - is it also going to make its way to master?

@zachgk
Copy link
Contributor

zachgk commented Jul 8, 2019

The equivalent that was merged into master was issue #13929 and PR #14000

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Java Label to identify Java API component Scala
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants