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

Resolve circular dep when installing gunicorn in venv #223

Merged
merged 1 commit into from
Aug 4, 2015

Conversation

mvschaik
Copy link
Contributor

@mvschaik mvschaik commented Aug 4, 2015

The anchor pattern now requires python::config to happen before creating virtual envs. If gunicorn is installed in the virtual env, it can not be started before the virtual env is created. But the service is declared in python::config.

That looks something like this:

(Exec[python_virtualenv_/srv/venv/myenv] => Python::Virtualenv[myenv] => Python::Gunicorn[myapp] => File[/etc/gunicorn.d/myapp] => Python::Gunicorn[myapp] => Service[gunicorn] => Class[Python::Config] => Exec[python_virtualenv_/srv/venv/myenv])

The declaration that causes this is:

python::virtualenv { 'myenv':
  venv_dir => '/srv/venv/myenv';
}

python::gunicorn { 'myapp':
  virtualenv => '/srv/venv/myenv',
  dir        => '/srv/myapp/',
  appmodule  => 'wsgi:app',
  require    => Python::Virtualenv['myenv'];  # <-- problem starts here!
}

If I don't require the Python::Virtualenv in my Python::Gunicorn, gunicorn won't be able to start.

Note that this doesn't re-introduce #215, since the virtual env is still created after the packages are installed.

The anchor pattern now requires python::config to happen before creating virtual envs. If gunicorn is installed in the virtual env, it can not be started before the virtual env is created. But the service is declared in python::config.

That looks something like this:
```
(Exec[python_virtualenv_/srv/venv/myenv] => Python::Virtualenv[myenv] => Python::Gunicorn[myapp] => File[/etc/gunicorn.d/myapp] => Python::Gunicorn[myapp] => Service[gunicorn] => Class[Python::Config] => Exec[python_virtualenv_/srv/venv/myenv])
```

The declaration that causes this is:
```puppet
python::virtualenv { 'myenv':
  venv_dir => '/srv/venv/myenv';
}

python::gunicorn { 'myapp':
  virtualenv => '/srv/venv/myenv',
  dir        => '/srv/myapp/,
  appmodule  => 'wsgi:app',
  require    => Python::Virtualenv['myenv'];  # <-- problem starts here!
}
```
If I don't require the `Python::Virtualenv` in my `Python::Gunicorn`, gunicorn won't be able to start.
shivapoudel added a commit that referenced this pull request Aug 4, 2015
Resolve circular dep when installing gunicorn in venv
@shivapoudel shivapoudel merged commit e88b89e into voxpupuli:master Aug 4, 2015
shivapoudel pushed a commit that referenced this pull request Sep 1, 2015
Resolve circular dep when installing gunicorn in venv
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.

3 participants