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

519 update deployment docs second try #874

Merged
merged 15 commits into from May 7, 2013

Conversation

seanh
Copy link
Contributor

@seanh seanh commented May 5, 2013

@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:

Questions:

  • Is there a better user name than seanh?
  • I changed <VirtualHost 0.0.0.0:8080> to <VirtualHost 0.0.0.0:80> in the
    apache 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?
  • Can files like apache.wsgi and the apache sites-available file be shared
    between source and package installs? Maybe add the file in git somewhere,
    and make them both import it

Changes:

  • 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
  • Changed default FileStore storage dir from /my/path/to/storage/root/directory to /var/lib/ckan/default
  • 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
Filestore dir:     /var/lib/ckan/default

Sean Hammond added 6 commits May 5, 2013 14:44
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
@ghost ghost assigned nigelbabu and seanh May 5, 2013
Sean Hammond added 2 commits May 5, 2013 18:43
Update the database and user names in travis build
@seanh seanh mentioned this pull request May 6, 2013
Minor edits to the datastore docs, from Dominik. See:

#807
@ghost ghost assigned nigelbabu May 6, 2013
.. |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
Copy link
Contributor

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.

Copy link
Contributor Author

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.)

Sean Hammond added 3 commits May 6, 2013 14:32
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.
@seanh
Copy link
Contributor Author

seanh commented May 6, 2013

@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

@joetsoi
Copy link
Contributor

joetsoi commented May 6, 2013

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'
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why not?

@nigelbabu
Copy link
Contributor

We use Nginx for our deployments as well, so if we're going to have unified instructions, having it listed is a good idea.

@nigelbabu
Copy link
Contributor

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.

@seanh
Copy link
Contributor Author

seanh commented May 7, 2013

@nigelbabu Ok:

  1. I don't see why a development install can't use pip install -e.
  2. For nginx, I agree it would be good to add this but I don't know how we set it up (we've never had docs for this afaik)
  3. Do you think the apache.wsgi file could go into git, and then be imported by both the docs and the packaging? (We could leave this for 2.1)

@seanh
Copy link
Contributor Author

seanh commented May 7, 2013

  1. I double-checked (since I don't use it myself) pip install -e is fine for dev installs
  2. I think it would be good to put nginx into the deployment docs, but can this wait for 2.1? It should have a brief (one sentence) explanation of why you would want to use nginx and apache together for CKAN, and then how to do it. @nigelbabu Can you make a ticket for this in 2.1? And do you also want to assign it to yourself? :)
  3. apache.wsgi file let's get this sorted for 2.1

Are there any other issues?

@nigelbabu
Copy link
Contributor

  1. Sounds good!
    2 and 3. I'm happy for us to finalize those in 2.1. I opened issue Add documentation for Nginx configuration with CKAN #877 for that.

Merging this in now.

nigelbabu added a commit that referenced this pull request May 7, 2013
@nigelbabu nigelbabu merged commit e88b2fb into master May 7, 2013
@nigelbabu nigelbabu deleted the 519-update-deployment-docs-second-try branch May 7, 2013 11:56
@seanh
Copy link
Contributor Author

seanh commented May 7, 2013

Cherry-picked into release-v2.0

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.

None yet

4 participants