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

Predictive Unit/Deployment Environment Variables not set by operator #1449

Closed
axsaucedo opened this issue Feb 16, 2020 · 5 comments · Fixed by #1491
Closed

Predictive Unit/Deployment Environment Variables not set by operator #1449

axsaucedo opened this issue Feb 16, 2020 · 5 comments · Fixed by #1491
Assignees
Labels
Milestone

Comments

@axsaucedo
Copy link
Contributor

axsaucedo commented Feb 16, 2020

Currently there are three parameters which should be set by the operator but are not being set, including:

  • PREDICTIVE_UNIT_ID
  • PREDICTOR_ID
  • SELDON_DEPLOYMENT_ID

These three seem are only set if the environment variable for the PREDICTIVE_UNIT_SERVICE_PORT is not set, as per:

if !utils.HasEnvVar(con.Env, machinelearningv1.ENV_PREDICTIVE_UNIT_SERVICE_PORT) {
con.Env = append(con.Env, []corev1.EnvVar{
corev1.EnvVar{Name: machinelearningv1.ENV_PREDICTIVE_UNIT_SERVICE_PORT, Value: strconv.Itoa(int(portNum))},
corev1.EnvVar{Name: machinelearningv1.ENV_PREDICTIVE_UNIT_ID, Value: con.Name},
corev1.EnvVar{Name: machinelearningv1.ENV_PREDICTOR_ID, Value: p.Name},
corev1.EnvVar{Name: machinelearningv1.ENV_SELDON_DEPLOYMENT_ID, Value: mlDep.ObjectMeta.Name},
}...)
}

These three environment variables would be useful to have within the container even when the port is not set, so would be good to move those out from the if statement.

However it would be important to understnad whether there is a historical reason why this was set, and whether removing it could cause issues.

@axsaucedo axsaucedo added the bug label Feb 16, 2020
@ukclivecox
Copy link
Contributor

I imagine they are always set as this seems to be the only place that sets them. Do you have an example where they are not set?

However, its probably safe to always set them see I can't the user wanting to override them.

@axsaucedo
Copy link
Contributor Author

Oh that's a good point, yeah you're right, if the user already set them we wouldn't want to override them. Yeah the example I have is the Streaming one, but the main reason is because I actually set PREDICTIVE_UNIT_SERVICE_PORT, however I still require these three variables to be set by the operator - is there a reason why these three variables are only set if the PORT env is not specificed? Otherwise it would be good to still set them (unless as you say it has been previously overridden)

@ukclivecox
Copy link
Contributor

OK. I don't think we had a use case where the user sets PREDICTIVE_UNIT_SERVICE_PORT rather than the Operator doing it. I would suggest ensuring the Operator can't set the value itself - you can always set the port in the graph spec - see Tensorflow example in procotol_examples notebook.

I would suggest a change where we always set the other 3 envs and maybe check for the PREDICTIVE_UNIT_SERVICE_PORT if we think its really useful that a user could set it different from the port value in the graph - otherwise we should always set it.

@axsaucedo
Copy link
Contributor Author

Sounds perfect, I think both suggestions make sense. Setting the other 3 env vars whilst still taking into account overrides would be useful. I actually didn't know you could set the port on the graph, but that makes more sense.

@axsaucedo
Copy link
Contributor Author

One more thing to note (and perhaps something to discuss further) is that for the batch PR I had to also add another environment variable called PREDICTIVE_UNIT_SERVICE_HOST as it's necessary to provide the host to which the streaming service will be connecting. However now that you mention it it may make more sense to introduce a new environment variable as this would not be a service host, but more of a data source.

@ukclivecox ukclivecox added this to the 1.1 milestone Feb 20, 2020
seldondev added a commit that referenced this issue Mar 3, 2020
Always set variables for predictive unit and deployment identifiers [Fixes #1449]
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants