Skip to content

Commit ea0a8fe

Browse files
authored
Merge pull request #650 from clearlydefined/scancodeUpgrade
Upgrading scancode to v32.4.1 and adding dev notes
2 parents 1715ccb + f91c086 commit ea0a8fe

File tree

6 files changed

+474
-373
lines changed

6 files changed

+474
-373
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ coverage/
66
.nyc_output
77
*~
88
\#*#
9+
env.json

DevDockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends --no-install-su
2121
gem install bundler -v 2.5.4 --no-document
2222

2323
# Scancode
24-
ARG SCANCODE_VERSION="32.1.0"
24+
ARG SCANCODE_VERSION="32.4.1"
2525
RUN pip3 install --upgrade pip setuptools wheel && \
2626
curl -Os https://raw.githubusercontent.com/nexB/scancode-toolkit/v$SCANCODE_VERSION/requirements.txt && \
2727
pip3 install --constraint requirements.txt scancode-toolkit==$SCANCODE_VERSION && \

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends --no-install-su
1919
gem install bundler -v 2.5.4 --no-document
2020

2121
# Scancode
22-
ARG SCANCODE_VERSION="32.1.0"
22+
ARG SCANCODE_VERSION="32.4.1"
2323
RUN pip3 install --upgrade pip setuptools wheel && \
2424
curl -Os https://raw.githubusercontent.com/nexB/scancode-toolkit/v$SCANCODE_VERSION/requirements.txt && \
2525
pip3 install --constraint requirements.txt scancode-toolkit==$SCANCODE_VERSION && \

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,34 @@ A service that crawls projects and packages for information relevant to ClearlyD
66

77
The quickest way to get a fully functional local ClearlyDefined set up (including the crawler) is to use the [Dockerized ClearlyDefined environment setup](https://github.com/clearlydefined/docker_dev_env_experiment). This runs all services locally and does not require access to the ClearlyDefined Azure account.
88

9+
**THIS IS THE SUGGEST DEV WORKFLOW AS LOCAL INSTALL/SETUP IS VERY ANGRY RIGHT NOW.**
10+
911
## Alternative Setup
1012

11-
Some parts of this set up may require access to the ClearlyDefined Azure Account.
13+
Some parts of this set up may require access to the ClearlyDefined Azure Account or proper setup of [Azurite](https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite) for local storage management.
1214

1315
1. Clone this repo
14-
1. `cd` to the repo dir and run `npm install`
15-
1. Copy the `template.env.json` file to the **parent** directory of the repo and rename it to `env.json`. Ideally this repo is colocated with the other ClearlyDefined repos. You can share the `env.json` file. Just merge the two files. Some properties are meant to be shared.
16-
1. After copying/merging, update the file to have the property values for your system. See the [Configuration](#configuration) section for more details.
17-
1. Install [ScanCode](https://github.com/nexB/scancode-toolkit) if desired (see below).
18-
1. Run `npm start`
16+
2. `cd` to the repo dir and run `npm install`
17+
3. Copy the `template.env.json` file to the **parent** directory of the repo and rename it to `env.json`. Ideally this repo is colocated with the other ClearlyDefined repos. You can share the `env.json` file. Just merge the two files. Some properties are meant to be shared.
18+
4. After copying/merging, update the file to have the property values for your system. See the [Configuration](#configuration) section for more details.
19+
5. Install [ScanCode](https://github.com/nexB/scancode-toolkit) if desired (see below).
20+
6. Run `npm start`
1921

2022
That results in the ClearlyDefined crawler starting up and listening for POSTs on port 5000. See the [Configuration](#configuration) section for info on how to change the port.
2123

2224
### ScanCode install notes
2325

2426
Due to an issue with ScanCode's install configuration on Windows, you may need to **replace** the `bin` folder (actually a "junction") with the contents of the `Scripts` folder. That is, delete `bin` and copy `Scripts` to `bin`. See https://github.com/nexB/scancode-toolkit/issues/1129 for more details.
2527

28+
## Setup for running tests
29+
30+
If you are just interested in running the tests for the crawler then you need to be using Node v18.20.8 on your local system to get `npm install` and the tests to run safely. This will be fixed as we upgrade the dependencies but for now this is the best solution. If you are using [nvm](https://github.com/nvm-sh/nvm) you can follow the instructions below, using the lowest working node version, to get things setup to run tests.
31+
32+
1. Clone this repo
33+
2. cd into the `crawler` directory
34+
3. run `nvm install v18.20.8; nvm use v18.20.8` to instal the correct node version
35+
4. run `npm run test` and profit
36+
2637
## Queuing work with the crawler
2738

2839
The crawler takes _requests_ to rummage around and find relevant information about projects. For example, to crawl an NPM, or a GitHub repo, POST one of the following JSON bodies to `http://localhost:5000/requests`. Note that you can also queue an array of requests by POSTing a single (or array of) JSON request object. For example,

0 commit comments

Comments
 (0)