Skip to content
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

Startup script for App Service #464

Merged
merged 3 commits into from
Jul 28, 2023
Merged

Startup script for App Service #464

merged 3 commits into from
Jul 28, 2023

Conversation

pamelafox
Copy link
Collaborator

Purpose

This PR overrides the default Oryx startup script with its own. This change enables developers to more easily override gunicorn settings to find the right setup for their traffic levels. For example, they can vary number of threads, change the worker class to async/gevent/etc.

Eventually we could setup load testing to come up with recommendations / enable others to figure out best gunicorn settings for their use case.

Does this introduce a breaking change?

Marking as breaking to clarify that the App must be both provisioned and deployed for this change- provisioned for the appCommandLine config change, and deployed to add the two new files.

[X] Yes
[ ] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[X] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

  • azd up
  • See in logs evidence that its using startup script:
2023-07-27T04:43:37.170015663Z Launching oryx with: create-script -appPath /home/site/wwwroot -output /opt/startup/startup.sh -virtualEnvName antenv -defaultApp /opt/defaultsite -userStartupCommand 'start_appservice.sh'
2023-07-27T04:43:37.463169267Z Found build manifest file at '/home/site/wwwroot/oryx-manifest.toml'. Deserializing it...
2023-07-27T04:43:37.470786379Z Build Operation ID: d4752674c9b24790
2023-07-27T04:43:37.471918625Z Oryx Version: 0.2.20230512.3, Commit: a81ce1fa16b6e03d37f79d3ba5e99cf09b28e4ef, ReleaseTagName: 20230512.3
2023-07-27T04:43:37.472665556Z Output is compressed. Extracting it...
2023-07-27T04:43:37.753684162Z Extracting '/home/site/wwwroot/output.tar.gz' to directory '/tmp/8db8e5b1af64b7c'...
2023-07-27T04:43:57.798886156Z App path is set to '/tmp/8db8e5b1af64b7c'
2023-07-27T04:43:57.891648889Z Writing output script to '/opt/startup/startup.sh'
2023-07-27T04:43:59.393022517Z Using packages from virtual environment antenv located at /tmp/8db8e5b1af64b7c/antenv.
2023-07-27T04:43:59.393808349Z Updated PYTHONPATH to '/opt/startup/app_logs:/tmp/8db8e5b1af64b7c/antenv/lib/python3.10/site-packages'
2023-07-27T04:44:13.712802256Z [2023-07-27 04:44:13 +0000] [69] [INFO] Starting gunicorn 20.1.0
2023-07-27T04:44:13.714464225Z [2023-07-27 04:44:13 +0000] [69] [INFO] Listening at: http://0.0.0.0:8000 (69)
2023-07-27T04:44:13.720354068Z [2023-07-27 04:44:13 +0000] [69] [INFO] Using worker: gthread
2023-07-27T04:44:13.762019187Z [2023-07-27 04:44:13 +0000] [70] [INFO] Booting worker with pid: 70
2023-07-27T04:44:13.789227609Z [2023-07-27 04:44:13 +0000] [71] [INFO] Booting worker with pid: 71
2023-07-27T04:44:13.811931045Z [2023-07-27 04:44:13 +0000] [72] [INFO] Booting worker with pid: 72

app/backend/gunicorn.conf.py Outdated Show resolved Hide resolved
@pamelafox pamelafox merged commit 62824c3 into Azure-Samples:main Jul 28, 2023
6 checks passed
@pamelafox pamelafox deleted the startscript branch July 28, 2023 00:09
HughRunyan pushed a commit to RMI/RMI_chatbot that referenced this pull request Mar 26, 2024
* Startup script

* Newlines

* Change threads
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants