Code Monkey home page Code Monkey logo

scanoss-engine's Introduction

SCANOSS Platform: Containerized Environment

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:

Quick start

To initiate SCANOSS using our sample Knowledge Base test-kb, follow these steps:

  1. Clone this repository

    git clone https://github.com/scanoss/scanoss-engine
  2. 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 the ldb folder exists.
    • The API is configured to listen on port 8083.
    • Please review the script for further reference.
  3. 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

Customization options are available through scripts and configuration files found under the scripts folder:

  • app-config-prod.json: API Configuration. See api.go for reference
  • env-setup.sh: Container-optimized API setup script.

Building your own container image

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:

  1. Clone this repository or download and extract the repository source package.

    git clone https://github.com/scanoss/scanoss-engine
    cd scanoss-engine/
  2. 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".

  3. 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.

  4. 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 ...

License

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

scanoss-engine's People

Contributors

agustingroh avatar perezale avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.