Python Automation Menu Driven Program

Created a Menu Using Python integrating AWS,Hadoop,Docker,Linux and Webserver

ARTH TEAM_TASK — 1

What is Automation?

Why use Python for task automation?

Linux

  • Opening applications like chrome,notepad,media player etc
  • Opening websites using chrome
  • Some basic linux commands

Here we integrate some basic concepts of commands with python to automated the things.

if you haven’t watch the previous video watch it to clarify whether the commands are working or not. we will provide the github link to see the programming codes.

Let’s move to the AWS Part i.e. how we automate this also using python

AWS

In this we used python speech recognition module so that we can speak what we need it recognizes and later on do the task for me

At first when we get on to this page it greets you and ask what to do ,if you want to know what tasks it performs just say anything including the help so that it can understand to help you.

then it will explain about its tasks ,mentioned below

here for demo i create a ebs volume , then for creating the ebs volume it requires the type ,size ,and region.

after taking the info it creates the volume for you in the region.

now if we want to see the volume we ask this code to show all the ebs volume created .It will redirect to the aws web and show all the ebs volumes

it can do everything which the code mentioned in the help section (mentioned earlier)

Here is the video in which i do the same steps mentioned above ,go through it AWS

Docker

We created a menu driven program using python that can run commands of docker

This is the Menu

Option-1

Option-2

In our menu,we provided 4 options. First 3 options are linux based images.And we provided 4th option using which we can pull any other image.

Pulling Alpine Image
Pulling Ubuntu Image

In above two figures,we pulled alpine and ubuntu image.In below figure, we pulled a busybox image using 4th option

Option-3

What is a Container?

Here,we created a container of an ubuntu image using option 6. The underlying command used here is:

docker run -it --name ubuntuos ubuntu

In the above example,we created a container.After we create,we get the terminal of it. Using the terminal,we can do required operations.

Option-7

Another way is to create a container and run it in background.

docker run -dit --name ubuntuos ubuntu

Option — 4 and 5

Running Containers
All Containers

Option — 8 and 9

To stop a container, we use docker stop <os_name>

Option 10 and 11

Using option 11,we can delete all containers. The command used here is

docker rm `docker ps -aq`

Option 12

HADOOP

Option 1 and 2

Press option 2 for installation of AWS CLI

Option 3

Option 4

Option 5 and 6

Namenode Configuration

To check if namenode is stated,we can use jps command

Now,we use other option to start datanode.

And therefore,hadoop configuration is completed.

Webserver

  • Check if webserver software is installed or not
  • If not, then install webserver software
  • Check status,web service start or not
  • If not, start the web service
  • Create file which you want to show to the client
  • Check list of how many files we have
  • To view the website

Option 1

Option 2

Option 3 and 4

systemctl status httpd

And to start the service, we use option 4. The underlying command is

systemctl start httpd

Option 5 and 6

Option 7

This is our project github link: https://github.com/akshayvsuresh/arthtask

This project is done by Ayush Milan,Kritika Yadav,Vishnu Kumar,Akshay Suresh under the guidance of Vimal Daga Sir.

Thank you

Tech Explorer

Get the Medium app