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

Introduce isolation in artifacts.yaml #749

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Conversation

c0rv4x
Copy link

@c0rv4x c0rv4x commented Oct 13, 2024

Add isolation in Github CI/CD to avoid unsafe code being executed in the self-hosted runner. This could otherwise lead to the runner takeover

@@ -75,6 +75,9 @@ jobs:
path: ${{ env.x86_64_image_path }}
export-docker-image-arm64:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have another job export-docker-image-x86_64 above. If it does for arm64, why don't we do it for x86_64 as well?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x86_64 is run on Github-hosted runner, so it would be unnecessary

Comment on lines 78 to 80
container:
image: arm64v8/ubuntu:22.04 # Specify an arm64 Docker image here
options: --security-opt=no-new-privileges # Optional: Add additional Docker security options
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it fails the presubmit check, could you check it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I skipped this on purpose since the job is run in runs-on: ubuntu-22.04, which is a Github-hosted runner. It will have it's own isolation so this is not really necessary.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regardless of the purpose of this PR, it shouldn't break any presubmit checks. This PR is currently breaking export-docker-image-arm64.
https://github.com/google/android-cuttlefish/actions/runs/11336098940/job/31525430431?pr=749

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed! Will fix that today

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, it takes some time to see if it possible to do docker-in-docker for bazel to work on building docker images

@c0rv4x
Copy link
Author

c0rv4x commented Oct 18, 2024

Hey, I have updated the code, but can we launch it on your setup?

@0405ysj
Copy link
Collaborator

0405ysj commented Oct 25, 2024

Hey, I have updated the code, but can we launch it on your setup?

Ah, sure. I wasn't able to visit here for a couple of days due to my personal reasons. You wanted to trigger the presubmit, right?

@c0rv4x
Copy link
Author

c0rv4x commented Oct 25, 2024 via email

@0405ysj
Copy link
Collaborator

0405ysj commented Oct 25, 2024

Sorry, but I don't have enough bandwidth to try that today. Perhaps I can try with your pending PR next Monday.

Out of curiosity, what's the purpose for checking the discrepancies? It seems it still fails the presubmit check.

README.md Outdated
Comment on lines 89 to 96
123
123
123
123
123
123
123
123
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this?

pushd $android_cuttlefish_root_dir
docker build \
# Use the PLATFORM environment variable, defaulting to linux/amd64 if not set
platforms="${PLATFORM:-linux/amd64}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to remove PLATFORM env variable. It's not a standard one in Linux, so it would lead building amd64 image in arm64 machine as well in default.

@@ -87,7 +90,7 @@ jobs:
- name: bazel version
run: bazel version
- name: Build docker image
run: bazel build --sandbox_writable_path=$HOME //docker:orchestration_image_tar
run: bazel build --sandbox_writable_path=$HOME //docker:orchestration_image_tar --action_env=PLATFORM=linux/arm64
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, future users need to specify the arch when building docker image, though they may not be interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants