GithubHelp home page GithubHelp logo

arca-devops's Introduction

DevOps for ARCA network

This is the steps required to reproduce the actions necessary in completing the devops challenge from the ARCA network.

Docker

The objective is to write a shell script to fire up 3 docker containers, respectively of Kibana 6.4.2, Nginx and MySQL, with all instances able to ping each other regardless of deployment environment. Also, Nginx needs to be configured (for immediate access, I presume).

The steps in reproducing the script are documented in the docker.md file.

To run the resulting docker.sh shell script, please follow the steps below:

  1. Log in to bash shell with docker installed. Verify with docker info.

  2. Run the command bash docker.sh and watch the outputs. Please make sure your environment has access to the internet. This process will take some time.

  3. You can verify the running containers with docker ps. Navigate to port 8080 on your host address in a web browser to verify that Nginx is functional. For example, http://localhost:8080.

  4. To finish the demo and clean up resources, run the cleanup script with bash cleanup.sh. This removes the running containers, but not the base images. To remove all docker images on the system, use docker rmi $(docker images -q).

- WARNING: This will remove all images in your local repo.

CloudFormation

I'm required to write a basic cloudformation script to deploy a lone server to a region in AWS on the default VPC. The resulting script is the instance.yml file, and below are the steps to "run" that script:

  1. Have AWS cli installed. Version 2 is preferred, but version 1 will do just fine.

  2. Configure the CLI with programmatic keys generated from the AWS IAM console. Also configure a default AWS region and a default output format.

  3. Run aws cloudformation deploy --stack-name temp --template-file instance.yml from your terminal.

  4. Run aws cloudformation list-exports |grep Value for the instance id of the resulting EC2 instance.

  5. Query the list of instance ids of all running instances with this command: aws ec2 describe-instances --filters Name=instance-type,Values=t2.micro Name=instance-state-name,Values=running --query "Reservations[].Instances[].InstanceId". Verify that the instance id returned in step 4 is included.

  6. This instance id will be needed in the Python section below. Once done, cleanup with: aws cloudformation delete --stack-name temp.

Python

Here, we create two identical Python scripts โ€” one to stop, and another to start the instance created in the previous section. The resulting scripts are power-off and power-on respectively. To run them,

  1. Make sure python is installed.

  2. Boto3 is a dependency. Install with pip or conda.

  3. Replace the the instances list in both power-off.py and power-on.py to include the instance id of your own instance, exported in the CloudFormation section.

  4. python power-off.py will power down the running instance. Verify with step 5 from CloudFormation section.

  5. python power-on.py will power up the stopped instance. Verify with step 5 from CloudFormation section. You may need a few seconds for changes to propagate.

  6. Cleanup the stack with step 6 in the CloudFormation section.

The Questions

Rewritten for clarity.

A. Using Docker and Bash


Using bash script, Write a script that will automatically provision 3 docker containers running kibana version 6.4.2, nginx server, mysql server separately on each container.Environment:

  • container A: kibana version 6.4.2
  • container B: nginx server
  • container C: mysql server

Acceptance criteria: Solution should be prepared as only one script, which creates three Docker images, runs containers from them, and configures Nginx.

The three docker containers should also be able to ping each other regardless of where they are deployed.

Provide a well documented steps for how to reproduce your work.

B. Cloudformation with Python for Infrastructure Automation


  • Write a CloudFormation template to provision a server in a default VPC
  • Write a python script to start the provisioned server
  • Write a python script to stop the provisioned server

arca-devops's People

Contributors

agmt5989 avatar

Stargazers

 avatar

Watchers

 avatar  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.