3.4.1 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

Development of applications

Library Backward compatibility Deprecations
Master API client Backward compatible
Worker (Java) Backward compatible Deprecations
Worker (Python) Backward compatible

Deployment of Optimization Server

Chart Backward compatibility Deprecations
dbos-volume Break changes: adjust code
dbos-secrets Break changes: adjust code
dbos-infra Break changes: adjust code
dbos Break changes: adjust code
cplex Break changes: adjust code
wod Break changes: adjust code

Worker (Java)

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 image pull secrets in values file has changed.

3.4.1:

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

3.5.0:

global:
  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.