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

Fix"Unable to locate package msodbcsql17"on M1 #5638

Merged
merged 1 commit into from
Dec 16, 2021
Merged

Fix"Unable to locate package msodbcsql17"on M1 #5638

merged 1 commit into from
Dec 16, 2021

Conversation

zhengr
Copy link
Contributor

@zhengr zhengr commented Oct 30, 2021

What type of PR is this? (check all applicable)

  • Bug Fix

Description

If you run the docker-compose on a Mac with the new M1 chip, you will get the "Unable to locate package msodbcsql17" error. Because there are currently no msodbcsql17 packages for arm64 architecture. The solution was to change the base image in the Dockerfile to change the installation to the older AMD architecture.

FROM --platform=linux/amd64 python:3.7-slim-buster

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

If you run the docker-compose on a Mac with the new M1 chip, you will get the "Unable to locate package msodbcsql17" error. Because there are currently no msodbcsql17 packages for arm64 architecture. The solution was to change the base image in the Dockerfile to change the installation to the older AMD architecture. 

FROM --platform=linux/amd64 python:3.7-slim-buster
@dangoldin
Copy link
Contributor

I ended up doing this for some local development but it did make the build significantly slower. Is the idea that it's not going to slow anything down on M1 and on M1 it's already broken anyway?

@susodapop
Copy link
Contributor

I think this is a good idea. We've had a lot of questions about compiling on the apple silicon chips. Until we can iron out the builds this will communicate to people early that it's not expected to work. We should add something to our docs about it as well.

@susodapop susodapop self-assigned this Dec 13, 2021
@arikfr
Copy link
Member

arikfr commented Dec 15, 2021

@dangoldin did you just slow down the build time of the image or other things as well?

@dangoldin
Copy link
Contributor

@arikfr Just the build time from what I noticed.

@arikfr arikfr merged commit 965db26 into getredash:master Dec 16, 2021
@arikfr
Copy link
Member

arikfr commented Dec 16, 2021

In the future we should consider using a different image without the MSSQL stuff so we don't have to use a different architecture, but for now this feels like a reasonable solution.

Thank you!

@susodapop
Copy link
Contributor

susodapop commented Dec 16, 2021

I support this merge, but the good news is that shortly it won't be necessary if we modify how we install it:

From their docs:

The Microsoft ODBC driver for SQL Server on macOS is only supported on the x64 architecture through version 17.7. The Apple M1 (ARM64) is supported starting with version 17.8. The architecture will be detected and the correct package will be automatically installed by the Homebrew formula. If your command prompt is running in x64 emulation mode on the M1, the x64 package will be installed. If you're not running in emulation mode in your command prompt, the ARM64 package will be installed.

Since we don't use brew to install we can simply borrow the implementation from their brew taps.

@gdevenyi
Copy link
Contributor

This, while it allows M1 to work, will forever break any other ARM system by hard-coding the docker builds.

M1 users should be doing this,
https://stackoverflow.com/questions/65612411/forcing-docker-to-use-linux-amd64-platform-by-default-on-macos

And this Docker file needs some conditional addition of this driver so it will build on ARM.

harveyrendell pushed a commit to pushpay/redash that referenced this pull request Jan 8, 2025
If you run the docker-compose on a Mac with the new M1 chip, you will get the "Unable to locate package msodbcsql17" error. Because there are currently no msodbcsql17 packages for arm64 architecture. The solution was to change the base image in the Dockerfile to change the installation to the older AMD architecture. 

FROM --platform=linux/amd64 python:3.7-slim-buster
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.

5 participants