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

back2source: Automate running pipeline on many projects #1506

Open
2 of 3 tasks
pombredanne opened this issue Jan 6, 2025 · 2 comments
Open
2 of 3 tasks

back2source: Automate running pipeline on many projects #1506

pombredanne opened this issue Jan 6, 2025 · 2 comments
Assignees

Comments

@pombredanne
Copy link
Member

pombredanne commented Jan 6, 2025

We are running many d2d pipelines in the issues below.
We need to create the scripts to make this a smooth process:

The related issues are:

@pombredanne pombredanne converted this from a draft issue Jan 6, 2025
@pombredanne pombredanne moved this to In progress in 05-Back2Source next Jan 7, 2025
@tdruez
Copy link
Contributor

tdruez commented Jan 9, 2025

The new batch-create management command is available to create projects from a CSV input. (#1437)

Documented at https://scancodeio.readthedocs.io/en/latest/command-line-interface.html#scanpipe-batch-create-input-directory-input-directory-input-list-filename-csv

1. Create a 2 columns CSV file:

project_name input_urls
project-1.0 https://url.com/source-1.0.zip#from, https://url.com/binary-1.0.zip#to
project-2.0 https://url.com/source-2.0.zip#from, https://url.com/binary-2.0.zip#to

2. Run the batch-create management command with the CSV file as input

  • Put the CSV file in your current directory

  • Run the following replacing <FILENAME.CSV> with the CSV file name and the <PLATFORM_LABEL> with a pertinent tag (e.g.: cpp, Python, Java, Rust, Ruby, JavaScript, ...)

    docker compose -f /opt/scancodeio/docker-compose.yml run --rm \
        --volume ${PWD}:/input-data:ro \
        web scanpipe batch-create \
        --input-list /input-data/<FILENAME.CSV> \
        --pipeline map_deploy_to_develop \
        --label back2source-<PLATFORM_LABEL> \
        --execute --async
    
  • Alternatively, if the input CSV file is available online, on the https://github.com/aboutcode-org/back2source-data/ repo for example, you can provide this URL as the --input-list value:

    docker compose -f /opt/scancodeio/docker-compose.yml run --rm \
        web scanpipe batch-create \
        --input-list https://github.com/aboutcode-org/back2source-data/raw/....../<FILENAME.CSV> \
        --pipeline map_deploy_to_develop \
        --label back2source-<PLATFORM_LABEL> \
        --execute --async
    

@tdruez
Copy link
Contributor

tdruez commented Jan 23, 2025

Use a helper script to create these CSV inputs for instance from a PURL.

@pombredanne I don't think we need this at the moment, in case we do, it may be better handled as another issue with more details.

I think we have everything we need to run many projects scan with the current implementation of batch-create (see comment above) and the report feature completed in #1524

The scan execution is happening in #1437 (comment)

Let me know if anything else is needed here, otherwise you can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

No branches or pull requests

2 participants