Automatically configure the networks. By the end of the project, you will understand the basics of software-defined networking.
- How networking works.
To further teach Python programming we'll dive into basic networking programming. We will do the following:
- Writing an example mock docker container
- We manage the networking and resources for a mock docker container.
- Finished networking.
- Declarative configuration
- Install pieces of software dynamically.
- Define a network
- Make changes to the network using automation.
- Creating APIs for the network.
- Creating command line tools to do exactly what's necessary.
I will be looking for something during this project. I will primarily look for:
- Understanding of operating systems and networking (from the mocker container project). Code is written as proof of understanding.
- Interact with different networking devices (using our project)
- https://github.com/tonybaloney/mocker
- https://github.com/pkgcore/pychroot
- https://github.com/cloudsigma/cgroupspy
- https://github.com/svinota/pyroute2
Your job is to recreate the functionality of the images.py
file (located here).
- Understand what the file is doing.
- What does list_images do?
- Convert the file manipulation within the file from
os
topathlib
.- What does it do?
- What is an image?
- What is a JSON file?
- How do I open a json file?
- How do I read json?
- How to do important things with json data?
You can use the tool rich to write modern tables for this assignment if you want. Its also possible to write tables from scratch.
Example code (from rich):
from rich.console import Console
from rich.table import Table
table = Table(title="Star Wars Movies")
table.add_column("Released", justify="right", style="cyan", no_wrap=True)
table.add_column("Title", style="magenta")
table.add_column("Box Office", justify="right", style="green")
table.add_row("Dec 20, 2019", "Star Wars: The Rise of Skywalker", "$952,110,690")
table.add_row("May 25, 2018", "Solo: A Star Wars Story", "$393,151,347")
table.add_row("Dec 15, 2017", "Star Wars Ep. V111: The Last Jedi", "$1,332,539,889")
table.add_row("Dec 16, 2016", "Rogue One: A Star Wars Story", "$1,332,439,889")
console = Console()
console.print(table)
Here are questions people may ask about coding in general.
Source material here.
root_dir
refers to base directory of output file, or working directory for your working script.
base_dir
refers to the content you want pack.
For example, if you have a directory tree like:
/home/apast/git/someproject
And you want to build a package for someproject
folder, you can set:
root_dir="/home/apast/git"
base_dir="someproject"
If the contents of your tree is like following, for example:
/home/apast/git/someproject/test.py
vs./home/apast/git/someproject/model.py