You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ambari.apache.org by "Olivér Szabó (JIRA)" <ji...@apache.org> on 2018/09/10 15:30:00 UTC

[jira] [Resolved] (AMBARI-24609) Ability to install common ambari python libraries to maven repository (local / remote)

     [ https://issues.apache.org/jira/browse/AMBARI-24609?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivér Szabó resolved AMBARI-24609.
-----------------------------------
    Resolution: Fixed

> Ability to install common ambari python libraries to maven repository (local / remote)
> --------------------------------------------------------------------------------------
>
>                 Key: AMBARI-24609
>                 URL: https://issues.apache.org/jira/browse/AMBARI-24609
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-agent, ambari-server
>    Affects Versions: 2.7.0
>            Reporter: Olivér Szabó
>            Assignee: Olivér Szabó
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 3.0.0
>
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> 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:
> {code:xml}
>  <dependency>
>  <groupId>org.apache.ambari</groupId>
>  <artifactId>ambari-python</artifactId>
>  <version>2.0.0.0-SNAPSHOT</version>
>  <scope>test</scop>
>  </dependency>
> {code}
>  Gradle example:
> {code:groovy}
>  testCompile "org.apache.ambari:ambari-python:2.0.0.0-SNAPSHOT@tar.gz"
> {code}
> 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
> {code:bash}
>  ./install-ambari-python.sh
> {code}
> Deploy to maven remote repo
> {code:bash}
>  ./install-ambari-python.sh --deploy -i <repoId> -r <repoUrl>
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)