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

[MXNET-710] Change POM files to be able to regularly publish to Apache Release & Maven Central Repo #11862

Merged
merged 4 commits into from
Jul 25, 2018

Conversation

nswamy
Copy link
Member

@nswamy nswamy commented Jul 23, 2018

Description

This brings the ability to publish Maven packages using Apache Maven Release plugin and is integrated with the existing Make file System. The steps to perform the Scala Release is documented here:
https://cwiki.apache.org/confluence/display/MXNET/MXNet-Scala+Release+Process.

This process was used to publish both 1.2.0 and 1.2.1 releases. This could be further automated by integrating to the CI system to publish SNAPSHOTS to the Apache SnapShot repo which can be picked up to perform the Release.

@lanking520 @andrewfayres

@nswamy nswamy requested review from szha and yzhliu as code owners July 23, 2018 22:03
@nswamy nswamy changed the title Change POM files to be able to regularly publish to Apache Release & Maven Central Repo [MXNET-710] Change POM files to be able to regularly publish to Apache Release & Maven Central Repo Jul 24, 2018
Copy link
Member

@lanking520 lanking520 left a comment

Choose a reason for hiding this comment

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

You can also try to change the

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
       <configuration>
          <skip>true</skip>
        </configuration>
     </plugin>

to the parent pom file and them apply changes to each assembly files.

@@ -589,6 +589,7 @@ scalaclean:
scalapkg:
(cd $(ROOTDIR)/scala-package; \
mvn package -P$(SCALA_PKG_PROFILE),$(SCALA_VERSION_PROFILE) -Dcxx="$(CXX)" \
-Dbuild.platform="$(SCALA_PKG_PROFILE)" \
Copy link
Member

Choose a reason for hiding this comment

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

Can't we used this param in the profile directly?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I have tried this, I couldn't use read this from the profile in release/release-perform that is why I had to add an additional property.

-Darguments=""-Dbuild\.platform=\""$(SCALA_PKG_PROFILE)\""

-Dcflags="$(CFLAGS)" -Dldflags="$(LDFLAGS)" \
-Dlddeps="$(LIB_DEP) $(ROOTDIR)/lib/libmxnet.a")

scalarelease-dryrun:
Copy link
Member

Choose a reason for hiding this comment

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

Could you please also include explanations on these make target in the CWiki and possibly provide the links to explains the reason to run this and the following two make target below?

Copy link
Member Author

Choose a reason for hiding this comment

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

https://cwiki.apache.org/confluence/display/MXNET/MXNet-Scala+Release+Process#MXNet-ScalaReleaseProcess-MavenPublish

#if you don't set this it will fail with the error "gpg: signing failed: Inappropriate ioctl for device"
export GPG_TTY=$(tty)
#build scalapkg
make scalapkg
#make sure everything is working as expected
make scalarelease-dryrun
# Releases to Apache Snapshot
make scaladeploy. This will upload to the snapshot repo
# Verify that the package has been uploaded in https://repository.apache.org/content/repositories/snapshots/
# Preparing the release will create the new tag, automatically checking in on your behalf.(We have disabled CheckIn)
make scalarelease-prepare
# this will upload to the staging repository and make it for testing
make scalarelease-perform

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<!--<version>1.1.0-SNAPSHOT</version>-->
Copy link
Member

Choose a reason for hiding this comment

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

Remove this comments?

Copy link
Member Author

Choose a reason for hiding this comment

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

I left it there because I am not using a version and to point out and remember that it is 1.1.0-SNAPSHOT(there is no released version)

# below routine shamelessly copied from
# https://github.com/apache/incubator-mxnet/blob/master/setup-utils/install-mxnet-osx-python.sh

