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

Simplify deployment by embedding assets into library. #13

Closed

Conversation

meiersi
Copy link
Contributor

@meiersi meiersi commented Apr 9, 2013

Hi Johan,

we would like to use ekg at Erudify to monitor services deployed in our cloud. However, it's reliance on extra data files makes deploying applications built using it unnecessarily difficult. The attached patch uses the file-embed library to embed the necessary assets directly into the ekg library at compile time.

It would be great, if you could change ekg to use this scheme. If required, then I can add either a cabal flag that allows to compile without embedding the files, or I can add an additional argument to startServer, which allows to specify the assets directory. I guess one would typically use the latter for development of the default monitor or for using a simple custom monitor. However, I do expect that for almost all use cases this direct embedding of the assets is the most convenient option.

What do you think?

best regards,
Simon

@tibbe
Copy link
Collaborator

tibbe commented Apr 9, 2013

Hi Simon,

See #8 for previous discussion on this topic. The short version is that I want to avoid TH where possible, as it leads to all kinds of headaches (e.g. when cross-compiling).

You can already specify the datadir of any cabal program by using the <packname>_datadir (e.g. ekg_datadir) environment variable. The code that implements this feature lives in https://github.com/haskell/cabal/blob/master/Cabal/Distribution/Simple/Build/PathsModule.hs . Does this help?

@meiersi
Copy link
Contributor Author

meiersi commented Apr 10, 2013

Hi Johan,

thanks for the reference to #8. I was looking for it, but overlooked the closed pull-requests. I understand your concern with respect to using template haskell, and I also agree that in the long-term we might need a better deployment solution. However, just deploying static binary files does have its appeals.

What about making the fully embedded option configurable via a cabal flag? The code changes would be very limited and people would gain an easier way for using/deploying ekg enabled services.

@meiersi
Copy link
Contributor Author

meiersi commented Apr 10, 2013

Hi Johan,

we discussed the issue internally and decided that we'll handle it for now by maintaining our custom fork until we have gathered more experience.

Thanks for your time,
Simon

@meiersi meiersi closed this Apr 10, 2013
@mwotton
Copy link

mwotton commented Jun 14, 2013

my 2c - it would be nice if ekg at least told you "hey, i can't find my data dir, you're gonna have a bad time". I don't mind handling the assets dir myself, but it's a pain to have to track down.

@tibbe
Copy link
Collaborator

tibbe commented Jun 14, 2013

Good idea. I won't be able to implement it until after my vacation I'm
afraid.
On Jun 13, 2013 11:29 PM, "Mark Wotton" notifications@github.com wrote:

my 2c - it would be nice if ekg at least told you "hey, i can't find my
data dir, you're gonna have a bad time". I don't mind handling the assets
dir myself, but it's a pain to have to track down.


Reply to this email directly or view it on GitHubhttps://github.com//pull/13#issuecomment-19441339
.

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.

3 participants