Open lvaylet opened 1 year ago
Running and debugging the SLO Generator from Visual Studio Code can be confusing due to the fact that slo-generator is defined as a console script entrypoint in setup.cfg:
slo-generator
setup.cfg
[options.entry_points] console_scripts = slo-generator = slo_generator.cli:main
Document how to run/debug a simple slo-generator compute ... command, for example in CONTRIBUTING.md.
slo-generator compute ...
CONTRIBUTING.md
This sample launch.json can be used to run/debug a simple slo-generator compute ... call:
launch.json
{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "SLO Generator", "type": "python", "request": "launch", "program": "${workspaceFolder}/venv/bin/slo-generator", "args": [ "compute", "--slo-config", "samples/cloud_monitoring/slo_gae_app_availability.yaml", "--config", "samples/config.yaml" ], "envFile": "${workspaceFolder}/.env", "console": "integratedTerminal", "justMyCode": true } ] }
Especially note the values of program (retrieved from which slo-generator after the package is installed in editable mode), args and envFile.
program
which slo-generator
args
envFile
![DESCRIPTION](LINK.png)
None identified.
No response
Update: type is now debugpy, as python will be deprecated soon according to Visual Studio Code itself.
type
debugpy
python
Summary
Running and debugging the SLO Generator from Visual Studio Code can be confusing due to the fact that
slo-generator
is defined as a console script entrypoint insetup.cfg
:Document how to run/debug a simple
slo-generator compute ...
command, for example inCONTRIBUTING.md
.Basic Example
This sample
launch.json
can be used to run/debug a simpleslo-generator compute ...
call:Especially note the values of
program
(retrieved fromwhich slo-generator
after the package is installed in editable mode),args
andenvFile
.Screenshots
Drawbacks
None identified.
Unresolved questions
No response
Code of Conduct