Compare commits

...

6 Commits

Author SHA1 Message Date
Averi Kitsch
b2cbb4098b debug 2025-08-05 11:05:39 -07:00
Yuan Teoh
4c177198c9 update Dockerfile 2025-08-05 09:57:04 -07:00
Averi Kitsch
618ae82176 debug 2025-08-05 09:54:07 -07:00
Yuan Teoh
9b11a59519 update continuous release 2025-08-05 09:42:38 -07:00
Averi Kitsch
f4219dc00a Merge branch 'main' into fix-ci 2025-08-05 09:12:48 -07:00
Averi Kitsch
10f79b7a97 ci: enable C++ compiler for duckDB 2025-08-05 08:53:37 -07:00
3 changed files with 122 additions and 118 deletions

View File

@@ -14,35 +14,36 @@
steps: steps:
- id: "build-docker" - id: "build-docker"
name: "gcr.io/cloud-builders/docker" name: "gcr.io/cloud-builders/docker"
waitFor: ['-'] waitFor: ["-"]
script: | script: |
#!/usr/bin/env bash #!/usr/bin/env bash
docker buildx create --name container-builder --driver docker-container --bootstrap --use docker buildx create --name container-builder --driver docker-container --bootstrap --use
docker buildx build --platform linux/amd64,linux/arm64 --build-arg COMMIT_SHA=$(git rev-parse HEAD) -t ${_DOCKER_URI}:$REF_NAME --push . docker buildx build --platform linux/amd64,linux/arm64 --build-arg COMMIT_SHA=$(git rev-parse HEAD) -t ${_DOCKER_URI}:$REF_NAME --push .
- id: "install-dependencies" - id: "install-dependencies"
name: golang:1 name: golang:1-bookworm
waitFor: ['-'] waitFor: ["-"]
env: env:
- 'GOPATH=/gopath' - "GOPATH=/gopath"
volumes: volumes:
- name: 'go' - name: "go"
path: '/gopath' path: "/gopath"
script: | script: |
apt-get install -y clang
go get -d ./... go get -d ./...
- id: "build-linux-amd64" - id: "build-linux-amd64"
name: golang:1 name: golang:1-bookworm
waitFor: waitFor:
- "install-dependencies" - "install-dependencies"
env: env:
- 'GOPATH=/gopath' - "GOPATH=/gopath"
volumes: volumes:
- name: 'go' - name: "go"
path: '/gopath' path: "/gopath"
script: | script: |
#!/usr/bin/env bash #!/usr/bin/env bash
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \ CGO_ENABLED=1 GOOS=linux GOARCH=amd64 \
go build -ldflags "-X github.com/googleapis/genai-toolbox/cmd.commitSha=$(git rev-parse HEAD)" -o toolbox.linux.amd64 go build -ldflags "-X github.com/googleapis/genai-toolbox/cmd.commitSha=$(git rev-parse HEAD)" -o toolbox.linux.amd64
- id: "store-linux-amd64" - id: "store-linux-amd64"
@@ -54,17 +55,17 @@ steps:
gcloud storage cp toolbox.linux.amd64 gs://$_BUCKET_NAME/$REF_NAME/linux/amd64/toolbox gcloud storage cp toolbox.linux.amd64 gs://$_BUCKET_NAME/$REF_NAME/linux/amd64/toolbox
- id: "build-darwin-arm64" - id: "build-darwin-arm64"
name: golang:1 name: golang:1-bookworm
waitFor: waitFor:
- "install-dependencies" - "install-dependencies"
env: env:
- 'GOPATH=/gopath' - "GOPATH=/gopath"
volumes: volumes:
- name: 'go' - name: "go"
path: '/gopath' path: "/gopath"
script: | script: |
#!/usr/bin/env bash #!/usr/bin/env bash
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 \ CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 \
go build -ldflags "-X github.com/googleapis/genai-toolbox/cmd.commitSha=$(git rev-parse HEAD)" -o toolbox.darwin.arm64 go build -ldflags "-X github.com/googleapis/genai-toolbox/cmd.commitSha=$(git rev-parse HEAD)" -o toolbox.darwin.arm64
- id: "store-darwin-arm64" - id: "store-darwin-arm64"
@@ -76,17 +77,17 @@ steps:
gcloud storage cp toolbox.darwin.arm64 gs://$_BUCKET_NAME/$REF_NAME/darwin/arm64/toolbox gcloud storage cp toolbox.darwin.arm64 gs://$_BUCKET_NAME/$REF_NAME/darwin/arm64/toolbox
- id: "build-darwin-amd64" - id: "build-darwin-amd64"
name: golang:1 name: golang:1-bookworm
waitFor: waitFor:
- "install-dependencies" - "install-dependencies"
env: env:
- 'GOPATH=/gopath' - "GOPATH=/gopath"
volumes: volumes:
- name: 'go' - name: "go"
path: '/gopath' path: "/gopath"
script: | script: |
#!/usr/bin/env bash #!/usr/bin/env bash
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 \ CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 \
go build -ldflags "-X github.com/googleapis/genai-toolbox/cmd.commitSha=$(git rev-parse HEAD)" -o toolbox.darwin.amd64 go build -ldflags "-X github.com/googleapis/genai-toolbox/cmd.commitSha=$(git rev-parse HEAD)" -o toolbox.darwin.amd64
- id: "store-darwin-amd64" - id: "store-darwin-amd64"
@@ -98,17 +99,17 @@ steps:
gcloud storage cp toolbox.darwin.amd64 gs://$_BUCKET_NAME/$REF_NAME/darwin/amd64/toolbox gcloud storage cp toolbox.darwin.amd64 gs://$_BUCKET_NAME/$REF_NAME/darwin/amd64/toolbox
- id: "build-windows-amd64" - id: "build-windows-amd64"
name: golang:1 name: golang:1-bookworm
waitFor: waitFor:
- "install-dependencies" - "install-dependencies"
env: env:
- 'GOPATH=/gopath' - "GOPATH=/gopath"
volumes: volumes:
- name: 'go' - name: "go"
path: '/gopath' path: "/gopath"
script: | script: |
#!/usr/bin/env bash #!/usr/bin/env bash
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 \ CGO_ENABLED=1 GOOS=windows GOARCH=amd64 \
go build -ldflags "-X github.com/googleapis/genai-toolbox/cmd.commitSha=$(git rev-parse HEAD)" -o toolbox.windows.amd64 go build -ldflags "-X github.com/googleapis/genai-toolbox/cmd.commitSha=$(git rev-parse HEAD)" -o toolbox.windows.amd64
- id: "store-windows-amd64" - id: "store-windows-amd64"
@@ -123,7 +124,7 @@ options:
automapSubstitutions: true automapSubstitutions: true
dynamicSubstitutions: true dynamicSubstitutions: true
logging: CLOUD_LOGGING_ONLY # Necessary for custom service account logging: CLOUD_LOGGING_ONLY # Necessary for custom service account
machineType: 'E2_HIGHCPU_32' machineType: "E2_HIGHCPU_32"
substitutions: substitutions:
_REGION: us-central1 _REGION: us-central1

View File

@@ -14,7 +14,7 @@
steps: steps:
- id: "build-docker" - id: "build-docker"
name: "gcr.io/cloud-builders/docker" name: "gcr.io/cloud-builders/docker"
waitFor: ['-'] waitFor: ["-"]
script: | script: |
#!/usr/bin/env bash #!/usr/bin/env bash
export VERSION=$(cat ./cmd/version.txt) export VERSION=$(cat ./cmd/version.txt)
@@ -28,12 +28,12 @@ steps:
- id: "install-dependencies" - id: "install-dependencies"
name: golang:1 name: golang:1
waitFor: ['-'] waitFor: ["-"]
env: env:
- 'GOPATH=/gopath' - "GOPATH=/gopath"
volumes: volumes:
- name: 'go' - name: "go"
path: '/gopath' path: "/gopath"
script: | script: |
go get -d ./... go get -d ./...
@@ -42,14 +42,14 @@ steps:
waitFor: waitFor:
- "install-dependencies" - "install-dependencies"
env: env:
- 'GOPATH=/gopath' - "GOPATH=/gopath"
volumes: volumes:
- name: 'go' - name: "go"
path: '/gopath' path: "/gopath"
script: | script: |
#!/usr/bin/env bash #!/usr/bin/env bash
export VERSION=$(cat ./cmd/version.txt) export VERSION=$(cat ./cmd/version.txt)
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \ CGO_ENABLED=1 GOOS=linux GOARCH=amd64 \
go build -ldflags "-X github.com/googleapis/genai-toolbox/cmd.buildType=binary -X github.com/googleapis/genai-toolbox/cmd.commitSha=$(git rev-parse HEAD)" -o toolbox.linux.amd64 go build -ldflags "-X github.com/googleapis/genai-toolbox/cmd.buildType=binary -X github.com/googleapis/genai-toolbox/cmd.commitSha=$(git rev-parse HEAD)" -o toolbox.linux.amd64
- id: "store-linux-amd64" - id: "store-linux-amd64"
@@ -66,14 +66,14 @@ steps:
waitFor: waitFor:
- "install-dependencies" - "install-dependencies"
env: env:
- 'GOPATH=/gopath' - "GOPATH=/gopath"
volumes: volumes:
- name: 'go' - name: "go"
path: '/gopath' path: "/gopath"
script: | script: |
#!/usr/bin/env bash #!/usr/bin/env bash
export VERSION=$(cat ./cmd/version.txt) export VERSION=$(cat ./cmd/version.txt)
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 \ CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 \
go build -ldflags "-X github.com/googleapis/genai-toolbox/cmd.buildType=binary -X github.com/googleapis/genai-toolbox/cmd.commitSha=$(git rev-parse HEAD)" -o toolbox.darwin.arm64 go build -ldflags "-X github.com/googleapis/genai-toolbox/cmd.buildType=binary -X github.com/googleapis/genai-toolbox/cmd.commitSha=$(git rev-parse HEAD)" -o toolbox.darwin.arm64
- id: "store-darwin-arm64" - id: "store-darwin-arm64"
@@ -90,14 +90,14 @@ steps:
waitFor: waitFor:
- "install-dependencies" - "install-dependencies"
env: env:
- 'GOPATH=/gopath' - "GOPATH=/gopath"
volumes: volumes:
- name: 'go' - name: "go"
path: '/gopath' path: "/gopath"
script: | script: |
#!/usr/bin/env bash #!/usr/bin/env bash
export VERSION=$(cat ./cmd/version.txt) export VERSION=$(cat ./cmd/version.txt)
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 \ CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 \
go build -ldflags "-X github.com/googleapis/genai-toolbox/cmd.buildType=binary -X github.com/googleapis/genai-toolbox/cmd.commitSha=$(git rev-parse HEAD)" -o toolbox.darwin.amd64 go build -ldflags "-X github.com/googleapis/genai-toolbox/cmd.buildType=binary -X github.com/googleapis/genai-toolbox/cmd.commitSha=$(git rev-parse HEAD)" -o toolbox.darwin.amd64
- id: "store-darwin-amd64" - id: "store-darwin-amd64"
@@ -114,14 +114,14 @@ steps:
waitFor: waitFor:
- "install-dependencies" - "install-dependencies"
env: env:
- 'GOPATH=/gopath' - "GOPATH=/gopath"
volumes: volumes:
- name: 'go' - name: "go"
path: '/gopath' path: "/gopath"
script: | script: |
#!/usr/bin/env bash #!/usr/bin/env bash
export VERSION=$(cat ./cmd/version.txt) export VERSION=$(cat ./cmd/version.txt)
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 \ CGO_ENABLED=1 GOOS=windows GOARCH=amd64 \
go build -ldflags "-X github.com/googleapis/genai-toolbox/cmd.buildType=binary -X github.com/googleapis/genai-toolbox/cmd.commitSha=$(git rev-parse HEAD)" -o toolbox.windows.amd64 go build -ldflags "-X github.com/googleapis/genai-toolbox/cmd.buildType=binary -X github.com/googleapis/genai-toolbox/cmd.commitSha=$(git rev-parse HEAD)" -o toolbox.windows.amd64
- id: "store-windows-amd64" - id: "store-windows-amd64"
@@ -137,7 +137,7 @@ options:
automapSubstitutions: true automapSubstitutions: true
dynamicSubstitutions: true dynamicSubstitutions: true
logging: CLOUD_LOGGING_ONLY # Necessary for custom service account logging: CLOUD_LOGGING_ONLY # Necessary for custom service account
machineType: 'E2_HIGHCPU_32' machineType: "E2_HIGHCPU_32"
substitutions: substitutions:
_REGION: us-central1 _REGION: us-central1

