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

Add build argument for policy package in relevant packages #364

Closed
rdimaio opened this issue Jan 30, 2025 · 0 comments · Fixed by #375
Closed

Add build argument for policy package in relevant packages #364

rdimaio opened this issue Jan 30, 2025 · 0 comments · Fixed by #375
Assignees
Labels
enhancement New feature or request

Comments

@rdimaio
Copy link
Contributor

rdimaio commented Jan 30, 2025

Sharing this great idea by @maxnoe, already used in the Rucio containers for BDMS - their Dockerfile for reference: https://gitlab.cta-observatory.org/cta-computing/dpps/bdms/bdms-rucio-images/-/blob/main/Dockerfile?ref_type=heads

We can add two build args POLICY_MODULE_NAME and POLICY_PACKAGE_REQUIREMENT. If they're passed at build time, we install the policy package, otherwise we don't install anything.

The main advantage of doing this: communities that only have the need to add a policy package, without customizing the images any further, wouldn't need to create custom images and could simply pass the policy package as build arg.

Downside: it might be potentially unsafe to allow dynamic installation of any package via pip; i.e. POLICY_PACKAGE_REQUIREMENT could be overridden and cause a malicious package to be installed. I think that it would be very unlikely for this to happen in a community (and even then, I don't expect that just installing a malicious Python package could cause significant damage), but it might be worth considering.

POLICY_PACKAGE_REQUIREMENTcould either point to a package name, or to a local directory - Max provided this example:

docker build -v path/to/repo:/policy-src --build-args POLICY_PACKAGE_REQUIREMENT=/policy-src

For remote installs, we could also consider passing an optional argument for pip's --index-url, so that a community could host their policy package on an index other than PyPI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

1 participant