ankaios icon indicating copy to clipboard operation
ankaios copied to clipboard

Unable to request whole CompleteState via the ControlInterface

Open inf17101 opened this issue 6 months ago • 3 comments

Currently, it is not possible to fetch the whole CompleteState over the ControlInterface. On the workload site the empty CompleteState is received (workloads: None, workloadStates: None). Only parts of the CompleteState can be requested when the user sets an appropriate filter mask.

Current Behavior

Empty CompleteState received over the ControlInterface when requesting the whole CompleteState.

Expected Behavior

A workload shall be able to receive the whole CompleteState shall be received over the ControlInterface.

Steps to Reproduce

  1. Navigate to the control interface example folder inside the repository: cd examples
  2. Modify the create_request_for_complete_state function body inside the python_control_interface example (adjust the filterMask to include the desiredState):
    return control_api.ToAnkaios(
        request=ank_base.Request(
            completeStateRequest=ank_base.CompleteStateRequest(
                fieldMask=["desiredState", "workloadStates"] # <-- the filter mask you must change to this
            ),
            requestId=REQUEST_ID,
        )
    )
  1. Change the permissions of the startConfig.yaml file to allow the workload to request the whole CompleteState:
...
        - type: StateRule
          operation: Read
          filterMask:
            - "*" # change to wildcard to allow full read access
...
  1. Run the example: ANK_BIN_DIR=/workspaces/ankaios/target/x86_64-unknown-linux-musl/debug ./run_example.sh python_control_interface
  2. Check the log output of the workload:
podman logs -f $(podman ps -a | grep control_interface | awk '{print $1}')

You should see an empty CompleteState: image

Context (Environment)

Release v0.4.0 Linux All Control Interface examples and all workloads requesting the whole CompleteState over the Control Interface are affected

Logs

After checking the server logs (tail -f /tmp/ankaios-server.log) there is an issue with the tagging when using flatten and enums: image

Like in the picture the error string is a serde_yaml conversion error untagged and internally tagged enums do not support enum input

Additional Information

Final result

To be filled by the one closing the issue.

inf17101 avatar Aug 13 '24 10:08 inf17101