JV-conseil/ucloud

UCloud Web Qualification

JV-conseil opened this issue ยท 0 comments

Validate UCloud as a stable cloud service to serve Python Django v4.1.2 web app coupled with a PostgreSQL Server
Provided UCloud is up and running ๐Ÿ‘‰ https://status.cloud.sdu.dk/

app-thalassa cloud sdu dk running in DEBUG=False with cache activated and collectstatic
app-thalassa.cloud.sdu.dk running in DEBUG=False with cache activated and collectstatic.

  • PostgreSQL Server v14.5 initialization.
  • PostgreSQL Server v14.5 New Database and User creation.
  • PostgreSQL Server v14.5 SSL set up pg_hba.conf
  • Django v4.1.2 access environment variables through os.environ.get("DBHOST")
  • Django v4.1.2 DEBUG=True
  • Django v4.1.2 SECURE_SSL_REDIRECT = True fails ๐Ÿ‘‰ should not be declared in settings.py ๐Ÿšซ
  • Django v4.1.2 SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") โœ…
  • Django v4.1.2 <> PostgreSQL Server v14.5 connection django.db.backends.postgresql
  • Django v4.1.2 <> PostgreSQL Server v14.5 SSL transactions SSLMODE=require
  • Django v4.1.2 makemigrations & migrate
  • Django v4.1.2 create_superuser
  • Django v4.1.2 CSRF_COOKIE_SECURE = True and CSRF_USE_SESSIONS = True
  • Django v4.1.2 DEBUG=False
  • Django v4.1.2 ALLOWED_HOSTS set to
    ['localhost', 'app-627236-0.cloud.sdu.dk', 'app-githubbing.cloud.sdu.dk']
  • Django v4.1.2 collectstatic
  • Django v4.1.2 serves static files through whitenoise
  • Django v4.1.2โ€™s cache framework > Filesystem caching django.core.cache.backends.filebased.FileBasedCache
  • Django v4.1.2 <> PostgreSQL Server v14.5 ETL python manage.py xloader.
  • Django v4.1.2 run in pseudo UCloud localhost mode (see below ๐Ÿ‘€ ) https://app-{job-id}-0.cloud.sdu.dk.
  • Django v4.1.2 run with a Public link https://app-githubbing.cloud.sdu.dk.
  • UCloud app run over 24 hours โณ
  • PostgreSQL Server v15.2 initialization.
  • PostgreSQL Server v15.2 New Database and User creation.
  • PostgreSQL Server v15.2 SSL set up pg_hba.conf
  • Django v4.1.2 <> PostgreSQL Server v15.2 connection django.db.backends.postgresql
  • Django v4.1.2 <> PostgreSQL Server v15.2 SSL transactions SSLMODE=require
  • Django v4.1.2 <> PostgreSQL Server v15.2 ETL python manage.py xloader

Issues

  • Public Link running only once then error 503 upstream connect error or disconnect/reset before headers. reset reason: connection termination ๐Ÿ™… (Solved on 2023, March 24th).
  • Outdated Python ๐Ÿ versions in containerized app.

End of March, 2023 ๐Ÿ‘€

  • PostgreSQL server v14.5 version bump to v15.2
  • Django v4.1.2 version bump to v4.1.7
  • Python version bump to v3.11.2

TODO

  • Python 3.11.2 - Always run latest stable release of Python ๐Ÿ in containerized app (at least Django).
  • PgBouncer - 1.18.0 Dec 12, 2022. Install, setup with PostgreSQL Server v15.2.
  • Custom Domain Name (DNS) instead of Public Links.
  • PenTest
  • ...

Pseudo UCloud localhost mode

Pseudo UCloud localhost mode = when Django app is running on https://app-{job-id}-0.cloud.sdu.dk interface with no Public link connected.

  1. Pseudo UCloud localhost execution is cookie restricted to the current browser session ๐Ÿ‘‰ cannot be shared with another browser session; an error 403 is raised: same browser in Private mode will fail, another browser on the same computer will fail.
  2. Public link and Pseudo UCloud localhost mode are exclusive to one another.
  3. Public link resources cannot be shared among users ๐Ÿ‘‰ one user has to launch a job and attach a Public link he "owns", he cannot attach a Public link created by another user.
  4. As an extra-check/validation, UCloud does check your Public link availability on creation for a similar one already existing created by someone else.

Containers overview

March 2022 with u1-standard-8 machine.

Environment set -eufo pipefail ${USER} Python 3.11.0 apt update Creation Age
Terminal Debian 0.9.0 โŒ โœ… 3.6.8 โŒ 28/12/2022 75 days
Terminal Ubuntu 0.20.0 โŒ โœ… 3.10.7 โŒ 960 sec 28/12/2022 75 days
Terminal Ubuntu 0.21.0
(Linux version 5.4.228.el8 Ubuntu 22.10)
โŒ โœ… 3.10.7 โŒ 233 sec 21/03/2023 0 days
Terminal CentOS 0.8.0 โŒ โœ… 3.6.8 โŒ 14/06/2022 272 days
PostgreSQL Server v14.5
(Linux v5.4.228.el8 Debian)
โœ… โŒ โŒ 218 sec 12/10/2022 152 days
PostgreSQL Server v15.2
(Linux v5.4.228.el8 Debian 6.1.2023)
โœ… โŒ 3.9.2 โŒ 24 sec 16/03/2023 4 days
Django v4.1.2 4.1.2
(Linux v5.4.228.el8 Debian)
โœ… โŒ โœ… 962 sec 08/11/2022 125 days

Incident review

Health Page Status ๐Ÿ‘‰ https://status.cloud.sdu.dk/

Year Incidents (nb)
2023 9
2022 18

Service Level Objective (SLO) for UCloud Compute >= 85% for Monthly Uptime Percentage.

Notes ๐Ÿ“

  • Aalborg (AAU) presentation of UCloud ๐ŸŽ“