Skip to content

Commit

Permalink
Update the documentation with pipelines renaming #1044
Browse files Browse the repository at this point in the history
Signed-off-by: tdruez <tdruez@nexb.com>
  • Loading branch information
tdruez committed Jan 17, 2024
1 parent 61db46c commit 63c3fc1
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 55 deletions.
2 changes: 1 addition & 1 deletion docs/automation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ For instance, you can create a project and trigger it using the following comman
crontab::

docker compose exec -it web scanpipe create-project scan-$(date +"%Y-%m-%dT%H:%M:%S") \
--pipeline scan_package \
--pipeline scan_single_package \
--input-url https://github.com/package-url/packageurl-python/archive/refs/heads/main.zip \
--execute

Expand Down
10 changes: 5 additions & 5 deletions docs/built-in-pipelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ Pipeline Base Class
:members:
:member-order: bysource

.. _pipeline_docker:
.. _pipeline_analyze_docker_image:

Analyse Docker Image
--------------------
.. autoclass:: scanpipe.pipelines.docker.Docker()
:members:
:member-order: bysource

.. _pipeline_root_filesystems:
.. _pipeline_analyze_root_filesystem:

Analyze Root Filesystem or VM Image
-----------------------------------
.. autoclass:: scanpipe.pipelines.root_filesystem.RootFS()
:members:
:member-order: bysource

.. _pipeline_docker_windows:
.. _analyze_windows_docker_image:

Analyse Docker Windows Image
----------------------------
Expand Down Expand Up @@ -66,7 +66,7 @@ Load Inventory
:members:
:member-order: bysource

.. _pipeline_deploy_to_develop:
.. _pipeline_map_deploy_to_develop:

Map Deploy To Develop
---------------------
Expand Down Expand Up @@ -98,7 +98,7 @@ Scan Codebase Package
:members:
:member-order: bysource

.. _pipeline_scan_package:
.. _pipeline_scan_single_package:

Scan Single Package
-------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/command-line-interface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ You can use more than one ``PIPELINE_NAME`` to add multiple pipelines at once.
For example, assuming you have created beforehand a project named "foo", this will
add the docker pipeline to your project::

$ scanpipe add-pipeline --project foo docker
$ scanpipe add-pipeline --project foo analyze_docker_image


`$ scanpipe execute --project PROJECT`
Expand Down
19 changes: 10 additions & 9 deletions docs/distros-os-images.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,19 @@ may be only used for certain pipelines:
- **RPM-based** Linux distros: RHEL, Fedora, openSUSE/SUSE
- **Alpine** Linux distros

For the above three flavors, the :ref:`docker <pipeline_docker>` and
:ref:`root_filesystems <pipeline_root_filesystems>` pipelines support comprehensive
detection of installed system packages, their provenance, their license metadata,
and their installed files.
For the above three flavors, the
:ref:`analyze_docker_image <pipeline_analyze_docker_image>` and
:ref:`analyze_root_filesystem_or_vm_image <pipeline_analyze_root_filesystem>` pipelines
support comprehensive detection of installed system packages, their provenance,
their license metadata, and their installed files.

- For **Windows**, the :ref:`docker_windows <pipeline_docker_windows>` pipeline supports
Windows Docker images with extensive detection of installed Windows packages,
programs, and the majority of installed files.
- For **Windows**, the :ref:`analyze_windows_docker_image <analyze_windows_docker_image>`
pipeline supports Windows Docker images with extensive detection of installed Windows
packages, programs, and the majority of installed files.

- **Distroless** Docker images system packages are detected with the
:ref:`docker <pipeline_docker>` pipeline; package and license metadata are also
detected.
:ref:`analyze_docker_image <pipeline_analyze_docker_image>` pipeline; package and
license metadata are also detected.
However, some work needs to be done to achieve comprehensive support and fix
the issue of system packages ot tracking their installed files. Check `this
open GitHub issue <https://github.com/GoogleContainerTools/distroless/issues/741>`_
Expand Down
24 changes: 13 additions & 11 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ Selecting the right pipeline for your needs depends primarily on the type of inp
data you have available.
Here are some general guidelines based on different input scenarios:

