Giter VIP home page Giter VIP logo

beyondmd_interview's Introduction

BeyondMD Interview Assessment

Topic

  • Make a simple page using HTML, CSS, and/or javascript that displays “Hello BeyondMD!“, and then dockerize it. It must run using docker compose.
  • Write a script that collects and reports various system health information, such as CPU, memory, disk usage, active users, and/or running processes for a debian server.
  • Create an idempotent Ansible playbook that automates the installation and configuration of Docker on a Debian bookworm host, ensuring it correctly handles repeated executions without unnecessary changes to the system state.
  • Bonus points if you use vagrant as a local testing environment for your ansible playbook. I personally really like the "debian-sandbox/bookworm64" vagrant image.

Step 1

Wrote a sample HTML5/CSS3 script which displays the message "Hello BeyondMD!" as pictured below

Img 1

After writing the HTML script and testing locally that the output is correct, the next step is to containerize our simple webpage For that, we write a Dockerfile which pulls the official image of https from docker hub We cna also use a docker-compose.yml file which will specify the ports mapping

Note: Our port 8080 was already busy during this exercise, so we used the port 3000 instead (Subtle ReactJS reference here!)

Once everything looks good, we build our docker image using the command below:

Img 2

We then run the generated docker image

Img 3

Now we can check at http://localhost:3000/ and see the webpage live from the browser window

Img 4

Step 2

By writing a short bash script, we can output various system health information from a Debian bookworm server as pictured below:

Img 5

Step 3

The installation of Docker can be automated on a Debian bookworm server using a ansible playbook. The playbook contains step-by-step commands and parameters detailing each step of the installation of Docker on Debian OS We can test our playbook by using the "ansible-playbook" command.

In our case, the remote server was secured using a private key for ssh connections, so we had to include an extra "--private-key" parameter in the command as pictured below:

Img 6

We can check that docker was successfully installed on the remote server by manually ssh-ing and testing the command "docker --version"

Step 4

We can use vagrant to provision a local Debian bookworm environment for the ansible playbook. For that, we need to write a Vagrant script which specifies details about the desired VM box as well as referrencing our previously written ansible playbook.

After everything looks good with the Vagrant script, we can now run the "vagrant run" and "vagrant ssh" commands to create and provision the vagrant VM as shown below:

Img 7

beyondmd_interview's People

Contributors

yankev07 avatar

Watchers

 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.