Closed droctothorpe closed 1 day ago
@HumairAK to recreate the edge case:
ARGO_ARCHIVE_LOGS=true
in configs.ts
.cd
into the frontend
directory.NAMESPACE=kubeflow npm run start:proxy-and-server
to start the UI on your host machine.kubeflow
namespace:
metadata:
annotations:
workflows.argoproj.io/default-artifact-repository: artifact-repositories
name: artifact-repositories
namespace: kubeflow
data:
artifact-repositories: |-
archiveLogs: true
s3:
accessKeySecret:
key: accesskey
name: mlpipeline-minio-artifact
bucket: mlpipeline
endpoint: minio-service.kubeflow:9000
insecure: true
keyFormat: foo
secretKeySecret:
key: secretkey
name: mlpipeline-minio-artifact
kind: ConfigMap
minio
, password: minio123
).mlpipeline/foo
rather than the default keyFormat specified in configs.ts
. Argo grants precedence to the keyFormat
specified in the artifact-repositories
configmap over the keyFormat
specified in workflow-controller-configmap
. I updated the instructions to reproduce to edge case to make manual validation a lot easier by running the UI on your host machine.
Hey @droctothorpe /@quinnovator, thanks for this. I'm trying this out now and encountering some hiccups. I suspect it might be my environment/setup, but I want to confirm with you first.
the UI yaml is as posted below:
And the artifact repository configmap:
kind: ConfigMap
apiVersion: v1
metadata:
name: artifact-repositories
namespace: kubeflow
# edit: forgot to add this
annotations:
workflows.argoproj.io/default-artifact-repository: artifact-repositories
data:
artifact-repositories: |-
archiveLogs: true
s3:
accessKeySecret:
key: accesskey
name: mlpipeline-minio-artifact
bucket: mlpipeline
endpoint: minio-service.kubeflow:9000
insecure: true
keyFormat: custom_location/{{workflow.name}}/{{workflow.creationTimestamp.Y}}/{{workflow.creationTimestamp.m}}/{{workflow.creationTimestamp.d}}/{{pod.name}}
secretKeySecret:
key: secretkey
name: mlpipeline-minio-artifact
As you can see I have set ARGO_ARTIFACT_REPOSITORIES_LOOKUP
and ARGO_ARCHIVE_LOGS
to true
. I can also confirm it's got the PR changes by viewing the UI pod container logs, the UI config has:
{
argo: {
archiveArtifactory: 'minio',
archiveBucketName: 'mlpipeline',
archiveLogs: true,
keyFormat: 'artifacts/{{workflow.name}}/{{workflow.creationTimestamp.Y}}/{{workflow.creationTimestamp.m}}/{{workflow.creationTimestamp.d}}/{{pod.name}}',
artifactRepositoriesLookup: true
^^^^^ PR change
The pipeline used:
So question for you:
Thank you so much for taking the time to validate this, @HumairAK, and for being so thorough with documenting the issue that you encountered.
I'm going to try a couple of things to see if I can repro your results:
NAMESPACE=kubeflow npm run start:proxy-and-server
), validate that I can toggle between multiple tasks.I think I see the problem. I did a comparison of the two configmaps:
Your configmap is missing the workflows.argoproj.io/default-artifact-repository: artifact-repositories
annotation. From the AWF documentation:
Can you run the same test but make sure to include that annotation in your configmap?
Thank you! 🙏
Ah yeah I actually did include the annotation, when trying to prune the configmap of runtime information for the github post, I accidentally left it out.
I see that in your configmap your path is set to keyFormat: foo
which makes it seem like it will just overwrite the main.log
for each task, but in your (1) and (2), the logs are different. So I'm wondering if you cleaned up the underlying Workflows for those tests? With the given configmap I would have expected the logs view to show the same logs.
Confirming that the workflows were deleted.
I see that in your configmap your path is set to
keyFormat: foo
which makes it seem like it will just overwrite themain.log
for each task, but in your (1) and (2), the logs are different. With the given configmap I would have expected the logs view to show the same logs.
I actually had the keyFormat
field in my configmap set to foo/artifacts/{{workflow.name}}/{{workflow.creationTimestamp.Y}}/{{workflow.creationTimestamp.m}}/{{workflow.creationTimestamp.d}}/{{pod.name}}
from an earlier test where I wanted to confirm that the string replacement was happening properly. That's why the logs were different.
I changed keyFormat
to a static string ("foo") to see what happens. Confirming that the logs are in fact identical for differing components in that scenario.
I'm still unable to repro the failure scenario. I'll try to build and deploy the image instead of running it on the host next.
AHA found the reason:
k8serr:Could not get configMap artifact-repositories in namespace kubeflow: configmaps "artifact-repositories" is forbidden: User "system:serviceaccount:kubeflow:ml-pipeline-ui" cannot get resource "configmaps" in API group "" in the namespace "kubeflow", additional info: [object Object]
we'll need to update the mlpipeline ui role for this
and we should probably surface this error so it's easier to find next time
/lgtm /approve
let me retry running the ci
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: HumairAK
The full list of commands accepted by this bot can be found here.
The pull request process is described here
@droctothorpe are you guys willing to provide some supplementing docs for this functionality? I'm thinking https://www.kubeflow.org/docs/components/pipelines/operator-guides/ here makes the most sense
Thanks for the review and merge, @HumairAK! Happy to add some supplemental docs. Would you prefer for it to be in a standalone page or appended to https://www.kubeflow.org/docs/components/pipelines/operator-guides/configure-object-store/?
I think we can create a standalone page on logging. Especially since we're planning future work on that front, there will probably be more to add later. WDYT?
Description of your changes:
Argo Workflows supports the ability to specify an artifact repository for archived logs uniquely for each namespace rather than just globally as documented here.
This PR adds support for this functionality to the KFP UI. If a workflow runs and...
artifact-repositories
configmap in the target namespace that provides a unique, namespacedkeyFormat
...this PR ensures that logs are still accessible in the UI. This functionality is disabled by default to avoid unnecessary network calls (for end users who don't leverage namespace-specific
artifact-repositories
). It can be toggled on throughconfigs.ts
or an environment variable.Co-authored with @quinnovator 🌟 .
Fixes: https://github.com/kubeflow/pipelines/issues/11339
Checklist: