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

Hosting for OSB Volunteer app #31

Open
reidab opened this issue Apr 30, 2015 · 4 comments
Open

Hosting for OSB Volunteer app #31

reidab opened this issue Apr 30, 2015 · 4 comments
Assignees

Comments

@reidab
Copy link
Member

reidab commented Apr 30, 2015

We need to set up server space for the OSB volunteer app, either on a rebuilt arroway or on a new machine. @reidab needs to coordinate with @ChrisFreeman about what needs to be installed for this app to work.

@akf
Copy link

akf commented Apr 30, 2015

@ChrisFreeman notes that he wants both "dev" and "production" environments.

@reidab
Copy link
Member Author

reidab commented May 18, 2015

I think I have a server set up with all the infrastructure to run the volunteer app, but I need a little more information to complete the config:

  1. What's the name of the main app and its wsgi module?
  2. What directory are the static files stored in?

If you want to jump in and start trying to get things configured, here's some info to get you started:

Server Info

You should be able to ssh in to [email protected]. You'll wind up in the base deployment directory for the volunteer app: /var/www/osbridge-volunteer. The directory structure here is managed using Capistrano, which I recommend we use for deployment (more on that later).

I've got a basic Django "Hello World" app running there now, which you can access at http://volunteer-new.opensourcebridge.org. This app will be overwritten when you deploy the real volunteer app there.

The app is running behind nginx, using uWSGI as the application server. You can restart it by touching the uwsgi config at /var/www/osbridge-volunteer/shared/config/uwsgi_config.ini.

Logs for this app from both uWSGI and nginx can found in /var/www/osbridge-volunteer/shared/log

Deployment Setup

To get your app set up for deployment with Capistrano:

  1. Make sure you have a working Ruby install that's at least 1.9.3: ruby -v
  2. Install Capistrano: gem install capistrano
  3. Copy the Capfile, and config/ directory from the currently-deployed Hello World app into the root of your repo.
  4. Customize the repo_url in config/deploy.rb to point at your app's repo instead of the Hello World app.
  5. You should now be able to deploy the app to the server by running cap production deploy. This will get the files there, but there's still probably a bit more tweaking we'll need to do to get things set finalized.

Configuration

Production settings are managed by linking in a production-specific Django settings module at deploy time. For the demo app, this file is located at /var/www/osbridge-volunteer/shared/osbridge_volunteer/production_settings.py and is pre-populated with the MySQL connection information for the server. On deployment, this file is symlinked into the newly-deployed codebase at /var/www/osbridge-volunteer/current/osbridge_volunteer/production_settings.py

You'll want to make a new directory in /var/www/osbridge-volunteer/shared/ that matches the name of your main app and create an appropriate production_settings.py there, copying over the database info from the demo file. You'll then need to edit the folder name in config/production.rb before deploying.

uWSGI runs the app in an environment with DJANGO_SETTINGS_MODULE set to reference these settings. It's currently pointing at osbridge_volunteer.production_settings, so I'll need to update this once I know the name of your app.

@ChrisFreeman
Copy link

Thanks! I really appreciate all the work you've put into it! I'll check it
out in the morning. -- Chris

On Monday, May 18, 2015, Reid Beels [email protected] wrote:

I think I have a server set up with all the infrastructure to run the
volunteer app, but I need a little more information to complete the config:

  1. What's the name of the main app and its wsgi module?
  2. What directory are the static files stored in?

If you want to jump in and start trying to get things configured, here's
some info to get you started:
Server Info

You should be able to ssh in to [email protected]
javascript:_e(%7B%7D,'cvml','[email protected]');.
You'll wind up in the base deployment directory for the volunteer app:
/var/www/osbridge-volunteer. The directory structure
http://capistranorb.com/documentation/getting-started/structure/ here
is managed using Capistrano http://capistranorb.com, which I recommend
we use for deployment (more on that later).

I've got a basic Django "Hello World" app running there now, which you can
access at http://volunteer-new.opensourcebridge.org. This app will be
overwritten when you deploy the real volunteer app there.

The app is running behind nginx, using uWSGI
http://uwsgi-docs.readthedocs.org/en/latest/ as the application server.
You can restart it by touching the uwsgi config at
/var/www/osbridge-volunteer/shared/config/uwsgi_config.ini.

Logs for this app from both uWSGI and nginx can found in
/var/www/osbridge-volunteer/shared/log
Deployment Setup

To get your app set up for deployment with Capistrano:

  1. Make sure you have a working Ruby install that's at least 1.9.3: ruby
    -v
  2. Install Capistrano: gem install capistrano
  3. Copy the Capfile, and config/ directory from the currently-deployed Hello
    World app https://github.com/reidab/osbridge-django-test into the
    root of your repo.
  4. Customize the repo_url in config/deploy.rb to point at your app's
    repo instead of the Hello World app.
  5. You should now be able to deploy the app to the server by running cap
    production deploy. This will get the files there, but there's still
    probably a bit more tweaking we'll need to do to get things set finalized.

Configuration

Production settings are managed by linking in a production-specific Django
settings module at deploy time. For the demo app, this file is located at
/var/www/osbridge-volunteer/shared/osbridge_volunteer/production_settings.py
and is pre-populated with the MySQL connection information for the server.
On deployment, this file is symlinked into the newly-deployed codebase at
/var/www/osbridge-volunteer/current/osbridge_volunteer/production_settings.py

You'll want to make a new directory in /var/www/osbridge-volunteer/shared/
that matches the name of your main app and create an appropriate
production_settings.py there, copying over the database info from the
demo file. You'll then need to edit the folder name in
config/production.rb before deploying.

uWSGI runs the app in an environment with DJANGO_SETTINGS_MODULE set to
reference these settings. It's currently pointing at
osbridge_volunteer.production_settings, so I'll need to update this once
I know the name of your app.


Reply to this email directly or view it on GitHub
#31 (comment).

@reidab
Copy link
Member Author

reidab commented Feb 17, 2016

This is all set up on the osbridge server, but the volunteer app never actually got up and running there. For 2016, this would require coordination with @ChrisFreeman to see if it's still relevant.

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