Skip to content

Add exclusive mode and prerequisites #86

Merged
merged 38 commits into from Apr 19, 2020
Merged

Add exclusive mode and prerequisites #86

merged 38 commits into from Apr 19, 2020

Conversation

donald
Copy link
Contributor

@donald donald commented Apr 19, 2020

  • Add some tests (mx_strvec_*)
  • Remove dysfunctional cache feature from mxq_strvec functions
  • Avoid some logfile noise
  • Add flags --exclusive for daemon. A daemon in exclusive mode only accepts jobs it is explicitly whitelisted for (mxqsub --whitelist )
  • Fix a bug for mxqsub --group-id
  • Fix a bug in keywordset, where a keyword, which is a substring of antother keyword, might wrongly by matched
  • Let a group specify what prerequisites it needs via a boolean expression ( `mxqsub --prerequisites "ssse3 & cuda" )
  • Let a server collect what prerequisites it has ( from hostconfig and processor features + hostnames + "true" ) and start only matching jobs.
  • Expand web interface to show prerequisites of server and group.

Supersedes #85

The only two functions from the mx_strvec familiy which are used by
mxqd and mxqsub have no tests currently. Add test.
Remove test for a "cache bug", as we are going to remove the mx_strvec
cache feature in the next commit.
The idea of the cache was to store the address and the number of the
elements of a single vector in variables each time the length was
determined.

However, this aliases the pointer to the string vector owned by the user.
If the users free()s his pointer to the vector, the cached pointer
becomes invalid.

An approach would be to require the user to always use a library routine
to free the vector. This library routine would need to invalidate the
static alias pointer, too.  However, the assumed performance win doesn't
seem worth the complexity.

Remove the cache code.
@donald donald mentioned this pull request Apr 19, 2020
@donald donald changed the title Add prerequisites Add exclusive mode and prerequisites Apr 19, 2020
Only unmount and remove job temporary directories for jobs, which
actually requested one to avoid meaningless warnings in the logfile.
We'd like to have a daemon flag, namely "exclusive". This flag should be
published by the daemon into the database, so that is visible to the web
interface.

Although we currently need only a single boolean flag, make it a integer,
so that we can add more flags at a later time without changing the database
scheme.
When a daemon is started, with --exclusive it will set daemon_flags to 1
to indicate, that it is running in exclusive mode.

In exclusive mode, the daemon should only start jobs which have an
implicit whitelist (`mxqsub --whitelist`) which includes the daemons
name. This is implemented in the next commit.
If the daemon was stared with `--exclusive`, only start jobs which have
the daemon in their whitelist.
Do not match "abcdef" with "abc" in find_name().
Update of "abcdef" with "+ab" wrongly resulted in "ab", because the
substring was matched for the keywords. Add a test for the bug fixed in
the last commit.
Add function keywordset_add to update a keywordset with names from a
string, not requiring  embedded "+" markers.
Add function keywordset_free_byref to be used with `__attribute__
((cleanup))`.
@donald donald force-pushed the add-prerequisites branch 2 times, most recently from eace747 to 2d9ba1f Compare April 19, 2020 11:45
The inlined keywordset_free_byref from keywordset.h uses
keywordset_free, so link keywordset.o in, too.
Add a simple bison based expression parser and evaluator for
boolean expressions with identifiers from keywordsets.

Identifiers existing in the supplied keywordset evaluate to true,
others to false. This can be combined with boolean arithmetic w
using  '!', '&', '|', '(' and ')'. White space is ignored.

Example valid expressions:

    cuda
    cuda & ssse3
    amd & !desktop
    theinternet | deadpool
Add a test for the expression parser.
Add field "prerequisites" to mxq_daemon which hold the prerequisites the
server offers (e.g. cpu feature flags and hostconfig keywords). This
field is used to publish the discovered prerequisites.
Add add column to store a prerequisites expression which the group
requires from the server.
Initialize set of prerequisites available on the server from
hostname, short hostname, hostconfig and cpu features. Also
include a keyword "true".

Store the preqrequisites as keywordset in the server structure to
use for cehcking group requiresments and as as string in the daemon
structure to be published to the database for documentation.
Reformulate server_is_qualified to make it (IMO) easier to understand
and easier to expand.
If the users specifies a prerequisites expression with --prerequisites,
parse it to verify its syntax and store it as a group attribute.
@donald donald merged commit eee840e into master Apr 19, 2020
@donald donald deleted the add-prerequisites branch October 28, 2022 14:22
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant