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

fix(reporter): Add ScanCode license texts to reporter docker image #1680

Conversation

wkl3nk
Copy link
Contributor

@wkl3nk wkl3nk commented Dec 19, 2024

Dump the ScanCode license texts to directory /opt/scancode-license-data when creating the reporter docker container.
This directory is used by ORT as fallback option if the ScanCode license texts cannot be located by the existing heuristic look-up algorithm.

See oss-review-toolkit/ort#9622.

@wkl3nk wkl3nk force-pushed the wkl3nk/add-scancode-license-texts-to-reporter-image branch from 5ea0573 to 99e6636 Compare December 20, 2024 12:30
@wkl3nk wkl3nk marked this pull request as ready for review December 20, 2024 12:30
@sschuberth

This comment was marked as resolved.

@wkl3nk wkl3nk force-pushed the wkl3nk/add-scancode-license-texts-to-reporter-image branch from 99e6636 to 4da28f7 Compare December 20, 2024 13:15
RUN apt-get update && apt-get install -y curl libgomp1 && rm -rf /var/lib/apt/lists/*

# Use pip to install ScanCode
RUN curl -Os https://raw.githubusercontent.com/nexB/scancode-toolkit/v$SCANCODE_VERSION/requirements.txt && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder whether in this case, where ScanCode itself it not really needed, it wouldn't be more efficient to use e.g. curl (and some jq magic) on the LicenseDB API and download the *.LICENSE files directly.

Copy link
Contributor Author

@wkl3nk wkl3nk Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then the procedere to fetch the *.LICENSE files would be different from how it is done in the ORT docker image. I would prefer to do it in the same way for both docker images: The ORT docker image and the ORT Server Reporter docker image.

Copy link
Contributor

@sschuberth sschuberth Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can understand your motivation. However, the constraints are a bit different: The ORT Docker image needs ScanCode anyway, so it's natural to also use scancode-license-data. But here, we're adding all of ScanCode just to run scancode-license-data.

That's just something I wanted to point out. For simplicity, we should probably still do as you propose. I believe we anyway need to rework the way ORT provides ScanCode license texts. But that can and probably should be addressed separately.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that we should first improve the way we get license texts in ORT itself. There might be ways to implement this more efficiently, but as this only affects build performance in the multi-stage build and not the final image I don't see it as a pressing issue.

@wkl3nk wkl3nk force-pushed the wkl3nk/add-scancode-license-texts-to-reporter-image branch from 4da28f7 to 74c966d Compare January 7, 2025 08:14
Dump the ScanCode license texts to directory
/opt/scancode-license-data
when creating the reporter docker container.
This directory is used by ORT as fallback option if the
ScanCode license texts cannot be located by
the existing heuristic look-up algorithm.

See oss-review-toolkit/ort#9622.

Signed-off-by: Wolfgang Klenk <[email protected]>
@wkl3nk wkl3nk force-pushed the wkl3nk/add-scancode-license-texts-to-reporter-image branch from 74c966d to fd2563d Compare January 7, 2025 09:16
@mnonnenmacher mnonnenmacher added this pull request to the merge queue Jan 7, 2025
Merged via the queue into eclipse-apoapsis:main with commit 2c366e3 Jan 7, 2025
24 checks passed
@mnonnenmacher mnonnenmacher deleted the wkl3nk/add-scancode-license-texts-to-reporter-image branch January 7, 2025 10:17
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

Successfully merging this pull request may close these issues.

3 participants