Skip to content
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

Describe ToT docker image version as head commit short sha #705

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 44 additions & 1 deletion .github/workflows/artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,47 @@ jobs:
with:
name: image_gce_debian11_amd64
path: image.tar.gz

export-docker-image-x86_64:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 # aka v2
- name: Get docker image name
run: |
short_sha=$(echo ${{ github.sha }} | cut -c1-8)
echo "x86_64_image_path=orchestration-image-x86_64-${short_sha}.tar" >> $GITHUB_ENV
- name: Install bazel
run: sudo bash tools/buildutils/installbazel.sh
- name: bazel version
run: bazel version
- name: Build docker image
run: bazel build --sandbox_writable_path=$HOME //docker:orchestration_image_tar
- name: Set filename of docker image
run: mv bazel-bin/docker/orchestration-image.tar ${{ env.x86_64_image_path }}
- name: Publish docker image
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # aka v4.0.0
with:
name: docker-image-x86_64
path: ${{ env.x86_64_image_path }}
export-docker-image-arm64:
runs-on: arm-ubuntu-arm-22.04-4core
steps:
- name: Checkout repository
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 # aka v2
- name: Get docker image name
run: |
short_sha=$(echo ${{ github.sha }} | cut -c1-8)
echo "arm64_image_path=orchestration-image-arm64-${short_sha}.tar" >> $GITHUB_ENV
- name: Install bazel
run: sudo bash tools/buildutils/installbazel.sh
- name: bazel version
run: bazel version
- name: Build docker image
run: bazel build --sandbox_writable_path=$HOME //docker:orchestration_image_tar
- name: Set filename of docker image
run: mv bazel-bin/docker/orchestration-image.tar ${{ env.arm64_image_path }}
- name: Publish docker image
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # aka v4.0.0
with:
name: docker-image-arm64
path: ${{ env.arm64_image_path }}
41 changes: 0 additions & 41 deletions .github/workflows/docker.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions .github/workflows/host-image-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ jobs:
name: u-boot
path: tools/cuttlefish-host-image-installer/u-boot.bin

build-docker-image-job:
uses: ./.github/workflows/docker.yaml

test-install-cuttlefish-deb-job:
runs-on: ubuntu-latest
needs: build-cuttlefish-deb-job
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ cuttlefish-orchestration latest 0123456789ab 2 minutes ago 690MB
### Download prebuilt image

Downloading latest image is available
[here](https://github.com/google/android-cuttlefish/releases/tag/latest).
[here](https://github.com/google/android-cuttlefish/actions/workflows/artifacts.yaml?query=event%3Apush).

After downloading image, please load the image and verify with
`docker image list`.
Expand Down
4 changes: 2 additions & 2 deletions docker/image-build-bazel-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ fi
script_location="$(rlocation ${rlocation_base}/docker/image-build-bazel-wrapper.sh)"
repo_root_dir=$(dirname $(dirname $(readlink -f ${script_location})))

tag="BUILD$(date +%+4Y%m%d)-$RANDOM"
name="cuttlefish-orchestration:${tag}"
head_commit_sha=$(git -C ${repo_root_dir} rev-parse HEAD | cut -c1-8)
name="cuttlefish-orchestration:${head_commit_sha}"

function remove_image() {
docker rmi ${name}
Expand Down
Loading