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

Update README to include instructions for building to ARM. #555

Closed
wants to merge 1 commit into from

Conversation

Smit2553
Copy link

@Smit2553 Smit2553 commented Sep 3, 2024

Updated the build instructions for macOS on ARM. Specifically, I updated the Readme to show the required flags to ensure that builds on ARM machines utilize x86 emulation rather than targeting ARM architecture. These updates are in the macOS warning section under Local Deployment.

Additionally, I improved the README by updating the markdown syntax, replacing asterisks (*) with underscores (_) for italics.

@Smit2553
Copy link
Author

Smit2553 commented Sep 3, 2024

Addresses similar issues to those present in #271. The issue was closed by updating certain Python package versions but the problem still exists on current builds. Using the x86 flags in the docker build and run causes the errors to not occur.

@Smit2553
Copy link
Author

Smit2553 commented Sep 3, 2024

Update to the changes from * to _

It's just Prettier linting preference, looking at the Markdown docs (*) is still perfectly fine. I can change it back to (*) for italics if needed.

@robwaz
Copy link
Member

robwaz commented Sep 3, 2024

IIRC, it didn't used to be necessary to build the dojo itself on ARM. The infra used to run on ARM. The challenge image was built using the platform argument though.

I think we should take a quick look to see if we can make this possible before running everything through Apple's Rosetta.

@Smit2553
Copy link
Author

Smit2553 commented Sep 3, 2024

@robwaz Currently trying to build directly to ARM without the platform arguments causes the build to succeed but the container fails on startup. I was trying to build directly for a few hours last night and the night before. The container fails at random points weirdly enough. It's always step 28 but the command being executed is different. From what I can see it isn't a specific package that causes the crash. I could be wrong and I can provide more logs when I get back home if we want to try and debug further.

Logs of the errors I got last night are attached below.
This is using the default ports:

Sep 03 06:40:13 5403a4f57456 dojo[12779]: #28 0.118 fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/main/aarch64/APKINDEX.tar.gz
Sep 03 06:40:13 5403a4f57456 dojo[12779]: #28 0.411 fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/community/aarch64/APKINDEX.tar.gz
Sep 03 06:40:13 5403a4f57456 dojo[12779]: #28 0.795 (1/37) Installing ca-certificates (20240705-r0)
Sep 03 06:40:13 5403a4f57456 dojo[12779]: #28 0.822 (2/37) Installing docker-cli (26.1.5-r0)
Sep 03 06:40:13 5403a4f57456 dojo[12779]: #28 CANCELED
Sep 03 06:40:13 5403a4f57456 dojo[12779]: ------
Sep 03 06:40:13 5403a4f57456 dojo[12779]:  > [challenge essentials 2/4] RUN <<EOF (rm -f /etc/apt/apt.conf.d/docker-clean...):
Sep 03 06:40:13 5403a4f57456 dojo[12779]: 0.073 exec /bin/bash: exec format error
Sep 03 06:40:13 5403a4f57456 dojo[12779]: ------
Sep 03 06:40:13 5403a4f57456 dojo[12779]: failed to solve: process "/bin/bash -ceov pipefail     rm -f /etc/apt/apt.conf.d/docker-clean\n    echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache\n\n    (set +o pipefail; yes | unminimize)\n\n    dpkg --add-architecture i386\n\n    apt-get clean && rm -rf /var/lib/apt/lists/*\n" did not complete successfully: exit code: 1
Sep 03 06:40:13 5403a4f57456 systemd[1]: pwn.college.service: Main process exited, code=exited, status=17/n/a
Sep 03 06:40:13 5403a4f57456 systemd[1]: pwn.college.service: Failed with result 'exit-code'.
Sep 03 06:40:13 5403a4f57456 systemd[1]: Failed to start pwn.college.service - pwn.college docker compose service.

This is trying to remap the ports to something else that isn't system reserved:

Sep 03 06:41:55 b8309ddbb861 dojo[12761]: #28 0.729 (3/31) Installing c-ares (1.28.1-r0)
Sep 03 06:41:55 b8309ddbb861 dojo[12761]: #28 0.748 (4/31) Installing libunistring (1.2-r0)
Sep 03 06:41:55 b8309ddbb861 dojo[12761]: #28 0.805 (5/31) Installing libidn2 (2.3.7-r0)
Sep 03 06:41:55 b8309ddbb861 dojo[12761]: #28 CANCELED
Sep 03 06:41:55 b8309ddbb861 dojo[12761]: ------
Sep 03 06:41:55 b8309ddbb861 dojo[12761]:  > [challenge essentials 2/4] RUN <<EOF (rm -f /etc/apt/apt.conf.d/docker-clean...):
Sep 03 06:41:55 b8309ddbb861 dojo[12761]: 0.082 exec /bin/bash: exec format error
Sep 03 06:41:55 b8309ddbb861 dojo[12761]: ------
Sep 03 06:41:55 b8309ddbb861 dojo[12761]: failed to solve: process "/bin/bash -ceov pipefail     rm -f /etc/apt/apt.conf.d/docker-clean\n    echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache\n\n    (set +o pipefail; yes | unminimize)\n\n    dpkg --add-architecture i386\n\n    apt-get clean && rm -rf /var/lib/apt/lists/*\n" did not complete successfully: exit code: 1
Sep 03 06:41:55 b8309ddbb861 systemd[1]: pwn.college.service: Main process exited, code=exited, status=17/n/a
Sep 03 06:41:55 b8309ddbb861 systemd[1]: pwn.college.service: Failed with result 'exit-code'.
Sep 03 06:41:55 b8309ddbb861 systemd[1]: Failed to start pwn.college.service - pwn.college docker compose service.```

@ConnorNelson
Copy link
Member

Thanks for trying to resolve this! I think #558 is the correct fix.

@Smit2553
Copy link
Author

Smit2553 commented Sep 5, 2024

#558 Appears to be a better fix method than forcing the dojo to run through Rosetta.

@Smit2553 Smit2553 closed this Sep 5, 2024
@Smit2553 Smit2553 deleted the update-readme-MacOS-ARM branch September 5, 2024 03:08
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.

3 participants