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

Monitor a scan's progress #66

Closed
cco3 opened this issue Dec 8, 2020 · 4 comments
Closed

Monitor a scan's progress #66

cco3 opened this issue Dec 8, 2020 · 4 comments
Assignees
Milestone

Comments

@cco3
Copy link

cco3 commented Dec 8, 2020

Is there any way to do this with a large image?

@tdruez
Copy link
Contributor

tdruez commented Dec 9, 2020

At the moment, you could run a Pipeline directly, bypassing the task system, to get the progress log displayed in the terminal:

$ cd scancode.io
$ source bin/activate
$ scanpipe create-project PROJECT_NAME --input docker_image.tar
$ DJANGO_SETTINGS_MODULE='scancodeio.settings' bin/python scanpipe/pipelines/docker.py run --project PROJECT_NAME

This will display Pipeline steps live execution:

2020-12-09 04:49:01.279 Workflow starting (run-id 1607489341272759):
2020-12-09 04:49:01.284 [1607489341272759/start/1 (pid 19637)] Task is starting.
2020-12-09 04:49:02.569 [1607489341272759/start/1 (pid 19637)] Task finished successfully.
2020-12-09 04:49:02.574 [1607489341272759/extract_images/2 (pid 19644)] Task is starting.
2020-12-09 04:49:03.799 [1607489341272759/extract_images/2 (pid 19644)] Task finished successfully.
2020-12-09 04:49:03.805 [1607489341272759/extract_layers/3 (pid 19649)] Task is starting.
2020-12-09 04:49:05.016 [1607489341272759/extract_layers/3 (pid 19649)] Task finished successfully.
[...]

I will improve the task system to provide easy access to progress information about Pipeline execution.

@tdruez tdruez self-assigned this Dec 9, 2020
@tdruez tdruez added this to the 1.1 milestone Dec 9, 2020
tdruez added a commit that referenced this issue Dec 9, 2020
@cco3
Copy link
Author

cco3 commented Dec 9, 2020

Thanks!

@cco3 cco3 closed this as completed Dec 9, 2020
@tdruez
Copy link
Contributor

tdruez commented Dec 10, 2020

@cco3 a new status management command is also available to display a high level status of a Project.
It can be useful to monitor the database objects addition:

$ scanpipe status --project PROJECT_NAME

@tdruez tdruez reopened this Dec 10, 2020
tdruez added a commit that referenced this issue Dec 14, 2020
tdruez added a commit that referenced this issue Jan 28, 2021
Signed-off-by: Thomas Druez <tdruez@nexb.com>
tdruez added a commit that referenced this issue Jan 28, 2021
Signed-off-by: Thomas Druez <tdruez@nexb.com>
tdruez added a commit that referenced this issue Jan 28, 2021
Add the logic to set the run_id at the start of the pipeline execution

Signed-off-by: Thomas Druez <tdruez@nexb.com>
tdruez added a commit that referenced this issue Jan 28, 2021
Signed-off-by: Thomas Druez <tdruez@nexb.com>
tdruez added a commit that referenced this issue Jan 28, 2021
…#66

Signed-off-by: Thomas Druez <tdruez@nexb.com>
tdruez added a commit that referenced this issue Jan 28, 2021
Signed-off-by: Thomas Druez <tdruez@nexb.com>
tdruez added a commit that referenced this issue Jan 29, 2021
#79)

* Upgrade metaflow library to latest version #66

Signed-off-by: Thomas Druez <tdruez@nexb.com>

* Move the project load into a common init_pipeline Pipeline method #66

Signed-off-by: Thomas Druez <tdruez@nexb.com>

* Add run_id as a Run model field #66

Add the logic to set the run_id at the start of the pipeline execution

Signed-off-by: Thomas Druez <tdruez@nexb.com>

* Add tests for the scanpipe tasks module #66

Signed-off-by: Thomas Druez <tdruez@nexb.com>

* Log messages from Pipeline execution on a new Run instance `log` field #66

Signed-off-by: Thomas Druez <tdruez@nexb.com>

* Add entry in the CHANGELOG #66

Signed-off-by: Thomas Druez <tdruez@nexb.com>
@tdruez
Copy link
Contributor

tdruez commented Feb 16, 2021

The monitoring of Pipeline execution was improved and is available in the command line, the UI, and the REST API.

Command line

$ scanpipe status --project PROJECT_NAME
Project: MyProject
Create date: Feb 16 2021 06:08
Work directory: /var/projects/MyProject-40599791

Database:
 - CodebaseResource: 403
   - (no status): 398
   - ignored-not-interesting: 4
   - scanned: 1
 - DiscoveredPackage: 0
 - ProjectError: 1

Pipelines:
 [RUNNING] docker
   2021-02-16 06:08:06.95 Pipeline [docker] starting
   2021-02-16 06:08:06.95 Step [extract_images] starting
   2021-02-16 06:08:06.97 Step [extract_images] completed in 0.02 seconds
   2021-02-16 06:08:06.97 Step [extract_layers] starting
   2021-02-16 06:08:07.13 Step [extract_layers] completed in 0.16 seconds
   2021-02-16 06:08:07.14 Step [find_images_linux_distro] starting
   2021-02-16 06:08:07.14 Step [find_images_linux_distro] completed in 0.00 seconds
   2021-02-16 06:08:07.14 Step [collect_images_information] starting
[...]

UI

From the Project details view, click on the "Running" pipeline entry in the Pipeline section:
Screenshot 2021-02-16 at 10 09 55 AM

This will open a modal with the current progress:
Screenshot 2021-02-16 at 10 10 11 AM

REST API

GET /api/projects/<PROJECT_UUID>/
The progress values are available in the runs field.

@tdruez tdruez closed this as completed Feb 16, 2021
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

No branches or pull requests

2 participants