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

Allow setting the container when the pod has more than one container #149

Open
fabricebrito opened this issue May 17, 2023 · 2 comments
Open
Labels
bug Something isn't working

Comments

@fabricebrito
Copy link
Contributor

The env variable CALRISSIAN_POD_NAME allow discovering the volumes to mount on the spawned pods.

This is implemented in class KubernetesPodVolumeInspector on the assumption that there's a single container in that pod

python

def get_first_container(self):
        return self.pod.spec.containers[0]

When having more containers in the calrissian pod, this implementation breaks.

The proposed evolution in this issue is to allow defining the container name via env variable and get the container by name if that variable is set

@emmanuelmathot emmanuelmathot added the bug Something isn't working label Jun 19, 2023
@davidjsherman
Copy link

@fabricebrito I'm trying to understand the underlying use case here, since it seems obvious that CALRISSIAN_POD_NAME should always be the pod name as defined in the pod metadata, and never the name of a container in the spec.

The suggestion is that the env variable CALRISSIAN_POD_NAME (chosen by Python constant POD_NAME_ENV_VARIABLE) is used to retrieve mounted volume information, but I can't find any use of that variable, so I'm guessing that there are some workflows somewhere else that use this information. I'm guessing it's not for specifying a pod directory for use with kubectl, since that wouldn't use the container name but the pod name.

I am asking because we are considering whether to retrieve the pod name for inclusion in result provenance, and if CALRISSIAN_POD_NAME is not the pod name then we couldn't count on it.

@davidjsherman
Copy link

It seems that we aren't looking for a general mechanism for inspecting volumes, but for finding the specific volumes that play specific roles in Calrissian's pods. If that is true, wouldn't it be better to name the env variables by those roles, rather than making it necessary to infer the volumes from implicit rules in pod and container names?

For example, in our own templates for Calrissian job submission, we use specific parameters for CALRISSION_INPUT_VOLUME, CALRISSION_TEMP_VOLUME, and CALRISSION_OUTPUT_VOLUME.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants