Skip to content

Commit 2e1149d

Browse files
authored
Merge branch 'google:master' into master
2 parents e623186 + aad1acb commit 2e1149d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+2343
-1130
lines changed

.github/workflows/publish-to-pypi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
build
4545
--sdist --wheel --outdir dist/ .
4646
- name: Publish distribution to PyPI
47-
uses: pypa/gh-action-pypi-publish@e53eb8b103ffcb59469888563dc324e3c8ba6f06 # v1.8.12
47+
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # v1.8.14
4848
with:
4949
password: ${{ secrets.PYPI_API_TOKEN }}
5050
packages_dir: dist/

.github/workflows/scorecards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ jobs:
5050

5151
# Upload the results to GitHub's code scanning dashboard.
5252
- name: "Upload to code-scanning"
53-
uses: github/codeql-action/upload-sarif@928ff8c822d966a999092a6a35e32177899afb7c # v2.24.6
53+
uses: github/codeql-action/upload-sarif@e56cfd0877b4826be144d11aa31e6c64a55828e9 # v2.24.7
5454
with:
5555
sarif_file: results.sarif

Pipfile.lock

Lines changed: 243 additions & 250 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deployment/build-and-stage.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,20 @@ steps:
123123
args: ['push', '--all-tags', 'gcr.io/oss-vdb/alpine-cve-convert']
124124
waitFor: ['build-alpine-cve-convert', 'cloud-build-queue']
125125

126+
- name: 'gcr.io/cloud-builders/docker'
127+
entrypoint: 'bash'
128+
args: ['-c', 'docker pull gcr.io/oss-vdb/debian-cve-convert:latest || exit 0']
129+
id: 'pull-debian-cve-convert'
130+
waitFor: ['setup']
131+
- name: gcr.io/cloud-builders/docker
132+
args: ['build', '-t', 'gcr.io/oss-vdb/debian-cve-convert:latest', '-t', 'gcr.io/oss-vdb/debian-cve-convert:$COMMIT_SHA', '-f', 'cmd/debian/Dockerfile', '--cache-from', 'gcr.io/oss-vdb/debian-cve-convert:latest', '--pull', '.']
133+
dir: 'vulnfeeds'
134+
id: 'build-debian-cve-convert'
135+
waitFor: ['pull-debian-cve-convert']
136+
- name: gcr.io/cloud-builders/docker
137+
args: ['push', '--all-tags', 'gcr.io/oss-vdb/debian-cve-convert']
138+
waitFor: ['build-debian-cve-convert', 'cloud-build-queue']
139+
126140
- name: 'gcr.io/cloud-builders/docker'
127141
entrypoint: 'bash'
128142
args: ['-c', 'docker pull gcr.io/oss-vdb/combine-to-osv:latest || exit 0']
@@ -263,6 +277,7 @@ steps:
263277
debian-convert=gcr.io/oss-vdb/debian-convert:$COMMIT_SHA,\
264278
combine-to-osv=gcr.io/oss-vdb/combine-to-osv:$COMMIT_SHA,\
265279
alpine-cve-convert=gcr.io/oss-vdb/alpine-cve-convert:$COMMIT_SHA,\
280+
debian-cve-convert=gcr.io/oss-vdb/debian-cve-convert:$COMMIT_SHA,\
266281
debian-copyright-mirror=gcr.io/oss-vdb/debian-copyright-mirror:$COMMIT_SHA,\
267282
cpe-repo-gen=gcr.io/oss-vdb/cpe-repo-gen:$COMMIT_SHA,\
268283
nvd-cve-osv=gcr.io/oss-vdb/nvd-cve-osv:$COMMIT_SHA,\
@@ -312,6 +327,7 @@ images:
312327
- 'gcr.io/oss-vdb/alias-computation:$COMMIT_SHA'
313328
- 'gcr.io/oss-vdb/cron:$COMMIT_SHA'
314329
- 'gcr.io/oss-vdb/alpine-cve-convert:$COMMIT_SHA'
330+
- 'gcr.io/oss-vdb/debian-cve-convert:$COMMIT_SHA'
315331
- 'gcr.io/oss-vdb/combine-to-osv:$COMMIT_SHA'
316332
- 'gcr.io/oss-vdb/indexer:$COMMIT_SHA'
317333
- 'gcr.io/oss-vdb/debian-convert:$COMMIT_SHA'
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apiVersion: batch/v1
2+
kind: CronJob
3+
metadata:
4+
name: debian-cve-convert
5+
spec:
6+
schedule: "0 */1 * * *"
7+
concurrencyPolicy: Forbid
8+
jobTemplate:
9+
spec:
10+
activeDeadlineSeconds: 3600
11+
template:
12+
spec:
13+
containers:
14+
- name: debian-cve-convert
15+
image: debian-cve-convert
16+
imagePullPolicy: Always
17+
env:
18+
- name: GOOGLE_CLOUD_PROJECT
19+
value: oss-vdb-test
20+
- name: OUTPUT_GCS_BUCKET
21+
value: osv-test-cve-osv-conversion
22+
securityContext:
23+
privileged: true
24+
resources:
25+
requests:
26+
cpu: 1
27+
memory: "1G"
28+
limits:
29+
cpu: 1
30+
memory: "2G"
31+
restartPolicy: OnFailure
32+
volumes:
33+
- name: "ssd"
34+
hostPath:
35+
path: "/mnt/disks/ssd0"

