Skip to content

Commit 9c5c2e0

Browse files
committed
deployment
1 parent de2ac0c commit 9c5c2e0

6 files changed

Lines changed: 52 additions & 35 deletions

File tree

deployment/build-and-stage.yaml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ steps:
6262
args: ['push', '--all-tags', 'gcr.io/oss-vdb/worker-base']
6363
waitFor: ['build-worker-base', 'cloud-build-queue']
6464

65-
# Build/push core worker/importer/alias images.
65+
# Build/push core worker/recoverer images.
6666
- name: gcr.io/cloud-builders/docker
6767
args: ['build', '-t', 'gcr.io/oss-vdb/worker:latest', '-t', 'gcr.io/oss-vdb/worker:$COMMIT_SHA', '-f', 'gcp/workers/worker/Dockerfile', '.']
6868
id: 'build-worker'
@@ -71,15 +71,6 @@ steps:
7171
args: ['push', '--all-tags', 'gcr.io/oss-vdb/worker']
7272
waitFor: ['build-worker', 'cloud-build-queue']
7373

74-
- name: gcr.io/cloud-builders/docker
75-
args: ['build', '-t', 'gcr.io/oss-vdb/importer:latest', '-t', 'gcr.io/oss-vdb/importer:$COMMIT_SHA', '.']
76-
dir: 'gcp/workers/importer'
77-
id: 'build-importer'
78-
waitFor: ['build-worker']
79-
- name: gcr.io/cloud-builders/docker
80-
args: ['push', '--all-tags', 'gcr.io/oss-vdb/importer']
81-
waitFor: ['build-importer', 'cloud-build-queue']
82-
8374
- name: gcr.io/cloud-builders/docker
8475
args: ['build', '-t', 'gcr.io/oss-vdb/recoverer:latest', '-t', 'gcr.io/oss-vdb/recoverer:$COMMIT_SHA', '.']
8576
dir: 'gcp/workers/recoverer'
@@ -107,6 +98,20 @@ steps:
10798
waitFor: ['build-oss-fuzz-importer', 'cloud-build-queue']
10899

109100
# Build/push go images
101+
- name: 'gcr.io/cloud-builders/docker'
102+
entrypoint: 'bash'
103+
args: ['-c', 'docker pull gcr.io/oss-vdb/importer:latest || exit 0']
104+
id: 'pull-importer'
105+
waitFor: ['setup']
106+
- name: gcr.io/cloud-builders/docker
107+
args: ['build', '-t', 'gcr.io/oss-vdb/importer:latest', '-t', 'gcr.io/oss-vdb/importer:$COMMIT_SHA', '-f', 'cmd/importer/Dockerfile', '--cache-from', 'gcr.io/oss-vdb/importer:latest', '--pull', '.']
108+
dir: 'go'
109+
id: 'build-importer'
110+
waitFor: ['pull-importer']
111+
- name: gcr.io/cloud-builders/docker
112+
args: ['push', '--all-tags', 'gcr.io/oss-vdb/importer']
113+
waitFor: ['build-importer', 'cloud-build-queue']
114+
110115
- name: 'gcr.io/cloud-builders/docker'
111116
entrypoint: 'bash'
112117
args: ['-c', 'docker pull gcr.io/oss-vdb/exporter:latest || exit 0']

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ spec:
1717
image: importer
1818
args:
1919
- --delete
20-
- --delete_threshold_pct=2
21-
- --public_log_bucket=osv-test-public-import-logs
20+
- --delete-threshold-pct=2

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ spec:
1515
- name: OSV_VULNERABILITIES_BUCKET
1616
value: osv-test-vulnerabilities
1717
args:
18-
# TODO(michaelkedar): ssh secrets
19-
# TODO(michaelkedar): single source of truth w/ terraform config
20-
- "--public_log_bucket=osv-test-public-import-logs"
2118
# Note that with https://github.com/google/osv.dev/pull/2766
2219
# addition per-repository settings make this *really* take effect, see
2320
# https://github.com/google/osv.dev/pull/2837
24-
- "--strict_validation"
21+
- "--strict-validation"

deployment/clouddeploy/gke-workers/environments/oss-vdb/importer-deleter.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ spec:
1717
image: importer
1818
args:
1919
- --delete
20-
- --delete_threshold_pct=2
21-
- --public_log_bucket=osv-public-import-logs
20+
- --delete-threshold-pct=2

deployment/clouddeploy/gke-workers/environments/oss-vdb/importer.yaml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,3 @@ spec:
1414
value: oss-vdb
1515
- name: OSV_VULNERABILITIES_BUCKET
1616
value: osv-vulnerabilities
17-
args:
18-
- "--ssh_key_public=/secrets/ssh.pub"
19-
- "--ssh_key_private=/secrets/ssh"
20-
- "--public_log_bucket=osv-public-import-logs"
21-
volumeMounts:
22-
- mountPath: "/secrets"
23-
name: "secrets"
24-
volumes:
25-
- name: secrets
26-
secret:
27-
items:
28-
- key: ssh
29-
mode: 384
30-
path: ssh
31-
- key: ssh.pub
32-
path: ssh.pub
33-
secretName: secrets

go/cmd/importer/Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
FROM golang:1.26.0-alpine@sha256:d4c4845f5d60c6a974c6000ce58ae079328d03ab7f721a0734277e69905473e5 AS build
16+
17+
WORKDIR /src
18+
19+
COPY ./go.mod /src/go.mod
20+
COPY ./go.sum /src/go.sum
21+
RUN go mod download && go mod verify
22+
23+
24+
COPY ./ /src/
25+
RUN CGO_ENABLED=0 go build -o importer ./cmd/importer/
26+
27+
FROM alpine:3.23@sha256:25109184c71bdad752c8312a8623239686a9a2071e8825f20acb8f2198c3f659
28+
29+
# Need to install the full tar package, to not use the busybox version, which doesn't have --zstd support.
30+
RUN apk add --no-cache git zstd tar
31+
32+
COPY --from=build /src/importer /
33+
34+
ENTRYPOINT ["/importer"]

0 commit comments

Comments
 (0)