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

Added workflow to link binaries with releases #1767

Merged
merged 1 commit into from
Apr 25, 2023

Conversation

Shubham8287
Copy link
Contributor

@Shubham8287 Shubham8287 commented Apr 21, 2023

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you lint your code locally using cargo fmt command prior to submission?
  3. Have you checked your code using cargo clippy command?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

PR for #1733
/claim #1733

Sorry, something went wrong.

@Shubham8287 Shubham8287 marked this pull request as draft April 21, 2023 16:24
@Shubham8287
Copy link
Contributor Author

Jobs for Ubuntu are running well, but the ones for Mac are taking longer than expected. I will update the status as they progress.

Regarding building binaries for Windows, I encountered difficulties installing "clang" and "gcc-multilib" on that platform. Can you share steps you use to build on Windows?

@Shubham8287 Shubham8287 marked this pull request as ready for review April 21, 2023 18:05
@Shubham8287
Copy link
Contributor Author

Shubham8287 commented Apr 21, 2023

For testing, I created a Release in my forked repo - https://github.com/Shubham8287/qdrant/releases/tag/18. Not sure, how to test here.

@agourlay, please let me know if you have any concerns with my approach. I made an effort to optimize the use of https://github.com/taiki-e/upload-rust-binary-action, so I didn't require to separate the build and upload stages, just installing system dependencies as prior step.

@generall
Copy link
Member

Regarding building binaries for Windows, I encountered difficulties installing "clang" and "gcc-multilib" on that platform. Can you share steps you use to build on Windows?

We have windows CI in here https://github.com/qdrant/qdrant/blob/master/.github/workflows/rust.yml#L18
Could same be used in build?

@Shubham8287
Copy link
Contributor Author

Shubham8287 commented Apr 21, 2023

We have windows CI in here https://github.com/qdrant/qdrant/blob/master/.github/workflows/rust.yml#L18 Could same be used in build?

This looks helpful, I will give it a try. Thanks!

@Shubham8287
Copy link
Contributor Author

@generall I tried your advice, and added similar steps as rust.yml workflow but it seems to fail for some Perl dependency - https://github.com/Shubham8287/qdrant/actions/runs/4768237918/jobs/8477332680. I tried to explicitly install Perl and its dependency - https://github.com/Shubham8287/qdrant/actions/runs/4768167880/workflow but still no luck :(

@generall
Copy link
Member

@Shubham8287 If it builds tests, it should also be able to build release binaries.
Here is another example how it works in Meilisearch https://github.com/meilisearch/meilisearch/blob/main/.github/workflows/publish-binaries.yml

@Shubham8287
Copy link
Contributor Author

thanks! trying out.

@Shubham8287
Copy link
Contributor Author

I updated the code for including windows binary as well, you can refer here to see example Relasen- https://github.com/Shubham8287/qdrant/releases/tag/26

strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to also add aarch64-unknown-linux-gnu to the targets?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I will try this!

Copy link
Contributor Author

@Shubham8287 Shubham8287 Apr 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I tried it.
I realised we can't use https://github.com/taiki-e/upload-rust-binary-action action for aarch as this GA uses cross aarch container to compile code but we need to install few dependencies beforehand.

I tried to directly use cross by configuring Cross.toml https://github.com/cross-rs/cross/blob/main/docs/cross_toml.md#targettargetpre-build but the build is still not going through- https://github.com/Shubham8287/qdrant/actions/runs/4787382241/workflow#L50, Also I am not able to build it locally with cross, dependencies still messing up after many attempts.

Can you please verify if you can build it locally for aarch as you understand dependencies much better?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked you about aarch64-unknown-linux-gnu because I had trouble doing it in the past as well 😺

I propose to go with the PR as it is and work on aarch64-unknown-linux-gnu when it is needed.

repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build
run: cargo build --release --locked
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it necessary to build the project twice for Windows?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only this step is building the project, not the later one. The next step picks the binary build here and uploads them. This is basically a workaround because for windows, taiki-e/upload-rust-binary-action is not building the code no matter what target I use -https://github.com/Shubham8287/qdrant/actions/runs/4783873767/jobs/8504657732. I may check with GA maintainer for the issue later but building it explicitly looks harmless so I adopted it :).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, so the GA only build the project if the binary is not already present.

I guess we can live with the workaround 👍

@generall
Copy link
Member

@Shubham8287 there is a new rust version, could you please rebase to the current dev, so CI will pass?

@generall
Copy link
Member

Also, please move your PR to dev. According to https://github.com/qdrant/qdrant/blob/master/CONTRIBUTING.md#we-use-github-flow-so-all-code-changes-happen-through-pull-requests

@Shubham8287
Copy link
Contributor Author

@Shubham8287 there is a new rust version, could you please rebase to the current dev, so CI will pass?

sure!

@Shubham8287 Shubham8287 force-pushed the shub/added-release-workflow branch from 39df175 to 26d02c7 Compare April 24, 2023 12:34
@Shubham8287 Shubham8287 changed the base branch from master to dev April 24, 2023 12:35
@generall generall requested a review from agourlay April 24, 2023 18:30
Copy link
Member

@agourlay agourlay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution 👍

@generall generall merged commit 051dbb2 into qdrant:dev Apr 25, 2023
timvisee pushed a commit to paulotten/qdrant that referenced this pull request Apr 26, 2023
generall pushed a commit that referenced this pull request May 17, 2023
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.

None yet

3 participants