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

cOdiglet to use criwrapper to create ic #2015

Merged

Conversation

tamirdavid1
Copy link
Collaborator

No description provided.

@tamirdavid1 tamirdavid1 force-pushed the odiglet-to-use-criwrapper-to-create-ic branch from 298dd4b to 613ebf4 Compare December 16, 2024 15:27
@tamirdavid1 tamirdavid1 force-pushed the odiglet-to-use-criwrapper-to-create-ic branch from 7311ce9 to b2978f7 Compare December 17, 2024 07:22
runtimeDetailsByContainer:
description: Capture Runtime Details for the workloads that this CR
applies to.
items:
properties:
containerName:
type: string
criErrorMessage:
Copy link
Contributor

Choose a reason for hiding this comment

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

isnt status a better place for error messages instead of spec?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

potentially could be some error on specific container, we will have to verify this before instrumenting a container from the webhook

for _, endpoint := range defaultRuntimeEndpoints {
rc.Logger.Info("Attempting to connect to CRI runtime", "endpoint", endpoint)

rc.conn, err = grpc.NewClient(
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure this is actually trying to connect and not just creating a client?
Few thoughts:

  • As only one of the default Endpoints will respond - maybe worth putting a timeout when opening a connection as some of them will just time out so we can bail quickly
  • I think the CRI implementation is part of the container id in Kubernetes maybe we can use that (for example getting the container id of the current Odiglet Pod) and connector only to the right one instead of trying all the options

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

  1. I Warp it up as a Connect() - The function’s primary purpose is to connect to the CRI runtime, which it achieves by establishing and validating a gRPC connection.

I change the logic so it will try to find the unix domain socket in the FS so we wont need to iterate over them and try to connect to each one of them

}

// Check if status is already set
if len(currentConfig.Status.RuntimeDetailsByContainer) != 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not update always? This means only the first Odiglet that runs this wins, so we will not update the value if the user changed the docker image?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

correct, it wont work with cases where user changed the value exists in Dockerfile.
we design this solution with this gap in mind

@tamirdavid1 tamirdavid1 force-pushed the odiglet-to-use-criwrapper-to-create-ic branch from 71831ff to 1c14d62 Compare December 22, 2024 09:51
api/odigos/v1alpha1/instrumentedapplication_types.go Outdated Show resolved Hide resolved
api/odigos/v1alpha1/instrumentedapplication_types.go Outdated Show resolved Hide resolved
k8sutils/pkg/cri/criwrapper.go Outdated Show resolved Hide resolved
k8sutils/pkg/cri/criwrapper.go Show resolved Hide resolved
k8sutils/pkg/cri/criwrapper.go Outdated Show resolved Hide resolved
api/odigos/v1alpha1/instrumentedapplication_types.go Outdated Show resolved Hide resolved
api/odigos/v1alpha1/instrumentedapplication_types.go Outdated Show resolved Hide resolved
@tamirdavid1 tamirdavid1 force-pushed the odiglet-to-use-criwrapper-to-create-ic branch from ca8cee9 to 05e1f53 Compare December 23, 2024 11:51
@tamirdavid1 tamirdavid1 force-pushed the odiglet-to-use-criwrapper-to-create-ic branch from 975c7f3 to c679274 Compare December 23, 2024 11:59
@tamirdavid1 tamirdavid1 force-pushed the odiglet-to-use-criwrapper-to-create-ic branch from abdb8d1 to 717dfb7 Compare December 23, 2024 12:04
@tamirdavid1 tamirdavid1 force-pushed the odiglet-to-use-criwrapper-to-create-ic branch from 7acfbac to bd9bf89 Compare December 25, 2024 08:15
k8sutils/pkg/cri/criwrapper.go Outdated Show resolved Hide resolved
k8sutils/pkg/cri/criwrapper.go Outdated Show resolved Hide resolved
@tamirdavid1 tamirdavid1 force-pushed the odiglet-to-use-criwrapper-to-create-ic branch from bb3f5ef to 80737f1 Compare December 26, 2024 12:23
@tamirdavid1 tamirdavid1 merged commit 3f20124 into odigos-io:main Dec 26, 2024
32 checks passed
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.

4 participants