- If you have a **Docker image** as input, use the :ref:`docker <pipeline_docker>`
pipeline.
- If you have a **Docker image** as input, use the
:ref:`analyze_docker_image <pipeline_analyze_docker_image>` pipeline.
- For a full **codebase compressed as an archive**, choose the
:ref:`scan_codebase <pipeline_scan_codebase>` pipeline.
- If you have a **single package archive**, opt for the
:ref:`scan_package <pipeline_scan_package>` pipeline.
:ref:`scan_single_package <pipeline_scan_single_package>` pipeline.
- When dealing with a **Linux root filesystem** (rootfs), the
:ref:`root_filesystems <pipeline_root_filesystems>` pipeline is the appropriate
choice.
:ref:`analyze_root_filesystem_or_vm_image <pipeline_analyze_root_filesystem>` pipeline
is the appropriate choice.
- For processing the results of a **ScanCode-toolkit scan** or **ScanCode.io scan**,
use the :ref:`load_inventory <pipeline_load_inventory>` pipeline.
- When you have **manifest files**, such as a
**CycloneDX BOM, SPDX document, lockfile**, etc.,
use the :ref:`inspect_packages <pipeline_inspect_packages>` pipeline.
- For scenarios involving both a **development and deployment codebase**, consider using
the :ref:`deploy_to_develop <pipeline_deploy_to_develop>` pipeline.
the :ref:`map_deploy_to_develop <pipeline_map_deploy_to_develop>` pipeline.

These pipelines will automatically execute the necessary steps to scan and create the
packages, dependencies, and resources for your project based on the input data provided.
Expand All @@ -56,10 +56,11 @@ by running some of the following additional pipelines:
Please ensure that you have set up
:ref:`PurlDB <scancodeio_settings_purldb>` before running this pipeline.

What is the difference between scan_codebase and scan_package pipelines?
------------------------------------------------------------------------
What is the difference between scan_codebase and scan_single_package pipelines?
-------------------------------------------------------------------------------

The key differences are that the :ref:`scan_package <pipeline_scan_package>` pipeline
The key differences are that the
:ref:`scan_single_package <pipeline_scan_single_package>` pipeline
treats the input as if it were a single package, such as a package archive, and
computes a **License clarity** and a **Scan summary** to aggregate the package scan
data:
Expand Down Expand Up @@ -116,8 +117,9 @@ The following tools and libraries are used during the docker images analysis pip
- Secondary libraries and plugins from
`scancode-plugins <https://github.com/nexB/scancode-plugins>`_.

The pipeline documentation is available at :ref:`pipeline_docker` and its source code
at `docker.py <https://github.com/nexB/scancode.io/blob/main/scanpipe/pipelines/docker.py>`_.
The pipeline documentation is available at :ref:`pipeline_analyze_docker_image` and
its source code at
`docker.py <https://github.com/nexB/scancode.io/blob/main/scanpipe/pipelines/docker.py>`_.
It is hopefully designed to be simple and readable code.

