UCloud Web Qualification
JV-conseil opened this issue ยท 0 comments
JV-conseil commented
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.
- 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 insettings.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
andCSRF_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.
- 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.
- Public link and Pseudo UCloud localhost mode are exclusive to one another.
- 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.
- 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 ๐