Skip to content

Commit

Permalink
Update reqs
Browse files Browse the repository at this point in the history
  • Loading branch information
bsmartradio committed Jan 4, 2025
1 parent b25acf0 commit e988943
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 38 deletions.
28 changes: 13 additions & 15 deletions alertdb/bin/alertdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def main():
parser.add_argument(
"--backend",
type=str,
choices=("local-files", "google-cloud"),
choices=("local-files", "s3-remote"),
default="local-files",
help="backend to use to source alerts",
)
Expand All @@ -41,19 +41,19 @@ def main():
help="when using the local-files backend, the root directory where alerts should be found",
)
parser.add_argument(
"--gcp-project",
"--endpoint-url",
type=str,
default=None,
help="when using the google-cloud backend, the name of the GCP project",
help="when using the s3-remote backend, the endpoint url of the project",
)
parser.add_argument(
"--gcp-bucket-alerts",
"--bucket-alerts",
type=str,
default="alert-packets",
help="when using the google-cloud backend, the name of the boto3 bucket for alert packets",
)
parser.add_argument(
"--gcp-bucket-schemas",
"--bucket-schemas",
type=str,
default="alert-schemas",
help="when using the google-cloud backend, the name of the boto3 bucket for alert schemas",
Expand Down Expand Up @@ -85,22 +85,20 @@ def main():

backend = FileBackend(args.local_file_root)

elif args.backend == "google-cloud":
logger.info("using google-cloud backend")
elif args.backend == "s3-remote":
logger.info("using s3-remote backend")

if args.gcp_project is None:
parser.error("--backend=google-cloud requires --gcp-project be set")
logger.info("gcp_project: %s", args.gcp_project)
logger.info("endpoint-url: %s", args.endpoint_url)

if args.gcp_bucket_alerts is None or args.gcp_bucket_schemas is None:
if args.bucket_alerts is None or args.bucket_schemas is None:
parser.error(
"--backend=google-cloud requires --gcp-bucket-alerts and --gcp-bucket-schemas be set"
"--backend=s3-remote requires --bucket-alerts and --bucket-schemas be set"
)
logger.info("gcp_bucket_alerts: %s", args.gcp_bucket_alerts)
logger.info("gcp_bucket_schemas: %s", args.gcp_bucket_schemas)
logger.info("bucket_alerts: %s", args.bucket_alerts)
logger.info("bucket_schemas: %s", args.bucket_schemas)

backend = USDFObjectStorageBackend(
args.gcp_project, args.gcp_bucket_alerts, args.gcp_bucket_schemas
args.endpoint_url, args.bucket_alerts, args.bucket_schemas
)

else:
Expand Down
44 changes: 21 additions & 23 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ anyio==4.7.0 \
--hash=sha256:2f834749c602966b7d456a7567cafcb309f96482b5081d14ac93ccd457f9dd48 \
--hash=sha256:ea60c3723ab42ba6fff7e8ccb0488c898ec538ff4df1f1d5e642c3601d07e352
# via starlette
boto3==1.7.84 \
--hash=sha256:0ed4b107c3b4550547aaec3c9bb17df068ff92d1f6f4781205800e2cb8a66de5 \
--hash=sha256:64496f2c814e454e26c024df86bd08fb4643770d0e2b7a8fd70055fc6683eb9d
boto3==1.35.80 \
--hash=sha256:21a3b18c3a7fd20e463708fe3fa035983105dc7f3a1c274e1903e1583ab91159 \
--hash=sha256:50dae461ab5fbedfb81b690895d48a918fed0d5fdff37be1c4232770c0dc9712
# via -r requirements.in
botocore==1.10.84 \
--hash=sha256:380852e1adb9ba4ba9ff096af61f88a6888197b86e580e1bd786f04ebe6f9c0c \
--hash=sha256:d3e4b5a2c903ea30d19d41ea2f65d0e51dce54f4f4c4dfd6ecd7b04f240844a8
botocore==1.35.80 \
--hash=sha256:36e589dccb62380abd628b08fecfa2f7c89b99f41ec9fc42c467c94008c0be4a \
--hash=sha256:b8dfceca58891cb2711bd6455ec4f7159051f3796e0f64adef9bb334f19d8a92
# via
# boto3
# s3transfer
Expand Down Expand Up @@ -141,10 +141,6 @@ click==8.1.7 \
--hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \
--hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de
# via uvicorn
docutils==0.21.2 \
--hash=sha256:3a6b18732edf182daa3cd12775bbb338cf5691468f91eeeb109deff6ebfa986f \
--hash=sha256:dafca5b9e384f0e419294eb4d2ff9fa826435bf15f15b7bd45723e8ad76811b2
# via botocore
exceptiongroup==1.2.2 \
--hash=sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b \
--hash=sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc
Expand All @@ -159,9 +155,9 @@ google-api-core==2.24.0 \
# via
# google-cloud-core
# google-cloud-storage
google-auth==2.36.0 \
--hash=sha256:51a15d47028b66fd36e5c64a82d2d57480075bccc7da37cde257fc94177a61fb \
--hash=sha256:545e9618f2df0bcbb7dcbc45a546485b1212624716975a1ea5ae8149ce769ab1
google-auth==2.37.0 \
--hash=sha256:0054623abf1f9c83492c63d3f47e77f0a544caa3d40b2d98e099a611c2dd5d00 \
--hash=sha256:42664f18290a6be591be5329a96fe30184be1a1badb7292a7f686a9659de9ca0
# via
# google-api-core
# google-cloud-core
Expand Down Expand Up @@ -223,9 +219,9 @@ idna==3.10 \
# via
# anyio
# requests
jmespath==0.10.0 \
--hash=sha256:b85d0567b8666149a93172712e68920734333c0ce7e89b78b3e987f71e5ed4f9 \
--hash=sha256:cdf6525904cc597730141d61b36f2e4b8ecc257c420fa2f4549bac2c2d0cb72f
jmespath==1.0.1 \
--hash=sha256:02e2e4cc71b5bcab88332eebf907519190dd9e6e82107fa7f83b1003a6252980 \
--hash=sha256:90261b206d6defd58fdd5e85f478bf633a2901798906be2ad389150c5c60edbe
# via
# boto3
# botocore
Expand Down Expand Up @@ -380,9 +376,9 @@ rsa==4.9 \
--hash=sha256:90260d9058e514786967344d0ef75fa8727eed8a7d2e43ce9f4bcf1b536174f7 \
--hash=sha256:e38464a49c6c85d7f1351b0126661487a7e0a14a50f1675ec50eb34d4f20ef21
# via google-auth
s3transfer==0.1.13 \
--hash=sha256:90dc18e028989c609146e241ea153250be451e05ecc0c2832565231dacdf59c1 \
--hash=sha256:c7a9ec356982d5e9ab2d4b46391a7d6a950e2b04c472419f5fdec70cc0ada72f
s3transfer==0.10.4 \
--hash=sha256:244a76a24355363a68164241438de1b72f8781664920260c48465896b712a41e \
--hash=sha256:29edc09801743c21eb5ecbc617a152df41d3c287f67b615f73e5f750583666a7
# via boto3
six==1.17.0 \
--hash=sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274 \
Expand All @@ -406,10 +402,12 @@ typing-extensions==4.12.2 \
# pydantic-core
# starlette
# uvicorn
urllib3==2.2.3 \
--hash=sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac \
--hash=sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9
# via requests
urllib3==1.26.20 \
--hash=sha256:0ed14ccfbf1c30a9072c7ca157e4319b70d65f623e91e7b32fadb2853431016e \
--hash=sha256:40c2dc0c681e47eb8f90e7e27bf6ff7df2e677421fd46756da1161c39ca70d32
# via
# botocore
# requests
uvicorn==0.32.1 \
--hash=sha256:82ad92fd58da0d12af7482ecdb5f2470a04c9c9a53ced65b9bbb4a205377602e \
--hash=sha256:ee9519c246a72b1c084cea8d3b44ed6026e78a4a309cbedae9c37e4cb9fbb175
Expand Down

0 comments on commit e988943

Please sign in to comment.