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

Supporting x86 (32bit) hosts #1090

Closed
patrickjahns opened this issue Apr 5, 2015 · 10 comments
Closed

Supporting x86 (32bit) hosts #1090

patrickjahns opened this issue Apr 5, 2015 · 10 comments

Comments

@patrickjahns
Copy link

Hi,
#196 already addressed this some time ago, it was mentioned that it depends on docker. I`ve been recently playing around with docker on my private server that only supports 32bit. I have successfully build several 32bit containers on it and run them.

Are there any other requirements for dokku to run on 32 bit hosts?

FYI docker & 32bit:
https://github.com/docker-32bit
https://registry.hub.docker.com/repos/32bit/

@michaelshobbs
Copy link
Member

The only other binary requirement for running dokku that I can think of right now is nginx. I can't speak to any plugins you might want to use though.

@josegonzalez
Copy link
Member

@patrickjahns we currently don't support 32-bit installs, but if you'd like to do the work to make dokku installable there, I'd be happy to pull that in :)

I personally won't be working towards that goal as we'll be moving to dokku in docker in the near future, which should solve this. Closing as there isn't anything actionable.

@patrickjahns
Copy link
Author

@josegonzalez - thank you for the information. I am trying to make it work and document the steps in here for others. I am not sure how I would be able to provide patches (yet?). What is a recommended approach in this case?

Just for quick documentation steps ive taken and how far Ive come:

  • created a fresh ubuntu32 bit box
  • installed docker from repository (for init scripts)
  • manually compiled the current dev-version (1.5.0) and installed it

Docker is working so far

As for Dokku - I had to alter the Makefile:

  • remove the download for pluginhook and instead build my own version and install it
  • also remove the automated installer for docker, since it is already installed

The dokku installation works - but when pushing a project I run into the error

Error response from daemon: Cannot start container c94e049ee0aa1e20759bb6b37ab496fcc5e1dc7a57b3984d56e6fbbe02399c06: [8] System error: exec format error

The error probably relates to having a 64bit container (progrium/buildstep) in a 32bit OS. So my next step would be, to create a custom "progrium/buildstep" container for 32bit

Will post more results when I succeed

@patrickjahns
Copy link
Author

TL;DR;

  • dokku works on 32bit
  • you need to build your own progrium/buildstep container
  • you need to create 32bit buildpacks in order to run any application

So I followed the following steps to create a 32bit progrium/buildstep container

  1. create an ubuntu-deboostrap docker container ( https://github.com/tianon/docker-brew-ubuntu-debootstrap and use --arch=i386 for debootstrap)
  2. create a chedarish container from the in step 1 created container
  3. compile herokuish (https://github.com/gliderlabs/herokuish) against the container from 2

From then one the container is working.
The buildpacks provided from heroku (via herokuish) don`t work with a 32bit container since many (all?) heroku buildpacks have executables build against x64.

While it is possible to get dokku running on x86 with the proper container - it will be a lot of effort to maintain a 32bit version. You will need to re-build all containers, buildpacks and plugins against a 32bit container.

@josegonzalez
Copy link
Member

Poop. We can probably maintain separate buildpack/pluginhook/sshcommand debs for 32bit, but the buildpack thing is a separate issue, so I think this isn't worth the effort, and we'd be better suited to pushing users towards 64-bit hosts.

What host are you running that you can't use 64-bit dokku?

@patrickjahns
Copy link
Author

I am running it on my lowpower box at home , which is an old netbook with the first gen atom cpus and has no 64bit instructions :(

Creating dokku and the dockerimage can be streamlined into a vagrant box I guess.
Maintaining the buildpacks is more effort - I currently forked the heroku python buildpack and compiled my own set of python images. But maintaining other buildpacks as well is a lot of effort.

So I guess you are right for pushing people towards 64bit hosts - I don`t know of any cloud provider that does not support 64bit hosts so for the general public its no issue.

If I come up with another idea - i`ll post.

@josegonzalez
Copy link
Member

If you'd like to change the deb.mk to produce both 64 and 32-bit packages, we'd pull that in :)

@patrickjahns
Copy link
Author

I will have a look at it - I am mostly worried that we then need to also create 32-bit images for pluginhook, sshcommand and buildstep.

Biggest concern here is, how to do it for buildstep, since we need to base it of a 32bit debootstrap as mentioned above. Suggestions for best-practices here?

@josegonzalez
Copy link
Member

Build it inside a docker container running 32-bit ubuntu? shrug

@patrickjahns
Copy link
Author

Just a small update, I am working on the base of the building chain.
For creating the proper 32bit container cedarish needs to be build against a 32bit container. (As well as herokuish and the final dokku container). I will work on the final dokku 32bit building process while I set up the other necessary steps.

I am looking for people who want to support creating 32bit buildpacks to be used with dokku - so far I have created a 32bit python buildpack fork here:
https://github.com/patrickjahns/heroku-buildpack-python-x86_32

Creating 32bit buildpacks from existing heroku buildpacks is fairly straight forward - any precompiled files need to be recompiled against a 32bit chedarish container. Any precompiled binary packages to be fetched need to be recompiled against 32bit guest system and the downloading scripts in the buildpacks need to be updated.

From there on it just works. Since I mainly work with python applications I am not yet planing to release other buildpacks. Except if there is demand or people willing to work on it. Any ideas/suggestions/recommendations are very welcome

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

No branches or pull requests

3 participants