Skip to content

Commit

Permalink
mobile: use Docker image with Java & Android NDK installed (#25696)
Browse files Browse the repository at this point in the history
This allows us to move the `android_build` CI job from macOS to Linux,
freeing up some CI capacity.

It also allows us to remove the Java installation step from some other
CI jobs since it's now available directly in the docker image the job
runs on.

Related PRs:

* envoyproxy/envoy-build-tools#190
* envoyproxy/envoy-build-tools#197
* envoyproxy/envoy-build-tools#198

Signed-off-by: JP Simard <[email protected]>
  • Loading branch information
jpsim authored Feb 22, 2023
1 parent 3155866 commit 3ac3a1b
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 79 deletions.
30 changes: 14 additions & 16 deletions .github/workflows/android_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,32 @@ jobs:
androidbuild:
if: github.repository == 'envoyproxy/envoy'
name: android_build
runs-on: macos-12
runs-on: ubuntu-20.04
timeout-minutes: 90
container:
image: envoyproxy/envoy-build-ubuntu:mobile-f52df4a4e1e2ecbcda42eb2f27a1550b6c53eef0
env:
CC: /opt/llvm/bin/clang
CXX: /opt/llvm/bin/clang++
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Add safe directory
run: git config --global --add safe.directory /__w/envoy/envoy
- id: should_run
name: 'Check whether to run'
run: ./mobile/tools/should_run_ci.sh
- uses: actions/setup-java@c3ac5dd0ed8db40fedb61c32fbe677e6b355e94c
if: steps.should_run.outputs.run_ci_job == 'true'
with:
java-version: '8'
java-package: jdk
architecture: x64
distribution: zulu
- name: 'Install dependencies'
if: steps.should_run.outputs.run_ci_job == 'true'
run: cd mobile && ./ci/mac_ci_setup.sh --android
- name: 'Build envoy.aar distributable'
if: steps.should_run.outputs.run_ci_job == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd mobile && ./bazelw build \
$([ -z $GITHUB_TOKEN ] || echo "--config=remote-ci-macos") \
$([ -z $GITHUB_TOKEN ] || echo "--config=remote-ci-linux-clang") \
--remote_header="Authorization=Bearer $GITHUB_TOKEN" \
--fat_apk_cpu=x86_64 \
--linkopt=-fuse-ld=lld \
//:android_dist
javahelloworld:
if: github.repository == 'envoyproxy/envoy'
Expand Down Expand Up @@ -72,7 +70,7 @@ jobs:
with:
timeout_minutes: 6
max_attempts: 3
command: cd mobile && ./ci/mac_start_emulator.sh
command: ./mobile/ci/start_android_emulator.sh
# Return to using:
# cd mobile && ./bazelw mobile-install --fat_apk_cpu=x86_64 --start_app //examples/java/hello_world:hello_envoy
# When https://github.com/envoyproxy/envoy-mobile/issues/853 is fixed.
Expand Down Expand Up @@ -120,7 +118,7 @@ jobs:
with:
timeout_minutes: 6
max_attempts: 3
command: cd mobile && ./ci/mac_start_emulator.sh
command: ./mobile/ci/start_android_emulator.sh
# Return to using:
# ./bazelw mobile-install --fat_apk_cpu=x86_64 --start_app //examples/kotlin/hello_world:hello_envoy_kt
# When https://github.com/envoyproxy/envoy-mobile/issues/853 is fixed.
Expand Down Expand Up @@ -168,7 +166,7 @@ jobs:
with:
timeout_minutes: 6
max_attempts: 3
command: cd mobile && ./ci/mac_start_emulator.sh
command: ./mobile/ci/start_android_emulator.sh
# Return to using:
# ./bazelw mobile-install --fat_apk_cpu=x86_64 --start_app //examples/kotlin/hello_world:hello_envoy_kt
# When https://github.com/envoyproxy/envoy-mobile/issues/853 is fixed.
Expand Down Expand Up @@ -216,7 +214,7 @@ jobs:
with:
timeout_minutes: 6
max_attempts: 3
command: cd mobile && ./ci/mac_start_emulator.sh
command: ./mobile/ci/start_android_emulator.sh
# Return to using:
# ./bazelw mobile-install --fat_apk_cpu=x86_64 --start_app //examples/kotlin/hello_world:hello_envoy_kt
# When https://github.com/envoyproxy/envoy-mobile/issues/853 is fixed.
Expand Down
13 changes: 1 addition & 12 deletions .github/workflows/android_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 90
container:
image: envoyproxy/envoy-build-ubuntu:7304f974de2724617b7492ccb4c9c58cd420353a
image: envoyproxy/envoy-build-ubuntu:mobile-f52df4a4e1e2ecbcda42eb2f27a1550b6c53eef0
env:
CC: /opt/llvm/bin/clang
CXX: /opt/llvm/bin/clang++
Expand All @@ -104,17 +104,6 @@ jobs:
- id: should_run
name: 'Check whether to run'
run: ./mobile/tools/should_run_ci.sh
- name: 'Java setup'
if: steps.should_run.outputs.run_ci_job == 'true'
uses: actions/setup-java@c3ac5dd0ed8db40fedb61c32fbe677e6b355e94c
with:
java-version: '8'
java-package: jdk
architecture: x64
distribution: zulu
- name: 'Install dependencies'
if: steps.should_run.outputs.run_ci_job == 'true'
run: cd mobile && ./ci/linux_ci_setup.sh
- name: 'Run Kotlin library integration tests'
if: steps.should_run.outputs.run_ci_job == 'true'
env:
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/asan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 180
container:
image: envoyproxy/envoy-build-ubuntu:7304f974de2724617b7492ccb4c9c58cd420353a
image: envoyproxy/envoy-build-ubuntu:mobile-f52df4a4e1e2ecbcda42eb2f27a1550b6c53eef0
env:
CC: /opt/llvm/bin/clang
CXX: /opt/llvm/bin/clang++
Expand All @@ -30,13 +30,6 @@ jobs:
- id: should_run
name: 'Check whether to run'
run: ./mobile/tools/should_run_ci.sh
- uses: actions/setup-java@c3ac5dd0ed8db40fedb61c32fbe677e6b355e94c
if: steps.should_run.outputs.run_ci_job == 'true'
with:
java-version: '8'
java-package: jdk
architecture: x64
distribution: zulu
- name: 'Run tests'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/tsan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 90
container:
image: envoyproxy/envoy-build-ubuntu:7304f974de2724617b7492ccb4c9c58cd420353a
image: envoyproxy/envoy-build-ubuntu:mobile-f52df4a4e1e2ecbcda42eb2f27a1550b6c53eef0
env:
CC: /opt/llvm/bin/clang
CXX: /opt/llvm/bin/clang++
Expand All @@ -30,13 +30,6 @@ jobs:
- id: should_run
name: 'Check whether to run'
run: ./mobile/tools/should_run_ci.sh
- uses: actions/setup-java@c3ac5dd0ed8db40fedb61c32fbe677e6b355e94c
if: steps.should_run.outputs.run_ci_job == 'true'
with:
java-version: '8'
java-package: jdk
architecture: x64
distribution: zulu
- name: 'Run tests'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
31 changes: 0 additions & 31 deletions mobile/ci/linux_ci_setup.sh

This file was deleted.

File renamed without changes.
8 changes: 4 additions & 4 deletions mobile/third_party/rbe_configs/config/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ platform(
],
exec_properties = {
# Please update both the commented tag and the sha256
# 7304f974de2724617b7492ccb4c9c58cd420353a
"container-image": "docker://envoyproxy/envoy-build-ubuntu@sha256:c219e5cf82f0058c12a801cfc9b680f10ddc480b99bedb099fb43f55d333f7ca",
# mobile-f52df4a4e1e2ecbcda42eb2f27a1550b6c53eef0
"container-image": "docker://envoyproxy/envoy-build-ubuntu@sha256:53ca98c3a8a34c55dbae7bfd447d6cab47377c4c05d611fdaba19809907e0b55",
"OSFamily": "Linux",
"Pool": "linux",
},
Expand All @@ -60,8 +60,8 @@ platform(
],
exec_properties = {
# Please update both the commented tag and the sha256
# 7304f974de2724617b7492ccb4c9c58cd420353a
"container-image": "docker://envoyproxy/envoy-build-ubuntu@sha256:c219e5cf82f0058c12a801cfc9b680f10ddc480b99bedb099fb43f55d333f7ca",
# mobile-f52df4a4e1e2ecbcda42eb2f27a1550b6c53eef0
"container-image": "docker://envoyproxy/envoy-build-ubuntu@sha256:53ca98c3a8a34c55dbae7bfd447d6cab47377c4c05d611fdaba19809907e0b55",
"OSFamily": "Linux",
"Pool": "linux",
# Necessary to workaround https://github.com/google/sanitizers/issues/916, otherwise, dangling threads in the
Expand Down

0 comments on commit 3ac3a1b

Please sign in to comment.