Delete Binder test artifacts and examples (#37862)

With the CL-first approach, the docker test configs for Binder need to be deleted before the Binder code and tests themselves can be deleted in the next step. Sanity checks fail otherwise.

Closes #37862

PiperOrigin-RevId: 683691175
pull/37871/head
AJ Heller 2 months ago committed by Copybara-Service
parent d56d89f691
commit 49d63f686a
  1. 24
      examples/android/binder/java/io/grpc/binder/cpp/README.md
  2. 25
      examples/android/binder/java/io/grpc/binder/cpp/exampleclient/AndroidManifest.xml
  3. 51
      examples/android/binder/java/io/grpc/binder/cpp/exampleclient/BUILD
  4. 15
      examples/android/binder/java/io/grpc/binder/cpp/exampleclient/ButtonPressHandler.java
  5. 26
      examples/android/binder/java/io/grpc/binder/cpp/exampleclient/MainActivity.java
  6. 72
      examples/android/binder/java/io/grpc/binder/cpp/exampleclient/native.cc
  7. 24
      examples/android/binder/java/io/grpc/binder/cpp/exampleclient/res/layout/activity_main.xml
  8. 5
      examples/android/binder/java/io/grpc/binder/cpp/exampleclient/res/values/strings.xml
  9. 21
      examples/android/binder/java/io/grpc/binder/cpp/exampleserver/AndroidManifest.xml
  10. 10
      examples/android/binder/java/io/grpc/binder/cpp/exampleserver/AndroidManifest_endpoint.xml
  11. 61
      examples/android/binder/java/io/grpc/binder/cpp/exampleserver/BUILD
  12. 13
      examples/android/binder/java/io/grpc/binder/cpp/exampleserver/ButtonPressHandler.java
  13. 26
      examples/android/binder/java/io/grpc/binder/cpp/exampleserver/ExportedEndpointService.java
  14. 27
      examples/android/binder/java/io/grpc/binder/cpp/exampleserver/MainActivity.java
  15. 82
      examples/android/binder/java/io/grpc/binder/cpp/exampleserver/native.cc
  16. 24
      examples/android/binder/java/io/grpc/binder/cpp/exampleserver/res/layout/activity_main.xml
  17. 5
      examples/android/binder/java/io/grpc/binder/cpp/exampleserver/res/values/strings.xml
  18. 49
      templates/tools/dockerfile/test/binder_transport_apk/Dockerfile.template
  19. 3
      test/distrib/bazel/test_single_bazel_version.sh
  20. 1
      tools/bazelify_tests/dockerimage_current_versions.bzl
  21. 2
      tools/bazelify_tests/test/strict_tests.bzl
  22. 2
      tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh
  23. 1
      tools/dockerfile/test/binder_transport_apk.current_version
  24. 87
      tools/dockerfile/test/binder_transport_apk/Dockerfile
  25. 2
      tools/internal_ci/linux/grpc_bazel_build_in_docker.sh
  26. 30
      tools/internal_ci/linux/grpc_binder_transport_apk.cfg
  27. 27
      tools/internal_ci/linux/grpc_binder_transport_apk.sh

@ -1,24 +0,0 @@
# gRPC-core BinderTransport example apps
## Build Instruction
1. Install Android SDK and NDK. Only NDK version >= 25 is supported. We tested against SDK Platform `33` and NDK `26.2.11394342`.
2. Make sure Bazel is at least `7.0`. Use `export OVERRIDE_BAZEL_VERSION=7.3.1` to selected a supported version listed in `bazel/supported_versions.txt` if necessary.
3. Point environment variables to install locations of SDK and NDK
```
export ANDROID_HOME=$HOME/android-sdk
export ANDROID_NDK_HOME=$HOME/android-sdk/ndk/26.2.11394342
```
4. To build a fat APK that supports `x86_64`, `armv7`, and `arm64`:
```
bazel build \
--extra_toolchains=@androidndk//:all \
--android_platforms=//bazel/platforms/android:x86_64,//bazel/platforms/android:armeabi-v7a,//bazel/platforms/android:arm64-v8a \
--copt=-Wno-unknown-warning-option \
//examples/android/binder/java/io/grpc/binder/cpp/exampleserver:app \
//examples/android/binder/java/io/grpc/binder/cpp/exampleclient:app
```
5. `adb install
bazel-bin/examples/android/binder/java/io/grpc/binder/cpp/exampleclient/app.apk`
6. `adb install
bazel-bin/examples/android/binder/java/io/grpc/binder/cpp/exampleserver/app.apk`

@ -1,25 +0,0 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.grpc.binder.cpp.exampleclient"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="29"
android:targetSdkVersion="30" />
<queries>
<package android:name="io.grpc.binder.cpp.exampleserver" />
</queries>
<application
android:label="gRPC BinderTransport Client Cpp">
<activity
android:name=".MainActivity"
android:label="gRPC BinderTransport Client Cpp" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

@ -1,51 +0,0 @@
# Copyright 2021 gRPC authors.
#
# 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.
cc_library(
name = "jni_lib",
srcs = ["native.cc"],
linkopts = [
"-ldl",
"-llog",
"-lm",
"-Wl,--no-undefined",
],
deps = [
"//:grpc++",
"//examples/protos:helloworld_cc_grpc",
],
alwayslink = True,
)
android_library(
name = "activity",
srcs = [
"ButtonPressHandler.java",
"MainActivity.java",
],
manifest = "AndroidManifest.xml",
resource_files = glob(["res/**"]),
deps = [
":jni_lib",
"@binder_transport_android_helper//io/grpc/binder/cpp:connection_helper",
],
)
android_binary(
name = "app",
manifest = "AndroidManifest.xml",
deps = [
":activity",
],
)

@ -1,15 +0,0 @@
package io.grpc.binder.cpp.exampleclient;
import android.app.Application;
public class ButtonPressHandler {
static {
System.loadLibrary("app");
}
public native String native_entry(Application application);
public String onPressed(Application application) {
return native_entry(application);
}
}

@ -1,26 +0,0 @@
package io.grpc.binder.cpp.exampleclient;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.Button;
import android.widget.TextView;
/** Main class for the example app. */
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.v("Example", "hello, world");
setContentView(R.layout.activity_main);
Button clickMeButton = findViewById(R.id.clickMeButton);
TextView exampleTextView = findViewById(R.id.exampleTextView);
ButtonPressHandler h = new ButtonPressHandler();
clickMeButton.setOnClickListener(
v -> exampleTextView.setText(h.onPressed(getApplication())));
}
}

@ -1,72 +0,0 @@
// Copyright 2021 gRPC authors.
//
// 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.
#include <android/log.h>
#include <grpcpp/create_channel_binder.h>
#include <grpcpp/security/binder_security_policy.h>
#include <jni.h>
#include "examples/protos/helloworld.grpc.pb.h"
#include "examples/protos/helloworld.pb.h"
extern "C" JNIEXPORT jstring JNICALL
Java_io_grpc_binder_cpp_exampleclient_ButtonPressHandler_native_1entry(
JNIEnv* env, jobject /*this*/, jobject application) {
// Lower the gRPC logging level, here it is just for demo and debugging
// purpose.
setenv("GRPC_VERBOSITY", "INFO", true);
if (grpc::experimental::InitializeBinderChannelJavaClass(env)) {
__android_log_print(ANDROID_LOG_INFO, "DemoClient",
"InitializeBinderChannelJavaClass succeed");
} else {
__android_log_print(ANDROID_LOG_INFO, "DemoClient",
"InitializeBinderChannelJavaClass failed");
}
static bool first = true;
static std::shared_ptr<grpc::Channel> channel;
if (first) {
first = false;
JavaVM* jvm;
{
jint result = env->GetJavaVM(&jvm);
assert(result == 0);
}
grpc::ChannelArguments ch_args;
// This is not required since "grpc.io.action.BIND" is already the default.
ch_args.SetString("grpc.binder.custom_android_intent_action_name",
"grpc.io.action.BIND");
channel = grpc::experimental::CreateCustomBinderChannel(
env, application, "io.grpc.binder.cpp.exampleserver",
"io.grpc.binder.cpp.exampleserver.ExportedEndpointService",
std::make_shared<
grpc::experimental::binder::SameSignatureSecurityPolicy>(
jvm, application),
ch_args);
return env->NewStringUTF("Clicked 1 time, channel created");
} else {
auto stub = helloworld::Greeter::NewStub(channel);
grpc::ClientContext context;
helloworld::HelloRequest request;
helloworld::HelloReply response;
request.set_name("BinderTransportClient");
grpc::Status status = stub->SayHello(&context, request, &response);
if (status.ok()) {
return env->NewStringUTF(response.message().c_str());
}
return env->NewStringUTF(
std::string("Clicked more than 1 time. Status not ok " +
std::to_string(status.error_code()))
.c_str());
}
}

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:padding="16dp"
android:orientation="vertical"
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/exampleTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textSize="32dp"
android:text="@string/thinking_face"/>
<Button
android:id="@+id/clickMeButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp"
android:text="@string/click_me_button"/>
</LinearLayout>

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="click_me_button">Run example</string>
<string name="thinking_face">🤔</string>
</resources>

@ -1,21 +0,0 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.grpc.binder.cpp.exampleserver"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="29"
android:targetSdkVersion="30" />
<application
android:label="gRPC BinderTransport Server Cpp">
<activity
android:name=".MainActivity"
android:label="gRPC BinderTransport Server Cpp" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.grpc.binder.cpp.exampleserver">
<uses-sdk android:minSdkVersion="29" android:targetSdkVersion="30"/>
<application>
<service
android:name=".ExportedEndpointService"
android:exported="true"/>
</application>
</manifest>

@ -1,61 +0,0 @@
# Copyright 2021 gRPC authors.
#
# 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.
cc_library(
name = "jni_lib",
srcs = ["native.cc"],
linkopts = [
"-ldl",
"-llog",
"-lm",
"-Wl,--no-undefined",
],
deps = [
"//:grpc++",
"//examples/protos:helloworld_cc_grpc",
],
alwayslink = True,
)
android_library(
name = "activity",
srcs = [
"ButtonPressHandler.java",
"MainActivity.java",
],
manifest = "AndroidManifest.xml",
resource_files = glob(["res/**"]),
deps = [
":endpoint",
":jni_lib",
],
)
android_library(
name = "endpoint",
srcs = ["ExportedEndpointService.java"],
exports_manifest = True,
manifest = "AndroidManifest_endpoint.xml",
deps = [
"@binder_transport_android_helper//io/grpc/binder/cpp:connection_helper",
],
)
android_binary(
name = "app",
manifest = "AndroidManifest.xml",
deps = [
":activity",
],
)

@ -1,13 +0,0 @@
package io.grpc.binder.cpp.exampleserver;
import android.app.Application;
public class ButtonPressHandler {
static {
System.loadLibrary("app");
}
public String onPressed(Application application) {
return "Server Button Pressed";
}
}

@ -1,26 +0,0 @@
package io.grpc.binder.cpp.exampleserver;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.content.Context;
import io.grpc.binder.cpp.GrpcCppServerBuilder;
/** Exposes gRPC services running in the main process */
public final class ExportedEndpointService extends Service {
static {
System.loadLibrary("app");
}
public ExportedEndpointService() {
init_grpc_server(this);
}
@Override
public IBinder onBind(Intent intent) {
// The argument should match the URI passed into grpc::ServerBuilder::AddListeningPort
return GrpcCppServerBuilder.GetEndpointBinder("binder:example.service");
}
public native void init_grpc_server(Context context);
}

