DevOps Homework Assessment: Star Wars API Challenge
This assignment is designed to assess your understanding of DevOps principles and practices. You'll build a solution that interacts with the Star Wars API, packages it into a Docker container, and (optionally) implements a CI/CD pipeline. This assignment is open for the month of February. Successful submissions will move on to the interview round.
Getting Started
- GitHub Account & Repository:
- Create a GitHub Account: If you don’t already have one, please create a free GitHub account: https://github.com/
- Public Repository: Create a public repository on GitHub for this assignment. All your work (script, Dockerfile, README, etc.) should be committed and pushed to this repository.
- Submission: When you are finished, simply send us the URL of your GitHub repository.
- Local Development:
- You may start working on the assignment locally.
To push your changes to GitHub, use these commands:
git init
git add .
git commit -m "Initial commit"
git remote add origin <your_repo_url>
git push -u origin main
The Challenge: Star Wars API Interaction
Your task is to build a solution that:
- Interacts with the Star Wars API: Retrieve information about starships.
- Packages the solution: Build a Docker container based on the latest Ubuntu image.
- (Optional) Automates the process: Set up a GitHub Actions workflow to build and push the Docker image.
Problem Statement: Retrieve Starship Information
You're challenged to create a script that retrieves information about starships from the public Star Wars API. Your solution should:
- Fetch data from the API.
- Extract relevant information (e.g., name, model, manufacturer, starship class).
- Display the retrieved data in a readable format.
- Handle pagination for retrieving all starships.
- Implement proper error handling to deal with potential API issues.
Example Repository Structure
<your-repo-root>
Dockerfile # Dockerfile to build the Ubuntu image with your script
script.<ext> # Your script file (e.g., script.py if using Python)
README.md # Instructions on building/running the container, an explanation of your approach, and bonus deployment considerations
.github/
workflows/
docker-build.yml # (Optional) GitHub Actions workflow file for building/pushing your Docker imageDocker Implementation
You will use a Dockerfile to create a container based on the latest Ubuntu image that runs your script. The Dockerfile should be efficient and follow best practices for image size and security.
GitHub Actions (Strongly Recommended)
Consider automating your Docker build process using GitHub Actions. This will allow you to build and push your Docker image automatically whenever you merge changes to the main branch.
Bonus: Production Deployment Considerations
Demonstrate your understanding of DevOps principles by outlining a production deployment strategy for your solution. Consider the following topics:
- Container Orchestration & Scaling: How would you deploy your solution using tools like Kubernetes or Docker Swarm?
- Monitoring & Logging: What tools and techniques would you use for monitoring and logging?
- CI/CD: How would you implement a CI/CD pipeline?
- Security: What security considerations would you take into account?
- Disaster Recovery: How would you plan for disaster recovery?
Resources & Helpful Links
Happy coding! Please don't hesitate to reach out if you have any questions during your work. Good luck with your assignment!