-
-
Notifications
You must be signed in to change notification settings - Fork 23
support custom TopCP images #1163
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
base: develop
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
This reverts commit 86d536d.
…/ssl-hep/ServiceX into 1162-support-custom-topcp-images
…62-support-custom-topcp-images
for more information, see https://pre-commit.ci
…62-support-custom-topcp-images
…/ssl-hep/ServiceX into 1162-support-custom-topcp-images
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1163 +/- ##
===========================================
+ Coverage 85.92% 86.16% +0.23%
===========================================
Files 94 94
Lines 3233 3260 +27
Branches 371 378 +7
===========================================
+ Hits 2778 2809 +31
+ Misses 380 378 -2
+ Partials 75 73 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…62-support-custom-topcp-images
for more information, see https://pre-commit.ci
…/ssl-hep/ServiceX into 1162-support-custom-topcp-images
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…/ssl-hep/ServiceX into 1162-support-custom-topcp-images
|
Is there any way we can move the image selection retrieval and verification into the TopCP CodeGen? I really don't like having a hardcoded test for I don't think we need to change the app at all to support this special case |
| request_record: TransformRequest, | ||
| namespace: str, | ||
| user_codegen_name: str, | ||
| custom_image: Optional[str] = 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.
Why iscustom_image still here?
| {{- if .Values.codeGen.topcp.enabled }} | ||
| # TopCP custom image configuration | ||
| TOPCP_ALLOWED_IMAGES = {{ .Values.codeGen.topcp.allowedImages | toJson | quote }} |
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.
Do we still need this in the App config?
| ) | ||
|
|
||
| def validate_custom_docker_image(image_name: str) -> bool: | ||
| allowed_images_json = os.environ.get("TOPCP_ALLOWED_IMAGES") |
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.
Could this be moved to the codegen's __init__ so that if there is a formatting error in the ALLOWED_IMAGES it will fail at startup instead of the first time someone submits?
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.
The function call can't go in __init__.py because there's nothing to compare it to. However, I added a check in create_app to validate the JSON parsing of of TOPCP_ALLOWED_IMAGES. And I removed type guarding from validate_custom_docker_image.
for more information, see https://pre-commit.ci
Backend work for supporting custom TopCP images from whitelisted Docker registry repositories: ssl-hep/ServiceX_frontend#658
Allowed images can be defined using the
codeGen.topcp.allowedImagesvalue, where the value should be a list of strings. Each string in the list will be tested to see if it is a valid prefix of the custom image. If it is, it will be allowed. The default value will allow any tags for thesslhep/servicex_science_image_topcprepository.Sample files that work with a custom TopCP image but not with the default/base image: