github.com/ssdev-go/moby@v17.12.1-ce-rc2+incompatible/hack/integration-cli-on-swarm/README.md (about)

     1  # Integration Testing on Swarm
     2  
     3  IT on Swarm allows you to execute integration test in parallel across a Docker Swarm cluster
     4  
     5  ## Architecture
     6  
     7  ### Master service
     8  
     9    - Works as a funker caller
    10    - Calls a worker funker (`-worker-service`) with a chunk of `-check.f` filter strings (passed as a file via `-input` flag, typically `/mnt/input`)
    11  
    12  ### Worker service
    13  
    14    - Works as a funker callee
    15    - Executes an equivalent of `TESTFLAGS=-check.f TestFoo|TestBar|TestBaz ... make test-integration` using the bind-mounted API socket (`docker.sock`)
    16  
    17  ### Client
    18  
    19    - Controls master and workers via `docker stack`
    20    - No need to have a local daemon
    21  
    22  Typically, the master and workers are supposed to be running on a cloud environment,
    23  while the client is supposed to be running on a laptop, e.g. Docker for Mac/Windows.
    24  
    25  ## Requirement
    26  
    27    - Docker daemon 1.13 or later
    28    - Private registry for distributed execution with multiple nodes
    29  
    30  ## Usage
    31  
    32  ### Step 1: Prepare images
    33  
    34      $ make build-integration-cli-on-swarm
    35  
    36  Following environment variables are known to work in this step:
    37  
    38   - `BUILDFLAGS`
    39   - `DOCKER_INCREMENTAL_BINARY`
    40  
    41  Note: during the transition into Moby Project, you might need to create a symbolic link `$GOPATH/src/github.com/docker/docker` to `$GOPATH/src/github.com/moby/moby`. 
    42  
    43  ### Step 2: Execute tests
    44  
    45      $ ./hack/integration-cli-on-swarm/integration-cli-on-swarm -replicas 40 -push-worker-image YOUR_REGISTRY.EXAMPLE.COM/integration-cli-worker:latest 
    46  
    47  Following environment variables are known to work in this step:
    48  
    49   - `DOCKER_GRAPHDRIVER`
    50   - `DOCKER_EXPERIMENTAL`
    51  
    52  #### Flags
    53  
    54  Basic flags:
    55  
    56   - `-replicas N`: the number of worker service replicas. i.e. degree of parallelism.
    57   - `-chunks N`: the number of chunks. By default, `chunks` == `replicas`.
    58   - `-push-worker-image REGISTRY/IMAGE:TAG`: push the worker image to the registry. Note that if you have only single node and hence you do not need a private registry, you do not need to specify `-push-worker-image`.
    59  
    60  Experimental flags for mitigating makespan nonuniformity:
    61  
    62   - `-shuffle`: Shuffle the test filter strings
    63  
    64  Flags for debugging IT on Swarm itself:
    65  
    66   - `-rand-seed N`: the random seed. This flag is useful for deterministic replaying. By default(0), the timestamp is used.
    67   - `-filters-file FILE`: the file contains `-check.f` strings. By default, the file is automatically generated.
    68   - `-dry-run`: skip the actual workload
    69   - `keep-executor`: do not auto-remove executor containers, which is used for running privileged programs on Swarm