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

Debug facilities (part 1) #406

Closed
wants to merge 7 commits into from
Closed

Conversation

r-c-n
Copy link

@r-c-n r-c-n commented Jan 29, 2024

Requirements:

Add support for bypassing (dry-running) the initial pipeline stages and add a launcher script (debug_run.sh) to make it easier to run pipeline services individually in a local setup. See the commit messages and the script documentation for more info.

Running the trigger service with --dry-run <result> will generate checkout nodes with "dry_run" as a debug parameter and a forced result so that certain subsequent stages will simply run the logic and code generation and bypass actions that require external factors. This is meant as a way to exercise the pipeline stages locally without relying on a full staging instance.

Short function that's only used once and that takes a relatively big
number of parameters (potentially more). Inline it instead.

Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
@r-c-n r-c-n requested review from nuclearcat and a-wai January 29, 2024 13:58
Ricardo Cañuelo added 3 commits January 29, 2024 15:49
Maintaining a list of parameters loaded from context parameters with the
same name is redundant, doesn't make the code clearer and requires
maintenance. Access the parameters directly from the dict instead,

Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
Add a new command-line option to trigger dry_run events. These will
generate checkout nodes with debug parameters to bypass subsequent
pipeline stages and fake a result. This may be useful for debugging
purposes, for instance, to check the triggering of other pipeline
services and test code generation and application logic piece by piece
without relying on a remote staging instance.

Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
The script relies on a new docker-compose-debug.yaml file, which spawns
from the initial docker-compose.yaml, but it only specifies the command
to run for the monitor. The rest of the services don't run any specific
commands.

The purpose is to make it possible to run each service separately with
more flexibility, allowing different commands in each run, for instance.

debug_run.sh is meant to be used to start the monitor along with the
rest of the service images, and then run services individually with
custom commands as needed.

This may be useful during development and debugging.

Example:

  - Start the service images and run the monitor in one terminal:

      ./debug_run.sh

  - (In another terminal) Run the scheduler service:

      ./debug_run.sh scheduler loop --runtimes=shell

  - (In another terminal) Run the tarball service:

      ./debug_run.sh tarball run

Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
@r-c-n r-c-n marked this pull request as ready for review January 29, 2024 14:54
@nuclearcat nuclearcat added the staging-skip Don't test automatically on staging.kernelci.org label Jan 29, 2024
@nuclearcat nuclearcat removed the staging-skip Don't test automatically on staging.kernelci.org label Feb 8, 2024
@nuclearcat
Copy link
Member

Lets test it

@nuclearcat nuclearcat added the staging-skip Don't test automatically on staging.kernelci.org label Feb 8, 2024
@nuclearcat
Copy link
Member

Causing crash in tarball service:

today at 6:08:19 PM  File "/home/kernelci/pipeline/base.py", line 69, in run
today at 6:08:19 PM    status = self._run(context)
today at 6:08:19 PM             ^^^^^^^^^^^^^^^^^^
today at 6:08:19 PM  File "/home/kernelci/./pipeline/tarball.py", line 155, in _run
today at 6:08:19 PM    version, tarball_url)
today at 6:08:19 PM    ^^^^^^^
today at 6:08:19 PMNameError: name 'version' is not defined

Ricardo Cañuelo added 3 commits February 9, 2024 08:59
If the checkout node includes a "dry_run" debug option, bypass the
tarball actions and update the node using its debug info, making it
'available' for other services.

Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
If the input node specifies a "dry_run" result in its debug parameters,
skip the building and uploading stages and return the fake result.

Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
@r-c-n
Copy link
Author

r-c-n commented Feb 9, 2024

@nuclearcat I uploaded a fix (there was a line missing)

@nuclearcat
Copy link
Member

do we still need this PR?

@r-c-n
Copy link
Author

r-c-n commented Jul 25, 2024

No one's using this, so go ahead.

@nuclearcat nuclearcat closed this Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
staging-skip Don't test automatically on staging.kernelci.org
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants