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

[Cherry-Pick] s3 storage initializer: only set environment variables if variables are set in storage secret json #131

Closed
wants to merge 1 commit into from

Conversation

Jooho
Copy link

@Jooho Jooho commented Nov 22, 2023

This is cherry-pick of kserve#3259

What this PR does / why we need it:

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 #

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 relevant result summary. Provide instructions so it can be reproduced.
Please also list any relevant details for your test configuration.

  • Test A

Test Step:

  1. install opendatahub operator and kserve
  2. The detail guide is here: https://docs.google.com/document/d/1pf0x1geayFr-06lAQKr96ynVsnOCcpgmAfbgoHgg8AI/edit

Scale down odh operator pod

oc scale deploy/opendatahub-operator-controller-manager -n openshift-operators --replicas=0

Update storage initializer image and restart kserve controler

oc edit cm inferenceservice-config -o yaml -n opendatahub
....
 storageInitializer: |-
    {
        "image" : "quay.io/jooholee/kserve-storage-initializer:ssl-verify",
...

oc delete pod -l control-plane=kserve-controller-manager --force 
  1. deploy test isvc(model) in aws https s3 (I used QE team s3 @bdattoma)

Check point
Check the log of init-container "storage-initializer". If the log looks like the following, it works fine

oc logs deploy/caikit-example-isvc-predictor-00001-deployment  -c storage-initializer
INFO:root:Initializing, args: src_uri [s3://modelmesh-example-models/llm/models] dest_path[ [/mnt/models]
INFO:root:Copying contents of s3://modelmesh-example-models/llm/models to local
INFO:botocore.credentials:Found credentials in environment variables.
INFO:root:Downloaded object llm/models/flan-t5-small-caikit/artifacts/config.json to /mnt/models/flan-t5-small-caikit/artifacts/config.json
INFO:root:Downloaded object llm/models/flan-t5-small-caikit/artifacts/generation_config.json to /mnt/models/flan-t5-small-caikit/artifacts/generation_config.json
INFO:root:Downloaded object llm/models/flan-t5-small-caikit/artifacts/pytorch_model.bin to /mnt/models/flan-t5-small-caikit/artifacts/pytorch_model.bin
INFO:root:Downloaded object llm/models/flan-t5-small-caikit/artifacts/special_tokens_map.json to /mnt/models/flan-t5-small-caikit/artifacts/special_tokens_map.json
INFO:root:Downloaded object llm/models/flan-t5-small-caikit/artifacts/spiece.model to /mnt/models/flan-t5-small-caikit/artifacts/spiece.model
INFO:root:Downloaded object llm/models/flan-t5-small-caikit/artifacts/tokenizer.json to /mnt/models/flan-t5-small-caikit/artifacts/tokenizer.json
INFO:root:Downloaded object llm/models/flan-t5-small-caikit/artifacts/tokenizer_config.json to /mnt/models/flan-t5-small-caikit/artifacts/tokenizer_config.json
INFO:root:Downloaded object llm/models/flan-t5-small-caikit/config.yml to /mnt/models/flan-t5-small-caikit/config.yml
INFO:root:Successfully copied s3://modelmesh-example-models/llm/models to /mnt/models
  • 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:


…re set in storage secret json

By setting environment variables to the result of `.get(..., "")`,
the corresponding env variables are set to an empty value.

This is an issue for some values, such as `AWS_CA_BUNDLE`, which should
be set to a path pointing to a valid CA bundle. When set to an empty string,
 it is propagated all the way down to `botocore.httpsession.URLLib3Session._setup_ssl_cert`,
 which interprets it as `False` and disables verification.

See https://github.com/boto/botocore/blob/6e0ec833714ed88d46e294048cdb0d3869eb2ab5/botocore/httpsession.py#L376-L382

Signed-off-by: Daniele Trifirò <dtrifiro@redhat.com>
Copy link

openshift-ci bot commented Nov 22, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Jooho

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

@Jooho
Copy link
Author

Jooho commented Nov 22, 2023

please do not merge this until everything is ready

@Jooho
Copy link
Author

Jooho commented Nov 24, 2023

another pr will be sent soon

@Jooho Jooho closed this Nov 24, 2023
Jooho pushed a commit to Jooho/kserve that referenced this pull request Feb 28, 2024
…tudio-purge-kserve-art-explainer-28

Red Hat Konflux purge kserve-art-explainer-28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants