Uploaded image for project: 'Bigtop'
  1. Bigtop
  2. BIGTOP-2543

Some minor problems on provisioner/docker/docker-hadoop.sh

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.0
    • Component/s: provisioner
    • Labels:
      None

      Description

      1. If there's no docker instance, docker-hadoop.sh --list shows docker-compose's help message.

      sekikn@ubuntu:~/bigtop/provisioner/docker$ docker ps
      CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
      sekikn@ubuntu:~/bigtop/provisioner/docker$ ./docker-hadoop.sh -l
      Define and run multi-container applications with Docker.
      
      Usage:
        docker-compose [-f=<arg>...] [options] [COMMAND] [ARGS...]
        docker-compose -h|--help
      
      Options:
        -f, --file FILE           Specify an alternate compose file (default: docker-compose.yml)
        -p, --project-name NAME   Specify an alternate project name (default: directory name)
        --x-networking            (EXPERIMENTAL) Use new Docker networking functionality.
                                  Requires Docker 1.9 or later.
        --x-network-driver DRIVER (EXPERIMENTAL) Specify a network driver (default: "bridge").
                                  Requires Docker 1.9 or later.
        --verbose                 Show more output
        -v, --version             Print version and exit
      
      (snip)
      

      2. docker-hadoop.sh --create seems to execute unnecessary docker cp command and displays a file-not-found warning.

      sekikn@ubuntu:~/bigtop/provisioner/docker$ ./docker-hadoop.sh -c 1
      
      (snip)
      
      lstat /home/sekikn/bigtop/provisioner/docker/centos: no such file or directory
      

      I think line 104 was accidentally copied from line 97.

       95 copy-to-instances() {
       96     for node in ${NODES[*]}; do
       97         docker cp  $1 $node:$2 &
       98     done
       99     wait
      100 }
      101 
      102 bootstrap() {
      103     for node in ${NODES[*]}; do
      104         docker cp  $1 $node:$2 &
      105         docker exec $node bash -c "/bigtop-home/bigtop-deploy/vm/utils/setup-env-$1.sh $2" &
      106     done
      107     wait
      108 }
      

      3. Its help message shows an option usage as --create=NUM_INSTANCES, but the equal should be removed (same as BIGTOP-2512).

      sekikn@ubuntu:~/bigtop/provisioner/docker$ ./docker-hadoop.sh --create=3
      Unknown argument: '--create=3'
      usage: docker-hadoop.sh [-C file ] args
             -C file                                   Use alternate file for config.yaml
        commands:
             -c NUM_INSTANCES, --create=NUM_INSTANCES  Create a Docker based Bigtop Hadoop cluster
      

        Activity

        Hide
        sekikn Kengo Seki added a comment -

        Attaching a patch.

        Show
        sekikn Kengo Seki added a comment - Attaching a patch.
        Hide
        cos Konstantin Boudnik added a comment -

        It looks good to me. Evans Ye, would you have a chance to take a look real quick? Shouldn't take much of your time Thanks!

        Show
        cos Konstantin Boudnik added a comment - It looks good to me. Evans Ye , would you have a chance to take a look real quick? Shouldn't take much of your time Thanks!
        Hide
        evans_ye Evans Ye added a comment -

        Patch looks great. Committed and pushed.
        Thanks Kengo Seki.

        Show
        evans_ye Evans Ye added a comment - Patch looks great. Committed and pushed. Thanks Kengo Seki .

          People

          • Assignee:
            sekikn Kengo Seki
            Reporter:
            sekikn Kengo Seki
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development