Am I able to run ScanCode.io on Windows?
Expand Down
4 changes: 2 additions & 2 deletions docs/output-files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ as shown below
],
"runs": [
{
"pipeline_name": "docker",
"pipeline_name": "analyze_docker_image",
"description": "A pipeline to analyze a Docker image.",
"uuid": "5f1ec0c5-91ed-45c8-ab3d-beae44018716",
"created_date": "2021-06-13T00:50:18.367560Z",
Expand All @@ -78,7 +78,7 @@ as shown below
"task_end_date": "2021-06-13T01:20:56.486136Z",
"task_exitcode": 0,
"task_output": "",
"log": "2021-06-13 01:20:47.66 Pipeline [docker] starting\n2021-06-13 01:20:47.66 Step [extract_images] starting\n2021-06-13 01:20:47.72 Step [extract_images] completed in 0.05 seconds\n2021-06-13 01:20:47.72 Step [extract_layers] starting\n2021-06-13 01:20:47.84 Step [extract_layers] completed in 0.12 seconds\n2021-06-13 01:20:47.84 Step [find_images_linux_distro] starting\n2021-06-13 01:20:47.84 Step [find_images_linux_distro] completed in 0.00 seconds\n2021-06-13 01:20:47.85 Step [collect_images_information] starting\n2021-06-13 01:20:47.85 Step [collect_images_information] completed in 0.00 seconds\n2021-06-13 01:20:47.85 Step [collect_and_create_codebase_resources] starting\n2021-06-13 01:20:48.65 Step [collect_and_create_codebase_resources] completed in 0.79 seconds\n2021-06-13 01:20:48.65 Step [collect_and_create_system_packages] starting\n2021-06-13 01:20:50.89 Step [collect_and_create_system_packages] completed in 2.24 seconds\n2021-06-13 01:20:50.89 Step [flag_uninteresting_codebase_resources] starting\n2021-06-13 01:20:50.90 Step [tag_uninteresting_codebase_resources] completed in 0.00 seconds\n2021-06-13 01:20:50.90 Step [tag_empty_files] starting\n2021-06-13 01:20:50.91 Step [tag_empty_files] completed in 0.00 seconds\n2021-06-13 01:20:50.91 Step [scan_for_application_packages] starting\n2021-06-13 01:20:50.98 Step [scan_for_application_packages] completed in 0.07 seconds\n2021-06-13 01:20:50.98 Step [scan_for_files] starting\n2021-06-13 01:20:56.46 Step [scan_for_files] completed in 5.48 seconds\n2021-06-13 01:20:56.46 Step [analyze_scanned_files] starting\n2021-06-13 01:20:56.47 Step [analyze_scanned_files] completed in 0.00 seconds\n2021-06-13 01:20:56.47 Step [tag_not_analyzed_codebase_resources] starting\n2021-06-13 01:20:56.48 Step [tag_not_analyzed_codebase_resources] completed in 0.00 seconds\n2021-06-13 01:20:56.48 Pipeline completed\n",
"log": "2021-06-13 01:20:47.66 Pipeline [analyze_docker_image] starting\n2021-06-13 01:20:47.66 Step [extract_images] starting\n2021-06-13 01:20:47.72 Step [extract_images] completed in 0.05 seconds\n2021-06-13 01:20:47.72 Step [extract_layers] starting\n2021-06-13 01:20:47.84 Step [extract_layers] completed in 0.12 seconds\n2021-06-13 01:20:47.84 Step [find_images_linux_distro] starting\n2021-06-13 01:20:47.84 Step [find_images_linux_distro] completed in 0.00 seconds\n2021-06-13 01:20:47.85 Step [collect_images_information] starting\n2021-06-13 01:20:47.85 Step [collect_images_information] completed in 0.00 seconds\n2021-06-13 01:20:47.85 Step [collect_and_create_codebase_resources] starting\n2021-06-13 01:20:48.65 Step [collect_and_create_codebase_resources] completed in 0.79 seconds\n2021-06-13 01:20:48.65 Step [collect_and_create_system_packages] starting\n2021-06-13 01:20:50.89 Step [collect_and_create_system_packages] completed in 2.24 seconds\n2021-06-13 01:20:50.89 Step [flag_uninteresting_codebase_resources] starting\n2021-06-13 01:20:50.90 Step [tag_uninteresting_codebase_resources] completed in 0.00 seconds\n2021-06-13 01:20:50.90 Step [tag_empty_files] starting\n2021-06-13 01:20:50.91 Step [tag_empty_files] completed in 0.00 seconds\n2021-06-13 01:20:50.91 Step [scan_for_application_packages] starting\n2021-06-13 01:20:50.98 Step [scan_for_application_packages] completed in 0.07 seconds\n2021-06-13 01:20:50.98 Step [scan_for_files] starting\n2021-06-13 01:20:56.46 Step [scan_for_files] completed in 5.48 seconds\n2021-06-13 01:20:56.46 Step [analyze_scanned_files] starting\n2021-06-13 01:20:56.47 Step [analyze_scanned_files] completed in 0.00 seconds\n2021-06-13 01:20:56.47 Step [tag_not_analyzed_codebase_resources] starting\n2021-06-13 01:20:56.48 Step [tag_not_analyzed_codebase_resources] completed in 0.00 seconds\n2021-06-13 01:20:56.48 Pipeline completed\n",
"execution_time": 8
}
],
Expand Down
12 changes: 6 additions & 6 deletions docs/rest-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Using cURL:
data='{
"name": "project_name",
"input_urls": "https://download.url/package.archive",
"pipeline": "scan_package",
"pipeline": "scan_single_package",
"execute_now": true
}'
Expand All @@ -111,7 +111,7 @@ Using cURL:
upload_file="/path/to/the/archive.zip"
curl -F "name=project_name" \
-F "pipeline=scan_package" \
-F "pipeline=scan_single_package" \
-F "execute_now=True" \
-F "upload_file=@$upload_file" \
"$api_url"
Expand All @@ -131,7 +131,7 @@ Using Python and the **"requests"** library:
data = {
"name": "project_name",
"input_urls": "https://download.url/package.archive",
"pipeline": "scan_package",
"pipeline": "scan_single_package",
"execute_now": True,
}
response = requests.post(api_url, data=data)
Expand All @@ -149,7 +149,7 @@ Using Python and the **"requests"** library:
api_url = "http://localhost/api/projects/"
data = {
"name": "project_name",
"pipeline": "scan_package",
"pipeline": "scan_single_package",
"execute_now": True,
}
files = {"upload_file": open("/path/to/the/archive.zip", "rb")}
Expand Down Expand Up @@ -279,7 +279,7 @@ Using cURL:
api_url="http://localhost/api/projects/6461408c-726c-4b70-aa7a-c9cc9d1c9685/add_pipeline/"
content_type="Content-Type: application/json"
data='{
"pipeline": "docker",
"pipeline": "analyze_docker_image",
"execute_now": true
}'
Expand Down Expand Up @@ -434,7 +434,7 @@ The run details view returns all information available about a pipeline run.
{
"url": "http://localhost/api/runs/8d5c3962-5fca-47d7-b8c8-47a19247714e/",
"pipeline_name": "scan_package",
"pipeline_name": "scan_single_package",
"status": "success",
"description": "A pipeline to scan a single package archive with ScanCode-toolkit.",
"project": "http://localhost/api/projects/cd5b0459-303f-4e92-99c4-ea6d0a70193e/",
Expand Down
8 changes: 4 additions & 4 deletions docs/tutorial_api_analyze_package_archive.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Instructions:
- First, let's create a new project called ``boolean.py-3.8``.
- We'll be using this `package <https://github.com/bastikr/boolean.py/archive/refs/tags/v3.8.zip>`_
as the project input.
- We can add and execute the scan_package pipeline on our new project.
- We can add and execute the scan_single_package pipeline on our new project.

.. note::
Whether you follow this tutorial and previous instructions using cURL or
Expand All @@ -33,7 +33,7 @@ Using cURL
data='{
"name": "boolean.py-3.8",
"input_urls": "https://github.com/bastikr/boolean.py/archive/refs/tags/v3.8.zip",
"pipeline": "scan_package",
"pipeline": "scan_single_package",
"execute_now": true
}'
Expand All @@ -52,7 +52,7 @@ Using cURL
{
"name": "boolean.py-3.8",
"input_urls": "https://github.com/bastikr/boolean.py/archive/refs/tags/v3.8.zip",
"pipeline": "scan_package",
"pipeline": "scan_single_package",
"execute_now": true
}
Expand Down Expand Up @@ -100,7 +100,7 @@ Using Python script
data = {
"name": "boolean.py-3.8",
"input_urls": "https://github.com/bastikr/boolean.py/archive/refs/tags/v3.8.zip",
"pipeline": "scan_package",
"pipeline": "scan_single_package",
"execute_now": True,
}
response = requests.post(api_url, data=data)
Expand Down
27 changes: 14 additions & 13 deletions docs/tutorial_cli_analyze_docker_image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ Instructions
Alternatively, you can copy files manually to the :guilabel:`input/`
directory to include entire directories.

- Add the docker pipeline to your project:
- Add the ``analyze_docker_image`` pipeline to your project:

.. code-block:: console
$ scanpipe add-pipeline --project staticbox docker
$ scanpipe add-pipeline --project staticbox analyze_docker_image
.. code-block:: console
>> Pipeline docker added to the project
>> Pipeline analyze_docker_image added to the project
- Check the status of the pipeline added to your project:

Expand All @@ -97,7 +97,7 @@ Instructions
.. code-block:: console
>> [NOT_STARTED] docker
>> [NOT_STARTED] analyze_docker_image
.. note::
The ``scanpipe show-pipeline`` command lists all the pipelines added to the
Expand All @@ -106,34 +106,34 @@ Instructions
already running, pipelines with **"SUCCESS"** or **"FAILURE"** status, and those
will be running next, pipelines with **"NOT_STARTED"** status as shown below.

- Run the docker pipeline on this project. In the output, you will be shown
the pipeline's execution progress:
- Run the ``analyze_docker_image`` pipeline on this project. In the output, you will be
shown the pipeline's execution progress:

.. code-block:: console
$ scanpipe execute --project staticbox
.. code-block:: console
>> Pipeline docker run in progress...
Pipeline [docker] starting
>> Pipeline analyze_docker_image run in progress...
Pipeline [analyze_docker_image] starting
Step [extract_images] starting
Step [extract_images] completed in 0.18 seconds
Step [extract_layers] starting
[...]
Pipeline completed
docker successfully executed on project staticbox
analyze_docker_image successfully executed on project staticbox
- Executing the ``show-pipeline`` command again will also confirm the success
of the pipeline execution - **"[SUCCESS] docker"** status:
of the pipeline execution - **"[SUCCESS] analyze_docker_image"** status:

.. code-block:: console
$ scanpipe show-pipeline --project staticbox
.. code-block:: console
>> [SUCCESS] docker
>> [SUCCESS] analyze_docker_image
- Get the results of the pipeline execution as a JSON file using the ``output`` command:

Expand All @@ -155,11 +155,12 @@ Instructions
after the project creation.
For example, the following command will create a project named ``staticbox2``,
download the test Docker image to the project's :guilabel:`input/`
directory, add the docker pipeline, and execute the pipeline in one operation:
directory, add the ``analyze_docker_image`` pipeline, and execute the pipeline in
one operation:

.. code-block:: bash
$ scanpipe create-project staticbox2 \
--input-url https://github.com/nexB/scancode.io-tutorial/releases/download/sample-images/30-alpine-nickolashkraus-staticbox-latest.tar \
--pipeline docker \
--pipeline analyze_docker_image \
--execute
7 changes: 4 additions & 3 deletions docs/tutorial_web_ui_analyze_docker_image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ Instructions
- Paste the input Docker image's URL,
`docker://alpine/httpie <https://hub.docker.com/r/alpine/httpie/>`_,
in the **"Download URL"** field, which fetches the image from the provided URL.
- Use the **"Pipeline"** dropdown list, add the **"docker"** pipeline to your project
- You can add and execute the docker pipeline in one operation by checking the
**"Execute pipeline now"** checkbox.
- Use the **"Pipeline"** dropdown list, add the ``analyze_docker_image`` pipeline to
your project.
- You can add and execute the ``analyze_docker_image`` pipeline in one operation by
checking the **"Execute pipeline now"** checkbox.

.. image:: images/tutorial-web-ui-project-form.png

Expand Down

0 comments on commit 63c3fc1

Please # to comment.