View File

@@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
# Use the latest stable golang 1.x to compile to a binary # Use the latest stable golang 1.x to compile to a binary
FROM --platform=$BUILDPLATFORM golang:1 AS build FROM --platform=$BUILDPLATFORM golang:1-bookworm AS build
WORKDIR /go/src/genai-toolbox WORKDIR /go/src/genai-toolbox
COPY . . COPY . .
@@ -23,8 +23,11 @@ ARG TARGETARCH
ARG BUILD_TYPE="container.dev" ARG BUILD_TYPE="container.dev"
ARG COMMIT_SHA="" ARG COMMIT_SHA=""
RUN apt-get update && \
apt install -y clang && \
rm -rf /var/lib/apt/lists/*
RUN go get ./... RUN go get ./...
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \ RUN CGO_ENABLED=1 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
go build -ldflags "-X github.com/googleapis/genai-toolbox/cmd.buildType=container.${BUILD_TYPE} -X github.com/googleapis/genai-toolbox/cmd.commitSha=${COMMIT_SHA}" go build -ldflags "-X github.com/googleapis/genai-toolbox/cmd.buildType=container.${BUILD_TYPE} -X github.com/googleapis/genai-toolbox/cmd.commitSha=${COMMIT_SHA}"
# Final Stage # Final Stage