From a47dc976541b30505c44b03250dd1db97a567354 Mon Sep 17 00:00:00 2001 From: Kevin Reynolds Date: Thu, 2 May 2024 09:21:06 -0400 Subject: [PATCH] walkthrough --- labapp/app/app.py | 23 ++- labapp/app/markdown/lb.md | 14 +- labapp/app/markdown/manipulation.md | 8 +- labapp/app/markdown/overview.md | 52 +++++-- labapp/app/markdown/portability.md | 10 +- labapp/app/markdown/route.md | 8 +- labapp/app/markdown/setup.md | 5 +- labapp/app/markdown/welcome.md | 28 ++-- labapp/app/templates/header.html | 9 -- labapp/app/templates/lb.html | 19 --- labapp/app/templates/netpolicy.html | 9 -- labapp/app/templates/orig-base.html | 221 ---------------------------- labapp/app/templates/path.html | 9 -- labapp/app/templates/setup.html | 33 +++-- labapp/app/templates/vnet.html | 9 -- 15 files changed, 132 insertions(+), 325 deletions(-) delete mode 100644 labapp/app/templates/header.html delete mode 100644 labapp/app/templates/lb.html delete mode 100644 labapp/app/templates/netpolicy.html delete mode 100644 labapp/app/templates/orig-base.html delete mode 100644 labapp/app/templates/path.html delete mode 100644 labapp/app/templates/vnet.html diff --git a/labapp/app/app.py b/labapp/app/app.py index 5baa928..eff6173 100644 --- a/labapp/app/app.py +++ b/labapp/app/app.py @@ -87,16 +87,16 @@ def setup(): if action == 'save': this_eph_ns = request.form['eph_ns'].strip() if not validate_eph_ns(this_eph_ns): - flash("Invalid ephemeral NS.", "danger") + flash("Invalid ephemeral namespace.", "danger") return redirect(url_for('setup')) response = make_response(redirect('/setup')) response.set_cookie('eph_ns', this_eph_ns, max_age=60*60*24) - flash('Ephemeral NS successfully set.', "success") + flash('Ephemeral namespace successfully set.', "success") return response if action == 'clear': response = make_response(redirect('/setup')) response.set_cookie('eph_ns', '', expires=0) - flash("Ephemeral NS cleared.", "info") + flash("Ephemeral namespace cleared.", "info") return response html = render_md("markdown/setup.md") return render_template('setup.html', @@ -358,7 +358,22 @@ def manip3(): return jsonify(status='success', data=data) except (LabException, requests.RequestException, ValueError) as e: return jsonify(status='fail', error=str(e)) - + +@app.route('/_port1') +def port1(): + """Friend test""" + try: + s = requests.Session() + s.headers.update({"User-Agent": "MCN-Lab-Runner/1.0"}) + ns = eph_ns() + if not ns: + raise LabException("Ephemeral NS not set") + url = f"https://{ns}.{app.config['base_url']}/" + data = cloudapp_fetch(s, url, 7, 'info', {"method": "GET", "path": "/"}) + return jsonify(status='success', data=data) + except (LabException, requests.RequestException, ValueError) as e: + return jsonify(status='fail', error=str(e)) + @app.route('/_port2', methods=['POST']) def port2(): """Friend test""" diff --git a/labapp/app/markdown/lb.md b/labapp/app/markdown/lb.md index c5315b4..403faab 100644 --- a/labapp/app/markdown/lb.md +++ b/labapp/app/markdown/lb.md @@ -1,5 +1,5 @@ # **Load Balancing** @@ -32,6 +32,10 @@ Build an origin pool and load balancer based on the exercise requirements. The cloud app is TLS only.
  • +     + The load balancer domain is {{ ns }}.mcn-lab.f5demos.com. +
  • +
  •     Use the wildcard cert provided in the shared NS, mcn-lab-wildcard, to enable TLS on the LB.
  • @@ -146,5 +150,11 @@ document.getElementById('requestBtn2').addEventListener('click', () => { -After completing both exercises, move on to the routing exercise. + diff --git a/labapp/app/markdown/manipulation.md b/labapp/app/markdown/manipulation.md index cf140fe..d15513d 100644 --- a/labapp/app/markdown/manipulation.md +++ b/labapp/app/markdown/manipulation.md @@ -174,5 +174,11 @@ document.getElementById('requestBtn3').addEventListener('click', () => { -Finish off App Connect with an exercise on load balancer portability. + diff --git a/labapp/app/markdown/overview.md b/labapp/app/markdown/overview.md index b0c8525..23772b9 100644 --- a/labapp/app/markdown/overview.md +++ b/labapp/app/markdown/overview.md @@ -6,7 +6,7 @@ -The lab environment, the application endpoints, and how you interact with the load balancer have been simplified in an effort to focus on concepts. +The lab environment, the service endpoints, and how you interact with the load balancer have been simplified in an effort to focus on concepts. Understanding the environment, it's topology, and the rudimentary functionality of the cloud app will help in completing the exercises.
    @@ -19,15 +19,15 @@ The lab environment contains three distributed sites meshed using the F5 Distrib @@ -40,7 +40,7 @@ The lab environment contains three distributed sites meshed using the F5 Distrib An instance of the cloud app is hosted in each remote cloud environment. The cloud app is a simple application that echoes back an HTTP request. -While working through the lab, unless otherwise noted, the test results are displaying the headers and info **from the request received by the app**. +While working through the lab, unless otherwise noted, test results display headers and info **from the request received by the app**. For testing, you can access an endpoint of each cloud app from your browser. @@ -52,21 +52,37 @@ For testing, you can access an endpoint of each cloud app from your browser.

    - -
    ## **Lab Exercises** Lab exercises will ask you to create configuration in the lab tenant. -To complete a lab exercise, you will run a test against the load balancer advertised from the Customer Edge in your UDF site. -Tests are integrated in this lab app. +Exercise requirements are listed in a table along with an object type indicator. + +
    #### **Test Criteria** -Exercises will specify thier success criteria along with the test. +To complete lab exercises, you will run tests against the load balancer advertised from the Customer Edge in your UDF site. +You will build this load balancer in the first exercise. +All tests will be run from this lab app. + +Each test will specify success criteria immediately prior to the button. Here are some examples to try. @@ -131,13 +147,25 @@ ubuntu@ubuntu:~$ curl -s https://foo.mcn-lab.f5demos.com/ | jq "info": "bar" } ``` + + +
    +## **Issues** -Note that responses displayed in exercise tests are truncated for readibility. +Use the lab repository issue tracker to report bugs, typos, or lab enhancements. -Next, visit the setup page before starting the exercises. + diff --git a/labapp/app/markdown/portability.md b/labapp/app/markdown/portability.md index 0a6e0d3..af61565 100644 --- a/labapp/app/markdown/portability.md +++ b/labapp/app/markdown/portability.md @@ -46,7 +46,7 @@ Host: eph-ns.mcn-lab.f5demos.com
    @@ -107,4 +107,10 @@ document.getElementById('requestBtn2').addEventListener('click', () => { -Congratulations on completing the App Connect exercises. Move on to the first Network Connect exercise on virtual networks. \ No newline at end of file + \ No newline at end of file diff --git a/labapp/app/markdown/route.md b/labapp/app/markdown/route.md index d7a43b7..29830a3 100644 --- a/labapp/app/markdown/route.md +++ b/labapp/app/markdown/route.md @@ -123,4 +123,10 @@ document.getElementById('requestBtn2').addEventListener('click', () => { -Once you've completed the exercises, move on to the manipulation exercise. \ No newline at end of file + \ No newline at end of file diff --git a/labapp/app/markdown/setup.md b/labapp/app/markdown/setup.md index c2ea7e2..a5c6466 100644 --- a/labapp/app/markdown/setup.md +++ b/labapp/app/markdown/setup.md @@ -6,7 +6,7 @@ -Log in to the lab tenant and open any namespaced tile (Multi-Cloud App Connect, Distributed Apps, etc.). The ephemeral namespace is a randomly generated concatenation of adjective-animal in the navigation bar towards the top. +Log in to the lab tenant and open any namespaced tile -- Multi-Cloud App Connect, Distributed Apps, etc. The ephemeral namespace is a randomly generated concatenation of adjective-animal in the navigation bar towards the top. eph-ns @@ -18,7 +18,7 @@ The ephemeral namespace will be used to derive a unique URL for the load balance - + + diff --git a/labapp/app/markdown/welcome.md b/labapp/app/markdown/welcome.md index 6d9f36a..d59d750 100644 --- a/labapp/app/markdown/welcome.md +++ b/labapp/app/markdown/welcome.md @@ -7,9 +7,9 @@ -This lab is a "practical" training activity. -Each exercise will ask you to **configure** F5 Distributed Cloud ("XC") objects to reinforce core XC Multi-Cloud Networking ("MCN") concepts. -Once configured, you'll be asked to **test** your configuration using this web application. +This lab is a practical training activity. +Each exercise will ask you to configureF5 Distributed Cloud ("XC") objects to reinforce core XC Multi-Cloud Networking ("MCN") concepts. +Once configured, you will test the configuration using this web application.
    @@ -22,18 +22,17 @@ When your UDF deployment launched, two automated processes started - Customer Ed ### **Customer Edge** The CE in the UDF deployment will registered with the lab tenant. -CEs on first launch update software and, often, their OS. This can be very time consuming ~20 min from when the CE is booted. - -This lab app includes an indicator of the CE's status along with the site name in the navigation pane. -The **site name** is needed when configuring the load balancer advertise policy. +CEs on first launch update software and, often, their OS. This can take ~20 min from when the CE is booted. +This lab app includes an indicator of the CE's site name and status in the navigation pane (👀 look to the left). +The **site name** is needed when configuring the load balancer's advertise policy.
    ### **Account Provisioning** -Check the email used to launch your UDF deployment for a "welcome" or password reset email to the lab tenant. -Update your password and log into the tenant. +Check the email used to launch your UDF deployment for a welcome or password reset email from the lab tenant. +Update your password to log into the tenant.

    @@ -59,7 +58,7 @@ Here's a few things you can do while waiting for the CE to be registered and pro

  •     - Check for the tenant "welcome" email. + Check for the tenant welcome email.
  •     @@ -70,6 +69,13 @@ Here's a few things you can do while waiting for the CE to be registered and pro -Welcome to the lab! Next, read an overview that explains the lab environment, tools, and exercises. + + diff --git a/labapp/app/templates/header.html b/labapp/app/templates/header.html deleted file mode 100644 index 597c8a7..0000000 --- a/labapp/app/templates/header.html +++ /dev/null @@ -1,9 +0,0 @@ -{% extends "base.html" %} - -{% block title %}MCN Practical: Header Manipulation{% endblock %} - -{% block content %} -
    - {{ content|safe }} -
    -{% endblock %} \ No newline at end of file diff --git a/labapp/app/templates/lb.html b/labapp/app/templates/lb.html deleted file mode 100644 index 9a65b1b..0000000 --- a/labapp/app/templates/lb.html +++ /dev/null @@ -1,19 +0,0 @@ -{% extends "base.html" %} - -{% block title %}MCN Practical: Load Balancer{% endblock %} - -{% with messages = get_flashed_messages(with_categories=true) %} -{% if messages %} -
    - {% for category, message in messages %} -
    {{ message }}
    - {% endfor %} -
    -{% endif %} -{% endwith %} - -{% block content %} -
    - {{ content|safe }} -
    -{% endblock %} \ No newline at end of file diff --git a/labapp/app/templates/netpolicy.html b/labapp/app/templates/netpolicy.html deleted file mode 100644 index 6123842..0000000 --- a/labapp/app/templates/netpolicy.html +++ /dev/null @@ -1,9 +0,0 @@ -{% extends "base.html" %} - -{% block title %}MCN Practical: Network Policy{% endblock %} - -{% block content %} -
    - {{ content|safe }} -
    -{% endblock %} \ No newline at end of file diff --git a/labapp/app/templates/orig-base.html b/labapp/app/templates/orig-base.html deleted file mode 100644 index 712e3a0..0000000 --- a/labapp/app/templates/orig-base.html +++ /dev/null @@ -1,221 +0,0 @@ - - - - - {% block title %}{{ title }}{% endblock %} - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - {% block content %} - {% endblock %} -
    -
    -
    - - - - diff --git a/labapp/app/templates/path.html b/labapp/app/templates/path.html deleted file mode 100644 index 8ed974f..0000000 --- a/labapp/app/templates/path.html +++ /dev/null @@ -1,9 +0,0 @@ -{% extends "base.html" %} - -{% block title %}MCN Practical: Path Routing{% endblock %} - -{% block content %} -
    - {{ content|safe }} -
    -{% endblock %} \ No newline at end of file diff --git a/labapp/app/templates/setup.html b/labapp/app/templates/setup.html index 89805ef..b97651d 100644 --- a/labapp/app/templates/setup.html +++ b/labapp/app/templates/setup.html @@ -5,23 +5,28 @@ {% block content %}
    {{ content|safe }} -
    -
    - {% with messages = get_flashed_messages(with_categories=true) %} - {% if messages %} -
    - {% for category, message in messages %} -
    {{ message }}
    - {% endfor %} -
    -
    - When ready, start the exercises. -
    - {% endif %} - {% endwith %} +
    + {% with messages = get_flashed_messages(with_categories=true) %} + {% if messages %} +
    + {% for category, message in messages %} +
    {{ message }}
    + {% endfor %} +
    + {% endif %} + {% endwith %} +
    + + {% endblock %} diff --git a/labapp/app/templates/vnet.html b/labapp/app/templates/vnet.html deleted file mode 100644 index 44a9666..0000000 --- a/labapp/app/templates/vnet.html +++ /dev/null @@ -1,9 +0,0 @@ -{% extends "base.html" %} - -{% block title %}MCN Practical: Virtual Networks{% endblock %} - -{% block content %} -
    - {{ content|safe }} -
    -{% endblock %} \ No newline at end of file