@ -1,27 +0,0 @@
package io.grpc.binder.cpp.exampleserver;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.Button;
import android.widget.TextView;
import io.grpc.binder.cpp.exampleserver.R;
/** Main class for the example app. */
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.v("Example", "hello, world");
setContentView(R.layout.activity_main);
Button clickMeButton = findViewById(R.id.clickMeButton);
TextView exampleTextView = findViewById(R.id.exampleTextView);
ButtonPressHandler h = new ButtonPressHandler();
clickMeButton.setOnClickListener(
v -> exampleTextView.setText(h.onPressed(getApplication())));
}
}

@ -1,82 +0,0 @@
// Copyright 2021 gRPC authors.
//
// 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.
#include <android/log.h>
#include <grpcpp/create_channel_binder.h>
#include <grpcpp/grpcpp.h>
#include <grpcpp/security/binder_credentials.h>
#include <grpcpp/security/binder_security_policy.h>
#include <jni.h>
#include "examples/protos/helloworld.grpc.pb.h"
#include "examples/protos/helloworld.pb.h"
namespace {
class GreeterService : public helloworld::Greeter::Service {
public:
grpc::Status SayHello(grpc::ServerContext*,
const helloworld::HelloRequest* request,
helloworld::HelloReply* response) override {
__android_log_print(ANDROID_LOG_INFO, "DemoServer", "Line number %d",
__LINE__);
__android_log_print(ANDROID_LOG_INFO, "DemoServer", "Got hello request: %s",
request->name().c_str());
response->set_message("Hi, " + request->name());
return grpc::Status::OK;
}
};
} // namespace
extern "C" JNIEXPORT void JNICALL
Java_io_grpc_binder_cpp_exampleserver_ExportedEndpointService_init_1grpc_1server(
JNIEnv* env, jobject /*this*/, jobject context) {
// Lower the gRPC logging level, here it is just for demo and debugging
// purpose.
setenv("GRPC_VERBOSITY", "INFO", true);
__android_log_print(ANDROID_LOG_INFO, "DemoServer", "Line number %d",
__LINE__);
static std::unique_ptr<grpc::Server> server = nullptr;
if (server != nullptr) {
// Already initiated
return;
}
if (grpc::experimental::InitializeBinderChannelJavaClass(env)) {
__android_log_print(ANDROID_LOG_INFO, "DemoServer",
"InitializeBinderChannelJavaClass succeed");
} else {
__android_log_print(ANDROID_LOG_INFO, "DemoServer",
"InitializeBinderChannelJavaClass failed");
}
static GreeterService service;
grpc::ServerBuilder server_builder;
server_builder.RegisterService(&service);
JavaVM* jvm;
{
jint result = env->GetJavaVM(&jvm);
assert(result == 0);
}
server_builder.AddListeningPort(
"binder:example.service",
grpc::experimental::BinderServerCredentials(
std::make_shared<
grpc::experimental::binder::SameSignatureSecurityPolicy>(
jvm, context)));
server = server_builder.BuildAndStart();
}

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:padding="16dp"
android:orientation="vertical"
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/exampleTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textSize="32dp"
android:text="@string/thinking_face"/>
<Button
android:id="@+id/clickMeButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp"
android:text="@string/click_me_button"/>
</LinearLayout>

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="click_me_button">Run example</string>
<string name="thinking_face">🤔</string>
</resources>

@ -1,49 +0,0 @@
%YAML 1.2
--- |
# Copyright 2021 The gRPC Authors
#
# 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.
<%include file="../../oss_fuzz_base.include"/>
<%include file="../../bazel.include"/>
#========================
# Java
RUN apt-get install -y openjdk-21-jdk
#========================
# Android SDK/NDK installation
ENV ANDROID_SDK_VERSION 11076708
ENV ANDROID_NDK_VERSION 26.2.11394342
ENV SDK_ROOT /opt/android-sdk
RUN mkdir -p $SDK_ROOT
RUN cd $SDK_ROOT && \
wget -O cmd.zip https://dl.google.com/android/repository/commandlinetools-linux-${'${ANDROID_SDK_VERSION}'}_latest.zip && \
unzip -q cmd.zip && \
rm cmd.zip
RUN yes | $SDK_ROOT/cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT --licenses # accept all licenses
# This is not required but desirable to reduce the time to download and the chance of download failure.
RUN mkdir -p ~/.android && touch ~/.android/repositories.cfg
RUN $SDK_ROOT/cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT "ndk;$ANDROID_NDK_VERSION" "platforms;android-33" "build-tools;34.0.0"
# Set environment variables for Bazel rules
ENV ANDROID_HOME $SDK_ROOT
ENV ANDROID_NDK_HOME $SDK_ROOT/ndk/$ANDROID_NDK_VERSION
# Define the default command.
CMD ["bash"]

@ -66,9 +66,6 @@ EXCLUDED_TARGETS=(
"-//third_party/toolchains/rbe_windows_bazel_6.3.2_vs2019/..."
"-//third_party/toolchains:rbe_windows_default_toolchain_suite"
# TODO(jtattermusch): add back once fixed
"-//examples/android/binder/..."
# Exclude bazelified tests as they contain some bazel hackery
"-//tools/bazelify_tests/..."
)

@ -90,7 +90,6 @@ DOCKERIMAGE_CURRENT_VERSIONS = {
"tools/dockerfile/test/android_ndk.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/android_ndk@sha256:e4fd2e0048c4ffd2a04e4a41154ee469ed61e058cb704ee95071f7a3bdad507a",
"tools/dockerfile/test/bazel.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/bazel@sha256:be25af8c0e5faf39a585e7ddd657c4fd66513e4eba0ee0c687109b19ed462518",
"tools/dockerfile/test/bazel_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/bazel_arm64@sha256:ce026fedc059c74bade52f4b87c54907a3cf9abb22f6a584dba584e1925bbc42",
"tools/dockerfile/test/binder_transport_apk.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/binder_transport_apk@sha256:5dddb0d70ee427c7ee20d2b4f9261579218dd6b208b74c2913e0e3c79b3166f7",
"tools/dockerfile/test/csharp_debian11_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_debian11_arm64@sha256:4d4bc5f15e03f3d3d8fd889670ecde2c66a2e4d2dd9db80733c05c1d90c8a248",
"tools/dockerfile/test/csharp_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_debian11_x64@sha256:0763d919b17b4cfe5b65aff3bf911c04e9e4d46d11649858742033facd9f534f",
"tools/dockerfile/test/cxx_alpine_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_alpine_x64@sha256:10587bea5d163bf5c34c6157ebd1863d22863d9d38bbaf5135ffc6fbf2b73004",

@ -31,7 +31,7 @@ def generate_strict_tests(name = ""):
strict_warning_jobs = []
for source in [
":all //src/core/... //src/compiler/... //examples/... -//examples/android/binder/...",
":all //src/core/... //src/compiler/... //examples/...",
"//test/... -//test/core/... -//test/cpp/...",
"//test/core/end2end/...",
"//test/core/... -//test/core/end2end/...",

@ -16,7 +16,7 @@
set -e
# directories to run against
DIRS="examples/cpp examples/android/binder src/core src/cpp test/core test/cpp include src/compiler src/ruby src/objective-c tools/distrib/python src/python/grpcio_observability"
DIRS="examples/cpp src/core src/cpp test/core test/cpp include src/compiler src/ruby src/objective-c tools/distrib/python src/python/grpcio_observability"
# file matching patterns to check
GLOB="*.h *.c *.cc *.m *.mm"

@ -1 +0,0 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/binder_transport_apk:bbd5ccb5bcc5e63beccba6b3b2e8c907a8335731@sha256:5dddb0d70ee427c7ee20d2b4f9261579218dd6b208b74c2913e0e3c79b3166f7

@ -1,87 +0,0 @@
# Copyright 2021 The gRPC Authors
#
# 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.
# Pinned version of the base image is used to avoid regressions caused
# by rebuilding of this docker image. To see available versions, you can run
# "gcloud container images list-tags gcr.io/oss-fuzz-base/base-builder"
# This base image is built on Mar 12, 2024
FROM gcr.io/oss-fuzz-base/base-builder@sha256:c3581153788bc49f3634fec3cd36a5d6dfd26632c4afc157fb6faf8ce3af732e
# -------------------------- WARNING --------------------------------------
# If you are making changes to this file, consider changing
# https://github.com/google/oss-fuzz/blob/master/projects/grpc/Dockerfile
# accordingly.
# -------------------------------------------------------------------------
# Install basic packages
RUN apt-get update && apt-get -y install \
autoconf \
build-essential \
curl \
libtool \
make \
vim \
wget
#========================
# Bazel installation
# Must be in sync with tools/bazel
ENV BAZEL_VERSION 7.3.1
# The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper.
ENV DISABLE_BAZEL_WRAPPER 1
# Download the correct bazel version and make sure it's on path.
RUN BAZEL_ARCH_SUFFIX="$(uname -m | sed s/aarch64/arm64/)" \
&& curl -sSL --fail -o /usr/local/bin/bazel "https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-linux-$BAZEL_ARCH_SUFFIX" \
&& chmod a+x /usr/local/bin/bazel
# Normally we would run "bazel --version" here to make sure bazel
# was correctly installed, but we can't do that because
# of # https://github.com/bazelbuild/bazel/issues/11379.
# We want to keep the arm64 version of the image buildable
# on x64 with use of qemu-user-static & binfmt emulation,
# but the self-extraction is broken for bazel currently.
# The binary will work correctly when run on real arm64
# hardware, when qemu-user-static isn't getting into the way.
#========================
# Java
RUN apt-get install -y openjdk-21-jdk
#========================
# Android SDK/NDK installation
ENV ANDROID_SDK_VERSION 11076708
ENV ANDROID_NDK_VERSION 26.2.11394342
ENV SDK_ROOT /opt/android-sdk
RUN mkdir -p $SDK_ROOT
RUN cd $SDK_ROOT && wget -O cmd.zip https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip && unzip -q cmd.zip && rm cmd.zip
RUN yes | $SDK_ROOT/cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT --licenses # accept all licenses
# This is not required but desirable to reduce the time to download and the chance of download failure.
RUN mkdir -p ~/.android && touch ~/.android/repositories.cfg
RUN $SDK_ROOT/cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT "ndk;$ANDROID_NDK_VERSION" "platforms;android-33" "build-tools;34.0.0"
# Set environment variables for Bazel rules
ENV ANDROID_HOME $SDK_ROOT
ENV ANDROID_NDK_HOME $SDK_ROOT/ndk/$ANDROID_NDK_VERSION
# Define the default command.
CMD ["bash"]

@ -15,8 +15,6 @@
# Build all basic targets using the strict warning option which leverages the
# clang compiler to check if sources can pass a set of warning options.
# For now //examples/android/binder/ are excluded because it needs Android
# SDK/NDK to be installed to build
set -ex

@ -1,30 +0,0 @@
# Copyright 2021 gRPC authors.
#
# 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.
# Config file for the internal CI (in protobuf text format)
# Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/linux/grpc_binder_transport_apk.sh"
timeout_mins: 60
action {
define_artifacts {
regex: "**/*sponge_log.*"
regex: "github/grpc/reports/**"
}
}
env_vars {
key: "BAZEL_SCRIPT"
value: "tools/internal_ci/linux/grpc_binder_transport_apk_build_in_docker.sh"
}

@ -1,27 +0,0 @@
#!/usr/bin/env bash
# Copyright 2021 gRPC authors.
#
# 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.
set -ex
# avoid slow finalization after the script has exited.
source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
# change to grpc repo root
cd $(dirname $0)/../../..
source tools/internal_ci/helper_scripts/prepare_build_linux_rc
export DOCKERFILE_DIR=tools/dockerfile/test/binder_transport_apk
exec tools/run_tests/dockerize/build_and_run_docker.sh "${BAZEL_SCRIPT}"
Loading…
Cancel
Save