You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add cc binary and image to the BUILD file in hello world
diff --git a/examples/helloworld/BUILD b/examples/helloworld/BUILD
index 924f8a4..4b0bf28 100644
--- a/examples/helloworld/BUILD+++ b/examples/helloworld/BUILD@@ -8,12 +8,23 @@
# 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_docker//cc:image.bzl", "cc_image")
load("@io_bazel_rules_docker//go:image.bzl", "go_image")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
load("@com_adobe_rules_gitops//gitops:defs.bzl", "k8s_deploy")
licenses(["notice"]) # Apache 2.0
+cc_binary(+ name = "tester",+ srcs = ["main.cc"],+)++cc_image(+ name = "image2",+ binary = ":tester",+)+
go_library(
name = "go_default_library",
srcs = ["helloworld.go"],
Add the cc base image that cc_image depends on to the example workspace
The output of bazel run //helloworld:mynamespace.show returns this yaml which not fill out the image values. Running show with the original go image correctly templates the manifests.
I am using basilisk, so it is picking up the version set in the .bazelversion from rules_gitopts. My project is on 6.0.0, and experiences the same problem as the above.
release 5.3.1
If bazel info release returns "development version" or "(@non-git)", tell us how you built Bazel.
Replace this line with your answer.
Snippet of the WORKSPACE file that includes rules_gitops rules.
This is the workspace file from the examples with the patch from above applied to add in the cc_base_image workspace required by cc_image.
# Copyright 2020 Adobe. All rights reserved.# This file is licensed to you 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 REPRESENTATIONS# OF ANY KIND, either express or implied. See the License for the specific language# governing permissions and limitations under the License.workspace(name="examples")
local_repository(
name="com_adobe_rules_gitops",
path="..",
)
# generated by workspace_snippet.shload("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
#---SNIP--- Below here is re-used in the workspace snippet published on releaseshttp_archive(
name="io_bazel_rules_go",
sha256="099a9fb96a376ccbbb7d291ed4ecbdfd42f6bc822ab77ae6f1b5cb9e914e94fa",
urls= [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains(version="1.19.2")
load("@com_adobe_rules_gitops//gitops:deps.bzl", "rules_gitops_dependencies")
rules_gitops_dependencies()
load("@com_adobe_rules_gitops//gitops:repositories.bzl", "rules_gitops_repositories")
rules_gitops_repositories()
#---END_SNIP--- marks the end of the the workspace snippet published on releases## examples dependencies#load(
"@io_bazel_rules_docker//go:image.bzl",
go_image_repositories="repositories",
)
go_image_repositories()
load(
"@io_bazel_rules_docker//cc:image.bzl",
cc_image_repos="repositories",
)
cc_image_repos()
Have you found anything relevant by searching the web?
No, I have searched quite abit, but its kind of vague problem (failed templating) that is difficult to search for.
I browsed and searched the issue tracker for relavent issues but didn't see anything related.
I have tried reading through relevant portions of the rules, but did not see anything that jumped out at me.
I searched github for com_adobe_rules_gitops cc_image filename:BUILD to try to locate places where people have used cc_images with gitops, but github yields no results. (same for BUILD.bazel).
Any other information, logs, or outputs that you want to share?
Thanks for taking a look 😁
The text was updated successfully, but these errors were encountered:
Description of the problem / feature request:
I am trying to deploy a c++ project with rules_gitops, but the bazel labels aren't rendering in the manifests.
Feature requests: what underlying problem are you trying to solve with this feature?
Support cc_images in manifests
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
I was able to modify the hello world example to reproduce the problem.
Test cc app
Add cc binary and image to the
BUILD
file in hello worldAdd the cc base image that cc_image depends on to the example workspace
Point manifests to use the cc image instead of the go image.
The output of
bazel run //helloworld:mynamespace.show
returns this yaml which not fill out the image values. Runningshow
with the original go image correctly templates the manifests.What operating system are you running Bazel on?
> uname -sr Linux 6.1.7-100.fc36.x86_64
What's the output of
bazel info release
?I am using basilisk, so it is picking up the version set in the
.bazelversion
from rules_gitopts. My project is on6.0.0
, and experiences the same problem as the above.If
bazel info release
returns "development version" or "(@non-git)", tell us how you built Bazel.Snippet of the
WORKSPACE
file that includes rules_gitops rules.This is the workspace file from the examples with the patch from above applied to add in the
cc_base_image
workspace required bycc_image
.Have you found anything relevant by searching the web?
No, I have searched quite abit, but its kind of vague problem (failed templating) that is difficult to search for.
I browsed and searched the issue tracker for relavent issues but didn't see anything related.
I have tried reading through relevant portions of the rules, but did not see anything that jumped out at me.
I searched github for
com_adobe_rules_gitops cc_image filename:BUILD
to try to locate places where people have used cc_images with gitops, but github yields no results. (same for BUILD.bazel).Any other information, logs, or outputs that you want to share?
Thanks for taking a look 😁
The text was updated successfully, but these errors were encountered: