Open Source Development 11 - Wrapping Up
Model Solutions
The Code Repository
The code itself is to found in a git repository at https://codeberg.org/arosano/librarya.git.
Example 1. README.md
|
|
Example 2. LICENSE
|
|
Example 3. Compilation of Our Work - testsuite.py
|
|
Example 4. Compilation of Our Work - liba.py
|
|
The Solution Itself
The Python code that solves the exercise follows here.
Example 5. librarya/ngramming.py
|
|
The solution being in an Alpine Linux container is in the following shell script.
Example 6. librarya/ngramming.sh
|
|
Example 7. Execution Example
|
|
The Docker Part
The following Dockerfile
to be executed re the README.md
from the project directory, ie the parent directory of
the librarya
repository documented above.
Example 8. The Generating Dockerfile
|
|
The Docker image is an Alpine Linux with git
,
python
, and nano
installed.
The directive in line 7 will cause the librarya
project to be included in the Docker image.
It should be possible to issue a git pull
from the librarya
directory, to get an
update from the repository server Codeberg.
A git remote -v
will give you the URL of
the repository if you need to check it.
The Docker image may be built from the CLI with code like the following. Alternatively it may be pulled from https://hub.docker.com on your CLI by
docker pull arosano0/classiccrypt
and used as shown in example 10 below.
Example 9. Generating Commands Locally
|
|
where classiccrypt
is the name for the image, and
classiccryptc
for the container. In testing you may
restart the container like this, again from the
CLI:
Example 10. Restart Sequence
|
|
Wrapping Up
Q & A
What did we do right? What could we have done better? Focus on code?
Thank You and Goodbye
“Alvaida!” “Dhanyabad!”