-
Notifications
You must be signed in to change notification settings - Fork 108
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
argocd kcl plugin rendering is slow and file.modpath is cached by different kcl modules #1421
Comments
Hello @riven-blade I've updated the package cache path to /tmp in this PR kcl-lang/kcl-lang.io#390 you can refer it to update the plugin config. Thanks for the feedback. |
@riven-blade Your configuration seems to rely on external packages, but it doesn't seem to have placed the cache in the corresponding location. Have you changed the configuration of argocd kcl plugin and restarted argocd? |
Yes, I changed the cache and pkg paths according to the issuer, and restarted argocd |
Can you set this environment variable locally, run this configuration repeatedly locally, and tell me the time cost and show the |
I have some ideas. I distinguish the stored files and pkg according to the angocd application. Each application is assigned a stored file, so that it should be able to be installed. |
export KCL_CACHE_PATH="/tmp/kcl_cache.${ARGOCD_APP_NAME}.${ARGOCD_APP_NAMESPACE}"
export KCL_PKG_PATH="/tmp/kcl_pkg.${ARGOCD_APP_NAME}.${ARGOCD_APP_NAMESPACE}"
create_dir_if_not_exists() {
local dir_path=$1
if [ ! -d "$dir_path" ]; then
mkdir -p "$dir_path"
fi
}
create_dir_if_not_exists "$KCL_CACHE_PATH"
create_dir_if_not_exists "$KCL_PKG_PATH" |
Failed to load target state: failed to generate manifest for source 1 of 1: rpc error: code = Unknown desc = Manifest generation error (cached): plugin sidecar failed. error generating manifests in cmp: rpc error: code = Unknown desc = error generating manifests: The yaml file is referenced in the code, and the cache server has an absolute path. |
|
Hello, you can use the import file
base: tiangong.App {
configMap = {"application-config.yaml": file.modpath() + "datastore/staging/application-config.yaml"}
secret = {"application-secret.yaml": file.modpath() + "datastore/staging/application-secret.yaml"}
} |
@riven-blade KCL caches external dependency package code and compilation cache, both of which are recorded in relative paths. If you are a custom YAML configuration file, please ensure that it exists within kcl. mod and use a path relative to kcl. mod in the code to read it. For example. import file
base: tiangong.App {
configMap = {"application-config.yaml": file.modpath() + "datastore/staging/application-config.yaml"}
secret = {"application-secret.yaml": file.modpath() + "datastore/staging/application-secret.yaml"}
} |
Hello @riven-blade The |
General Question
argo logs
time="2024-06-19T05:40:54Z" level=info msg="finished streaming call with code OK" grpc.code=OK grpc.method=GenerateManifest grpc.service=plugin.ConfigManagementPluginService grpc.start_time="2024-06-19T05:40:41Z" grpc.time_ms=13448.232 span.kind=server system=grpc
time="2024-06-19T05:41:36Z" level=info msg="finished streaming call with code OK" grpc.code=OK grpc.method=MatchRepository grpc.service=plugin.ConfigManagementPluginService grpc.start_time="2024-06-19T05:41:23Z" grpc.time_ms=13530.473 span.kind=server system=grpc
time="2024-06-19T05:41:50Z" level=info msg="finished streaming call with code OK" grpc.code=OK grpc.method=GetParametersAnnouncement grpc.service=plugin.ConfigManagementPluginService grpc.start_time="2024-06-19T05:41:36Z" grpc.time_ms=13499.884 span.kind=server system=grpc
Plug-in configuration
images: kcllang/kcllang-cmp-plugin
shell
The text was updated successfully, but these errors were encountered: