Skip to content

Conversation

@dean
Copy link
Contributor

@dean dean commented Jun 19, 2014

This adds an option to deploy kitsune via Vagrant with Ubuntu 14.04.

  • ./manage.py generatedata does not currently work, not sure why. Was planning on using an anonymized dump of the production database for data.
  • Also, this is blocked until the requirements update in Update requirement from PIL to Pillow #1984 is merged as well.

@mythmon
Copy link
Contributor

mythmon commented Jun 19, 2014

I'm going to look through this, but it would be good if someone else could review this too, since I've been fairly involved in writing this patch.

Copy link
Member

Choose a reason for hiding this comment

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

Does this have version 0.90.10? If not, then we need to change this since the Elasticsearch folks change features between minor releases.

Copy link
Contributor

Choose a reason for hiding this comment

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

This installs 0.90.13, which matches what I had on my laptop when I was helping Dean set this up. I guess I'm not on the right version either :\

Copy link
Member

Choose a reason for hiding this comment

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

Yeah... I think we can get away with version mismatches for most things, but Elasticsearch versions get kind of funky. I highly recommend using 0.90.10 explicitly.

Having said that, maybe it doesn't matter. I don't know what the difference between 0.90.10 and 0.90.13 is. But we definitely can't be using a non-0.90.x version.

@willkg
Copy link
Member

willkg commented Jun 20, 2014

@mythmon mentioned that you were seeing really crazy issues with Mac OSX and .pth files and that the thinking was that we'd peep-ify vendor/ into a requirements file. I don't see that here, though. Did that get resolved some other way?

@dean
Copy link
Contributor Author

dean commented Jun 20, 2014

The performance issues stem from using shared directories with Vagrant and Virtualbox. We didn't resolve that here by peep-ifying vendor/, but we should definitely create a bug for it.

Oh, and before I thought vagrant was timing out from the path issues, but it turned out to be another problem. Starting kitsune is slow, but once it's started it works fine.

manage.py Outdated
Copy link
Member

Choose a reason for hiding this comment

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

So what does this code do now? Is it fundamentally changing sys.path at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's only changing the order of the packages. Instead of putting new_sys_path packages at the front of sys.path, it appends them to the end. It makes lookup times much quicker because the more frequently used packages to run the server are already at the front of sys.path.

Copy link
Member

Choose a reason for hiding this comment

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

