| # Copyright 2025 Google LLC | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the License); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an AS IS BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") | |
| go_library( | |
| name = "gpuconfig", | |
| srcs = [ | |
| "artifacts.go", | |
| "config.go", | |
| "generate_configs.go", | |
| "gpu_driver_versions.go", | |
| "query_mds.go", | |
| "read_configs.go", | |
| "upload_configs.go", | |
| ], | |
| importpath = "cos.googlesource.com/cos/tools.git/src/pkg/gpuconfig", | |
| visibility = ["//visibility:public"], | |
| deps = [ | |
| "//src/cmd/cos_gpu_installer/deviceinfo", | |
| "//src/pkg/gcs", | |
| "//src/pkg/gpuconfig/pb", | |
| "//src/pkg/utils", | |
| "@com_github_golang_glog//:glog", | |
| "@com_github_golang_protobuf//proto", | |
| "@com_github_google_uuid//:uuid", | |
| "@com_google_cloud_go_storage//:storage", | |
| "@org_golang_google_api//iterator", | |
| "@org_golang_google_protobuf//proto", | |
| ], | |
| ) | |
| go_test( | |
| name = "gpuconfig_test", | |
| srcs = [ | |
| "generate_configs_test.go", | |
| "gpu_driver_versions_test.go", | |
| "read_configs_test.go", | |
| "upload_configs_test.go", | |
| ], | |
| data = glob(["testdata/**"]), | |
| embed = [":gpuconfig"], | |
| deps = [ | |
| "//src/pkg/fakes", | |
| "//src/pkg/gpuconfig/pb", | |
| "@com_github_golang_protobuf//proto", | |
| "@com_github_google_go_cmp//cmp", | |
| "@org_golang_google_protobuf//encoding/prototext", | |
| "@org_golang_google_protobuf//testing/protocmp", | |
| ], | |
| ) |