deployment/clouddeploy/gke-workers/environments/oss-vdb-test/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
resources:
22
- ../../base
3+
- debian-cve-convert.yaml
34
patches:
45
- path: workers.yaml
56
- path: scaler.yaml

deployment/clouddeploy/osv-api/clouddeploy.yaml

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,21 @@ metadata:
55
description: OSV API pipeline
66
serialPipeline:
77
stages:
8-
- targetId: staging-api
8+
- targetId: staging-api-multi
99
profiles: [ staging ]
10-
- targetId: production-api
10+
- targetId: production-api-multi
1111
profiles: [ prod ]
1212
---
1313

14+
apiVersion: deploy.cloud.google.com/v1
15+
kind: Target
16+
metadata:
17+
name: staging-api-multi
18+
description: multi-target oss-vdb-test API instances
19+
multiTarget:
20+
targetIds: [staging-api, staging-api-batch]
21+
---
22+
1423
apiVersion: deploy.cloud.google.com/v1
1524
kind: Target
1625
metadata:
@@ -25,6 +34,32 @@ executionConfigs:
2534
serviceAccount: [email protected]
2635
---
2736

37+
apiVersion: deploy.cloud.google.com/v1
38+
kind: Target
39+
metadata:
40+
name: staging-api-batch
41+
description: oss-vdb-test API batch query instance
42+
run:
43+
location: projects/oss-vdb-test/locations/us-central1
44+
deployParameters:
45+
serviceName: "osv-grpc-backend-batch"
46+
containerConcurrency: "1"
47+
executionConfigs:
48+
- usages:
49+
- RENDER
50+
- DEPLOY
51+
serviceAccount: [email protected]
52+
---
53+
54+
apiVersion: deploy.cloud.google.com/v1
55+
kind: Target
56+
metadata:
57+
name: production-api-multi
58+
description: multi-target oss-vdb API instances
59+
multiTarget:
60+
targetIds: [production-api, production-api-batch]
61+
---
62+
2863
apiVersion: deploy.cloud.google.com/v1
2964
kind: Target
3065
metadata:
@@ -37,3 +72,20 @@ executionConfigs:
3772
- RENDER
3873
- DEPLOY
3974
serviceAccount: [email protected]
75+
---
76+
77+
apiVersion: deploy.cloud.google.com/v1
78+
kind: Target
79+
metadata:
80+
name: production-api-batch
81+
description: oss-vdb API batch query instance
82+
run:
83+
location: projects/oss-vdb/locations/us-central1
84+
deployParameters:
85+
serviceName: "osv-grpc-backend-batch"
86+
containerConcurrency: "1"
87+
executionConfigs:
88+
- usages:
89+
- RENDER
90+
- DEPLOY
91+
serviceAccount: [email protected]
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
apiVersion: serving.knative.dev/v1
22
kind: Service
33
metadata:
4-
name: osv-grpc-backend
4+
name: osv-grpc-backend # from-param: ${serviceName}
55
spec:
66
template:
7+
metadata:
8+
annotations:
9+
autoscaling.knative.dev/maxScale: '300'
710
spec:
811
containers:
912
- image: osv-server
@@ -13,11 +16,13 @@ spec:
1316
startupProbe:
1417
grpc:
1518
service: osv.v1.OSV
19+
initialDelaySeconds: 5
20+
timeoutSeconds: 5
1621
livenessProbe:
1722
grpc:
1823
service: osv.v1.OSV
1924
timeoutSeconds: 5
2025
failureThreshold: 3
2126
periodSeconds: 10
2227
timeoutSeconds: 60
23-
containerConcurrency: 10
28+
containerConcurrency: 5 # from-param: ${containerConcurrency}

