Skip to content

Commit

Permalink
Merge branch 'crawler-added-sources' of https://github.com/SoftwareDe…
Browse files Browse the repository at this point in the history
…signLab/nvip-crawler into crawler-added-sources
  • Loading branch information
cg7346 committed Sep 27, 2023
2 parents 8420748 + eab4167 commit 28cf9b0
Show file tree
Hide file tree
Showing 568 changed files with 3,908 additions and 459,850 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/crawler-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ jobs:
# Setup MySQL DB for tests that require connection (Might not need this)
- name: Initialize Database
env:
LIQUIBASE_URL: ${{ env.HIKARI_URL }}
LIQUIBASE_USER: ${{ env.HIKARI_USER }}
LIQUIBASE_PASS: ${{ env.HIKARI_PASSWORD }}
LIQUIBASE_COMMAND_URL: ${{ env.HIKARI_URL }}
LIQUIBASE_COMMAND_USERNAME: ${{ env.HIKARI_USER }}
LIQUIBASE_COMMAND_PASSWORD: ${{ env.HIKARI_PASSWORD }}
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE ${{ env.DB_NAME }};' -u${{ env.HIKARI_USER }} -p${{ env.HIKARI_PASSWORD }}
- name: Run Liquibase Update
run: |
mvn liquibase:update
mvn liquibase:update --projects=crawler
- name: Test Crawler
run: |
Expand Down Expand Up @@ -93,6 +93,5 @@ jobs:

- name: Build and Push Docker Image for Crawler
run: |
cd crawler
docker build . -t nvip-crawler-sub:dev -t ghcr.io/softwaredesignlab/nvip-crawler-sub:dev
docker build . -f crawler/Dockerfile -t nvip-crawler-sub:dev -t ghcr.io/softwaredesignlab/nvip-crawler-sub:dev
docker push ghcr.io/softwaredesignlab/nvip-crawler-sub:dev
10 changes: 5 additions & 5 deletions .github/workflows/patchfinder-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ jobs:

- name: Initialize DB
env:
LIQUIBASE_URL: ${{ env.HIKARI_URL }}
LIQUIBASE_USER: ${{ env.HIKARI_USER }}
LIQUIBASE_PASS: ${{ env.HIKARI_PASSWORD }}
LIQUIBASE_COMMAND_URL: ${{ env.HIKARI_URL }}
LIQUIBASE_COMMAND_USERNAME: ${{ env.HIKARI_USER }}
LIQUIBASE_COMMAND_PASSWORD: ${{ env.HIKARI_PASSWORD }}
run: |
mysql -e 'CREATE DATABASE nvip;' -u${{ env.HIKARI_USER }} -p${{ env.HIKARI_PASSWORD }}
mvn liquibase:update --no-transfer-progress
mvn liquibase:update --no-transfer-progress --projects=patchfinder
- name: Test and Build PatchFinder with Maven
run: |
Expand Down Expand Up @@ -101,5 +101,5 @@ jobs:
- name: Build and Push Docker Image for Patchfinder
run: |
cd patchfinder
docker build . -t nvip-patchfinder:dev -t ghcr.io/softwaredesignlab/nvip-patchfinder:dev
docker build . -f patchfinder/Dockerfile -t nvip-patchfinder:dev -t ghcr.io/softwaredesignlab/nvip-patchfinder:dev
docker push ghcr.io/softwaredesignlab/nvip-patchfinder:dev
10 changes: 5 additions & 5 deletions .github/workflows/pne-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ jobs:

