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

Restoring init container support. #2475

Merged
merged 3 commits into from Oct 29, 2022

Conversation

rachitchauhan43
Copy link
Contributor

@rachitchauhan43 rachitchauhan43 commented Oct 19, 2022

Signed-off-by: rachitchauhan43 rachitchauhan43@gmail.com

What this PR does / why we need it:
Use cases are:

  1. In case of Inference graphs, we need to make calls to external services from within a pre/post-process method and for that we need to construct auth headers using secrets loaded by init-container.
  2. Similarly, there is a use case where have sensitive data that needs to be decrypted first inside predict method using secret loaded using init container.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #2139

Type of changes
Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Feature/Issue validation/testing:

Please describe the tests that you ran to verify your changes and relevent result summary. Provide instructions so it can be reproduced.
Please also list any relevant details for your test configuration.

  • Test A

  • Test B

  • Logs

Special notes for your reviewer:

  1. Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Checklist:

  • Have you added unit/e2e tests that prove your fix is effective or that this feature works?
  • Has code been commented, particularly in hard-to-understand areas?
  • Have you made corresponding changes to the documentation?

Release note:


Signed-off-by: rchauhan4 <rachit_chauhan@intuit.com>
@rachitchauhan43
Copy link
Contributor Author

/cc @yuzisun

@rachitchauhan43
Copy link
Contributor Author

How I tested ?

Used this yaml for ISVC:

kind: InferenceService
metadata:
  name: test-init-container
  namespace: kserve-test
spec:
  predictor:
    volumes:
      - emptyDir: { }
        name: shared-data
    initContainers:
      - image: docker.myorg.com/data-mlplatform/utils/secret-loader:latest
        name: secrets-loader
        volumeMounts:
          - mountPath: /secrets
            name: shared-data
        command: [ 'sh',
                   '-c',
                   'date > /secrets/my-value' ]
    containers:
      - args:
          - --model_name
          - qbo-in
        image: docker.myorg.com/personal/myuser/qbo-in:v1
        name: kserve-container
        volumeMounts:
          - mountPath: /secrets
            name: shared-data
        resources:
          requests:
            cpu: 101m
            memory: 256Mi

As you can see below, i ssh into container and can see my secrets mounted:
Screen Shot 2022-10-19 at 9 09 10 AM

See the finally YAML with status and spec both:

isvc_with_initcontainer_yaml.txt

Makefile Outdated Show resolved Hide resolved
Signed-off-by: rchauhan4 <rachit_chauhan@intuit.com>
@rachitchauhan43 rachitchauhan43 requested review from yuzisun and removed request for Tomcli and yuzliu October 21, 2022 00:20
Signed-off-by: Dan Sun <dsun20@bloomberg.net>
@yuzisun
Copy link
Member

yuzisun commented Oct 29, 2022

Thanks @rachitchauhan43 ! I will re-generate the swagger json later and updated the doc for the process of code-gen.
/lgtm
/approve

@kserve-oss-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rachitchauhan43, yuzisun

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@yuzisun yuzisun merged commit 71bf2ce into kserve:master Oct 29, 2022
@rachitchauhan43
Copy link
Contributor Author

Thanks @rachitchauhan43 ! I will re-generate the swagger json later and updated the doc for the process of code-gen. /lgtm /approve

@yuzisun: Can you point me where you updated the doc for the process of code-gen ?

@yuzisun
Copy link
Member

yuzisun commented Nov 16, 2022

Thanks @rachitchauhan43 ! I will re-generate the swagger json later and updated the doc for the process of code-gen. /lgtm /approve

@yuzisun: Can you point me where you updated the doc for the process of code-gen ?

It is here in the developer guide https://kserve.github.io/website/master/developer/developer/#iterating

@rachitchauhan43 rachitchauhan43 deleted the init-container-support branch February 25, 2023 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support custom init containers and volumes in KServe
3 participants