Testing the Container Setup

About this task

Test that the Memory Machine container is managing memory correctly with HugePages enabled.

Procedure

  1. Change to namespace injection.
    $ oc project injection
    $
  2. Create a test pod using the included configuration file single-pod-model-test.yaml:
    $ oc create -f deployment/single-pod-model-test.yaml
    $
  3. Attach the test pod:
    $ oc exec -it mm-single-model-test-container -- bash
    $
  4. Check Memory Machine container usage:
    $ oc get pods -o wide
    NAME                 READY STATUS  RESTARTS AGE IP NODE                            NOMINATED NODE READINESS GATES 
    memory-machine-4bh5m 1/1   Running 0        18h 10.0.0.214 osc-5k68w-worker-9c42p  <none>         <none> 
    memory-machine-kjxpw 1/1   Running 0        18h 10.0.0.215 osc-5k68w-worker-jvd4p  <none>         <none> 
    memory-machine-lmpk8 1/1   Running 0        18h 10.0.0.216 osc-5k68w-worker-7c4g5  <none>         <none> 
    mm-single-model-test-container 1/1 Running 0 18h 10.0.0.215 osc-5k68w-worker-jvd4p <none>         <none>
    $
  5. Note the node on which the mm-single-model-test-container is running. In this case, the node is osc-5k68w-worker-jvd4p.
  6. Note the pod in which the Memory Machine memory manager is running. In this case, the pod associated with node osc-5k68w-worker-jvd4p is memory-machine-kjxpw.
  7. List the memory manager container on the current node. For this example:
    $ oc exec -it memory-machine-kjxpw -- mvmcli container list \
      -s /tmp/memverge/dpme_daemon.0
    Pod Namespace Pod Name                       Pod IP     Node Name              Date Started             Command 
    ----------------------------------------------------------------------------------------------------------------------------------- 
    injection     mm-single-model-test-container 10.0.0.215 osc-5k68w-worker-jvd4p Wed Apr 21 01:02:46 2021 sleep
    $
  8. Show the PMEM used by the memory manager container on the current node. For this example:
    $ oc exec -it memory-machine-kjxpw -- mvmcli show-usage -s /tmp/memverge/dpme_daemon.0
    PMEM Usage: 
    Total Dax 17177772032, Used Dax 12582912, License capacity 9895604649984 
    Managed DRAM(MiB): Total 0.00, Used 0.00 (0.00) 
    Managed PMEM(MiB): Total 16382.00, Used 12.00 (0.07) 
    License capacity (MiB): 9437184.00
    $

    The PMEM used on the memory manager is 12MiB, indicating that it is managing 8MiB more than the initially allocated 4MiB.

  9. Clean up the test environment using the supplied scripts:
    1. Clean up the Memory Machine daemonSet, related resources, and test pod:
      $ scripts/clean_single_pod.sh
      $
    2. Clean up the webhook and related resources:
      $ ./scripts/clean_webhook.sh
      $