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

Distribute binary through composer #71

Closed
grachevko opened this issue Dec 21, 2018 · 19 comments · Fixed by #73
Closed

Distribute binary through composer #71

grachevko opened this issue Dec 21, 2018 · 19 comments · Fixed by #73
Labels
C-enhancement Category: enhancement. Meaning improvements of current module, transport, etc..

Comments

@grachevko
Copy link

What about include build binary to composer install?
To update need to do two thing: update composer and update binary. This is not convenient.

@Alex-Bond
Copy link
Contributor

@grachevko there 2 things that comes to mind:

  1. Size of the package (we have to include 4 dists in this case)
  2. A lot of people using a custom build or RR

I think it's not a really good idea to do that. But it's only my opinion.

@grachevko
Copy link
Author

@Alex-Bond it depends on how to solve that.
The goal is remove need to duplicate version of rr in composer and binary downloader.
For example this goal can be reached by downloader script, which i can add to composer.json in post-install-cmd. Downloader will depend on installed rr version from composer.

If you don't need to download default binary, just not add call downloader in composer.json.
I think it's quite enough.

But It will not be superfluous to investigate how other libs solve that.

@wolfy-j
Copy link
Contributor

wolfy-j commented Dec 21, 2018

In theory, I can download the needed file from releases directly (via GitHub API) and unpack it.

Though, I would not recommend making this script autorun. I think vendor/bin/rr-update should work.

@grachevko
Copy link
Author

@wolfy-j yeap, that is exactly what i mean.

@wolfy-j
Copy link
Contributor

wolfy-j commented Jan 11, 2019

You can now build RR locally with or without additional services. See https://github.com/spiral/roadrunner/wiki/Quick-Builds

@wolfy-j wolfy-j closed this as completed Jan 11, 2019
@Alex-Bond
Copy link
Contributor

@wolfy-j how about removing Docker dep? Building RR inside Docker inside Docker (2 times) not so cool idea :)

@wolfy-j
Copy link
Contributor

wolfy-j commented Jan 11, 2019

I do not expect it to be build in Docker but outside. This approach gives us flexibility to build any RR version based on custom specs. I'm still open to implement rr-download but without Symfony/Console dependency (you can use console wrapper from Builder) :)

@wolfy-j
Copy link
Contributor

wolfy-j commented Jan 11, 2019

You can also compile it outside of your container, thought in this case I might need to add -os flag as currently it detect the OS on host machine.

@Alex-Bond
Copy link
Contributor

@wolfy-j how about adding the flag to build in local env? Like qbuild -local.
Imagine the situation - you building RR using Jenkins in k8s. In this case, you running agent inside pod already. Running pod inside pos is not a good idea.

@wolfy-j
Copy link
Contributor

wolfy-j commented Jan 11, 2019

It is actually intended to build in local env, this is the approach my DevOps requested (specifically to use with Jenkins). You expect to build (or use already build version) rr locally and then pack it with the rest of your applications before deployment.

@Alex-Bond
Copy link
Contributor

Thats not a really good idea to have binaries inside git.

@wolfy-j
Copy link
Contributor

wolfy-j commented Jan 11, 2019

There is no binaries in git.

@Alex-Bond
Copy link
Contributor

If you compile it locally, how you will pass it to jenkins? Jenkins running whole build process inside docker.

@wolfy-j
Copy link
Contributor

wolfy-j commented Jan 11, 2019

I'm not fully aware of the details where Jenkins is building Docker images, but you convinced me that this approach might not work for everyone. I'll try to come up with alternative.

@wolfy-j wolfy-j reopened this Jan 11, 2019
@Alex-Bond
Copy link
Contributor

@wolfy-j while preparing Sentry package i found a pretty interesting thing - how we will sen dependancy? Like what if my module depends on some internal or 3d party module and must be called only after deps injected?

@stefanos82
Copy link

I was about to open a new ticket to ask a question about the binary file for rr.

Shouldn't composer execute vendor/spiral/roadrunner/build.sh right after the package was installed?

The only problem I have with this option is that I have to symlink the generated file to vendor/bin/ in order to use it as I want to.

Has anyone else figure out a better way?

@Alex-Bond
Copy link
Contributor

@stefanos82 i think it's not a good idea to build it from sources every time. Build it 1 time when you deploying app first time and that's it. Just update it if you need to. Don't forget that most of the people will not have Go runtime on the server (why you need to?).
In my case, i just copy binary file for Linux from GitHub and run it.

@stefanos82
Copy link

OK, now I'm really confused.

If that's the case, then what's the use of composer req spiral/roadrunner symfony/psr-http-message-bridge as described in https://github.com/spiral/roadrunner/wiki/Laravel-Framework?

If I go to vendor directory I can clearly see spiral/roadrunner/ that contains all the necessary source code.

If I don't need the Go runtime, what's the purpose of this dependency?

@stefanos82
Copy link

I just saw the 'src' folder that contains all the PHP files. Silly me...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: enhancement. Meaning improvements of current module, transport, etc..
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants