Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

METRON-1349 Full Dev Builds Metron Twice #866

Closed
wants to merge 1 commit into from

Conversation

nickwallen
Copy link
Contributor

@nickwallen nickwallen commented Dec 13, 2017

Removing the "Quick Dev" environment in #852 had an unintended side effect. It caused Metron to be built twice during the Full Dev deployment process. Unless you prefer a double-build for thoroughness, this can be annoying.

Testing

Deploy Full Dev and ensure that Metron is not build twice. Once Metron is deployed, login to Ambari and run the Metron Service Check. If the service check passes, we've done a solid.

More detailed steps might look like this.

  1. Clear out the old logs and launch Full Dev.

    cd metron-deployment/vagrant/full-dev-platform
    rm ansible.log
    vagrant up
    
  2. Ensure that Metron was built only once. There should be only one record each for "Build Metron" and "Build Metron RPMs".

    $ grep "Build Metron" ansible.log
    2017-12-13 10:06:56,040 p=4688 u=nallen |  TASK [metron-builder : Build Metron] *******************************************
    2017-12-13 10:12:19,838 p=4688 u=nallen |  TASK [metron-builder : Build Metron RPMs] **************************************
    

yum: name=epel-release update_cache=yes


yum: name=epel-release
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to force a cache update here. This role gets run repetitively and forcing a cache update just slows us down.

wait_for :
host: "{{ ambari_host }}"
port: "{{ ambari_port }}"
delay: 120
timeout: 300
timeout: 600
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to always wait 2 minutes for Ambari to be ready. Most often it is already up and kicking by the time we get here. Rather than have a forced delay, I just added the delay duration to the overall timeout parameter in case there is a delay in getting Ambari going.

become: true
roles:
- { role: ambari_slave }
- { role: metron-builder, tags: ['build'] }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the cause of the second build.

The process was a bit more complex when Quick Dev was around because it would launch the Quick Dev image, then rebuild and try to push out new bits to Quick Dev. Since we don't need that any longer, this can be simplified.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will --ansible-skip-tags="build" still keep it from building at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@ottobackwards
Copy link
Contributor

Do you mean I should see two cowsay building metrons before and only one after?

@nickwallen
Copy link
Contributor Author

Sorry, I do not understand what you are asking, @ottobackwards

@ottobackwards
Copy link
Contributor

How would I have known it was building twice? How do I tell if it builds only once? I usually fire and forget vagrant up

@ottobackwards
Copy link
Contributor

i'm on irc if you want to chat btw ;)

@justinleet
Copy link
Contributor

@ottobackwards Yes, I think you'd see it twice, looking at my logs

2017-12-11 09:50:06,120 p=15256 u=jleet |  TASK [metron-builder : Build Metron] *******************************************
2017-12-11 09:56:16,676 p=15256 u=jleet |  �[0;33mchanged: [node1 -> localhost]�[0m
2017-12-11 09:56:16,682 p=15256 u=jleet |  TASK [metron-builder : Build Metron RPMs] **************************************
2017-12-11 10:07:05,114 p=15256 u=jleet |  �[0;33mchanged: [node1 -> localhost]�[0m

Way down later in the build:

2017-12-11 10:36:16,385 p=15256 u=jleet |  TASK [metron-builder : Build Metron] *******************************************
2017-12-11 10:46:43,988 p=15256 u=jleet |  �[0;33mchanged: [node1 -> localhost]�[0m
2017-12-11 10:46:44,014 p=15256 u=jleet |  TASK [metron-builder : Build Metron RPMs] **************************************
2017-12-11 11:00:49,602 p=15256 u=jleet |  �[0;33mchanged: [node1 -> localhost]�[0m
...

@nickwallen Is this a correct assessment?

@nickwallen
Copy link
Contributor Author

With this PR, you should see "Build Metron" and "Build Metron RPMs" only once each. Here is the log output of what it should look-like.
ansible.example.log

@justinleet
Copy link
Contributor

Yeah, sorry, I wasn't clear, my log sample is prior to this PR

@nickwallen
Copy link
Contributor Author

Also, keep in mind that each time you run a 'vagrant up' it will append to that ansible.log file. So that file will contain multiple deployments.

@ottobackwards
Copy link
Contributor

Ok, so validation is through the logs. You mean you don't see cowsay messages for ansible @nickwallen ? lol

@ottobackwards
Copy link
Contributor

ottobackwards commented Dec 14, 2017

ok: [node1]
 ______________________________________
< TASK [metron-builder : Build Metron] >
 --------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

@nickwallen
Copy link
Contributor Author

Ha. Very nice @ottobackwards . I added more detailed testing steps should they be needed by anyone else. Sadly, no cows.

@justinleet
Copy link
Contributor

@ottobackwards Nope, at least I don't. I assume you're not on a Mac, because I don't believe cowsay is installed by default on them. Hilariously, I just installed it via homebrew though.

@ottobackwards
Copy link
Contributor

I am on a mac, and I don't remember why I did it, but I have cowsay installed

@ottobackwards
Copy link
Contributor

Ran per instructions
Ran again with skip tags build
Everything fine in all uis

Nice work! +1

@nickwallen
Copy link
Contributor Author

Thanks @ottobackwards .

I should also mention that I did run Metron up in AWS too in testing this PR, since that also depends on the changes I made here. That worked nicely also.

@justinleet
Copy link
Contributor

I'm +1 by inspection, given that @ottobackwards ran it up successfully. Good job!

@mmiklavc
Copy link
Contributor

Much, much better! Thanks @nickwallen +1

vagrant up  1356.81s user 192.34s system 63% cpu 40:35.63 total

@asfgit asfgit closed this in d9ed1ba Dec 14, 2017
iraghumitra pushed a commit to iraghumitra/incubator-metron that referenced this pull request Feb 17, 2018
@nickwallen nickwallen deleted the METRON-1349 branch September 17, 2018 19:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants