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

feat: adding bulk jdl submission and job policy checking #43

Merged

Conversation

simon-mazenoux
Copy link
Contributor

@simon-mazenoux simon-mazenoux commented Jul 5, 2023

Adding bulk submission of jdls to the job submission endpoint, and implement job policy checking (solves Implement JobPolicy #23 )

(Tests need to be relaunched once DIRACGrid/DIRAC#7092 get merged)

@simon-mazenoux simon-mazenoux force-pushed the feat-adding-bulk-jdl-submission branch from 7b02177 to c073061 Compare July 5, 2023 13:27
@simon-mazenoux simon-mazenoux changed the title feat: adding bulk jdl submission feat: adding bulk jdl submission and job policy Jul 5, 2023
@simon-mazenoux simon-mazenoux changed the title feat: adding bulk jdl submission and job policy feat: adding bulk jdl submission and job policy checking Jul 5, 2023
@simon-mazenoux simon-mazenoux force-pushed the feat-adding-bulk-jdl-submission branch 3 times, most recently from 9d75d48 to cf82ae4 Compare September 4, 2023 12:58
@fstagni fstagni closed this Sep 4, 2023
@fstagni fstagni reopened this Sep 4, 2023
@fstagni
Copy link
Contributor

fstagni commented Sep 4, 2023

This effectively depends from #67 (which in turn depends from DIRACGrid/DIRAC#7143). I convert to draft until the 2 above are sorted.

@fstagni fstagni marked this pull request as draft September 4, 2023 13:45
Comment on lines 115 to 123
class DiracxJobPolicy(JobPolicy):
def __init__(self, user_info: UserInfo, allInfo: bool = True):
self.userName = user_info.preferred_username
self.userGroup = user_info.dirac_group
self.userProperties = user_info.properties
self.jobDB = None
self.allInfo = allInfo
self._permissions: dict[str, bool] = {}
self._getUserJobPolicy()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we define this outside the method rather than creating a new class every time the API route is called?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was more a kind of proof of concept while waiting for a decision about attributing directly the properties during the token creation. In any case, this will need to be refactored because JobPolicy is also used in endpoinds such as kill, delete or reschedule

@chrisburr chrisburr marked this pull request as ready for review September 5, 2023 15:19
@chrisburr chrisburr force-pushed the feat-adding-bulk-jdl-submission branch from 8d7b2ef to ebadbd8 Compare September 6, 2023 08:05
@chrisburr chrisburr merged commit 35fa9db into DIRACGrid:main Sep 6, 2023
7 checks passed
@simon-mazenoux simon-mazenoux deleted the feat-adding-bulk-jdl-submission branch September 6, 2023 11:53
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

Successfully merging this pull request may close these issues.

4 participants