-
Notifications
You must be signed in to change notification settings - Fork 178
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
RFC: Enhance Environment Variable support #303
Comments
IIRC, we discussed this sometime back @adrianchiris. Any comments? |
Hi @amorenoz indeed i remember ! with device info spec landing, this information (Some of this ?) may be expoesd thorugh downward API ? |
Sure, no rush @adrianchiris. The way I came to remember this issue was while coding the vDPA support: |
Hi @amorenoz, Im thinking of a different approach, instead of having the information exposed across multiple environment variables per allocated device, have a single extendable environment variable per allocated device with all the information from the different info providers as json format. As a side effect This would also make query of device information for a specific device from within the container fairly easy. So, if i take your example above and apply this approach we would have:
We can make this as consistent as possible with device-info-spec so later maybe DeviceInfoProviders may be used in the creation of the file (today it is stated that the goal of the interface is to retrieve Device Plugin API specific information).
The maps from the various providers will be merged to a single map ensuring uniqueness of top level keys in |
I agree, that's a cleaner approach. I thought this kind of approach was out of the table, maybe because it was considered in the initial device-info-spec discussion days. If this is an option, I'd say, keep the json device-info-spec compliant to avoid confusion and work towards API unification. If we go down this road, I would try tu unify the sources of such information and use the |
I must have missed the notification for your reply here Adrian. In regards to:
Im probably missing some history here with past discussions about extending environment variables created by device plugin. |
This was discussed in today's community meeting. There is agreement to expose extended information via environment variables as this RFC proposes. |
The Device Plugin API allows Device Plugins to set any number of environment variables.
Currently, the SR-IOV Network Device Plugin uses this API to set the following ENV var per allocation call:
EnvName: "PCIDEVICE_${resourceNamePrefix}_${resourceName}",
EnvValue: Comma-separated list of PCI Addresses of the allocated resources
This approach can be considered to limit extensibility (more information cannot be easily added without overcomplicating the EnvValue) and flexibility (only PCIDEVICEs can be exposed).
I'd like to raise the question of: Can this mechanism be improved to allow more/different information to be added to the Pod through this mechanism?
An example proposal
As a discussion-trigger I'll put forward a possible enhancement (assuming #281 gets merged):
resourceServer
adds the current key-value to the response message by using thedeviceID
, which is the PCI Address. So backwards compatibility is ensured.DeviceInfoProvider
API is changed so that GetEnvVal returns a map (map[string] string
of EnvName - EnvValue)DeviceInfoProvider
can add ENV variables.pciAddress
gets appended or prepended to the ENV names of the InfoProvider (e.g: byPciDevice.GetEnvVal()
or by 'resourcePool.GetEnvs()')resourceServer
adds all the key-values to the AllocateResponse message.The result on an allocate call with two devices the result would be something like:
(The values of each Info Provider are just examples to show the point)
Does it make sense to consider something like this?
The text was updated successfully, but these errors were encountered: