From 3.4.2 to 3.5.0

Summary

Optimization Server 3.5.0 introduces deprecations in:

Optimization Server 3.5.0 introduces breaking change in:

  • Helm chart values file

Worker (Java)

See this page for more details.

Get inputs

The usual way to get an input parameter in you task is using Parameter object:

void execute(Parameter inputs, Parameter outputs, ExecutionContext context) {
    byte[] inputData = inputs.get("inputName");
}

This method has been deprecated due to a high memory usage with large inputs. Now you can read your input data through a Java InputStream:

void execute(Parameter inputs, Parameter outputs, ExecutionContext context) {
    ParameterData parameterData = context.getInputData("inputName");
    try (InputStream inputStream = parameterData.open()) {
        //Load your data with "inputStream" object
    }
}

For small inputs, you can also use parameterData.loadAsString() or parameterData.loadAsBytes(). You can check which input parameters are available using context.getInputNames() and context.containsInput().

Save outputs

The usual way to save an output parameter in you task is using Parameter object:

void execute(Parameter inputs, Parameter outputs, ExecutionContext context) {
    inputs.emit("inputName", "value".getBytes());
}

This method has been deprecated due to a high memory usage with large inputs. Now you can save your output data through a Java InputStream:

void execute(Parameter inputs, Parameter outputs, ExecutionContext context) {
    InputStream result = ...;
    context.notifyOutput("outputName", ParameterData.of(result));
}

If it is more convenient, you can write the data to an OutputStream:

void execute(Parameter inputs, Parameter outputs, ExecutionContext context) {
    context.notifyOutput("outputName", ParameterData.of(outputStream -> {
        //Write the result into "outputStream" object
    }));
}

For small outputs, you can also use ParameterData.of(String) or ParameterData.of(byte[]).

Helm charts

The syntax for declaring root hostname and image pull secrets in values file has changed.

3.4.1:

global:
  domain: mydomain.com
  image:
    imagePullSecrets:
      - name: docker-registry.decisionbrain.loc-secret

3.5.0:

global:
  host: mydomain.com
  image:
    imagePullSecrets:
      - docker-registry.decisionbrain.loc-secret

The properties are migrated by calling the Python helper script. Make sure the output file complies with the description of the example above.