SPDX-FileCopyrightText | SPDX-License-Identifier | title | author | footer | description | keywords | color | class | style | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
© 2023 Menacit AB <foss@menacit.se> |
CC-BY-SA-4.0 |
Virtualisation course: Introduction to virtual development |
Joel Rangsmo <joel@menacit.se> |
© Course authors (CC BY-SA 4.0) |
Examples of how virtualisation can help devops teams be more effective |
|
#ffffff |
|
section.center {
text-align: center;
}
|
In theory, collaborative development of software shouldn't be that hard.
from flask import Flask, request
app = Flask("kool_app")
@app.route("/api/request_info")
def request_information():
return {
"ip_address": request.remote_addr,
"browser": request.headers["User-Agent"]}
$ flask run
* Environment: production
* Debug mode: off
* Running on http://127.0.0.1:5000
$ curl http://localhost:5000/api/request_info | jq
{
"browser": "curl/7.81.0",
"ip_address": "127.0.0.1"
}
What dependencies (and versions) are installed on developers workstations?
How about in the different server environments?
Who should deploy and manage the stack? (application, load balancer, databases, etc.)
$ cat requirements.txt
Flask==2.0.3
$ python3 -m venv .
$ ls
bin include lib64 lib app.py
pyvenv.cfg requirements.txt
$ bin/pip install -r requirements.txt
Successfully installed Flask-2.0.3
$ bin/flask run
* Environment: production
* Running on http://127.0.0.1:5000
- Sharing venv's is not trivial
- Only handles Python dependencies*
- Doesn't describe how stack should be run