kubeflow / mpi-operator

Kubernetes Operator for MPI-based applications (distributed training, HPC, etc.)
https://www.kubeflow.org/docs/components/training/mpi/
Apache License 2.0
419 stars 210 forks source link

add custom setup.py to install mpijob module #579

Closed vsoch closed 12 months ago

vsoch commented 12 months ago

Problem: we cannot currently install the python mpijob module Solution: add a setup.py proper that is ignored by the generator

Notes:

Future improvements:

This will close #578

google-oss-prow[bot] commented 12 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: terrytangyuan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubeflow/mpi-operator/blob/master/OWNERS)~~ [terrytangyuan] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
cliu-nuro commented 11 months ago

Hi @vsoch , what's the timeline like to release this package to pypi?

vsoch commented 11 months ago

hey @cliu-nuro - there is no timeline, it's more that we could do it when it's requested. It isn't super hard, a maintainer/owner would need to create the first (dummy) deployment locally, usually you just do:

python setup.py sdist
twine upload dist/<path-to-tar-gz>

or create the package manually in the UI. Then get a pypi token / username for the package, explicitly, and then you just need a workflow like this:

name: release mpijob

on:
  release:
    types: [created]

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3

    - name: Install
      run: conda create --quiet --name mpijob twine

    - name: Install dependencies
      run: |
        export PATH="/usr/share/miniconda/bin:$PATH"
        source activate mpijob
        cd /path/to/where/mpijob/setup.py/is
        pip install -e .[all]
        pip install setuptools wheel twine
    - name: Build and publish
      env:
        TWINE_USERNAME: ${{ secrets.PYPI_USER }}
        TWINE_PASSWORD: ${{ secrets.PYPI_PASS }}
      run: |
        export PATH="/usr/share/miniconda/bin:$PATH"
        source activate mpijob
        python setup.py sdist bdist_wheel
        twine upload dist/*

And that should upload on releases. I'm not a maintainer here so I can't do most of that, but happy to provide guidance!

alculquicondor commented 11 months ago

@terrytangyuan what was the process to release to pypi?

terrytangyuan commented 11 months ago

I don't think we have a process yet. It's not published to PyPI.

terrytangyuan commented 11 months ago

We can instruct users to install directly from GitHub.