Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

23.02.ug #7

Open
wants to merge 48 commits into
base: 23.02.ug
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
f110bf5
Wait_finished method for job API (regarding #240) (#242)
JonaOtto Sep 9, 2022
f60220c
Fixed mem_per_cpu setting in job class (#243)
JonaOtto Sep 10, 2022
7b370f7
fix typos (#252)
schluenz Dec 23, 2022
da978a6
Fix creating RPM packages (#248)
tazend Jan 3, 2023
a2fa6e1
Support updating end_time in slurm_update_reservation (#255)
pllopis Jan 6, 2023
ace7785
Fix formatting error for reservation_list example (#256)
pllopis Jan 6, 2023
2617092
Raise ValueError on slurm_update_reservation (#257)
pllopis Jan 6, 2023
ffc419f
Actually retrieve the batch script contents (#258)
tazend Feb 4, 2023
61d4740
Brought __rpc_num2string in sync with slurm 22.05 message types (#261)
wresch Feb 9, 2023
dd73ddf
bump pyslurm version (#263)
tazend Feb 26, 2023
f3dbb73
Transition from sphinx to mkdocs for documentation (#271)
tazend Mar 10, 2023
3b89325
Migrate pyslurm.pyx from reST to google docstring style (#273)
tazend Mar 15, 2023
f506d63
Support for Slurm 23.02.X (#277)
tazend Apr 7, 2023
23d436e
Revert usage of return type hints (#281)
tazend Apr 12, 2023
3dc607a
Reorganize slurm header definitions into seperate files (#282)
tazend Apr 30, 2023
0043080
Big rework (#283)
tazend May 1, 2023
b81d491
Update documentation and do some restructuring (#285)
tazend May 5, 2023
4ec608e
drop the doc/ directory in doc_files for building rpm (#286)
wpoely86 May 5, 2023
be9395c
some more doc fixes (#287)
tazend May 5, 2023
788f445
just use the copyright notice again that was also previously used (#288)
tazend May 6, 2023
42471d8
some more improvements (#291)
tazend May 12, 2023
538bf42
Start maintaining a changelog (#293)
tazend May 18, 2023
d5b0076
fix paths in MANIFEST.in (#295)
elelayan May 24, 2023
8ebc5c5
Rework Partition API (#296)
tazend May 27, 2023
a84d23c
Allow db job modification and some fixes (#297)
tazend May 27, 2023
37f7e22
Few fixes and handle modification consistently (#300)
tazend Jun 2, 2023
3a603e1
Fix parsing user names in JobSearchFilter (#303)
tazend Jun 5, 2023
485722b
Implement DB Associations API and a little refactoring. (#304)
tazend Jun 25, 2023
0a65047
Refactor + improve docs (#305)
tazend Jul 13, 2023
fe572c7
More doc improvements and other fixes (#306)
tazend Jul 18, 2023
0e4a327
Update CHANGELOG (#307)
tazend Jul 18, 2023
a0dfa6b
Fix recursively transforming collections to JSON (#308)
tazend Jul 18, 2023
2810957
Bump version to 23.2.2 (#309)
tazend Jul 18, 2023
b435d68
Fix a reference to an invalid property and return the correct value f…
robgics Aug 24, 2023
4ecdfa0
Nodes: Some Bugfixes and new attributes (#318)
tazend Aug 26, 2023
7ebf64a
Add new attributes to db.Jobs and truncate_time option to db.JobFilte…
tazend Sep 8, 2023
84a3d11
Merge branch '22.05.ug' into 23.02.ug
itkovian Oct 2, 2023
2ee2696
bump: workflow image to ubuntu 22.04 LTS
itkovian Oct 13, 2023
5b76298
bump: slurm version in docker images to 23.02.6
itkovian Oct 13, 2023
32d1e69
bump: back to ubuntu 20.04 LTS because of py3.6
itkovian Oct 13, 2023
141303f
fix: other slurm image
itkovian Oct 13, 2023
3067a70
bump: actions to newer version
itkovian Oct 13, 2023
cff9c8a
bump: python 3.9 version to 3.9.18
itkovian Oct 17, 2023
3f94b5d
fix: verbose building
itkovian Oct 17, 2023
7194d82
feat: support for building on el9
itkovian Jan 10, 2024
43e242d
fix: rpm is called python3-devel
itkovian Jan 10, 2024
b8d437b
fix: remove cython upper bound verison limit
itkovian Jan 10, 2024
2482522
fix: remove exceprtion raise
itkovian Jan 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pyslurm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
fail-fast: false
steps:
- name: Checkout repository code
uses: actions/checkout@v2
uses: actions/checkout@main
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Ignore Build Directory #
build/
site

# Ignore Docs Directory #
#doc/
Expand All @@ -15,6 +16,9 @@ pyslurm/*.pxi~
pyslurm/*.pxd~
pyslurm/*.so
pyslurm/*.c
pyslurm/**/*.c
pyslurm/**/*.so
pyslurm/**/__pycache__

# Ignore vim swap files
*.swp
Expand All @@ -24,6 +28,7 @@ tests/*.pyc

# Ignore pycache (Python 3)
*/__pycache__
*/**/__pycache__

# Ignore job output files
*.out
Expand Down
100 changes: 100 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased on the [23.2.x](https://github.com/PySlurm/pyslurm/tree/23.2.x) branch

- New Classes to interact with Database Associations (WIP)
- `pyslurm.db.Association`
- `pyslurm.db.Associations`
- New Classes to interact with Database QoS (WIP)
- `pyslurm.db.QualityOfService`
- `pyslurm.db.QualitiesOfService`
- Add `truncate_time` option to `pyslurm.db.JobFilter`, which is the same as -T /
--truncate from sacct.
- Add new Attributes to `pyslurm.db.Jobs` that help gathering statistics for a
collection of Jobs more convenient.
- Fix `allocated_gres` attribute in the `pyslurm.Node` Class returning nothing.
- Add new `idle_memory` and `allocated_tres` attributes to `pyslurm.Node` class
- Fix Node State being displayed as `ALLOCATED` when it should actually be
`MIXED`.

## [23.2.2](https://github.com/PySlurm/pyslurm/releases/tag/v23.2.2) - 2023-07-18

### Added

- Ability to modify Database Jobs
- New classes to interact with the Partition API
- [pyslurm.Partition][]
- [pyslurm.Partitions][]
- New attributes for a Database Job:
- `extra`
- `failed_node`
- Added a new Base Class [MultiClusterMap][pyslurm.xcollections.MultiClusterMap] that some Collections inherit from.
- Added `to_json` function to all Collections

### Fixed

- Fixes a problem that prevented loading specific Jobs from the Database if
the following two conditions were met:
- no start/end time was specified
- the Job was older than a day

### Changed

- Improved Docs
- Renamed `JobSearchFilter` to [pyslurm.db.JobFilter][]
- Renamed `as_dict` function of some classes to `to_dict`

## [23.2.1](https://github.com/PySlurm/pyslurm/releases/tag/v23.2.1) - 2023-05-18

### Added

- Classes to interact with the Job and Submission API
- [pyslurm.Job](https://pyslurm.github.io/23.2/reference/job/#pyslurm.Job)
- [pyslurm.Jobs](https://pyslurm.github.io/23.2/reference/job/#pyslurm.Jobs)
- [pyslurm.JobStep](https://pyslurm.github.io/23.2/reference/jobstep/#pyslurm.JobStep)
- [pyslurm.JobSteps](https://pyslurm.github.io/23.2/reference/jobstep/#pyslurm.JobSteps)
- [pyslurm.JobSubmitDescription](https://pyslurm.github.io/23.2/reference/jobsubmitdescription/#pyslurm.JobSubmitDescription)
- Classes to interact with the Database Job API
- [pyslurm.db.Job](https://pyslurm.github.io/23.2/reference/db/job/#pyslurm.db.Job)
- [pyslurm.db.Jobs](https://pyslurm.github.io/23.2/reference/db/job/#pyslurm.db.Jobs)
- [pyslurm.db.JobStep](https://pyslurm.github.io/23.2/reference/db/jobstep/#pyslurm.db.JobStep)
- [pyslurm.db.JobFilter](https://pyslurm.github.io/23.2/reference/db/jobsearchfilter/#pyslurm.db.JobFilter)
- Classes to interact with the Node API
- [pyslurm.Node](https://pyslurm.github.io/23.2/reference/node/#pyslurm.Node)
- [pyslurm.Nodes](https://pyslurm.github.io/23.2/reference/node/#pyslurm.Nodes)
- Exceptions added:
- [pyslurm.PyslurmError](https://pyslurm.github.io/23.2/reference/exceptions/#pyslurm.PyslurmError)
- [pyslurm.RPCError](https://pyslurm.github.io/23.2/reference/exceptions/#pyslurm.RPCError)
- [Utility Functions](https://pyslurm.github.io/23.2/reference/utilities/#pyslurm.utils)

### Changed

- Completely overhaul the documentation, switch to mkdocs
- Rework the tests: Split them into unit and integration tests

### Deprecated

- Following classes are superseded by new ones:
- [pyslurm.job](https://pyslurm.github.io/23.2/reference/old/job/#pyslurm.job)
- [pyslurm.node](https://pyslurm.github.io/23.2/reference/old/node/#pyslurm.node)
- [pyslurm.jobstep](https://pyslurm.github.io/23.2/reference/old/jobstep/#pyslurm.jobstep)
- [pyslurm.slurmdb_jobs](https://pyslurm.github.io/23.2/reference/old/db/job/#pyslurm.slurmdb_jobs)

## [23.2.0](https://github.com/PySlurm/pyslurm/releases/tag/v23.2.0) - 2023-04-07

### Added

- Support for Slurm 23.02.x ([f506d63](https://github.com/PySlurm/pyslurm/commit/f506d63634a9b20bfe475534589300beff4a8843))

### Removed

- `Elasticsearch` debug flag from `get_debug_flags`
- `launch_type`, `launch_params` and `slurmctld_plugstack` keys from the
`config.get()` output
- Some constants (mostly `ESLURM_*` constants that do not exist
anymore)
6 changes: 3 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include README.rst
include README.md
include COPYING.txt
graft examples
graft tests
graft doc
graft docs
graft pyslurm/slurm
graft pyslurm/pydefines
include pyslurm/alps_cray.h
recursive-include pyslurm *.pyx *.px[di] *.h
140 changes: 24 additions & 116 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
# PySlurm
# <img src="logo.png" alt="PySlurm Logo">

[![PySlurm](https://github.com/PySlurm/pyslurm/actions/workflows/pyslurm.yml/badge.svg?branch=main)](https://github.com/PySlurm/pyslurm/actions/workflows/pyslurm.yml)
pyslurm is the Python client library for the [Slurm Workload Manager](https://slurm.schedmd.com)

## Overview

PySlurm is the Python client library for the [Slurm](https://slurm.schedmd.com) HPC Scheduler.

## Prerequisites
## Requirements

* [Slurm](https://slurm.schedmd.com) - Slurm shared library and header files
* [Python](https://www.python.org) - >= 3.6
* [Cython](https://cython.org) - >= 0.29.30 but < 3.0

This PySlurm branch is for the Slurm Major-Release 22.05
This Version is for Slurm 23.02.x

## Versioning

In pyslurm, the versioning scheme follows the official Slurm versioning. The
first two numbers (`MAJOR.MINOR`) always correspond to Slurms Major-Release,
for example `23.02`.
The last number (`MICRO`) is however not tied in any way to Slurms `MICRO`
version, but is instead PySlurm's internal Patch-Level. For example, any
pyslurm 23.02.X version should work with any Slurm 23.02.X release.

## Installation

Expand All @@ -21,130 +26,33 @@ By default, it is searched inside `/usr/include` for the Header files and in
For Slurm installations in different locations, you will need to provide
the corresponding paths to the necessary files.

You can specify these Paths with environment variables, for example:

```shell
export SLURM_INCLUDE_DIR=/opt/slurm/22.05/include
export SLURM_LIB_DIR=/opt/slurm/22.05/lib
```

Then you can proceed to install PySlurm, for example:
You can specify those with environment variables (recommended), for example:

```shell
pip install pyslurm==22.05.0
export SLURM_INCLUDE_DIR=/opt/slurm/23.02/include
export SLURM_LIB_DIR=/opt/slurm/23.02/lib
```

Or by cloning the repository:
Then you can proceed to install pyslurm, for example by cloning the Repository:

```shell
git clone https://github.com/PySlurm/pyslurm.git && cd pyslurm
python setup.py install
scripts/build.sh

# Or simply with pip
pip install .
```

Also see `python setup.py --help`

## Release Versioning

PySlurm's versioning scheme follows the official Slurm versioning. The first
two numbers (MAJOR.MINOR) always correspond to Slurms Major-Release, for example
`22.05`. The last number (MICRO) is however not tied in any way to Slurms
MICRO version. For example, any PySlurm 22.05.X version should work with any
Slurm 22.05.X release.

## Documentation

The API documentation is hosted at <https://pyslurm.github.io>.

To build the docs locally, use [Sphinx](http://www.sphinx-doc.org) to generate
the documentation from the reStructuredText based docstrings found in the
pyslurm module once it is built:

```shell
cd doc
make clean
make html
```

## Testing

PySlurm requires an installation of Slurm.

### Using a Test Container

To run tests locally without an existing Slurm cluster, `docker` and
`docker-compose` is required.

Clone the project:

```shell
git clone https://github.com/PySlurm/pyslurm.git
cd pyslurm
```

Start the Slurm container in the background:

```shell
docker-compose up -d
```

The cluster takes a few seconds to start all the required Slurm services. Tail
the logs:

```shell
docker-compose logs -f
```

When the cluster is ready, you will see the following log message:

```text
Cluster is now available
```

Press CTRL+C to stop tailing the logs. Slurm is now running in a container in
detached mode. `docker-compose` also bind mounds the git directory inside the
container at `/pyslurm` so that the container has access to the test cases.

Install test dependencies:

```shell
pipenv sync --dev
```

Execute the tests inside the container:

```shell
pipenv run pytest -sv scripts/run_tests_in_container.py
```

When testing is complete, stop the running Slurm container:

```shell
docker-compose down
```

### Testing on an Existing Slurm Cluster

You may also choose to clone the project and run tests on a node where Slurm is
already compiled and installed:

```shell
git clone https://github.com/PySlurm/pyslurm.git
cd pyslurm
pip install .
./scripts/configure.sh
pipenv sync --dev
pipenv run pytest -sv
```

## Contributors

PySlurm is made by [contributors like
pyslurm is made by [contributors like
you](https://github.com/PySlurm/pyslurm/graphs/contributors).

## Help
## Support

Feel free to ask questions in the [GitHub
Discussions](https://github.com/orgs/PySlurm/discussions)

Ask questions on the [PySlurm Google
Group](https://groups.google.com/forum/#!forum/pyslurm)
Found a bug or you are missing a feature? Feel free to [open an Issue!](https://github.com/PySlurm/pyslurm/issues/new)
7 changes: 1 addition & 6 deletions UPGRADE_C_API.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,8 @@ Then, simply generate the header definitions like in this example:
scripts/pyslurm_bindgen.py -D /directoy/with/slurm/headers > pyslurm/slurm/header.pxi

The script outputs everything to `stdout`. Simply redirect the output to the file: :code:`pyslurm/slurm/header.pxi`.
The headers should now be fully translated.

Now, 99% of the work is done for generating the headers. For the 1% left, you now need to open the generated file, search for the two follwowing statements and comment them out:

- `slurm_addr_t control_addr`
- `phtread_mutex_t lock`

The compiler will otherwise complain that these are incomplete type definitions.

Compiling, Updating, Testing
----------------------------
Expand Down
Loading
Loading