-
Notifications
You must be signed in to change notification settings - Fork 208
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
How to make pip install klayout
in macOs faster?
#1069
Comments
Yes. I have this in my backlog. We need to create a wheel for the newer macOS versions and upload to pypi. Right now it is compiling from source. Travis stopped their easy free open source service; last I checked they wanted a credit card to offer free builds. I will check GitHub actions (didn't know they offered macOS builds). |
Hi Thomas, yes, it takes 30min to compile from source :) we can set up github actions for this let me know what you think |
@joamatab: @thomaslima is correct. Travis has resource restrictions now that basically make it impossible to deploy KLayout packages. But I see the GitHub actions on the original fork failing and they are only executed on Linux. So is that functional? Is MacOS available with a free plan? Plus is there going to be active maintenance? I personally do not have the resources for continuous support of another CI queue. Matthias |
i think is not working yet
once is working, we can deploy wheels that work for all os (linux, macos, windows) as they are available for free in github actions another great thing would be to have a conda package for klayout |
From what I see the job you're proposing is only pulling the sources from PyPI and generating wheels for particular platforms on a regular basis. So it's not really CI/CD. So if it's not connected to KLayout's sources here and as this job is not tied to branches or pull requests here I'd prefer to have it separately. I propose to set up a new repository - i.e. klayout/pypi-buildbot - and put the GitHub actions there. |
Hi Matthias, the CICD job from the PR builds the sources from the klayout repo and uploads them to pypi, so in my opinion would be nice to have as part of the klayout, so they get updated on each new release or PR let me know what you think |
Ah, you're right. I stand corrected. I have a few remarks though:
I need to say, that I'm actually quite happy to have reduced my dependency on "free" services. These in fact generate some considerable workload by constantly upgrading their environments, certificates, authentication schemes etc. For example I moved away from Azure with Python deployment after they had removed all their MSVC2017 support (MS C++ compilers are magic, so MSVC2019 did not work out of the box ...). To my taste these services do not offer enough configuration options and stability for C++ deployment. I do not expect much more from GitHub actions. |
Hi Matthias,
what is the recommended way to build the python wheels? Let me know if you can figure out what's the issue of this error |
The error happens because of this:
so the curl package is missing. |
Apparently adding curl did not help. This is the package Ubuntu needs: But there are some more: for manylinux/CentOS this is the package list I have added: I assume (not tested) that for Ubuntu the package list is: |
perfect, thank you Matthias, I think it is working now :) |
Sorry I've been awol. =( Hey @joamatab just curious to check what's the status with the Mac build. I am trying your branch now but I noticed it failed in your GitHub fork. Caching used to work by enabling ccache and persisting the ccache folder between runs. Manylinux used to work by running python builds inside a docker image they provided. Is that still the case? Only wheels built within that docker earn the manylinux designation and can be uploaded to pypi. |
Hi Thomas, it's passing now https://github.com/joamatab/klayout/actions Matthias let me know if it's okay on your end Joaquin |
@klayoutmatthias @joamatab It is meant for various CI workflows but I think what's nice is that we can run locally on a specific hardware, like my M1 Mac, and it will build all py3.x wheels automatically. I'm testing it here: https://github.com/thomaslima/klayout/actions/workflows/build.yml |
perfect, thank you Thomas, i think you just need to have your PYPI token as a secret https://github.com/gdsfactory/gdsfactory/blob/master/.github/workflows/pythonpublish.yml |
@klayoutmatthias @joamatab This is how it works: There is a Because of the ccache strategy I used, we need to create a build job per docker file. This is achieved by a matrix in the - os: "macos-latest"
cibuild: "*macosx*"
- os: "ubuntu-latest"
cibuild: "*manylinux*"
- os: "ubuntu-latest"
cibuild: "*musllinux*" After each job is finished, the wheels are uploaded as an artifact, and captured by another job whose goal is to combine all wheels and upload to pypi: Note: macos-latest at the moment uses an Intel host with 10.11 (Big Sur) OS, but it doesn't matter, as it looks like cibuild builds wheels compatible with 10.9+. Right now, Apple Silicon (arm64) is not yet supported in Github Actions (actions/runner-images#2187 (comment)). I recommend we wait until it is and add it to the configuration above. Meanwhile, I think it's possible to run cibuildwheel locally. It's as simple as running Let me know if you have questions. I think it might be advisable to write this down in a readme file once we merge. |
Awesome, thank you Thomas! once we merge PR #1070 we will be able to |
Dear @thomaslima and @joamatab, thanks for the time you spent on this! I'll merge the changes to master and will try to deploy the solution on 0.27.9 for macos. Best regards, Matthias |
@klayoutmatthias Have you pushed again? @joamatab included a step in the workflow called "Cancel Workflow Action" that cancels a previously running build if you trigger a new one. I'm not sure what the reasoning was behind that. But that might have been the cause for this getting cancelled. The latest run based on master seems to be working: https://github.com/KLayout/klayout/actions/runs/2277996327 It looks like the push to branch 0.27 failed at the test stage because |
By the way, the upload step to pypi also worked: https://test.pypi.org/project/klayout/0.28/#files |
Hi Thomas and Matthias, from the CICD point of view it seems it worked uploading to testpypi How about starting to upload the MacOs wheels and the newer linux versions to pypi? |
Yes, that's the reason. Thanks for clarifying that.
0.27 is my stable branch. "master" will be the future 0.28 and it received some incompatible changes and isn't stable, so it's not ready for release yet. Best regards, Matthias |
Awesome, See PR for 0.27 branch |
Dear @joamatab and @thomaslima, I have merged all PRs and after adding import_lib.py the actions pass for me. I'll see for the next minor release how things work. BTW @joamatab: I have created a PR for a major change which targets towards including a Qt-less LayoutView to be included into the Python module. I think you had asked for that some time ago. It needs libpng for image reading and writing, but has a fairly complete API including mouse emulation. I think that could be the beginning of some behind-the-scene deployment of KLayout. The modification is too big to go into 0.27.x, but 0.28 is my target. |
Awesome, thank you Matthias! @tvt173 @flaport and @proppy would also love to see the Qt-less klayout so we can render GDS files from the browser environment, such as jupyter the |
@klayoutmatthias that's awesome to hear! I can't wait to add it to https://colab.research.google.com/gist/proppy/26525ff7d9810247759a8d3ff3c41dcb/openlane-with-conda-eda.ipynb, we're currently relying on mixture of |
I tried to create a v0.27.9-1 post version to trigger a MacOS build, but I had to patch the build action because a release was not included in the main selector (0e32c3b). Matthias |
It's done ... MacOS packages for 0.27.9-1 are on PyPI :) |
awesome! thank you Matthias! yes, now https://github.com/gdsfactory/gdsfactory/actions/runs/2310609416 thank you |
some macOs gdsfactory users have reported that
pip install klayout
takes 30min for macHow could we make it faster?
See the issue here
https://github.com/gdsfactory/gdsfactory/runs/6214659865?check_suite_focus=true
is there any version for klayout that could make it faster?
@klayoutmatthias
@thomaslima
@flaporte
@tvt173
@lukasc-ubc
The text was updated successfully, but these errors were encountered: