Specialised handling for griogrits, credit code padding and emre_keskin credit application#270
Specialised handling for griogrits, credit code padding and emre_keskin credit application#270jimmysway wants to merge 2 commits into
Conversation
Added logic for emre harvard Openstack Storage free storage Added test case for emre Harvard Openstack Storage handling Closes CCI-MOC#268
… to Billable Added test case for grio-grits move from Non-Billable to Billable
knikolla
left a comment
There was a problem hiding this comment.
I don't see it as being added to the list of Processors in process_report.py
| self.data.loc[rule_mask, invoice.PI_BALANCE_FIELD] = 0 | ||
| self.data.loc[rule_mask, invoice.BALANCE_FIELD] = 0 | ||
|
|
||
| def _apply_griot_grits_billable(self): |
There was a problem hiding this comment.
@joachimweyl why is this project not automatically classified as billable and why does it need a special rule?
There was a problem hiding this comment.
The whole test cluster and barcelona cluster are non-billable by defult in the hopes that eventually we will not need to use these as "produciton". therefore to make anything from these 2 clusters they need to be made billable manually.
There was a problem hiding this comment.
So this is a billable project in a non billable cluster? Sounds like a better place to handle this would be introducing a new field in the projects in the projects.yaml file.
@QuanMPhm cc.
There was a problem hiding this comment.
I believe a new override field, is_billable, that indicates if the project is billable for all, or specific clusters, would suffice?
There was a problem hiding this comment.
I believe a new override field,
is_billable, that indicates if the project is billable for all, or specific clusters, would suffice?
Yes. If the override field exists the billing status of the project will be the value of the field.
If the field is missing from the project entry, and there is a project entry in projects.yaml, it will be assumed as False.
Otherwise, if there is no entry in projects.yaml, it will take the value of the PI or cluster.
There was a problem hiding this comment.
The whole non-billable-projects repo historically has been made up of non-billable data that is how it is understood.
Hence why I suggested at some point in the near-future renaming that repository into invoicing-private-data, as that is what it has become.
If we add this billable project into the projects.yaml it won't necessarily be easy to track down what has happened to this project specifically.
I strongly disagree. It is much more harder to track down what is happening when you need to track down and read the code to see that you are setting the specific flag in a specific column, rather than having a readable and plain English is_billable: True in a YAML file.
Special cases imho are special because they need to be traced, we need to know what is going on.
This is not the first, nor the last special case that we have handled.
If we allow every special cases that we encounter to be one-offs, without ever generalizing, we're just going to be having a long list of one-off processors and then it will be truly lost and disappear in the list of processors.
What I am proposing here is a solution that allows this to not be a one-off anymore, since the difficulty of generalizing both cases in this PR is low and these cases become supported by the schema of the YAML files here.
There was a problem hiding this comment.
I’m not opposed to encoding this in YAML instead of code. My hesitation is specifically that projects.yaml and the surrounding repo have historically meant “nonbillable data,” so adding is_billable: true changes the meaning of that data source in a way that may confuse future operators. I understand that we will be changing the name of the repo in the future but those who have come across the projects.yaml have always understood it as explicity non-billable data.
I don't mean having projects ids randomly hardcoded in is good and I completely agree with the YAML plain english way of organising this information.
I propose that we introduce maybe a separate file perhaps called billing_overrides.yaml, or something of that nature so that projects.yaml can remain explicitly non-billable information as is familiar with everyone.
There was a problem hiding this comment.
I propose that we introduce maybe a separate file perhaps called billing_overrides.yaml, or something of that nature so that projects.yaml can remain explicitly non-billable information as is familiar with everyone.
No.
projects.yaml is already a billing override, just with an implicit is_billable: False to all the projects listed there. Schema changes happen naturally, as is happening here, and this schema is the best place to accommodate this new feature. The default behavior will be preserved and an explicit new behavior will be introduced, so there are no concerns for confusion or breaking changes. Plus, we are the operators, so don't worry about future ones.
A new billing_overrides.yaml file that is separate from an already existing billing override file will only cause more confusion and split the same kind of schema into two separate places.
I have renamed cci-moc/non-billable-projects to cci-moc/invoicing-private-data
I would please like to no longer debate this further.
There was a problem hiding this comment.
https://github.com/CCI-MOC/invoicing-private-data/issues/89
This is a link to the issue
There was a problem hiding this comment.
#274 This is a link to the updated handling
|
|
||
| @dataclass | ||
| class SpecialBillingRulesProcessor(processor.Processor): | ||
| _EMRE_EMAIL = "emre_keskin@harvard.edu" |
There was a problem hiding this comment.
Instead of hardcoding the email that is not being billed for a specific resource, perhaps we can turn pi.txt in the non-billable-projects repo into a YAML file (as we did with projects.yaml) that contains for each PI in the list a field named specific-non-billed-su-types (or something similar) and takes a list of SU types to not bill the PI for.
I strongly dislike this kind of hardcoding of user data, be it emails, su types or specific projects into the code.
There was a problem hiding this comment.
I'm fine with this suggestion. @jimmysway Do you have other suggestions, and do you want to implement this change in nerc-rates?
There was a problem hiding this comment.
I don't think nerc-rates is the right place to put user information. That's why I mentioned non-billable-projects, which perhaps is about time we rename it to invoicing-private-data.
There was a problem hiding this comment.
I'm confused to where I am supposed to include the email information.
There was a problem hiding this comment.
I don't think
nerc-ratesis the right place to put user information. That's why I mentionednon-billable-projects, which perhaps is about time we rename it toinvoicing-private-data.
Ah sorry, I meant non-billable-projects. First time I got them mixed up :P
There was a problem hiding this comment.
So do you want to move this logic to the ValidateBillablePIsProcessor? @knikolla Or just load the PI.yaml into the special processor. I still maintain that special cases need to be handled in one spot
There was a problem hiding this comment.
So do you want to move this logic to the ValidateBillablePIsProcessor?
Yes
There was a problem hiding this comment.
I still maintain that special cases need to be handled in one spot
They wouldn't be special cases anymore, but supported by the schema of the respective YAML files. @jimmysway please trust my judgment.
There was a problem hiding this comment.
I will make that PR now to modify pi.txt into PR.yaml
There was a problem hiding this comment.
https://github.com/CCI-MOC/non-billable-projects/pull/88
here is the PR
There seems to be a lot of special one off cases that may grow in the future. I thought implementing a new processor would firstly, allow future one off cases to be implemented and secondly it one off cases would be centralized inside one distinct processor so you don't have to hunt for those cases in the future, it is clear what the processor is doing so the logic is very auditable. In any case, this will create a sort of framework or guide for future implementation of one of cases. |
I'm commenting on the fact that since this isn't being added to the list of processors in EDIT: To further edit and clarify, this must be added to that list for it to execute. |
I misunderstood my apologies |
|
@jimmysway Sorry for being late to respond. To clarify your confusion here and here, @knikolla is suggesting that we introduce new fields in the My suggestion is that you update the model for Make a PR to Does this clarify your confusion? |
|
If you believe you will not continue development on this PR, can you close it? |
Closes #268.