-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from bgpkit/crawler
`bgpkit-broker` cli with crawler + api + search
- Loading branch information
Showing
19 changed files
with
2,604 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# flyctl launch added from .gitignore | ||
target | ||
**/Cargo.lock | ||
**/.idea | ||
|
||
**/*.sqlite3* | ||
**/*.duckdb* | ||
**/*.parquet | ||
.env | ||
|
||
# flyctl launch added from .idea/.gitignore | ||
# Default ignored files | ||
.idea/shelf | ||
.idea/workspace.xml | ||
# Editor-based HTTP Client requests | ||
.idea/httpRequests | ||
# Datasource local storage ignored files | ||
.idea/dataSources | ||
.idea/dataSources.local.xml | ||
fly.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
/target | ||
Cargo.lock | ||
.idea | ||
|
||
*.sqlite3* | ||
*.duckdb* | ||
*.parquet | ||
/.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,75 @@ | ||
[package] | ||
name = "bgpkit-broker" | ||
version = "0.6.2" | ||
version = "0.7.0-alpha.1" | ||
edition = "2018" | ||
authors = ["Mingwei Zhang <mingwei@bgpkit.com>"] | ||
readme = "README.md" | ||
license = "MIT" | ||
repository = "https://github.com/bgpkit/bgpkit-broker" | ||
documentation = "https://docs.rs/bgpkit-broker" | ||
description = """ | ||
A library to access BGPKIT Broker API and enable searching for BGP data archive files over time from public available | ||
data sources. | ||
A library and command-line to provide indexing and searching functionalities for public BGP data archive files over time. | ||
""" | ||
keywords = ["bgp", "bgpkit", "api"] | ||
|
||
[[bin]] | ||
path= "src/cli/broker.rs" | ||
name="bgpkit-broker" | ||
required-features = ["cli"] | ||
|
||
[dependencies] | ||
|
||
############################################# | ||
# Core Broker Rust SDK dependencies | ||
############################################# | ||
chrono = { version = "0.4", features = ["serde"] } | ||
log="0.4" | ||
reqwest = {version = "0.11.17", features = ["blocking", "json"]} | ||
serde={version="1", features = ["derive"]} | ||
serde_json = "1" | ||
thiserror = "1.0" | ||
tracing = "0.1" | ||
|
||
############################################# | ||
# Optional dependencies | ||
############################################# | ||
|
||
# command-line interface dependencies | ||
clap = {version= "4.3", features=["derive"], optional=true} | ||
dirs = {version="5", optional=true} | ||
envy = {version = "0.4", optional = true } | ||
humantime = {version="2.1", optional = true} | ||
num_cpus = {version="1.15", optional=true} | ||
tabled = {version = "0.13", optional = true} | ||
tracing-subscriber = {version="0.3", optional=true} | ||
|
||
# crawler dependencies | ||
futures = {version="0.3", optional = true} | ||
oneio = {version="0.11.0", features = ["lib", "s3"], optional = true} | ||
regex = { version = "1", optional = true } | ||
scraper = { version = "0.17", optional = true } | ||
tokio = {version="1", optional = true, features = ["full"] } | ||
|
||
# api dependencies | ||
poem = {version="1", optional = true} | ||
poem-openapi = {version= "3", features=['swagger-ui', 'chrono'], optional = true} | ||
|
||
# database dependencies | ||
duckdb = {version="0.8", optional = true, features = ["bundled", "parquet", "httpfs", "r2d2"]} | ||
r2d2 = {version="0.8", optional = true} | ||
|
||
[features] | ||
default=[] | ||
cli = [ | ||
# command-line interface | ||
"clap", "dirs", "envy", "humantime", "num_cpus", "tracing-subscriber", "tabled", | ||
# crawler | ||
"futures", "oneio", "regex", "scraper", "tokio", | ||
# database | ||
"duckdb", "r2d2", | ||
# RESTful API | ||
"poem", "poem-openapi", | ||
] | ||
|
||
[dev-dependencies] | ||
anyhow = "1.0" | ||
tracing-subscriber = "0.3.17" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# select build image | ||
FROM rust:1.70 as build | ||
|
||
# create a new empty shell project | ||
RUN USER=root cargo new --bin my_project | ||
WORKDIR /my_project | ||
|
||
# copy your source tree | ||
COPY ./src ./src | ||
COPY ./Cargo.toml . | ||
|
||
# build for release | ||
RUN cargo build --release | ||
|
||
# our final base | ||
FROM debian:bullseye | ||
|
||
# copy the build artifact from the build stage | ||
COPY --from=build /my_project/target/release/bgpkit-broker /usr/local/bin/bgpkit-broker | ||
RUN DEBIAN=NONINTERACTIVE apt update; apt install -y curl libssl-dev ca-certificates tzdata cron; rm -rf /var/lib/apt/lists/* | ||
|
||
ENTRYPOINT bash -c '/usr/local/bin/bgpkit-broker serve' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.