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

oaradmissionrules command is missing #9

Open
nikosT opened this issue Jun 8, 2022 · 4 comments
Open

oaradmissionrules command is missing #9

nikosT opened this issue Jun 8, 2022 · 4 comments

Comments

@nikosT
Copy link
Contributor

nikosT commented Jun 8, 2022

The command oaradmissionrules is missing from installation.
Even if we enable all lines that concern the oaradmissionrules in the Makefiles/server.mk file, still command is not there.

Tested in master branch.

@adfaure
Copy link
Contributor

adfaure commented Jun 9, 2022

Hello,

This is because this command hasn't been ported to oar3 (yet?).
The way admission rules (AR) works in oar3 is different from oar2; in oar2 the ARs are written into the database, whereas in oar3 ARs are written in a file in a folder (hard-coded for now in /etc/oar/admission_rules.d/).

Although, there is still a way to write ARs in the database, I a am not sure if it is the recommended way in oar3.

@augu5te any insight ?

@augu5te
Copy link
Contributor

augu5te commented Jun 9, 2022

Oar3 allows the two approaches e.i. rules in DB or in folder. For now oaradmissionrules is missing so the actual recommendation is to put rules in /etc/oar/admission_rules.d/ (see the examples in etc/oar/admission_rules.d/ and their use in tests/lib/test_admission_rules.py also note the numerical prefix for evaluation order).

@nikosT
Copy link
Contributor Author

nikosT commented Jun 9, 2022

Thank you @adfaure and @augu5te for the clarifications! I ingested in the PostgreSQL a new admission rule, and it seems to be working fine. I have a question though on that, what is the context that is available to an admission rule. By context, I mean variables, functions, modules etc. For instance, I used and modified via the admission rule the resource_request variable which is responsible to pass the requested resources to the next step, but this was not obvious from the beginning (e.g. I tried other variables such as resource or initial_request but with no success). Is there a way to know the availability of the "tools" (variables, functions, modules, etc.) that can be used inside an admission rule?
With respect to the above, an admission rule can only modify "things" that are associated with the job, or other structures too? For example, can an admission rule "pin" a job to a specific node?

@adfaure
Copy link
Contributor

adfaure commented Jun 9, 2022

The AR are called with the exec function to which the local variables are the attributes of a JobParameters class.
Additionally, the global context of oar is given as the global context of the AR (thus the AR contains the module loaded by oar at the calling moment).

  • This should be documented here.

nikosT added a commit to nikosT/oar3 that referenced this issue Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants