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

plane-drone docker container error in M1 Mac #254

Closed
MyCADDev opened this issue Nov 13, 2022 · 6 comments
Closed

plane-drone docker container error in M1 Mac #254

MyCADDev opened this issue Nov 13, 2022 · 6 comments

Comments

@MyCADDev
Copy link

MyCADDev commented Nov 13, 2022

Hi
I'm seeing this error when I try to run the sample-config
Any workaround? Seems like a rust / docker / M1 Mac issue - https://docs.rs/notify/latest/notify/

$ docker compose up

plane-drone       | Error: Error building cert refresher.
plane-drone       | 
plane-drone       | Caused by:
plane-drone       |     Function not implemented (os error 38)
@paulgb
Copy link
Member

paulgb commented Nov 13, 2022

Thanks for tracking this down. Yes, it looks like notify is the issue here. I’ll have an attempt at reproducing this tomorrow and see if it’s an easy fix.

@MyCADDev
Copy link
Author

MyCADDev commented Nov 17, 2022

I made this change below in certs.rs and rebuilt the drone docker image in Ubuntu20 and now I can use that image on a M1 Mac

pub type RecommendedWatcher = PollWatcher;
pub fn recommended_watcher<F>(event_handler: F) -> Result<RecommendedWatcher, Error>
where
    F: EventHandler,
{
    RecommendedWatcher::new(event_handler, Config::default())
}

pub struct CertRefresher {
    receiver: Receiver<Option<Arc<CertifiedKey>>>,
    _watcher: RecommendedWatcher,
}

@paulgb
Copy link
Member

paulgb commented Nov 18, 2022

Thanks Harish. While looking into this I found that M1 builds have gotten very slow so I made this change in an attempt to fix it, I'll revisit this once I have a chance to see if my change worked.

@paulgb
Copy link
Member

paulgb commented Nov 18, 2022

I think the root of this issue was that we started using our own build image (to enable build caching), and we were not building an arm64 version of that image. Docker for Mac could run the image through amd64 emulation, but the emulation layer did not implement the filesystem polling APIs that the container expected.

This PR added an arm64 build to the build image, which works for me. Can you try this and confirm if it works for you? (In a git branch that doesn't have your certs.rs change applied)

docker pull ghcr.io/drifting-in-space/rust-sccache:latest
docker compose build
docker compose up

@MyCADDev
Copy link
Author

This works - thanks @paulgb !!

@paulgb
Copy link
Member

paulgb commented Nov 18, 2022

Thanks for filing and for confirming, Harish!

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

No branches or pull requests

2 participants