-
Notifications
You must be signed in to change notification settings - Fork 2
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
Automate default policies update process #18
base: main
Are you sure you want to change the base?
Conversation
jopemachine
commented
Dec 9, 2022
•
edited
Loading
edited
- This PR automates the default policy update process using some python scripts and Github Action (Update seccomp profiles #10).
ff69af1
to
b4a733b
Compare
scripts/update-policy.py
Outdated
return super(OYAMLDumper, self).increase_indent(flow, False) | ||
|
||
|
||
def lense(obj, *args): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote this utility function to simplify codes,
but I think utility like dot-prop looks also good.
get_property({'foo': {'bar': 'unicorn'}}, 'foo.bar');
//=> 'unicorn'
get_property({'foo': {'bar': 'a'}}, 'foo.notDefined.deep');
//=> None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually already have one implementation 😉: https://github.com/lablup/backend.ai/blob/e2e18a2/src/ai/backend/common/utils.py#L107
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is a well-packaged 3rd-party library with a clean API, I think it is also good to use one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied and pasted the nmget
code, but maybe making it as a separate lib named nmget
might be better idea to maintain.
scripts/update-policy.py
Outdated
return super(OYAMLDumper, self).increase_indent(flow, False) | ||
|
||
|
||
def lense(obj, *args): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually already have one implementation 😉: https://github.com/lablup/backend.ai/blob/e2e18a2/src/ai/backend/common/utils.py#L107
scripts/update-policy.py
Outdated
return super(OYAMLDumper, self).increase_indent(flow, False) | ||
|
||
|
||
def lense(obj, *args): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is a well-packaged 3rd-party library with a clean API, I think it is also good to use one.
Ubuntu seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |