The scanoss-engine repository offers a containerized environment, simplifying deployment with essential software components and dependencies encapsulated within a single Docker container. These components include:
To initiate SCANOSS using our sample Knowledge Base test-kb, follow these steps:
-
Clone this repository
git clone https://github.com/scanoss/scanoss-engine
-
Execute the
start.sh
script. This script pulls our test Knowledge Base (~40GB uncompressed) containing example components and starts the SCANOSS container.cd scanoss-engine/ ./start.sh
Notes:
- The example KB will be downloaded in the
./ldb
folder and the download will be skipped if theldb
folder exists. - The API is configured to listen on port 8083.
- Please review the script for further reference.
- The example KB will be downloaded in the
-
Test your environment by running a scan request using the Python CLI:
From another terminal you can run a scan against the container. If the scan was successfull, you will receive the match output.
scanoss-py scan --apiurl http://localhost:8083/api/scan/direct test-data/
Customization options are available through scripts and configuration files found under the scripts
folder:
app-config-prod.json
: API Configuration. See api.go for referenceenv-setup.sh
: Container-optimized API setup script.
Follow these steps if you want to build your own image.
Pre-requisites:
- A Knowledge Base. You may reuse the example KB downloaded in the Quick Start section or mine your own components following the minr guide and the test kb mining script. Ensure sufficient disk storage for mining required components.
Steps:
-
Clone this repository or download and extract the repository source package.
git clone https://github.com/scanoss/scanoss-engine cd scanoss-engine/
-
Build the container image:
To build the image, use the following command:
docker build -t scanoss-engine .
This command creates an image named "scanoss-engine".
-
Run a container:
Once the image is built, run the container with all required components available out of the box.
Replace
<LDB_DATA_DIR>
with a local directory containing the Knowledge Base in the Docker host.docker run --rm \ -p 8083:8083 \ -v <LDB_DATA_DIR>:/var/lib/ldb \ -it scanoss-engine
-
The API is configured to listen on port 8083.
-
The SCANOSS engine looks for databases in
/var/lib/ldb/
. -
The configuration variable
ScanningURL
defines the base URL for the source file's URL present in the output response.
-
-
Test your environment:
Once the container is running, query the API and run scans against the new Knowledge Base.
To verify the installation, scan a component from the mining list using the Python CLI:
scanoss-py scan --apiurl http://localhost:8083/api/scan/direct test-data/
The scanning results will include matches to the mined component.
Note: The Docker image is based on amd64 binaries. On non-amd64 processors you need to pass the option: --platform linux/amd64
to the docker run
command to enable compatibility:
docker run --platform linux/amd64 ...
The Scanoss Platform is entirely released under the GPL 2.0 license. Please check the LICENSE file for more information.
Copyright (C) 2018-2020 SCANOSS.COM