deployment/deploy-prod.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ steps:
2121
- name: gcr.io/cloud-builders/gcloud
2222
args: ['deploy', 'releases', 'promote', '--quiet', '--release=osv-$SHORT_SHA', '--region=us-central1', '--delivery-pipeline=gke-workers', '--to-target=production-workers', '--annotations=tag=$TAG_NAME']
2323
- name: gcr.io/cloud-builders/gcloud
24-
args: ['deploy', 'releases', 'promote', '--quiet', '--release=osv-$SHORT_SHA', '--region=us-central1', '--delivery-pipeline=osv-api', '--to-target=production-api', '--annotations=tag=$TAG_NAME']
24+
args: ['deploy', 'releases', 'promote', '--quiet', '--release=osv-$SHORT_SHA', '--region=us-central1', '--delivery-pipeline=osv-api', '--to-target=production-api-multi', '--annotations=tag=$TAG_NAME']
2525
- name: gcr.io/cloud-builders/gcloud
2626
args: ['deploy', 'releases', 'promote', '--quiet', '--release=osv-$SHORT_SHA', '--region=us-central1', '--delivery-pipeline=gke-indexer', '--to-target=production-indexer', '--annotations=tag=$TAG_NAME']
2727

@@ -36,6 +36,8 @@ steps:
3636
args: ['container', 'images', 'add-tag', '--quiet', 'gcr.io/oss-vdb/exporter:$COMMIT_SHA', 'gcr.io/oss-vdb/exporter:$TAG_NAME']
3737
- name: gcr.io/cloud-builders/gcloud
3838
args: ['container', 'images', 'add-tag', '--quiet', 'gcr.io/oss-vdb/alpine-cve-convert:$COMMIT_SHA', 'gcr.io/oss-vdb/alpine-cve-convert:$TAG_NAME']
39+
- name: gcr.io/cloud-builders/gcloud
40+
args: ['container', 'images', 'add-tag', '--quiet', 'gcr.io/oss-vdb/debian-cve-convert:$COMMIT_SHA', 'gcr.io/oss-vdb/debian-cve-convert:$TAG_NAME']
3941
- name: gcr.io/cloud-builders/gcloud
4042
args: ['container', 'images', 'add-tag', '--quiet', 'gcr.io/oss-vdb/combine-to-osv:$COMMIT_SHA', 'gcr.io/oss-vdb/combine-to-osv:$TAG_NAME']
4143
- name: gcr.io/cloud-builders/gcloud

deployment/terraform/environments/oss-vdb-test/api/api_config.tftpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ backend:
3131
- selector: "*"
3232
address: ${backend_url}
3333
deadline: 60
34+
- selector: "osv.v1.OSV.QueryAffectedBatch"
35+
address: ${backend_batch_url}
36+
deadline: 60

0 commit comments

Comments
 (0)