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

WIP: feat: add minio cache #521

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

aghilish
Copy link

Closes #464
This pull request enables using minio backend as s3 cache alternative.

πŸ“‘ Description

βœ… Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

β„Ή Additional Information

Signed-off-by: Shahrooz Aghili <[email protected]>
@aghilish aghilish requested review from a team as code owners September 30, 2024 10:38
@aghilish
Copy link
Author

@arbreezy Hi,

As an edge case when I use bedrock as the AI provider, client config can not pick up the minio access key and credentials from the cache secret and keeps using the aws_access_key_id and aws_secret_access_key.

please see Minio section in the README to quickly reproduce the issue.

@aghilish aghilish changed the title WIP: feat: add minio cache #464 WIP: feat: add minio cache Sep 30, 2024
@@ -266,8 +266,15 @@ func GetDeployment(config v1alpha1.K8sGPT, outOfClusterMode bool, c client.Clien
addRemoteCacheEnvVar("AZURE_TENANT_ID", "azure_tenant_id")
addRemoteCacheEnvVar("AZURE_CLIENT_SECRET", "azure_client_secret")
} else if config.Spec.RemoteCache.S3 != nil {
addRemoteCacheEnvVar("AWS_ACCESS_KEY_ID", "aws_access_key_id")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need different env variables although we are using the same aws client, in theory this shouldn't matter if it's s3 native or minio?

@arbreezy
Copy link
Member

@arbreezy Hi,

As an edge case when I use bedrock as the AI provider, client config can not pick up the minio access key and credentials from the cache secret and keeps using the aws_access_key_id and aws_secret_access_key.

please see Minio section in the README to quickly reproduce the issue.

Good shout,

this happens cause we override the same env variable with the bedrock's secret key which is added later thus overwriting the cache's secret.

I think the options are a) we initialise a minio native client b) we use profiles with the latter we need to create files IIRC

@arbreezy
Copy link
Member

I think we should adress the AWS env variables in another PR. The issue exists with s3 as remote cache + bedrock.

@aghilish you will have to add the updated CRD in helm templates too

if config.Spec.RemoteCache.S3.Endpoint != "" {
// MinIO
addRemoteCacheEnvVar("MINIO_ACCESS_KEY", "minio_access_key")
addRemoteCacheEnvVar("MINIO_SECRET_KEY", "minio_secret_key")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using the aws s3 client on the k8sgpt side so those secret names won't get picked, up I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Add minio remote cache support in the operator
2 participants