-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Enhancement/html maintenance page per Deployment FQDN🚧🚧🚧 #93
✨ Enhancement/html maintenance page per Deployment FQDN🚧🚧🚧 #93
Conversation
@odeimaiz I can guide you through the PR or what this implies for you quickly tomorrow if you want ;) |
image: nginx:1.23.3 | ||
configs: | ||
- source: maintenance_page_api_html | ||
target: /usr/share/nginx/html/index.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If i understand that well, this responds with an html page for the API as well?
That is not strictly necessary (might be ok to "replace" the swagger view under /dev/doc
though).
The API server is used to "talk to client machines". The important thing for the API is to return 503 (service unavailable) with a maintenance message and include in the headers the time to retry (e.g. end of maintenance).
Please check in the ops issues. There you should find all explanations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The html file returns the following JSON code :
{ "errors": { "msg": "Service currently unavailable due to scheduled maintenance.", "type": "runtime_error" } }
I don't think anything has been done for the headers though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
* Fix error in call_make call * quote dot * Initial changes * fix whitespace bug Co-authored-by: Dustin Kaiser <kaiser@itis.swiss> Co-authored-by: Dustin Kaiser <mail@dustinkaiser.eu>
This PR enables there to be individually styled maintenance pages for each
DEPLOYMENT_FQDNS
(i.e. domain, such ass4l-lite.sexy
orspeak.com
).This is implemented by using
j2
templating to procedurally generate adocker-compose.yml
for the maintenance page which contains one nginx perDEPLOYMENT_FQDNS
. In the codedesign of this PR and in the following tests we assume that osparc-products and FQDNs (==
domains) to have a 1:1 correspondence. The names will thus be used interchangeably.For now, the oSparc API maintenance page (which servers a json making clear that oSparc is in maintenance) will not be customized and remains a catchall for all domains. This is done solely for time reasons, conceptually there could be an API maintenance page per product, using the same approach.
The following routes are captured by the maintenance page when the maintenance page is up:
s4l.speag.com
)services. s4l.speag.com
,{subhost:[a-zA-Z0-9-]+}.services. s4l.speag.com
)services.testing. s4l.speag.com
,{subhost:[a-zA-Z0-9-]+}.services.testing. s4l.speag.com
)The following changes in associated repositories will be necessary:
.html
files are found in theosparc-ops-deployment-configuration
repo [in git speag].s4l.speag.com
is assumed to be found in the osparc-ops-deployment-configuration [git.speag.com/oSparc/osparc-ops-deployment-configuration] in theosparc.speag.com
branch (which identifies dalco-production according to the historic convention) in the path./maintenancePageWebHTML/s4l.speag.com.html
. For each further FQDNS, such as in this examples4l-lite.speag.com
, this html file is assumed to exist. [Minor clarification: All "assets" of a certain deployment life in the deployment's branch in the osparc-ops-deployment-configuration git-repo]🚧🚧🚧Additional necessary changes upon release 🚧🚧🚧:
MAINTENANCE_PAGES_TRAEFIK_PRIORITY
environment variable that needs to be added torepo.config
For this PR to be merged @odeimaiz approval is strictly necessary, since he will style (and thus own), the s4l maintenance pages. Gracias @odeimaiz !!
Example docker-compose.yml file created from
DEPLOYMENT_FQDNS=tip.speag.com, s4l.speag.com, s4l-lite.speag.com
:`