Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-24609

Ability to install common ambari python libraries to maven repository (local / remote)

    XMLWordPrintableJSON

    Details

      Description

      New cli script to create a maven tar.gz artifact:

      • `--clean` option to just delete dist directories
      • by default it uses `mvn install` on the generated tar.gz, that install the artifact into local maven repository
      • `--deploy` option to use `mvn deploy` for uploading generated tar.gz artifact to remote maven repository
      • `--version` option to provide the artifact and generated python dist version
      • update setup.py script to read the version from pom.xml during dist building, otherwise it uses PKG-INFO to get the right version, therefore if you are overriding the version during the build, it will always use the right version with pip or setup.py

      How it works:
      with setup.py an installable distribution created, with pip the packages are installed locally, then the install-ambari-python script creates a tar.gz from the installd packages and upload it to a maven repo (tar.gz content is the site-packages, the python version before that is not included)

      after the artifacts are installed to maven repos, these could be provided in external projects (to use to extend PYTHONPATH variable, in order to run tests against any stack code, like in MPacks);
      Maven example:

       <dependency>
       <groupId>org.apache.ambari</groupId>
       <artifactId>ambari-python</artifactId>
       <version>2.0.0.0-SNAPSHOT</version>
       <scope>test</scop>
       </dependency>
      

      Gradle example:

       testCompile "org.apache.ambari:ambari-python:2.0.0.0-SNAPSHOT@tar.gz"
      

      So in an external project, the ambari python files can be extracted during build time, and add them to the PYTHONPATH

      Usage examples:
      Install to maven local repo

       ./install-ambari-python.sh
      

      Deploy to maven remote repo

       ./install-ambari-python.sh --deploy -i <repoId> -r <repoUrl>
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                oleewere Oliver Szabo
                Reporter:
                oleewere Oliver Szabo
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m