Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Make work with Heroku style PAAS #277

Closed
wants to merge 3 commits into from
Closed

Make work with Heroku style PAAS #277

wants to merge 3 commits into from

Conversation

stuart-warren
Copy link

I've been trying to get this to work on Dokku etc for a couple days and have finally cast the correct incantation.
This is mainly provided as a suggestion, feel free to cherry pick if you like.

The cffi requirement was added so that the buildpack would build it correctly.
Using a Procfile means we can get rid of the exec in run.sh again.

git clone https://github.com/stuart-warren/docker-registry.git
git remote add server1 dokku@dokku.server1.com:registry
git push server1 master

dokku config:set DOCKER_REGISTRY_CONFIG=config_sample.yml

@shin-
Copy link
Contributor

shin- commented Apr 7, 2014

Thanks!

Not a fan of the additional dependency in requirements.txt (which to be fair needs to be cleaned up anyway). Can we maybe comment it out and add a comment saying "add this when pushing to Heroku/Dokku"?

cffi only required to get package to build with a heroku style buildpack
@@ -6,4 +6,4 @@ GUNICORN_GRACEFUL_TIMEOUT=${GUNICORN_GRACEFUL_TIMEOUT:-3600}
GUNICORN_SILENT_TIMEOUT=${GUNICORN_SILENT_TIMEOUT:-3600}

cd "$(dirname $0)"
exec gunicorn --access-logfile - --debug --max-requests 100 --graceful-timeout $GUNICORN_GRACEFUL_TIMEOUT -t $GUNICORN_SILENT_TIMEOUT -k gevent -b 0.0.0.0:$REGISTRY_PORT -w $GUNICORN_WORKERS wsgi:application
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why changing the run options in this PR? Should we leave them?

@samalba
Copy link
Contributor

samalba commented Apr 15, 2014

1 inline comment, other than that, looks good to merge.

@homerjam
Copy link

I'm looking for exactly this! Any plans to merge soon?

Thanks

@dmp42
Copy link
Contributor

dmp42 commented Jun 24, 2014

Hi @stuart-warren

Sorry for the long delay on this. Are you still motivated to have this work?

If yes, can you rebase against the current master (a LOT has changed since).

Thanks!

@dmp42 dmp42 added this to the 0.8 milestone Jun 24, 2014
@bacongobbler
Copy link
Contributor

shameless plug FWIW, you can deploy the docker registry from source on Deis:

$ cd docker-registry
$ deis create
$ git push deis master
remote: -----> Building Docker image
[...]
remote:        Launching... done, v3
remote:
remote: -----> bamboo-larkspur deployed to Deis
remote:        http://bamboo-larkspur.local.deisapp.com
$ curl http://bamboo-larkspur.local.deisapp.com
"docker-registry server (dev) (v0.8.0)"

Since Deis can build a project using either a Dockerfile or a Procfile, no modification to the project is required. In this case, it just reads the CMD entry from the Dockerfile. We're also (mostly) Heroku-compatible, so you have all the app management niceties like domains:add, config:set, releases:rollback et al.

😃

@dmp42
Copy link
Contributor

dmp42 commented Jun 25, 2014

@homerjam @stuart-warren: how does @bacongobbler suggestion looks? Is this enough for you guys?

@homerjam
Copy link

Sorry, I'm having difficulty remembering this far back! I checked out Deis and it looks good, but it'd still be great to have this working on Heroku - are you asking if Deis is enough or if the implementation style is ok?

@dmp42
Copy link
Contributor

dmp42 commented Jun 25, 2014

@bacongobbler can you elaborate on how you would deploy the registry on heroku and what (mostly) :-) compatible means?

@bacongobbler
Copy link
Contributor

Well for starters, the registry cannot be deployed to heroku at the moment because their buildpacks are missing liblzma-dev for both the default and the custom buildpack that @stuart-warren proposed (which I'm assuming was added into registry core after this PR was proposed):

$ heroku create
$ git push heroku master
[...]
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/app/include -I/opt/local/include -I/usr/local/include -I/app/.heroku/python/include/python2.7 -c backports/lzma/_lzmamodule.c -o build/temp.linux-x86_64-2.7/backports/lzma/_lzmamodule.o

       backports/lzma/_lzmamodule.c:115:18: error: lzma.h: No such file or directory
[...]
$ heroku config:set BUILDPACK_URL=https://github.com/mfenniak/heroku-buildpack-python-libffi.git
$ git push heroku master
[...]
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/app/include -I/opt/local/include -I/usr/local/include -I/app/.heroku/python/include/python2.7 -c backports/lzma/_lzmamodule.c -o build/temp.linux-x86_64-2.7/backports/lzma/_lzmamodule.o

       backports/lzma/_lzmamodule.c:115:18: error: lzma.h: No such file or directory
[...]

I couldn't find any buildpacks with python and lzma support out-of-the-box.

As for Deis, we are an open source PaaS based on Docker with a similar workflow to Heroku. The reason why this app is able to deploy to Deis is because we added a feature to build an app using its Dockerfile in the project root, otherwise we deploy the app via buildpack a la Heroku. In the registry's case, that means no project modification is required to get this app running on Deis, only docs. This workflow will be even further improved when we merge deis/deis#1190, which means that your docker image can be pulled from a registry (such as DockerHub) instead of being built from source every time :)

When I mean we are "mostly" compatible with Heroku means that we do not have all of the newer client commands such as heroku fork, but the app workflow stuff like pushing an app, adding a domain and running one-off processes with deis run are all possible.

Does that make sense, or is there something you'd like me to clarify further?

@dmp42
Copy link
Contributor

dmp42 commented Jun 25, 2014

@bacongobbler thanks a lot for all the infos, it's much clearer (at least for me!) :-)

@stuart-warren @homerjam if I understand correctly, Heroku compat is not going to happen unless we can add libzma-dev? Is this feasible? Or should that be addressed at heroku?

@stuart-warren
Copy link
Author

Hi,

I'm no longer interested in this seeing as Deis now does what I need :)
I'm going to close this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants