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

ER: New Developers with Mac processors are having problems running docker image #5644

Closed
6 tasks
roslynwythe opened this issue Oct 2, 2023 · 16 comments
Closed
6 tasks
Assignees
Labels
Complexity: See issue making label See the Issue Making label to understand the issue writing difficulty level ER Emergent Request Feature: Onboarding/Contributing.md Issue Making: Level 2 Make issue(s) from an ER or Epic ready for issue making role: back end/devOps Tasks for back-end developers size: 1pt Can be done in 4-6 hours

Comments

@roslynwythe
Copy link
Member

roslynwythe commented Oct 2, 2023

Dependencies (Issues created from this ER)

Emergent Requirement - Problem

A new developer with a Mac running M1 is unable to run docker using the hfla ghpages docker image

Issue you discovered this emergent requirement in

Date discovered

9/12

Did you have to do something temporarily

  • YES
  • NO

Who was involved

@sophia-bui @fyliu @homeroochoa47

What happens if this is not addressed

Some Mac users will be unable to run docker

Resources

Recommended Action Items

  • Make a new issue
  • Discuss with team
  • Let a Team Lead know

Potential solutions [draft]

We may do a variety of solutions, not just one. We should make issues (if feasible) for each.

Solution 1 (preferred)

Solution 2

  • Provide instructions in CONTRIBUTING.md for devs to build their own image using the Dockerfile

Solution 3

  • Provide instructions in CONTRIBUTING.md for devs to use the Rosetta 2 emulator
@roslynwythe roslynwythe added Feature Missing This label means that the issue needs to be linked to a precise feature label. role missing size: 0.25pt Can be done in 0.5 to 1.5 hours labels Oct 2, 2023
@github-actions

This comment was marked as resolved.

@roslynwythe roslynwythe added Complexity: Medium Feature: Infrastructure For changes on site technical architecture Complexity: Large role: back end/devOps Tasks for back-end developers and removed Complexity: Missing Feature Missing This label means that the issue needs to be linked to a precise feature label. labels Oct 2, 2023
@roslynwythe roslynwythe changed the title ER: New Developers on Mac M1 and M2 are having problems running docker image ER: New Developers on Mac processors are having problems running docker image Oct 2, 2023
@roslynwythe roslynwythe changed the title ER: New Developers on Mac processors are having problems running docker image ER: New Developers with Mac processors are having problems running docker image Oct 2, 2023
@ExperimentsInHonesty ExperimentsInHonesty added the ER Emergent Request label Nov 3, 2023
@ExperimentsInHonesty ExperimentsInHonesty added this to the 08. Team workflow milestone Nov 6, 2023
@roslynwythe
Copy link
Member Author

roslynwythe commented Nov 13, 2023

Sophia Bui
2 months ago
Hi,
I’m trying to set up my dev environment and ran into this issue yesterday. I’m currently on this link (on 1.6 Dev setup (6): Build and serve the website locally 1.6.a Starting Docker). I have Docker set up and have used it a few months ago. The instructions say to just have the application running and run the command “docker-compose up.” I did that, but I’m not getting the expected terminal output. I have a mac M1 and the output/error message I received is below (1. platform error 2. jekyll config file):
! hfla_site The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Attaching to hfla_site
hfla_site | ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-linux-musl]
hfla_site | Configuration file: none
hfla_site | Cleaner: Nothing to do for /srv/jekyll/_site.
hfla_site | Cleaner: Nothing to do for /srv/jekyll/.jekyll-metadata.
hfla_site | Cleaner: Nothing to do for .sass-cache.
hfla_site | ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-linux-musl]
hfla_site | Fatal: The configuration file '_config.yml' could not be found.
hfla_site | /usr/gem/gems/jekyll-3.9.2/lib/jekyll/configuration.rb:191:in rescue in read_config_file': The Configuration file '_config.yml' could not be found. (LoadError) hfla_site | from /usr/gem/gems/jekyll-3.9.2/lib/jekyll/configuration.rb:179:in read_config_file'
hfla_site | from /usr/gem/gems/jekyll-3.9.2/lib/jekyll/configuration.rb:207:in `block in read_config_files'
28 replies

Fang
2 months ago
Yes, this is a problem and I’m surprised it’s only surfacing now. The ghpages docker image only works for 64bit Intel. You should file a bug and ask that a multi platform image be built. Or at least one for arm 64 for m1
👍
1

Fang
2 months ago
You can also build your own image using the Dockerfile in the meantime. (edited)

Sophia Bui
2 months ago
Thank you!

Sophia Bui
2 months ago
I might go to office hours for this if I’m having trouble building the image

Fang
2 months ago
It’s the hackforla/ghpages-docker repo. That’s where you need to go to get the instructions for the image.
❤️
1

Homero Ochoa
2 months ago
Hi
@Sophia Bui
, out of curiosity did you install Rosetta 2 when installing docker? I have an M2 mac but haven't had this issue, and I believe Rosetta 2 should allow you to run the amd64 platform on a mac. Here's a similar issue from Stack Overflow
Stack OverflowStack Overflow
Running Docker Containers on Mac Apple Silicon M2: Platform Compatibility and Execution Errors (linux/arm64)
I'm a newbie to both macOS and Docker. I'm running into a series of roadblocks while trying to launch my project using Docker on Apple Silicon M2. I think that the issues i'm facing are related to ...
👍
1

Fang
2 months ago
I think just cloning it and running docker compose on it will build it

Fang
2 months ago
Right, Rosetta can emulate and allow you to run the image. It’s the simpler solution. Can one of you suggest that this be added to the documentation? Maybe then work on that issue.
🙌
1

Sophia Bui
2 months ago
I used Docker in the past with another opensource and did have an issue being an M1. I believe I installed Rosetta before. I’ll see and also ask DevOps. I’ll document it if I figure it out, appreciate all the help!
🙌
1

Roslyn Wythe
1 month ago
Thank you
@Fang

@Sophia Bui

@Homero Ochoa
for your ideas. I wrote an ER #5644 describing this situation. Would any of you be interested in writing and/or working on the issue?

https://github.com/[hackforla/website](https://github.com/hackforla/website)|hackforla/websitehackforla/website | Oct 1st | Added by GitHub

jason wong
1 month ago
@Sophia Bui
i dont think this is an m1/arm issue, since it looks like the container still manages to run. in the error it says _config.yml couldnt be found, do you have a _config.yml?

Sophia Bui
1 month ago
That is great that there is an issue for this. I’m not interested right now since the issue/solution is not clear, I moved to a different team so I could get started on contributing.
Hi
@jason wong
— regarding the config file, I can’t say 100% yes that file was there since I don’t have a copy on my local machine anymore, however I believe it was there since I was working on the yml file… ? If the config file is on the repo, I cloned it exactly as it was and followed instructions. I tried to build my own image and tried to edit the config file to add in multiple platforms but it was not working out. I did everything stated on the docs on onboarding/setting up my environment, didn’t change or delete files except trying to add on a line to include multiple platforms on my local machine. I wouldn’t think to add another yml file?

jason wong
1 month ago
oh interesting, then im really not sure now then since it just ran on my mac

Sophia Bui
1 month ago
@jason wong
do you have an M1? It could be an M1 issue since there’s been many issues online with docker :woman-shrugging:

jason wong
1 month ago
yes i do

jason wong
1 month ago
❯ docker-compose up
[+] Running 1/0
⠿ Container hfla_site Running 0.0s
Attaching to hfla_site
hfla_site | Configuration file: /srv/jekyll/_config.yml
hfla_site | Cleaner: Removing /srv/jekyll/_site...
hfla_site | Cleaner: Removing ./.jekyll-metadata...
hfla_site | Cleaner: Nothing to do for .sass-cache.
hfla_site | ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-linux-musl]
hfla_site | Configuration file: _config.yml
hfla_site | Configuration file: _config.docker.yml
hfla_site | Source: .
hfla_site | Destination: /srv/jekyll/_site
hfla_site | Incremental build: enabled
hfla_site | Generating...
hfla_site | done in 133.182 seconds.
hfla_site | Auto-regeneration: enabled for '.'
hfla_site | LiveReload address: http://0.0.0.0:35729/
hfla_site | Server address: http://0.0.0.0:4000/
hfla_site | Server running... press ctrl-c to stop.
hfla_site | LiveReload: Browser connected
^CGracefully stopping... (press Ctrl+C again to force)
[+] Running 1/1
⠿ Container hfla_site Stopped 0.4s
canceled
this is the output i get on mine

Sophia Bui
1 month ago
😳 Weird… I updated everything too like docker, Rosetta etc. Since no one else had this issue, maybe
@Roslyn Wythe
can just delete the issue then. I’ll be working on other projects anyway

Fang
1 month ago
I don’t have an apple silicon machine to test with if we made it build for arm too. But it seems like a really simple thing to make it happen that someone should do it anyway. Just a few lines in the ci config file.

jason wong
1 month ago
@Roslyn Wythe
do you know who maintains the ghpages docker image?
https://github.com/hackforla/ghpages-docker
hackforla/ghpages-docker
Docker file to build image pegged to GitHub Pages dependencies
Language
Shell
Last updated
a year ago
Added by GitHub

Roslyn Wythe
1 month ago
No unfortunately I don't know who maintains the ghpages docker image, but I was hoping someone with sufficient expertise would pick up the issue. I was hoping to ask Bonnie about it at our last meeting but there was not enough time.
@Fang
do you know of any current members with this expertise who might advise us?

jason wong
1 month ago
something that may work as an alternative is to have users build their own version of the docker image in their machines platform
image.png

image.png

jason wong
1 month ago
i dont know if it solves sophia's issue in particular but it does build a native version of the image

Roslyn Wythe
1 month ago
Yes @jason. Perhaps I should write an issue for someone to write up those instructions

Roslyn Wythe
1 month ago
for a dev to build their own version of the docker image

jason wong
1 month ago
it'd just mean devs would have to run a one time docker-compose build (edited)

Fang
1 month ago
Looks good
@jason wong
. Eric Vennemeyer did the docker image.

Roslyn Wythe
1 month ago
@jason wong
if its that simple, I'll write a complexity small issue to add that instruction to CONTRIBUTING.md

Fang
1 month ago
Or have someone update that ghpages-docker repo to build the arm image. Either way works. (edited)

@roslynwythe roslynwythe added Feature: Onboarding/Contributing.md size: 1pt Can be done in 4-6 hours Complexity: See issue making label See the Issue Making label to understand the issue writing difficulty level Issue Making: Level 2 Make issue(s) from an ER or Epic and removed Complexity: Large Feature: Infrastructure For changes on site technical architecture size: 0.25pt Can be done in 0.5 to 1.5 hours Complexity: Medium labels Nov 17, 2023
@roslynwythe
Copy link
Member Author

@ExperimentsInHonesty Please approve for issue making (should I have applied ready for prioritization instead?)

@ExperimentsInHonesty
Copy link
Member

@roslynwythe For additional context, Eric V. Created the docker image, and the bot that is supposed to maintain it. It looks like it has stopped running. Here is the WIKI file on ops that details where all the files are and how the update bot works. So that someone can start the journey to see why the updates stopped happening and what next steps are to get the docker image up to date and make sure the bot starts running again.

I have added updating this to the list of solutions above.

I am ready to prioritize this if you sign off on the way I have restructured the potential solutions.

I changed it from

Potential solutions [draft]

  • Developa multi-platform image
  • Provide instructions in CONTRIBUTING.md for devs to build their own image using the Dockerfile
  • Provide instructions on using Rosetta 2 emulator

to

Potential solutions [draft]

We may do a variety of solutions, not just one. We should make issues (if feasible) for each.

Solution 1 (preferred)

-Review the docker image Hack for LA created https://github.com/hackforla/ops/wiki/@danielridgebot-Ops-Wiki and see what we need to do to update it.

  • Make sure its a multi-platform image (if its not, improve it)

Solution 2

  • Provide instructions in CONTRIBUTING.md for devs to build their own image using the Dockerfile

Solution 3

  • Provide instructions in CONTRIBUTING.md for devs to use the Rosetta 2 emulator

@ExperimentsInHonesty ExperimentsInHonesty added ready for dev lead Issues that tech leads or merge team members need to follow up on and removed ready for product labels Nov 19, 2023
@jaasonw
Copy link
Member

jaasonw commented Nov 20, 2023

the bot likely stopped running because

Warning: To prevent unnecessary workflow runs, scheduled workflows may be disabled automatically. When a public repository is forked, scheduled workflows are disabled by default. In a public repository, scheduled workflows are automatically disabled when no repository activity has occurred in 60 days.

https://docs.github.com/en/actions/using-workflows/disabling-and-enabling-a-workflow

@roslynwythe roslynwythe removed the ready for dev lead Issues that tech leads or merge team members need to follow up on label Nov 21, 2023
@roslynwythe
Copy link
Member Author

@ExperimentsInHonesty Yes that looks good. It would be great to have all three options available.

@JessicaLucindaCheng
Copy link
Member

JessicaLucindaCheng commented Nov 21, 2023

@jaasonw

the bot likely stopped running because

Warning: To prevent unnecessary workflow runs, scheduled workflows may be disabled automatically. When a public repository is forked, scheduled workflows are disabled by default. In a public repository, scheduled workflows are automatically disabled when no repository activity has occurred in 60 days.

https://docs.github.com/en/actions/using-workflows/disabling-and-enabling-a-workflow

Great catch! 😃 I think a possible solution would be to have a GHA (GitHub Action) in the hackforla/website repo run every 60 days to update a file in the danielridgebot/check-ghpages-versions repo. This file could just have something like "Last update" and then the date.

@roslynwythe
Copy link
Member Author

roslynwythe commented Nov 24, 2023

There is a solution to the problem of the disabled workflow - "Keep-Alive Workflow", see https://github.com/marketplace/actions/keepalive-workflow

@roslynwythe
Copy link
Member Author

roslynwythe commented Nov 26, 2023

Thanks to @jaasonw for information regarding the multi-platform image

Potential Solutions

We should make issues (if feasible) as follows:

  • Create issue for updating hackforla/ghpages-docker for multi-platform use
  • Create issue for providing instructions in CONTRIBUTING.md for devs to build their own image using the Dockerfile
  • Create issue for providing instructions in CONTRIBUTING.md for devs to use the Rosetta 2 emulator

@fyliu
Copy link
Member

fyliu commented Nov 27, 2023

@ExperimentsInHonesty
Copy link
Member

LGTM

Copy link

github-actions bot commented Feb 9, 2024

Hi @roslynwythe, thank you for taking up this issue! Hfla appreciates you :)

Do let fellow developers know about your:-
i. Availability: (When are you available to work on the issue/answer questions other programmers might have about your issue?)
ii. ETA: (When do you expect this issue to be completed?)

You're awesome!

P.S. - You may not take up another issue until this issue gets merged (or closed). Thanks again :)

@roslynwythe
Copy link
Member Author

roslynwythe commented Feb 9, 2024

@roslynwythe
Copy link
Member Author

roslynwythe commented Feb 9, 2024

@fyliu Hi Fang, I'm writing the issues now to keep the Daniel Ridge bot alive and to update the Docker file so it supports multiple platforms. I'm looking at the Docker file documentation https://docs.docker.com/build/building/multi-platform/ and I need to select the specific architecture. I know mac M1 is arm-based but which specific architecture should we specify? And should we support additional architectures, aside from x86_64 ?

Thanks for your expertise, we really appreciate it!

@fyliu
Copy link
Member

fyliu commented Feb 9, 2024

In the repo I worked on above, I only chose the the most common platforms arm64 (Mac m1 and newer) and amd64 (intel Mac and most PCs). I was working on it at the time this issue came up and decided to add the support because of this.

There might be other useful platforms like Chrome/netbook or surface tablets, and raspberrypi 4 and above. I don't know if they're some different arm platforms. I kind of decide to leave it as an example in the code and someone can add more when needed.

@ExperimentsInHonesty
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: See issue making label See the Issue Making label to understand the issue writing difficulty level ER Emergent Request Feature: Onboarding/Contributing.md Issue Making: Level 2 Make issue(s) from an ER or Epic ready for issue making role: back end/devOps Tasks for back-end developers size: 1pt Can be done in 4-6 hours
Projects
Development

No branches or pull requests

5 participants