chkret() {
Copy link
Member

Choose a reason for hiding this comment

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

What is chkret?

Copy link
Member Author

Choose a reason for hiding this comment

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

chkret executes a command and checks return code.

elif [[ $PLATFORM == "linux-x86_64-gpu" ]]
then
echo "Building MXNet Backend on Linux GPU"
echo "Building MXNet Backend on Linux CPU"
Copy link
Member

Choose a reason for hiding this comment

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

remove this line?

Copy link
Member Author

@nswamy nswamy 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 comments, I have responded and see if that addresses your concern.

-Dcflags="$(CFLAGS)" -Dldflags="$(LDFLAGS)" \
-Dlddeps="$(LIB_DEP) $(ROOTDIR)/lib/libmxnet.a")

scalarelease-dryrun:
Copy link
Member Author

Choose a reason for hiding this comment

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

https://cwiki.apache.org/confluence/display/MXNET/MXNet-Scala+Release+Process#MXNet-ScalaReleaseProcess-MavenPublish

#if you don't set this it will fail with the error "gpg: signing failed: Inappropriate ioctl for device"
export GPG_TTY=$(tty)
#build scalapkg
make scalapkg
#make sure everything is working as expected
make scalarelease-dryrun
# Releases to Apache Snapshot
make scaladeploy. This will upload to the snapshot repo
# Verify that the package has been uploaded in https://repository.apache.org/content/repositories/snapshots/
# Preparing the release will create the new tag, automatically checking in on your behalf.(We have disabled CheckIn)
make scalarelease-prepare
# this will upload to the staging repository and make it for testing
make scalarelease-perform

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<!--<version>1.1.0-SNAPSHOT</version>-->
Copy link
Member Author

Choose a reason for hiding this comment

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

I left it there because I am not using a version and to point out and remember that it is 1.1.0-SNAPSHOT(there is no released version)

# below routine shamelessly copied from
# https://github.com/apache/incubator-mxnet/blob/master/setup-utils/install-mxnet-osx-python.sh

chkret() {
Copy link
Member Author

Choose a reason for hiding this comment

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

chkret executes a command and checks return code.

@@ -589,6 +589,7 @@ scalaclean:
scalapkg:
(cd $(ROOTDIR)/scala-package; \
mvn package -P$(SCALA_PKG_PROFILE),$(SCALA_VERSION_PROFILE) -Dcxx="$(CXX)" \
-Dbuild.platform="$(SCALA_PKG_PROFILE)" \
Copy link
Member Author

Choose a reason for hiding this comment

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

I think I have tried this, I couldn't use read this from the profile in release/release-perform that is why I had to add an additional property.

-Darguments=""-Dbuild\.platform=\""$(SCALA_PKG_PROFILE)\""

@nswamy
Copy link
Member Author

nswamy commented Jul 24, 2018

@lanking520 regarding

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
       <configuration>
          <skip>true</skip>
        </configuration>
     </plugin>

I am not sure if I got your suggestion right, but that is exactly how it is done right now.

@lanking520
Copy link
Member

@nswamy The normal practice is to add the configuration file in the parent pom and all child modules will extend that. So if you add the maven-deploy-plugin in the parent pom, you will see it applies to every where in all of the modules. In that case, you only need to specify the <skip>false</skip> to the place you want to be instead of adding <skip>true</skip> in every pom file

@nswamy
Copy link
Member Author

nswamy commented Jul 24, 2018

@lanking520 its already there
https://github.com/nswamy/incubator-mxnet/blob/35e064a707e4f694d3506628ac66196743cea7f6/scala-package/pom.xml#L164 in the parent and so does in the assembly pom files.
I understood what you are saying, agree it might not need to touch all files. It would be time consuming to test all of this(to make sure that the package release works fine). I prefer to keep it this way and probably change it during the next release cycle?

@lanking520
Copy link
Member

Agreed. We can create another PR specifically on cleaning the pom files and build cycle.

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19</version>
Copy link
Member

Choose a reason for hiding this comment

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

Why do we degrade the version here?

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch. will fix it

@nswamy nswamy merged commit 424fafe into apache:master Jul 25, 2018
XinYao1994 pushed a commit to XinYao1994/incubator-mxnet that referenced this pull request Aug 29, 2018
…e Release & Maven Central Repo (apache#11862)

* pom file changes for maven builds
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants