Skip to content

Commit

Permalink
clean up build to not require source flux (#2)
Browse files Browse the repository at this point in the history
This will discover flux in the install location,
and use include and lib from there. It assumes flux
security is under that same root. I think the *.h files
in src are not required and will likely remove them.

Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Co-authored-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch and vsoch committed May 3, 2023
1 parent 554682e commit febb740
Show file tree
Hide file tree
Showing 22 changed files with 169 additions and 8,123 deletions.
4 changes: 4 additions & 0 deletions .github/scripts/setup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash

set -euo pipefail

# This will be empty for nightly test, and we will clone master branch
FLUX_VERSION=${FLUX_VERSION:-0.48.0}
echo "Flux Version is ${FLUX_VERSION}"

here=$(pwd)
Expand Down Expand Up @@ -69,5 +72,6 @@ chmod +x etc/gen-cmdhelp.py
./configure --prefix=/usr/local
make
sudo make install
sudo make install
sudo ldconfig
cd ${here}
5 changes: 1 addition & 4 deletions .github/workflows/build-manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
version:
description: 'Version of flux to build'
required: true
release_version:
description: 'Pypi version to release to'
required: true

jobs:
build-manual:
Expand All @@ -31,7 +28,7 @@ jobs:
ls /code
ls ./
mv /code/src/bindings/python/flux ./flux
python3 setup.py sdist bdist_wheel --flux-root /code --security-src $HOME/security --security-include /usr/local/include/flux/security --version ${{ inputs.release_version }}
python3 setup.py sdist
sudo ldconfig
- name: Prepare Wheel
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
- name: Build Python Bindings
run: |
mv /code/src/bindings/python/flux ./flux
python3 setup.py sdist bdist_wheel --flux-root /code --security-src $HOME/security --security-include /usr/local/include/flux/security --version develop
python3 setup.py sdist
3 changes: 1 addition & 2 deletions .github/workflows/test-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ jobs:
- name: Build Python Bindings
run: |
mv /code/src/bindings/python/flux ./flux
python3 setup.py sdist bdist_wheel --flux-root /code --security-src $HOME/security --security-include /usr/local/include/flux/security --version develop
python3 setup.py sdist
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ __pycache__
.deps
build
src/.libs
src/*preproc.h
src/*clean.h
src/*.c
flux.egg-info
.eggs
Expand Down
35 changes: 32 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ If you want to build a custom version with Flux core you can do:

```bash
rm -rf ~/flux-core
export FLUX_VERSION=0.46.0
export FLUX_VERSION=0.48.0
wget https://github.com/flux-framework/flux-core/releases/download/v${FLUX_VERSION}/flux-core-${FLUX_VERSION}.tar.gz
tar -xzvf flux-core-${FLUX_VERSION}.tar.gz
sudo mv flux-core-${FLUX_VERSION} ~/flux-core
Expand All @@ -35,11 +35,13 @@ make
sudo make install
```

And then build your custom wheel:
And then copy over the Python source to "flux" and build your custom wheel:

```bash
$ rm -rf /workspaces/flux-python/flux
$ cp -R src/bindings/python/flux /workspaces/flux-python/flux
$ cd /workspaces/flux-python
$ python3 setup.py sdist bdist_wheel --flux-root /home/vscode/flux-core --security-src /home/vscode/security --security-include /usr/local/include/flux/security --version 0.46.0-rc-0
$ python3 setup.py sdist
```

And if you want to upload:
Expand All @@ -48,6 +50,33 @@ And if you want to upload:
$ twine upload dist/*.tar.gz
```

## Install on a System

Since we need to link to Flux libraries, you are advised to install flux and flux-security in the same location
that will be discovered via the executable "flux," so typically `/usr` or `/usr/local`. You can do either:

```bash
# Find the flux version on your system
flux --version

# Install the bindings that match that version
pip install flux-python==0.48.0
```
And if you are having trouble with the WCI cache, you can also wget the [file directly from pypi]()
and install the .tar.gz directly.

```bash
wget https://files.pythonhosted.org/packages/25/fb/02951d80e44a19db291f0e7370d4e7d82c0c1b17709a37913881f958dff7/flux-python-0.48.0rc0.tar.gz
pip install flux-python-0.48.0rc0.tar.gz
```

If you install to a local (personal) location (e.g., `$HOME/.local`) you'll need to add this to your `PYTHONPATH`

```bash
# The directory "flux" is under the site-packages here
export PYTHONPATH=$HOME/.local/lib/python3.7/site-packages
```

### Building Modules

We will need to build the tarball providing paths to the flux-core and flux-security
Expand Down

0 comments on commit febb740

Please sign in to comment.