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
519 update deployment docs second try #874
Conversation
Update the source install and related docs (datastore setup, solr setup, testing) and files (deployment.ini_tmp, test-core.ini) for CKAN 2.0. The idea is to document the setup process that OKFN is currently using on its servers, so that the deployment docs can become the docs for the OKFN dev team and we can dogfood our own docs, instead of having a bunch of wiki pages, READMEs, etc. that we follow and ignoring the "official" docs. Hopefully those can all be deleted or cut down massively once this is done. So both the docs now describe the layout we use on our servers, where there's space for multiple CKAN sites on the same server, with virtualenvs in /usr/lib/ckan/ and config files in /etc/ckan/. - Changed default virtualenv location from `~/pyenv` to `/usr/lib/ckan/default` - Changed default config files dir to `/etc/ckan/default` - Added tip for developers in source install docsS symlink `/usr/lib/ckan` and `/etc/ckan` to directories in your homedir to install ckan in your homedir - Changed default database user from `ckanuser` to `ckan_default` - Changed default database from `ckan_dev` to `ckan_default` - Changed default datastore database from `datastore` to `datastore_default` - Changed default datastore database user from `readonlyuser` to `datastore_default` - Changed default test databases from `ckan_test` and `ckan_test_datastore` to `ckan_test` and `datastore_test` - Changed default `ckan.site_id` from `ckan.net` to `default` - Disabled file log handler, rely on Apache's log files only (as we do on our servers) - Changed the docs to use restructured text substitutions for things like the paths to the virtualenv and config files, database names, etc. instead of typing them out each time - Lots of minor formatting fixes and editing So now we have: virtualenv: /usr/lib/ckan/default development.ini: /etc/ckan/default/development.ini production.ini: /etc/ckan/default/production.ini ckan.site_id: default Database user: ckan_default Database: ckan_default Datastore user: datastore_default Datastore db: datastore_default Test database: ckan_test Test datastore db: datastore_test
Make them fit with the changes in commit 6e1d325
Uses the same directory structure as the updated source install docs, so you can step through the source install docs and then the deployment docs as written and it all works. Also updated the apache.wsgi and sites-available files to match those that we use on our servers. Removed CORS setup instructions as this has been builtin since CKAN 1.5.
Minor edits to install from source docs
Minor edits to solr setup docs
Update the database and user names in travis build
Minor edits to the datastore docs, from Dominik. See: #807
.. |sstore| replace:: |config_dir|/sstore | ||
.. |storage_parent_dir| replace:: /var/lib/ckan | ||
.. |storage_dir| replace:: |storage_parent_dir|/default | ||
.. |restart_apache| replace:: sudo service apache2 reload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should either be called reload_apache or the command should be sudo service apache2 restart
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change it to reload. Let's use reload everywhere, and only put a restart if we find somewhere that it's actually needed. (I'm not sure what the difference is anyway.)
We've had reports from some users that this causes problems with some CKAN features, so we don't want to recommend it until tested.
@nigelbabu Ok, I've made the changes you suggested. Only thing is the question about copying development.ini or running paster make-config again, not sure what to do there but I'm happy to go with your recommendation if you have one |
Eitherway they'll both end up being generated from deployment.ini_tmpl. http://docs.pylonsproject.org/projects/pylons-webframework/en/latest/deployment.html#make-config it doesn't look like there was a way of specifying a different template file paster make-config is generated at this point for the packaging in a post install script so everyone gets a different beaker.session_secret as users are most likely too lazy to change it. (We should do the same for the repoz.who stuff that was mentioned in the standup on friday as well) The package currently also sets up nginx, it might be a good idea to just have it setup on apache as it's only there because that's how the data.gov stuff is deployed. Also 8080 is the default port for a bunch of stuff (e.g tomcat). If something's running on 8080 then the package will break and I'm worried we'll generate a whole bunch of support requests of "Hey the package install is broken!" where we end up figuring out that port is in use. |
|
||
.. parsed-literal:: | ||
|
||
pip install -e 'git+\ |git_url|\#egg=ckan' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a little tricky. We can't recommend this if someone wants to install CKAN for development.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not?
We use Nginx for our deployments as well, so if we're going to have unified instructions, having it listed is a good idea. |
the apache.wsgi file is in the package source. Once this is merged, I'll make sure the package stuff is same as what the source install recommends. |
@nigelbabu Ok:
|
Are there any other issues? |
Merging this in now. |
519 update deployment docs second try
Cherry-picked into release-v2.0 |
@nigelbabu I think you're probably the best person to review this, because you're doing the package install, and everything needs to be consistent between the package and source installs.
The new docs are built here:
I've tested these on my dev machine (using the symlinks into homedir tip) and on a fresh Ubuntu 12.04 VM (including deployment).
These files also changed:
After this is merged into master, I need to merge it into release-v2.0 and re-test. Some things are different between master and 2.0, e.g. test databases and user names. See #816
Todo:
deployment.rst
, see [wip] [#519] Update deployment docs for CKAN 2.0 #821 (comment)Questions:
seanh
?<VirtualHost 0.0.0.0:8080>
to<VirtualHost 0.0.0.0:80>
in theapache sites-available file, because nginx isn't included in the from-source
deployment instructions. Does the package install include nginx? Can nginx
setup instructions be added to
deployment.rst
?apache.wsgi
and the apache sites-available file be sharedbetween source and package installs? Maybe add the file in git somewhere,
and make them both import it
Changes:
~/pyenv
to/usr/lib/ckan/default
/etc/ckan/default
/usr/lib/ckan
and/etc/ckan
to directories in your homedir to install ckan in your homedirckanuser
tockan_default
ckan_dev
tockan_default
datastore
todatastore_default
readonlyuser
todatastore_default
ckan_test
andckan_test_datastore
tockan_test
anddatastore_test
ckan.site_id
fromckan.net
todefault
servers)
paths to the virtualenv and config files, database names, etc. instead of
typing them out each time
/my/path/to/storage/root/directory
to/var/lib/ckan/default
So now we have: