Closed gustavosr98 closed 1 year ago
I managed to reproduce the issue with one of our notebook tests by following the steps outlined in this issue.
---------------------------------------------------------------------------
SignatureDoesNotMatch Traceback (most recent call last)
Cell In[6], line 2
1 try:
----> 2 mc.make_bucket(MINIO_BUCKET)
3 except BucketAlreadyOwnedByYou:
4 print(f"Bucket {MINIO_BUCKET} already exists!")
File /opt/conda/lib/python3.8/site-packages/minio/api.py:336, in Minio.make_bucket(self, bucket_name, location, object_lock)
332 dump_http(method, url, headers, response,
333 self._trace_output_stream)
335 if response.status != 200:
--> 336 raise ResponseError(response, method, bucket_name).get_exception()
338 self._set_bucket_region(bucket_name, region=location)
SignatureDoesNotMatch: SignatureDoesNotMatch: message: The request signature we calculated does not match the signature you provided.
Minimal instructions to reporoduce.
!env | grep AWS
AWS_SECRET_ACCESS_KEY=WRR7QTDXG32F11HU1BTBAZS3N8FOE3
AWS_ACCESS_KEY_ID=minio
juju config mlflow-minio secret-key=miniominio
juju run-action mlflow-server/0 get-minio-credentials --wait
unit-mlflow-server-0:
UnitId: mlflow-server/0
id: "22"
results:
access-key: minio
secret-access-key: miniominio
status: completed
timing:
completed: 2023-08-17 20:47:35 +0000 UTC
enqueued: 2023-08-17 20:47:32 +0000 UTC
started: 2023-08-17 20:47:33 +0000 UTC
AWS_SECRET_ACCESS_KEY=WRR7QTDXG32F11HU1BTBAZS3N8FOE3 # <<< should be miniominio
AWS_ACCESS_KEY_ID=minio
Looks like key is not updated in user's namespace secret. Should it be?
juju config mlflow-minio secret-key=miniominio
juju run-action mlflow-server/0 get-minio-credentials --wait
unit-mlflow-server-0:
UnitId: mlflow-server/0
id: "28"
results:
access-key: minio
secret-access-key: miniominio
status: completed
timing:
completed: 2023-08-17 20:58:51 +0000 UTC
enqueued: 2023-08-17 20:58:38 +0000 UTC
started: 2023-08-17 20:58:49 +0000 UTC
microk8s.kubectl -n admin get secret mlflow-server-minio-artifact -o=yaml
apiVersion: v1
data:
AWS_ACCESS_KEY_ID: bWluaW8=
AWS_SECRET_ACCESS_KEY: V1JSN1FURFhHMzJGMTFIVTFCVEJBWlMzTjhGT0Uz
kind: Secret
metadata:
annotations:
metacontroller.k8s.io/decorator-controller: kubeflow-resource-dispatcher-controller
metacontroller.k8s.io/last-applied-configuration: '{"apiVersion":"v1","kind":"Secret","metadata":{"annotations":{"metacontroller.k8s.io/decorator-controller":"kubeflow-resource-dispatcher-controller"},"name":"mlflow-server-minio-artifact","namespace":"admin"},"stringData":{"AWS_ACCESS_KEY_ID":"minio","AWS_SECRET_ACCESS_KEY":"WRR7QTDXG32F11HU1BTBAZS3N8FOE3"}}'
creationTimestamp: "2023-08-17T18:34:08Z"
name: mlflow-server-minio-artifact
namespace: admin
resourceVersion: "31235"
uid: 448cc9b7-17fb-4839-9772-c3b9ee2cc5fe
type: Opaque
After the updating key, the relation mlflow-server:secrets resource-dispatcher:secrets
contains updated key:
From jhack:
"AWS_ACCESS_KEY_…
"minio"
"AWS_SECRET_ACCES…
"miniominio"
Candidate for fix in 1.8
This is expected behavior let me explain:
Resource dispatcher is responsible for distributing manifests across the namespaces with specific label. It is also responsible for updating those manifests in case the relation with resource dispatcher changes. That is what is happening. If you mlflow kubeflow plus resource dispatcher and you change the password for minio in mlflow bundle. resource dispatcher will update manifests in target namespaces. Its demonstrated also in Ivan's comment as he is pointing that the relation changes.
The error you are describing is just related how mounted secrets in Kubernetes work. Because we mount secret as environment variable to user's notebook, the environment will not automatically change on secret change (the secret in namespace changed but the notebook environment not). In order to use new environment with new value you need to restart pod.
If we want to automatically change the environment secret we would need to somehow monitor for secret change (e.g. with vault sidecar injector https://www.hashicorp.com/blog/injecting-vault-secrets-into-kubernetes-pods-via-a-sidecar) for now its out of scope. I will close this issue for now .
Reopennig looks like locally I had metacontroller v3 which is not in 1.7 bundle for kubeflow (there is v2) . We downgraded the metacontroller to v2 because kubeflow-profile-controller had issues with v3. We need v3 for resource dispatcher to correctly update the manifests in user namespaces.
Fixed by updating kfp-profile-controller to use Decorator controller https://github.com/canonical/kfp-operators/pull/344 and then updating metacontroller to v3 https://github.com/canonical/metacontroller-operator/pull/94
Versions
Kubernetes platform: Microk8s (v1.24.16)
Juju Agents: 2.9.43 Juju CLI: 2.9.44-ubuntu-amd64
resource-dispatcher: edge (rev 78) Kubeflow: 1.7/stable MLFlow: 2.1/edge
Rest of charm versions visible on
juju status
Reproduce
The integration between mlflow and kubeflow notebooks was working for me until I decided to update mlflow-minio credentials
Logs
Now testing the S3 credentials on existing, as well as on new notebooks I would still be getting the old secre-key
I tried: A. Removing and adding secret relation, but still the same result
B. Removing the application and redeploying, but still the same result
I could not find any workaround to it so far The only thing I could do was rollback the secret-key change Which, I am not sure if it is intended but after re-setting to no value I got the same secret-key I had before changing its value