diff --git a/.bazelrc b/.bazelrc index b0c59c76..9e1354c3 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,5 +1,17 @@ # See e.g. https://blog.aspect.dev/bazelrc-flags +# https://github.com/bazelbuild/rules_foreign_cc/issues/1129 +# Mandatory at the moment for Bazel 7.0.0. +build --noincompatible_sandbox_hermetic_tmp + +# This is mandatory if your build env doesn't have a proper Python 3 exe +# -- like the CI build image for this repo. +# The build image is using a fake python exe, see +# https://github.com/mvukov/bazel_builder/blob/main/Dockerfile. +# If blzmod is enabled, but not used as in this repo at the moment), +# then bazel for some reason tries to auto-detect a Python exe. +build --noenable_bzlmod + # Fix the wrong default to generate __init__.py to delimit a Python package. # This is a mandatory flag. build --incompatible_default_to_explicit_init_py diff --git a/.bazelversion b/.bazelversion index 19b860c1..66ce77b7 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -6.4.0 +7.0.0 diff --git a/.github/workflows/ci.bazelrc b/.github/workflows/ci.bazelrc index 931eb768..6599c77c 100644 --- a/.github/workflows/ci.bazelrc +++ b/.github/workflows/ci.bazelrc @@ -17,7 +17,7 @@ build:remote --experimental_remote_cache_compression # buildbuddy suggestions: build:remote --experimental_profile_include_primary_output build:remote --experimental_profile_include_target_label -build:remote --experimental_remote_build_event_upload=minimal +build:remote --remote_build_event_upload=minimal build:remote --noslim_profile # Don't spam CI logs. diff --git a/examples/README.md b/examples/README.md index 0c27374d..1e15ef7b 100644 --- a/examples/README.md +++ b/examples/README.md @@ -13,7 +13,4 @@ Before you build/run/test any of the targets in this folder, please make sure your terminal is in this folder, or in a subfolder, and not in the root of the repo. -If you want to run ROS 2 deployments in Docker containers, please install -[Docker](https://docs.docker.com/engine/install/ubuntu/). - You can start with a simple [chatter](chatter) example. diff --git a/examples/WORKSPACE b/examples/WORKSPACE index 42c4d023..55ddeac2 100644 --- a/examples/WORKSPACE +++ b/examples/WORKSPACE @@ -50,41 +50,3 @@ load( ) install_rules_ros2_pip_deps() - -# Below are listed only deps needed by examples: if you just need ROS 2 you don't -# need to import/load anything below. - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -# rules_docker is not strictly necessary, but interesting if you want to create -# and/or push docker containers for the examples. The docker executable is -# needed only if you want to run an image using Bazel. -http_archive( - name = "io_bazel_rules_docker", - sha256 = "b1e80761a8a8243d03ebca8845e9cc1ba6c82ce7c5179ce2b295cd36f7e394bf", - urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.25.0/rules_docker-v0.25.0.tar.gz"], -) - -load( - "@io_bazel_rules_docker//repositories:repositories.bzl", - container_repositories = "repositories", -) - -container_repositories() - -load("@io_bazel_rules_docker//repositories:deps.bzl", container_deps = "deps") - -container_deps() - -load( - "@io_bazel_rules_docker//container:container.bzl", - "container_pull", -) - -# The base docker image is defined in https://github.com/mvukov/bazel_deploy_base repo. -container_pull( - name = "ros_deploy_base", - digest = "sha256:322c3900f36c4078f4a7831026bd1782c859d27f0a8fc909c9928e59bdd764bb", - registry = "docker.io", - repository = "mvukov/bazel-deploy-base", -) diff --git a/examples/chatter/BUILD.bazel b/examples/chatter/BUILD.bazel index 68b01ba9..4ca03cd6 100644 --- a/examples/chatter/BUILD.bazel +++ b/examples/chatter/BUILD.bazel @@ -3,8 +3,6 @@ load("@com_github_mvukov_rules_ros2//ros2:cc_defs.bzl", "ros2_cpp_binary") load("@com_github_mvukov_rules_ros2//ros2:launch.bzl", "ros2_launch") load("@com_github_mvukov_rules_ros2//ros2:test.bzl", "ros2_test") load("@com_github_mvukov_rules_ros2//ros2:topic.bzl", "ros2_topic") -load("@io_bazel_rules_docker//container:container.bzl", "container_push") -load("@io_bazel_rules_docker//lang:image.bzl", container_image = "app_layer") load("@rules_python//python:defs.bzl", "py_binary") ros2_cpp_binary( @@ -70,19 +68,3 @@ ros2_bag( "@ros2_rosbag2//:rosbag2_interfaces", ], ) - -container_image( - name = "chatter_image", - base = "@ros_deploy_base//image", - binary = ":chatter", - docker_run_flags = "-it --rm --network=host", -) - -container_push( - name = "chatter_publish", - format = "Docker", - image = ":chatter_image", - registry = "docker.io", - repository = "mvukov/chatter", - tag = "demo_ros2", -) diff --git a/examples/chatter/README.md b/examples/chatter/README.md index 22c3b5e4..bd3be24f 100644 --- a/examples/chatter/README.md +++ b/examples/chatter/README.md @@ -37,12 +37,6 @@ You can run tests with bazel test //chatter:tests # To see the logs run with `--test_output=all`. ``` -To run the sample deployment in a Docker container, run - -```sh -bazel run //chatter:chatter_image -``` - Alternatively, you can run nodes without the launch mechanism. In a terminal run ```sh