Skip to content

Latest commit

 

History

History
119 lines (90 loc) · 2.44 KB

22-virt_devel_intro.md

File metadata and controls

119 lines (90 loc) · 2.44 KB
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
virtualisation
introduction
vm
os
container
devops
#ffffff
invert
section.center { text-align: center; }

Virtualised development

Why devops teams have grown to love it

bg right:30%


In theory, collaborative development of software shouldn't be that hard.

bg right:30%


app.py

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

bg right:30%


$ 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

bg right:30%


Some problems

  • Sharing venv's is not trivial
  • Only handles Python dependencies*
  • Doesn't describe how stack should be run

bg right:30%