How to use HTC Mock?

HTC Mock is a test tool for ArmoniK. It is used to generate tasks that will be run by ArmoniK. It provides a lot of options to personalize the tasks.

HTC Mock is used in CI to test ArmoniK automatically but it can also be used in development to generate realistic tasks.

Please make sure your version of Core is the same as HTC Mock's. If you use different versions, the test will fail. Please refer to the Default images page for more information on how to correctly set up.

To populate the database, you can also use scripts. See Populate database

Use it

HTC Mock is a development or test tool. It is not intended to be used in production.
shell
docker run --rm \
            -e HtcMock__NTasks=100 \
            -e HtcMock__TotalCalculationTime=00:00:00.100 \
            -e HtcMock__DataSize=1 \
            -e HtcMock__MemorySize=1 \
            -e HtcMock__EnableFastCompute=true \
            -e HtcMock__SubTasksLevels=1 \
            -e HtcMock__Partition=htcmock \
            -e GrpcClient__Endpoint=http://<ip>:5001 \
             dockerhubaneo/armonik_core_htcmock_test_client:<armonik_version_core>

Remember to replace <ip> with the IP of your machine or the IP of the machine where ArmoniK is deployed.

Remember to replace <armonik_version_core> with the current core version

Options

They must be prefixed by HtcMock__ and can be passed as environment variables or as command line arguments.

NameDescriptionDefault value
NTasksNumber of computing tasks (there are some supplementary aggregation tasks)100
TotalCalculationTimeTotal computation time for the computing tasks100ms
DataSizeSize of the task outputs1
MemorySizeSize of the memory used by the task during its execution1
SubTasksLevelsNumber of sub tasks levels.4
EnableFastComputeWhether the computing tasks will take the time parameter into consideration. Always used to generate the graph of task dependencies.true
EnableUseLowMemWhether the computing tasks will take the memory usage parameter into consideration. Always used to generate the graph of task dependencies.true
EnableSmallOutputWhether the computing tasks will take the output size parameter into consideration. Always used to generate the graph of task dependencies.true
TaskRpcExceptionRaise RpcException when task id ends by this string, ignored if empty stringstring.Empty
TaskErrorFinish task with Output when task id ends by this string, ignored if empty stringstring.Empty
PartitionPartition in which to submit the tasksstring.Empty
Table of Contents