Skip to content

Commit 18a2775

Browse files
authored
Minor updates to docker hos images (#33)
- Fix permissions for ohos-config.tar - Bump dependencies (uv, github runner, commandline tools) - Download command line tools automatically.
1 parent f0369e7 commit 18a2775

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

docker/build.sh

+3-12
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
set -eu
44

55
SERVO_GIT_HASH=$(git ls-remote https://github.com/servo/servo.git --branches refs/heads/main | awk '{ print $1}')
6-
HOS_COMMANDLINE_TOOLS_VERSION="5.0.3.906"
7-
GITHUB_ACTIONS_RUNNER_VERSION="2.322.0"
6+
GITHUB_ACTIONS_RUNNER_VERSION="2.323.0"
87
RUST_VERSION="1.85.0"
9-
UV_VERSION="0.6.4"
8+
UV_VERSION="0.6.14"
109
IMAGE_USERNAME=servo_ci
1110

1211

@@ -16,20 +15,12 @@ then
1615
cd hos_builder && wget https://cli.github.com/packages/githubcli-archive-keyring.gpg && cd -
1716
fi
1817

19-
if [[ ! -f "hos_commandline_tools/commandline-tools-linux-x64-${HOS_COMMANDLINE_TOOLS_VERSION}.zip" ]]
20-
then
21-
echo "Couldn't find the HarmonyOS commandline tools (version ${HOS_COMMANDLINE_TOOLS_VERSION}). Please download manually."
22-
echo "The commandline tools can be found at https://developer.huawei.com/consumer/cn/download/"
23-
echo "Note: Currently the commandline tools are only available to developers with a mainland china huawei account."
24-
exit 1
25-
fi
26-
2718
# Build the helper images
2819
docker build base -f base/Dockerfile -t servo_gha_base:latest --build-arg=USERNAME=${IMAGE_USERNAME}
2920
docker build gh_runner -f gh_runner/Dockerfile -t "servo_gha_runner:${GITHUB_ACTIONS_RUNNER_VERSION}" \
3021
--build-arg=USERNAME=${IMAGE_USERNAME} \
3122
--build-arg=GITHUB_ACTIONS_RUNNER_VERSION=${GITHUB_ACTIONS_RUNNER_VERSION}
32-
docker build hos_commandline_tools -f hos_commandline_tools/Dockerfile -t "hos_commandline_tools:${HOS_COMMANDLINE_TOOLS_VERSION}" \
23+
docker build hos_commandline_tools -f hos_commandline_tools/Dockerfile -t "hos_commandline_tools" \
3324
--build-arg=USERNAME=${IMAGE_USERNAME}
3425

3526
# Build the actual images
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
FROM servo_gha_base:latest
22

33
RUN mkdir -p data
4-
ADD commandline-tools-linux-x64-5.0.3.906.zip /data/commandline-tools.zip
4+
ARG COMMANDLINE_TOOLS_PATH=https://repo.huaweicloud.com/harmonyos/ohpm/5.0.5/commandline-tools-linux-x64-5.0.5.310.zip
5+
ADD ${COMMANDLINE_TOOLS_PATH} /data/commandline-tools.zip
56
RUN cd data && unzip -q commandline-tools.zip

docker/runner/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ COPY --from=commandline_tools /data/command-line-tools/sdk/default/openharmony/t
2323
# Note: We could solve this via Github secrets, but that would require first auditing all
2424
# servo workflows. I suspect that it is currently possible to extract secrets from the servo repo
2525
# via pull requests with malicous build scripts.
26-
ADD ohos-config.tar /home/${USERNAME}/
26+
ADD --chown=${USERNAME}:${USERNAME} ohos-config.tar /home/${USERNAME}/
2727
# Used to authorize with the hdc device and avoid the confirmation dialog.
2828
COPY --chown=${USERNAME}:${USERNAME} hdckey hdckey.pub /home/${USERNAME}/.harmony/
2929
ADD hdc.tar /usr/bin/

0 commit comments

Comments
 (0)