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

Correct typing for IOReadIOPSMax, IOWriteIOPSMax,... in systemd::manage_dropin #430

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

traylenator
Copy link
Contributor

@traylenator traylenator commented Mar 9, 2024

Pull Request (PR) description

Using any of the following directives in systemd::manage_dropin or systemd::manage_unit resulted in a compilation error.

  • IODeviceWeight
  • IOReadBandwidthMax
  • IOWriteBandwidthMax
  • IOReadIOPSMax
  • IOWriteIOPSMax

The types for these directives in Systemd::Unit::Slice and Systemd::Unit::Service have now been updated.

Example usage:

systemd::manage_dropin { 'devicelimits.conf':
  unit          =>  'special.service',
  service_entry => {
   'IOReadIOPSMax' => [
     ['/dev/afs',100],
     ['/dev/gluster','1000K'],
   ],
  },
}

would result in a drop in file of:

[Service]
IOReadIOPSMax=/dev/afs 100
IOReadIOPSMax=/dev/gluster 1000K

This Pull Request (PR) fixes the following issues

Worth Noting

  • The Types here are different to what the existing systemd::service_limit uses for these parameters.
  • My aim following this is to make systemd::service_limits a wrapper to systemd::manage_dropin.
    it contains a translation for these parameters to maintain backwards compatibility.
  • systemd::service_limits could then be deprecated.

@traylenator traylenator added the bug Something isn't working label Mar 9, 2024
@traylenator
Copy link
Contributor Author

Very open to the simpler:

systemd::manage_dropin { 'devicelimits.conf':
  unit          =>  'special.service',
  service_entry => {
   'IOReadIOPSMax' => [
      '/dev/afs 100',
      '/dev/gluster  1000K',
   ],
  },
}

👍 or 👎 for this simpler one.

…nd manage_dropin.

Useing any of the following directives in `systemd::manage_dropin` or
`systemd::manage_unit` resulted in a compilation error.

* `IODeviceWeight`
* `IOReadBandwidthMax`
* `IOWriteBandwidthMax`
* `IOReadIOPSMax`
* `IOWriteIOPSMax`

The types for these directives in `Systemd::Unit::Slice` and
`Systemd::Unit::Service` have now been updated.

Example usage:

```puppet
systemd::manage_dropin { 'devicelimits.conf':
  unit          =>  'special.service',
  service_entry => {
   'IOReadIOPSMax' => [
     ['/dev/afs',100],
     ['/dev/gluster','1000K'],
   ],
  },
}
```

would result in a drop in file of:

```config
[Service]
IOReadIOPSMax=/dev/afs 100
IOReadIOPSMax=/dev/gluster 1000K
```
@TheMeier
Copy link
Contributor

TheMeier commented Mar 10, 2024

Maybe make a type for

Variant[Tuple[Stdlib::Absolutepath, Systemd::Unit::Amount],Array[Tuple[Stdlib::Absolutepath, Systemd::Unit::Amount]]]

and

Array[Tuple[Stdlib::Absolutepath, Systemd::Unit::Amount]]

Systemd::Unit::Bandwidth?

@traylenator
Copy link
Contributor Author

traylenator commented Mar 11, 2024

Maybe make a type for

Variant[Tuple[Stdlib::Absolutepath, Systemd::Unit::Amount],Array[Tuple[Stdlib::Absolutepath, Systemd::Unit::Amount]]]

and

Array[Tuple[Stdlib::Absolutepath, Systemd::Unit::Amount]]

Systemd::Unit::Bandwidth?

I don't think this is used anywhere else.
I certainly don't want to move away from the obvious to read.

variant[array[thing],thing]

So would only leave the tuple to simplify and that's simple already. :-)

@traylenator traylenator merged commit 27be226 into voxpupuli:master Mar 11, 2024
35 checks passed
@traylenator traylenator deleted the devicew branch March 11, 2024 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IODeviceWeight, IOReadIOPSMax, .. do not work in systemd::manage_unit or systemd::dropin_file
3 participants