Right... so what I'm getting at is that they were at the end after line 12 and then this code takes them off the end and puts them at the end which is fundamentally not changing sys.path at all. Does that make sense? You can probably check sys.path before and after to verify that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I see what you're saying. Yeah, I just removed all the custom path configuration code (other than the site.addsitedir(vendors) and it seems to be the same After discussions with you via IRC I'm gonna revert the commit and just peep'ify the vendor packages instead. It seems to be the best solution to this problem anyways.

@dean dean changed the title Vagrant 905834 [Bug 905834] Developer Vagrant environment Jul 7, 2014
@dean dean force-pushed the vagrant-905834 branch 2 times, most recently from 0607196 to 1cbfa29 Compare September 11, 2014 22:00
@dean
Copy link
Contributor Author

dean commented Sep 16, 2014

Fixed up the script to use peep (making the assumption the peep branch is merged). Works flawlessly with < 2 second load times!

@dean
Copy link
Contributor Author

dean commented Sep 19, 2014

r?

@dean
Copy link
Contributor Author

dean commented Sep 19, 2014

The most recent updates have rebased this branch off master so that it can use peep.

To setup your VM, just checkout the branch and run:
$ vagrant up

@rlr
Copy link
Contributor

rlr commented Sep 25, 2014

I'll try this out. Assume I know nothing about vagrant, what do I do after vagrant up?

@rlr
Copy link
Contributor

rlr commented Sep 25, 2014

(I already have vagrant installed and had it setup for MDN before. I just don't remember the details on how to interact with it.)

@mythmon
Copy link
Contributor

mythmon commented Sep 25, 2014

After vagrant up, you should be able to vagrant ssh and get into the box. Inside that there should be a fully working kitsune that you can start with manage.py that includes mysql, memcached, redis, es, etc. It should have generatedata, but nothing more.

@willkg
Copy link
Member

willkg commented Sep 25, 2014

I think the vagrant environment is inextricably tied to the documentation for setting up development environments for contributors. I contend that this should include the changes to the hacking howto because the two should have been changed in tandem and testing both in tandem is important.

@rlr
Copy link
Contributor

rlr commented Sep 25, 2014

Here is the end of my output for a vagrant up:

Stderr from the command:

stdin: is not a tty
dpkg-preconfigure: unable to re-open stdin: No such file or directory
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1768  100  1768    0     0    314      0  0:00:05  0:00:05 --:--:--   430
gpg: keyring `/tmp/tmpqei4azro/secring.gpg' created
gpg: keyring `/tmp/tmpqei4azro/pubring.gpg' created
gpg: requesting key C7917B12 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpqei4azro/trustdb.gpg: trustdb created
gpg: key C7917B12: public key "Launchpad chrislea" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
gpg: keyring `/tmp/tmpg02ngrom/secring.gpg' created
gpg: keyring `/tmp/tmpg02ngrom/pubring.gpg' created
gpg: requesting key C7917B12 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpg02ngrom/trustdb.gpg: trustdb created
gpg: key C7917B12: public key "Launchpad chrislea" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
gpg: keyring `/tmp/tmpiddf2cad/secring.gpg' created
gpg: keyring `/tmp/tmpiddf2cad/pubring.gpg' created
gpg: requesting key DB82666C from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpiddf2cad/trustdb.gpg: trustdb created
gpg: key DB82666C: public key "Launchpad Old Python Versions" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
Extracting templates from packages: 100%

Current default time zone: 'Etc/UTC'
Local time is now:      Thu Sep 25 19:21:22 UTC 2014.
Universal Time is now:  Thu Sep 25 19:21:22 UTC 2014.
Run 'dpkg-reconfigure tzdata' if you wish to change it.


Creating config file /etc/papersize with new version
 * Stopping MariaDB database server mysqld
   ...done.
 * Starting MariaDB database server mysqld
   ...done.
 * Checking for corrupt, not cleanly closed and upgrade needing tables.
fatal: Not a git repository: /Users/rlr/dev/kitsune/.git/modules/kitsune/sumo/static/js/libs/ace
Unable to find current revision in submodule path 'kitsune/sumo/static/js/libs/ace'

@rlr
Copy link
Contributor

rlr commented Sep 25, 2014

I am able to ssh in, but I'm not sure what to do next. Should the virtual env be there already?

vagrant@ubuntu-14:~/kitsune$ ./manage.py runserver
Traceback (most recent call last):
  File "./manage.py", line 9, in <module>
    from django.conf import settings
ImportError: No module named django.conf

@rlr
Copy link
Contributor

rlr commented Sep 25, 2014

I am guessing I have to create a virtualenv and run peep and all that? Or? Just wondering. I know mdn does it so that once you ssh in after vagrant up everything is all set and you call foreman to start the server. Not saying we have to do that, just saying that we need docs like @willkg mentioned.

Copy link
Contributor

Choose a reason for hiding this comment

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

you could also just do this instead (probably a better idea):

./manage.py nunjucks_precompile

@rehandalal
Copy link
Contributor

+1 for updating the docs

Copy link
Contributor

Choose a reason for hiding this comment

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

i'm not sure why you're doing this ^ ^^ ^^^

@dean
Copy link
Contributor Author

dean commented Sep 30, 2014

@rlr From right where you ssh in:

source virtualenv/bin/activate
cd kitsune
./manage.py runserver 0.0.0.0:8000

Let me know if you have any other issues, I'll be updating docs next. :)

dean added 2 commits November 24, 2014 15:03
generatedata does not work in the VM. An anonymized dump of the
production database should be used instead.
Mostly code cleanup, but we also check for the presence of git
submodules now. If they aren't found, we show an error message then
quit provisioning.
@dean
Copy link
Contributor Author

dean commented Nov 24, 2014

Added documentation. r?

Copy link
Contributor

Choose a reason for hiding this comment

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

we don't have submodules anymore. So maybe we can remove this? @mythmon ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah. We don't need to do anything with submodules anymore. I got rid of the last one recently.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed 💯

@rlr
Copy link
Contributor

rlr commented Nov 26, 2014

Looks like you rebased to something recent 👍

I just to have to go through and try it again.

@dean
Copy link
Contributor Author

dean commented Dec 2, 2014

Fixed the unneeded submodule update in the provisioning script. r?

@rlr
Copy link
Contributor

rlr commented Dec 5, 2014

AWESOOMMEEEEE. I just had to add --no-use-wheel to the peep install line. I'll add that in a separate commit.

@rlr
Copy link
Contributor

rlr commented Dec 5, 2014

0929579 [bug 905834] Vagrant support for dev deployment.
0f6b739 Add --no-use-wheel in vagrant_provision.sh

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.

5 participants