- name: Initialize DB
env:
LIQUIBASE_URL: ${{ env.HIKARI_URL }}
LIQUIBASE_USER: ${{ env.HIKARI_USER }}
LIQUIBASE_PASS: ${{ env.HIKARI_PASSWORD }}
LIQUIBASE_COMMAND_URL: ${{ env.HIKARI_URL }}
LIQUIBASE_COMMAND_USERNAME: ${{ env.HIKARI_USER }}
LIQUIBASE_COMMAND_PASSWORD: ${{ env.HIKARI_PASSWORD }}
run: |
mysql -e 'CREATE DATABASE nvip;' -u${{ env.HIKARI_USER }} -p${{ env.HIKARI_PASSWORD }}
mvn liquibase:update --no-transfer-progress
mvn liquibase:update --no-transfer-progress --projects=productnameextractor
- name: Test and Build Product Extractor with Maven
run: |
Expand Down Expand Up @@ -119,5 +119,5 @@ jobs:
- name: Build and Push Docker Image for Product Extractor
run: |
cd productnameextractor
docker build . -t nvip-product-extractor:dev -t ghcr.io/softwaredesignlab/nvip-product-extractor:dev
docker build . -f productnameextractor/Dockerfile -t nvip-product-extractor:dev -t ghcr.io/softwaredesignlab/nvip-product-extractor:dev
docker push ghcr.io/softwaredesignlab/nvip-product-extractor:dev
2 changes: 1 addition & 1 deletion .github/workflows/reconciler-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ jobs:
- name: Build and Push Docker Image for Reconciler
run: |
cd reconciler
docker build . -t nvip-reconciler:dev -t ghcr.io/softwaredesignlab/nvip-reconciler:dev
docker build . -f reconciler/Dockerfile -t nvip-reconciler:dev -t ghcr.io/softwaredesignlab/nvip-reconciler:dev
docker push ghcr.io/softwaredesignlab/nvip-reconciler:dev
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ logs
*.iml

# Class outputs
/target/
/crawler/target/
/reconciler/target/
/productnameextractor/target/
*/target/*
/productnameextractor/nvip_data/data/test_results.csv

# Large files
Expand All @@ -36,4 +33,4 @@ env.list
# Git Repos
nvip_data/pypa-repo/
exploitfinder/src/main/resources/exploit-repo
patchfinder/src/main/resources/patch-repos
patchfinder/src/main/resources/patch-repos
37 changes: 0 additions & 37 deletions Dockerfile

This file was deleted.

27 changes: 17 additions & 10 deletions crawler/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
FROM maven:3.8-jdk-11-slim AS builder
FROM maven:3.8.7-openjdk-18-slim AS builder

WORKDIR /home/app

ADD pom.xml .
ADD crawler/pom.xml crawler/pom.xml
ADD exploitfinder/pom.xml exploitfinder/pom.xml
ADD patchfinder/pom.xml patchfinder/pom.xml
ADD productnameextractor/pom.xml productnameextractor/pom.xml
ADD reconciler/pom.xml reconciler/pom.xml

RUN mvn dependency:go-offline
ADD src/main src/main

RUN mvn package -Dmaven.test.skip=true
ADD crawler/src/main crawler/src/main

RUN mvn package -Dmaven.test.skip=true --projects=crawler

### Run Stage
FROM openjdk:11-jre-slim
### Crawler Run Stage
FROM openjdk:11-jre-slim AS crawler

RUN apt-get update \
&& apt-get install -y libglib2.0-0 libnss3 libxcb1
Expand All @@ -19,13 +26,13 @@ RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd6
RUN apt-get install -y ./google-chrome-stable_current_amd64.deb

VOLUME /usr/local/lib/resources
ADD resources /usr/local/lib/resources
COPY crawler/resources /usr/local/lib/resources

VOLUME /usr/local/lib/output
ADD output /usr/local/lib/output
COPY crawler/output /usr/local/lib/output

COPY --from=builder /home/app/target/nvip_lib /usr/local/lib/nvip_lib
COPY --from=builder /home/app/target/crawler-1.0.jar /usr/local/lib/crawler-1.0.jar
COPY --from=builder /home/app/crawler/target/nvip_lib /usr/local/lib/nvip_lib
COPY --from=builder /home/app/crawler/target/crawler-2.0.jar /usr/local/lib/crawler-2.0.jar

WORKDIR /usr/local/lib/
ENTRYPOINT ["java", "-cp", "crawler-1.0.jar:nvip_lib/*", "edu.rit.se.nvip.CrawlerMain"]
ENTRYPOINT ["java", "-cp", "crawler-2.0.jar:nvip_lib/*", "edu.rit.se.nvip.CrawlerMain"]
8 changes: 5 additions & 3 deletions crawler/env.list
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ HIKARI_URL=jdbc:mysql://host.docker.internal:3306/nvip_test?useSSL=false&allowPu
HIKARI_USER=root
HIKARI_PASSWORD=root

MQ_HOST=localhost
MQ_PORT=5672
MQ_QUEUE_NAME=CRAWLER_OUT
RABBIT_HOST=localhost
RABBIT_PORT=5672
RABBIT_USERNAME=guest
RABBIT_PASSWORD=guest
CRAWLER_OUTPUT_QUEUE=CRAWLER_OUT

LOG_LEVEL=INFO

Expand Down
Loading

0 comments on commit 28cf9b0

Please sign in to comment.