-
-
Notifications
You must be signed in to change notification settings - Fork 335
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
Create redistributable package for Julia #150
Comments
As mentioned, we can examine BinaryBuilder.jl . I'll see if I can do that myself. But perhaps you prefer to control the build process yourself? |
Here its not a few cpp files which you can easily compile wo modern C++ build systems. I use Cmake to build it, and config file for Cmake is pretty big(https://github.com/brainflow-dev/brainflow/blob/master/CMakeLists.txt) I would like to avoid porting it if its possible. Best case scenario and how it works for all other languages - compile C++ code using C++ specific build system(Cmake in our case) and add compiled libraries to bindings. If it's possible for Julia - its the best option, if not - need to check alternatives. E.g how it looks in python - you build c++ code first and when you build python package libraries are included into whl via package data https://github.com/brainflow-dev/brainflow/blob/master/python-package/setup.py#L25 So this way python users dont need to worry about compilation at all and can download package with precompiled libs included |
OK, so for Python the PYPI installs the binaries automatically in For future reference: And this blog post is mentioned. As mentioned in the blog "the artifacts subsystem is much more general and is widely applicable to all Julia packages." This suggests there must be a way to deploy a manual artifact via the package manager. The question is how difficult it is for a newbie like me. Also the docs have a section on Artifacts: Come on, it must be possible! |
" so for Python the PYPI installs the binaries automatically in /lib" This https://julialang.github.io/Pkg.jl/dev/artifacts/ looks promising, I will read about it too |
yeah, I see. The Julia _jll packages are also distributed as tarballs, so it just unpacks the folder structure you defined yourself in the tar ball. The Julia packages typically split the package in 2; one the regular Julia code, the other the _jll wrapper and libraries. But it's not necessary. Apparently all we need is an
Then we should be able to add your package, use it and the library should be installed. We can try with:
Note Julia package are typically uppercase camelcase, so I expected |
Ah wait, I'm checking out the release page. You don't have cross-compiled binaries available right? So we still need the client to compile somehow. Or we do have to set up something like BinaryBuilder.jl for your package. |
There are libs for all OSes bundled inside whl\jar\nuget files. We can add compiled C++ libs as well to release page, or upload it somewhere else if needed. For example currently CI uploads all artifacts to AWS S3 maybe we can use it instead github releases |
Ok, then I guess the easiest way would be to just have the I can also try to see what happens if I use the .whl url. |
I can patch this https://github.com/brainflow-dev/brainflow/blob/master/.github/workflows/run_unix.yml#L213 for all OSes and configure AWS to provide download link... I dont think that targz is a good option since for Julia it should and can work for all OSes, I doubt that it will open targz file on windows automatically. Can it download multiple files or only one? |
Just tried the docs example. I got an error.. but in the end it did work... |
Good to know, I think then we can create zip\targz with libs and upload it to release page |
TODO: check if tar.gz is really necessary TODO: check create_artifact(), archive_artifact(), bind_artifact!(), as used here for example: https://github.com/r3tex/ObjectDetector.jl/blob/master/dev/artifacts/generate_artifacts.jl Also https://github.com/CiaranOMara/ArtifactHelpers.jl |
Ok I think I figured it out, at least inside Julia:
This added the following to my local
Now when I activate my environment in this directory with the
When I browse this folder it contains the unpacked /lib files |
Its good, more likely will need to use this path in Julia code to load dlls by full path or set PATH\LD_LIBRARY_PATH to load libs |
Not sure I understand, but we can just use this path to initialize the DLL paths:
|
One question about downloaded artefacts.. will it still be possible to use local libraries if I have them? I can copypaste libs locally to required location for such debugging the question is will Julia fail if there is no file which it tries to download or not and is it possible to disable downloading |
I added compiled libs to release page, and its done automatically by CI now. |
I asked, and for automatic unpacking upon downloading of the artifact only tarballs are supported: https://github.com/JuliaLang/Pkg.jl/blob/353a7cb4c46b1c78dff6755c92071498b86deec9/src/PlatformEngines.jl#L463 So no .zip support. If we want to use .zip artifacts we will have to still write an unzipping function in our package For debugging, if the artifact is already downloaded I believe it doesn't download it again, so you could find its location and overwrite the content, but I havent tried. Also the point of using artifacts is that you don't care about their absolute location. But do you really consider this an important use-case, where you tightly prototype both the c++ code and a binding at the same time? (I'd rather prefer to look for automated binding generation from the header files or something) |
<< So no .zip support. If we want to use .zip artifacts we will have to still write an unzipping function in our package init() or something. Ok, I will change to targz << But do you really consider this an important use-case, where you tightly prototype both the c++ code and a binding at the same time? Yes, and its important. For example when you are adding new methods to the C++ part you need to add them to the Julia part as well and as of right now its done manually. Even if you do it automatically before publishing new release or pushing to the repo you need to test this change and you need to use local libraries for it |
Alright I'll have a look. I'm sure we can change the library locally, worst case we temporarily change the library path while testing. |
Once artifacts work: publish the Julia package. (or make this a separate issue?) Andrey mentioned publishing/deployment is now done here: https://github.com/brainflow-dev/brainflow/blob/master/.github/workflows/deploy.yml#L149 Changes to be made for Julia brainflow package:
Question: change package name from brainflow to BrainFlow? |
I think artifacts and package can be in the same task\issue Version update for other languages done in CI by string replace, here it can be the same I dont think that we need to rename package, idk about julia but in pypi for example package names are not case sensetive |
See Feature request: Store multiple registered packages in a single Git repository I know everything in there works from experience. Except I never tried doing the general registration. In the issue the following syntax is suggested: Nevermind, JuliaRegistrator mentions it in the Readme, so it should work: https://github.com/JuliaRegistries/Registrator.jl#registering-a-package-in-a-subdirectory |
Great! Looks like it was changed since I checked it last time |
@matthijscox I've changed it to tar |
Ok, artifact creating can be done much easier I found out with ArtifactUtils.jl
Everything should work, except I seem to have 7z.exe unpacking permission errors. I started a Julia discourse discussion here. |
idk what can be the reason for unpacking issue... |
It's installed together with Julia it seems. Here's the path it uses for me: I'll see if I get some response. As workaround I could indeed write a custom Could you try to run that |
Yeah, I will try on Windows and Linux. |
It was with admin priviligies on Windows |
I began a PR: #172 |
The PR is merged. Now we need to register. I requested the JuliaRegistrator app be installed for brainflow-dev: https://github.com/apps/juliateam-registrator/installations/new. It may be @Andrey1994 needs to approve, or request yourself. We can then comment on a commit like here: af142cf#commitcomment-45338833. But that only works once the App is installed. |
Nice! Is there a way to trigger the registrator manually from command line or somehow else? Ideally I want to register packages from existing CI pipelines which run all tests instead adding julia specific commits. Also in CI pipelines we can change versions if needed otherwise will need to do it manually |
As a hack which I really want to avoid we can create commit inside CI pipeline to trigger the registrator app... its not good but better than doing manually |
It seems like registrator app just prepares config file and runs smth like
I think it can be automated via simple script wo github app |
Error while trying to register: "Branch |
I tried the UI but didn't really get it working. You also won't be able to
automate it, right?
For the github app you need to add the subdir command.
…On Tue, Dec 22, 2020, 12:19 PM Andrey Parfenov ***@***.***> wrote:
Seems like there is a simple UI to register packages manually. Have you
tried it? It looks like a good option(I like it more than github app)
[image: image]
<https://user-images.githubusercontent.com/8217521/102883187-a3c3cf00-4460-11eb-89c5-5ee4fc1a73a8.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#150 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEDSNOPZ4XKGNNNR6IBN5PLSWB6D7ANCNFSM4UJF6HCA>
.
|
@JuliaRegistrator register branch=master subdir=julia-package/brainflow |
Registration pull request created: JuliaRegistries/General/26771 After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version. This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:
Also, note the warning: This looks like a new registration that registers version 3.7.2. |
I do like this github app. What's not to like? |
Ok I need to update the compat section in the Project.toml Also the automatic process would like us to follow the Julia style guide, so we should name the package
|
Lets rename it for julia to BrainFlow. In github app I do not like that its not attached to git tags\releases and bypasses CI in fact. And commands to trigger it written somewhere in issue\pr\commit. Lets keep registrator app if it works |
@JuliaRegistrator register branch=master subdir=julia-package/brainflow |
Registration pull request updated: JuliaRegistries/General/26771 After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version. This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:
Also, note the warning: This looks like a new registration that registers version 3.7.2. |
Ok I still made a mistake. compat versions need to have an upper bound. PackageA = "1" # [1.0.0, 2.0.0), has upper bound (good) I used the latter. |
@JuliaRegistrator register branch=master subdir=julia-package/brainflow |
Registration pull request updated: JuliaRegistries/General/26771 After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version. This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:
Also, note the warning: This looks like a new registration that registers version 3.7.2. |
Its merged, thanks @matthijscox ! |
* fix ganglion bled accel * add wifi ganglion accel fixes * final fix from andrey
Not sure that its possible to bundle native libraries with Julia packages right now, but need to double check and investigate different options
The text was updated successfully, but these errors were encountered: