Uploaded image for project: 'IGB'
  1. IGB
  2. IGBF-2480

Modify bioviz-playbooks to ensure that ec2 is running

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      See:

      https://bitbucket.org/lorainelab/bioviz-playbooks

      We're using the playbooks in this repository to deploy code for testing and production.

      To save money, we shut down the EC2 hosting the testing site when no-one is using it. Most of the time, it should be in an inactive state.

      However, the playbooks fail when the EC2 instance is not running.

      The failure happens during the "set_fact" task of the "inventory" role.

      For this task, please add some new logic to the "inventory" role that ensures that the ec2 is running by the end of the playbook. Also, please ensure that the delay caused by the need to re-start the ec2 does not cause later plays to fail due to ssh or other services needing time to boot up on the ec2.

      To test:

      • Run the playbooks in your AWS account (ansible-playbooks setup.yml after creating required variables files)
      • Run them again to make sure the playbooks are still idempotent
      • Use AWS console to shut down the ec2. Check that the setup.yml playbook can still run.

        Attachments

          Activity

          ann.loraine Ann Loraine created issue -
          ann.loraine Ann Loraine made changes -
          Field Original Value New Value
          Epic Link IGBF-2323 [ 18477 ]
          ann.loraine Ann Loraine made changes -
          Rank Ranked higher
          cdias1 Chester Dias (Inactive) made changes -
          Assignee Chester Dias [ cdias1 ]
          cdias1 Chester Dias (Inactive) made changes -
          Status To-Do [ 10305 ] In Progress [ 3 ]
          Hide
          cdias1 Chester Dias (Inactive) added a comment -

          Please review : https://bitbucket.org/chesterdias/bioviz-playbooks-chester-local/branch/IGBF-2480#diff

          The logic added will start the EC2 if not running and wait for ssh connection to open. This will avoid failure at set fact where the connection drop occurs

          Additional Notes:
          I saw some code for ipify url. I suggest removing it and use the amazon ec2_instance_info module for gathering the details about the newly created ec2 instance. As I understand any external website we hit always caches the IP address from where the hits come. Also should ipify go down someday our playbooks will fail.

          Show
          cdias1 Chester Dias (Inactive) added a comment - Please review : https://bitbucket.org/chesterdias/bioviz-playbooks-chester-local/branch/IGBF-2480#diff The logic added will start the EC2 if not running and wait for ssh connection to open. This will avoid failure at set fact where the connection drop occurs Additional Notes: I saw some code for ipify url. I suggest removing it and use the amazon ec2_instance_info module for gathering the details about the newly created ec2 instance. As I understand any external website we hit always caches the IP address from where the hits come. Also should ipify go down someday our playbooks will fail.
          cdias1 Chester Dias (Inactive) made changes -
          Status In Progress [ 3 ] Needs 1st Level Review [ 10005 ]
          cdias1 Chester Dias (Inactive) made changes -
          Assignee Chester Dias [ cdias1 ] Ann Loraine [ aloraine ]
          ann.loraine Ann Loraine made changes -
          Status Needs 1st Level Review [ 10005 ] First Level Review in Progress [ 10301 ]
          Hide
          ann.loraine Ann Loraine added a comment -

          Code looks good. Please submit PR.

          Show
          ann.loraine Ann Loraine added a comment - Code looks good. Please submit PR.
          ann.loraine Ann Loraine made changes -
          Status First Level Review in Progress [ 10301 ] Ready for Pull Request [ 10304 ]
          ann.loraine Ann Loraine made changes -
          Assignee Ann Loraine [ aloraine ] Chester Dias [ cdias1 ]
          Show
          cdias1 Chester Dias (Inactive) added a comment - PR: https://bitbucket.org/lorainelab/bioviz-playbooks/pull-requests/4/igbf-2480-added-code-to-wait-for-ssh/
          cdias1 Chester Dias (Inactive) made changes -
          Status Ready for Pull Request [ 10304 ] Pull Request Submitted [ 10101 ]
          cdias1 Chester Dias (Inactive) made changes -
          Assignee Chester Dias [ cdias1 ] Ann Loraine [ aloraine ]
          ann.loraine Ann Loraine made changes -
          Status Pull Request Submitted [ 10101 ] Reviewing Pull Request [ 10303 ]
          ann.loraine Ann Loraine made changes -
          Status Reviewing Pull Request [ 10303 ] Merged Needs Testing [ 10002 ]
          ann.loraine Ann Loraine made changes -
          Assignee Ann Loraine [ aloraine ]
          Hide
          ann.loraine Ann Loraine added a comment - - edited

          Philip Badzuh or Chaitanya Kintali - would you be able to test this change? (Please do the testing in your own personal AWS account if you have one.)

          Show
          ann.loraine Ann Loraine added a comment - - edited Philip Badzuh or Chaitanya Kintali - would you be able to test this change? (Please do the testing in your own personal AWS account if you have one.)
          ann.loraine Ann Loraine made changes -
          Status Merged Needs Testing [ 10002 ] Post-merge Testing In Progress [ 10003 ]
          ann.loraine Ann Loraine made changes -
          Assignee Ann Loraine [ aloraine ]
          Hide
          ann.loraine Ann Loraine added a comment -

          Tested:

          • Run the playbooks in your AWS account (ansible-playbooks setup.yml after creating required variables files) - works
          • Run them again to make sure the playbooks are still idempotent - works
          • Use AWS console to shut down the ec2. Check that the setup.yml playbook can still run. - works

          All tests worked, moving to Closed.

          Show
          ann.loraine Ann Loraine added a comment - Tested: Run the playbooks in your AWS account (ansible-playbooks setup.yml after creating required variables files) - works Run them again to make sure the playbooks are still idempotent - works Use AWS console to shut down the ec2. Check that the setup.yml playbook can still run. - works All tests worked, moving to Closed.
          ann.loraine Ann Loraine made changes -
          Resolution Done [ 10000 ]
          Status Post-merge Testing In Progress [ 10003 ] Closed [ 6 ]

            People

            • Assignee:
              ann.loraine Ann Loraine
              Reporter:
              ann.loraine Ann Loraine
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: