-
Notifications
You must be signed in to change notification settings - Fork 77
tools/docker: Add Docker image support for devlib #672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
24a084e
target: Address pylint issues in ChromeOsTarget class
metin-arm 1bd22c4
target: tests: Add support for testing ChromeOS targets
metin-arm c659c2b
test_target.py: Allow specifying connection timeout for Android targets
metin-arm 3e708bb
tools/docker: Add Docker image support for devlib
metin-arm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Copyright (C) 2024, ARM Limited and contributors. | ||
| # | ||
| # 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. | ||
| # | ||
| # This Dockerfile creates an image to run devlib CI tests. | ||
| # | ||
| # Running ``docker build -t devlib .`` command in ``tools/docker`` directory | ||
| # creates the docker image. | ||
| # | ||
| # The image can be runned via ``docker run -it --privileged devlib`` command. | ||
| # | ||
|
|
||
| FROM ubuntu:22.04 | ||
|
|
||
| ENV DEBIAN_FRONTEND noninteractive | ||
|
|
||
| ENV DEVLIB_REF master | ||
|
|
||
| RUN apt-get update && \ | ||
| apt-get install -y --no-install-recommends \ | ||
| aapt \ | ||
| bc \ | ||
| bison \ | ||
| build-essential \ | ||
| cmake \ | ||
| cpio \ | ||
| file \ | ||
| flex \ | ||
| git \ | ||
| libelf-dev \ | ||
| libncurses5-dev \ | ||
| libssl-dev \ | ||
| locales \ | ||
| python3-pip \ | ||
| qemu-system-arm \ | ||
| qemu-system-x86 \ | ||
| rsync \ | ||
| sudo \ | ||
| unzip \ | ||
| wget \ | ||
| vim \ | ||
| xz-utils | ||
|
|
||
| RUN apt-get -y autoremove && \ | ||
| apt-get -y autoclean && \ | ||
| apt-get clean && \ | ||
| rm -rf /var/cache/apt | ||
|
|
||
| RUN git clone -b ${DEVLIB_REF} -v https://github.com/ARM-software/devlib.git /devlib | ||
| RUN cd /devlib && \ | ||
| pip install --upgrade pip setuptools wheel && \ | ||
| pip install .[full] | ||
|
|
||
| # Set CMDLINE_VERSION environment variable if you want to use a specific | ||
| # version of Android command line tools rather than default which is | ||
| # ``11076708`` as of writing this comment. | ||
| RUN cd /devlib/tools/android && ./install_base.sh | ||
|
|
||
| # Set BUILDROOT_VERSION environment variable if you want to use a specific | ||
| # branch of buildroot rather than default which is ``2023.11.1`` as of | ||
| # writing this comment. | ||
| RUN cd /devlib/tools/buildroot && \ | ||
| ./generate-kernel-initrd.sh && \ | ||
| ./generate-kernel-initrd.sh -a x86_64 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Copyright (C) 2024, ARM Limited and contributors. | ||
| # | ||
| # 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. | ||
| # | ||
| # Prepare the groundwork and run tests/test_target.py on the Docker image. | ||
| # | ||
|
|
||
| set -eu | ||
|
|
||
| ANDROID_HOME="/devlib/tools/android/android-sdk-linux" | ||
| export ANDROID_HOME | ||
| export ANDROID_USER_HOME="${ANDROID_HOME}/.android" | ||
| export ANDROID_EMULATOR_HOME="${ANDROID_HOME}/.android" | ||
| export PATH=${ANDROID_HOME}/platform-tools/:${PATH} | ||
|
|
||
| EMULATOR="${ANDROID_HOME}/emulator/emulator" | ||
| EMULATOR_ARGS="-no-window -no-snapshot -memory 2048" | ||
| ${EMULATOR} -avd devlib-p6-12 ${EMULATOR_ARGS} & | ||
| ${EMULATOR} -avd devlib-p6-14 ${EMULATOR_ARGS} & | ||
| ${EMULATOR} -avd devlib-chromeos ${EMULATOR_ARGS} & | ||
|
|
||
| echo "Waiting 30 seconds for Android virtual devices to finish boot up..." | ||
| sleep 30 | ||
|
|
||
| cd /devlib | ||
| cp -f tools/docker/target_configs.yaml tests/ | ||
| python3 -m pytest --log-cli-level DEBUG ./tests/test_target.py | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| AndroidTarget: | ||
| # Android-12, Pixel-6 | ||
| entry-0: | ||
| timeout: 60 | ||
| connection_settings: | ||
| device: 'emulator-5554' | ||
|
|
||
| # Android-14, Pixel-6 | ||
| entry-1: | ||
| connection_settings: | ||
| device: 'emulator-5556' | ||
|
|
||
| # Android-13, Pixel tablet | ||
| entry-2: | ||
| connection_settings: | ||
| device: 'emulator-5558' | ||
|
|
||
| LocalLinuxTarget: | ||
| entry-0: | ||
| connection_settings: | ||
| unrooted: True | ||
|
|
||
| QEMUTargetRunner: | ||
| entry-0: | ||
| qemu_settings: | ||
| kernel_image: '/devlib/tools/buildroot/buildroot-v2023.11.1-aarch64/output/images/Image' | ||
|
|
||
| ChromeOsTarget: | ||
| connection_settings: | ||
| device: 'emulator-5558' | ||
|
|
||
| entry-1: | ||
| connection_settings: | ||
| port: 8023 | ||
|
|
||
| qemu_settings: | ||
| kernel_image: '/devlib/tools/buildroot/buildroot-v2023.11.1-x86_64/output/images/bzImage' | ||
| arch: 'x86_64' | ||
| cmdline: 'console=ttyS0' | ||
|
|
||
| ChromeOsTarget: | ||
| connection_settings: | ||
| device: 'emulator-5558' |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: For such a delay is it worth displaying something to the user to inform them of this wait?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Will show a message before sleeping.