Code Monkey home page Code Monkey logo

systems-puzzle's Introduction

Insight DevOps Engineering Systems Puzzle

My solution for Insight's systems puzzle

Install:

docker-compose up -d db

docker-compose run --rm flaskapp /bin/bash -c "cd /opt/services/flaskapp/src && python -c  'import database; database.init_db()'"

docker-compose up -d

Steps taken:

  1. Remapped Jenkins in my local environment to 7070 to free port 8080.
  2. Container now runs, but app is not loading.
  3. Reviewed scripts within the app. Checked the docker-compose file and saw that the ports were switched. Changed the ports so host is at 8080 and container 80.
  4. 502 bad gateway error from nginx still. Checked the logs of the container. Noticed that the port for the development server is at 5000. Changed proxy pass in nginx flask config to 5000.
  5. Dockerfile shows port 5001, but it’s not accessible. Opened up port in app.py to get it exposed.
  6. Double checked the app and db is still not working and leads to a broken route (http://localhost%2Clocalhost:8080/success). Trying the success route itself gives an empty object. Need to first redirect to success route on post.
  7. Reviewed proxy setups in nginx config. Server name localhost was labeled twice in the url and in turn host is labelled twice in the proxies. Removed one of the hosts. Restarted docker instances. Tested app again and now being redirected to correct success route with an object of [, , , , , ].
  8. Looked over app.py and database.py again. Db and add_method both look configured correctly. Success method is not returning the query.
  9. Fixed success method to display results of the query.
  10. App is now running.

systems-puzzle's People

Contributors

dspham avatar emhoa avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.