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

Support custom components #365

Closed
mbrodala opened this issue Feb 10, 2017 · 9 comments · Fixed by #368
Closed

Support custom components #365

mbrodala opened this issue Feb 10, 2017 · 9 comments · Fixed by #368
Assignees

Comments

@mbrodala
Copy link
Contributor

It would be useful if one could add custom components simply based on Docker images. Something like this:

web.site:
  # ...

custom.selenium:
  image: selenium/standalone-chrome

I'm not sure this is already possible with custom images.

This is a more general approach to the issue mentioned in #364 which could a) solve a huge chunk of problems and b) open a huge can of worms. ;-)

@danhunsaker
Copy link
Contributor

danhunsaker commented Feb 10, 2017

Give it a shot and find out? Just use data.selenium instead of custom.selenium, and go from there. It'll be a bit of trial and error, but that's how these things go. You should get all the standard env vars you'd expect elsewhere, making it easy enough to connect and run tests as desired.

One drawback is you'd have another component deployed to production that you wouldn't necessarily need/want there, so there might be an advantage to supporting a data variant that's only present in development. Be sure to add local_only: true to the data component to prevent it from deploying.

@mbrodala
Copy link
Contributor Author

True, having that component in production wouldn't be that useful. Do you think it would make sense that Nanobox supports "Dev components" similar to dev_packages, etc.?

For now a simple cat $selenium >> boxfile.yml could help to add the component on demand.

@mbrodala
Copy link
Contributor Author

I've now added this to my boxfile.yml (using chrome as component name to allow e.g. for firefox in the future):

data.chrome:
  image: selenium/standalone-chrome

But with nanbox run I get this error:

    data.chrome :
      √ Reserve IPs
      √ Starting docker container
      √ Attaching network
      ! Gathering requirements

Error   : bad exit code(126)
Context : failed to sync components -> failed to provision components -> failed to setup component (data.chrome) -> failed to run plan hook -> util:Exec:/opt/nanobox/hooks/plan

Enter to continue:

Any ideas how I could debug this? Manually running a container from this image works fine.

@danhunsaker
Copy link
Contributor

Huh. Looks like it's requiring the Nanobox hooks to be available in the image in order to consider it running. My understanding was that the absence of hooks should only reduce some of the capabilities, not prevent images from running entirely.

@tylerflint
Copy link
Contributor

That's the intent, but apparently that's not the case currently. We'll need to make issues to address these.

@lyondhill
Copy link
Contributor

The plan hook is currently required. I will have to figure out how to remove that dependency. @tylerflint is it possible to run custom in production? I want to make sure both local and production are in parity.

@mbrodala
Copy link
Contributor Author

mbrodala commented Feb 15, 2017

I tried to verify this but it's not working after a nanobox-update. And what I see is indeed odd:

λ nanobox version
Nanobox version 0.9.0 (d49e35eebb806a217d5e019209d15ac0)

How can I update to the latest version (2.0.2 ATM)? I guess I'll just re-install from bundle.

@tylerflint
Copy link
Contributor

Hey @mbrodala, sorry for the confusion on this. Here's a gist with instructions to upgrade to v2: https://gist.github.com/sanderson/73d91939710bf99992cdd5baf35adc89

Thanks

@mbrodala
Copy link
Contributor Author

Thanks for the heads up, that explains a lot. ;-)

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 a pull request may close this issue.

4 participants