cookbook 'devpi', '~> 2.0.0'
devpi (1) Versions 2.0.0 Follow0
Installs/Configures a devpi server
cookbook 'devpi', '~> 2.0.0', :supermarket
knife supermarket install devpi
knife supermarket download devpi
devpi Cookbook
This cookbook installs and configures a devpi server. Devpi server
is a PyPI-compatible Python Index server that acts as both a freestanding
Python Index as well as a pull-through cache of the official Python Package
Index.
Requirements
- Python Versions: Python 2.6 amd 2.7
- Operating Systems: Debian/Ubuntu, Enterprise Linux/CentOS
Attributes
<table>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<th><tt>['devpiserver']['admin_group']</tt></th>
<td>String</td>
<td>This group can administer the devpi server. This group
will be created if it does not exist.</td>
<td>devpi</td>
</tr>
<tr>
<th><tt>['devpiserver']['server_root']</tt></th>
<td>String</td>
<td>Store server data in this directory. This directory will be
created if it does not exist.</td>
<td>/opt/devpi-server/data</td>
</tr>
<tr>
<th><tt>['devpiserver']['server_port']</tt></th>
<td>Integer</td>
<td>Port number that the server will listen on.</td>
<td>3141</td>
</tr>
<tr>
<th><tt>['devpiserver']['daemon_user']</tt></th>
<td>String</td>
<td>Expect the daemon to run as this user. This user will be
created if it does not exist.</td>
<td>devpi</td>
</tr>
<tr>
<th><tt>['devpiserver']['version']</tt></th>
<td>String or <tt>nil</tt></td>
<td>Install this version of the devpi-server package.
Set this attribute to <tt>nil</tt> to install the latest
version.</td>
<td><tt>nil</tt></td>
</tr>
<tr>
<th><tt>['devpiserver']['virtualenv']</tt></th>
<td>Path</td>
<td>Install Python virtual environment here</td>
<td>/opt/devpi-server</td>
</tr>
</table>
Usage
Add the devpi::server recipe to your run_list
to install devpi server
into a Python virtual environment created just for it. The devpi::nginx
recipe creates an nginx site configured to expose the server on port 80.
The devpi::client recipe installs the devpi
command line client into
a virtual directory. The devpi::server recipe does not install the
command line client so you have to apply this recipe if you want the client
installed alongside the server.
devpi::server
Include this recipe in the run_list
to install the devpi server. It
will also create the daemon user and administrative group if necessary.
devpi::nginx
Include this recipe to expose the devpi-server using nginx as a
front-end server.
devpi::client
Include this recipe to install the devpi command-line client. This will
create a workstation from which you can manage a devpi-server installation.
devpi_server
This resource defines a complete installation of the devpi server. It will
create the Python virtual environment, install the packages/users/groups
needed to run the server, and even generate an nginx site definition for you.
Syntax
The simplest usage of the devpi_server resource is a single line that
identifies where the server instance should be installed into:
devpi_server '/opt/devpi'
If you want to control more aspects of the installed server, you do so
using the normal syntax:
devpi_server '/opt/devpi' do
admin_group 'admins'
port 6543
nginx_site 'devpi'
end
Actions
<table>
<tr><th>Action</th><th>Description</th></tr>
<tr>
<td><tt>:create</tt></td>
<td>Default. Installs a new devpi server instance into the named
directory.</td>
</tr>
<tr>
<td><tt>:delete</tt></td>
<td>Removes an existing server instance.</td>
</tr>
</table>
Attributes
<table>
<tr><th>Attribute</th><th>Description</th></tr>
<tr>
<td><tt>directory</tt></td>
<td>Install the devpi server into this directory. This will
be used as the root of the Python virtual environment created
for the server. If a virtual environment already exists, then
it will be used as-is. <b>This is the name attribute for this
resource.</b></td>
</tr>
<tr>
<td><tt>daemon_user</tt></td>
<td>The user that will run the daemon. This is used to set the
appropriate permissions on the data directories. The default
value for this attribute is <i>devpi</i>.</td>
</tr>
<tr>
<td><tt>admin_group</tt></td>
<td>The user group responsible for managing the devpi server. This
is used to set the appropriate permissions on the devpi related
directories. The default value for this attribute is also
<i>devpi</i>.</td>
</tr>
<tr>
<td><tt>port</tt></td>
<td>The port that the devpi server instance will listen on. The
default value for this attribute is <i>3141</i>.</td>
</tr>
<tr>
<td><tt>data_directory</tt></td>
<td>The directory used by the server to store the repository data.
The default value for this attribute is a sub-directory of
the server root named <i>data</i>.</td>
</tr>
<tr>
<td><tt>nginx_site</tt></td>
<td>If this attribute is set, then a new nginx site is created
with the specified name. It will be configured as a front-end
for the installed server.</td>
</tr>
<tr>
<td><tt>version</tt></td>
<td>If this attribute is set, then this version of the devpi
package will be installed. If this is omitted or set to
<tt>nil</tt>, then the most recent package will be installed.</td>
</tr>
</table>
devpi_nginx_site
This resource uses the devpi-server
command to generate an nginx site for
the server and optionally enable it.
Syntax
The root directory of the server installation is the only required parameter.
devpi_nginx_site 'devpi' do
directory '/opt/devpi'
end
This will create and enable an nginx site named devpi for the server that
is installed in the /opt/devpi virtual environment.
Actions
<table>
<tr><th>Action</th><th>Description</th></tr>
<tr>
<td><tt>:create</tt></td>
<td>Generate and optionally install the nginx configuration.</td>
</tr>
</table>
Attributes
<table>
<tr><th>Attribute</th><th>Description</th></tr>
<tr>
<td><tt>directory</tt></td>
<td>Generate the site for the devpi server installed in this
directory.</td>
</tr>
<tr>
<td><tt>daemon_user</tt></td>
<td>The user that will run the daemon. The default value for this
attribute is <i>devpi</i>.</td>
</tr>
<tr>
<td><tt>admin_group</tt></td>
<td>The user group responsible for managing the devpi server.
The default value for this attribute is <i>devpi</i>.</td>
</tr>
<tr>
<td><tt>port</tt></td>
<td>The port that the devpi server listens on. The
default value for this attribute is <i>3141</i>.</td>
</tr>
<tr>
<td><tt>data_directory</tt></td>
<td>The directory used by the server to store the repository data.
The default value for this attribute is a sub-directory of
the server root named <i>data</i>.</td>
</tr>
<tr>
<td><tt>enable</tt></td>
<td>Boolean flag that controls whether the site is enabled or not.
By default, the site will be enabled.</td>
</tr>
</table>
Vagrantfile
Though not a usage of the cookbook per-se, the Vagrantfile can be used
to start a stand-alone devpi-server instance. vagrant up will start
the server and make it available at http://172.16.0.11/.
Contributing
- Fork the repository on Github
- Create a new branch from
master
to hold your changes. - Create the test kitchen environment by running
kitchen converge
on whichever suite you are targeting. Then runkitchen verify
on the suite to make sure that the tests pass. - Edit README.md to describe your feature.
- Write integration tests that verify your feature, run them with
kitchen verify
-- they should fail - Implement your feature in its default configuration. You should not modify anything outside if the recipe at this point. Keep iterating until the integration tests pass.
- Run the static analysis tasks,
rubocop
andfoodcritic
, periodically. Fix any problems that they uncover. - Update README.md to mention any new attributes and add yourself to the AUTHORS list.
- Issue a pull-request on Github.
HACKING.md contains additional details about developing in this cookbook.
License and Authors
Cookbook Authors:
- Dave Shawley
License:
Copyright (C) 2013-2014 Dave Shawley
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Dependent cookbooks
nginx >= 0.0.0 |
python >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
devpi CHANGELOG
This file is used to list changes made in each version of the devpi cookbook.
2.0.0
- Fully embrace ChefDK for development.
- Switch attribute access from symbols to strings.
- Remove runit and supervisor recipes.
- Add
devpi_server
anddevpi_nginx_site
LWRPs. - Removed nginx site template in lieu of letting the devpi-server utility
generate one for us. That is precisely what the
devpi_nginx_site
LWRP does. - Remove log directory management. The generated nginx configuration does not provide a means to configure this.
1.1.0 (Never Released)
- Add the client recipe that installs the
devpi
command line utility. - Upgrade testing frameworks - ChefSpec 3.0, Test Kitchen 1.0.0.
- devpi-cookbook#2: Make the nginx log directory configurable via an attribute.
1.0.4 - 5-Jan-2014
- Copyright updated to include 2014.
1.0.3 - 4-Jan-2014
- The default nginx configuration limits the size of a POST/PUT request
to 1MB which is inconveniently small. This release makes the max upload
size unlimited by setting
client_max_body_size
to zero.
1.0.2 - 30-Dec-2013
- devpi-cookbook#2: The nginx recipe was not creating the nginx log directory.
- The nginx service is not necessarily started when it is installed. The recipe is required to explicitly start it.
1.0.1 - 24-Nov-2013
- devpi-cookbook#1: Renamed two Chef resources. Resource names should consistently use "devpi-server" instead of "devpi server".
1.0.0 - 23-Nov-2013
- Add the runit recipe that manages the server daemon using the runit package.
- Add the nginx recipe which installs an nginx site to front end the running daemon.
- Change daemonizing recipes to include server by default.
0.2.0 - 14-Nov-2013
Create the supervisor recipe that manages the server daemon using the
supervisord package.
0.1.0 - 14-Nov-2013
Initial release of the devpi cookbook. The server recipe will create
a python virtual environment and install the devpi-server into it. You
are responsible for setting up a daemon process at this point.
Collaborator Number Metric
2.0.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
2.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
2.0.0 failed this metric
FC064: Ensure issues_url is set in metadata: devpi/metadata.rb:1
FC065: Ensure source_url is set in metadata: devpi/metadata.rb:1
FC066: Ensure chef_version is set in metadata: devpi/metadata.rb:1
FC069: Ensure standardized license defined in metadata: devpi/metadata.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: devpi/providers/server.rb:110
FC085: Resource using new_resource.updated_by_last_action to converge resource: devpi/providers/server.rb:132
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
2.0.0 passed this metric
Testing File Metric
2.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
2.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
2.0.0 failed this metric
2.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
2.0.0 failed this metric
FC064: Ensure issues_url is set in metadata: devpi/metadata.rb:1
FC065: Ensure source_url is set in metadata: devpi/metadata.rb:1
FC066: Ensure chef_version is set in metadata: devpi/metadata.rb:1
FC069: Ensure standardized license defined in metadata: devpi/metadata.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: devpi/providers/server.rb:110
FC085: Resource using new_resource.updated_by_last_action to converge resource: devpi/providers/server.rb:132
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
2.0.0 passed this metric
Testing File Metric
2.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
2.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
2.0.0 failed this metric
FC065: Ensure source_url is set in metadata: devpi/metadata.rb:1
FC066: Ensure chef_version is set in metadata: devpi/metadata.rb:1
FC069: Ensure standardized license defined in metadata: devpi/metadata.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: devpi/providers/server.rb:110
FC085: Resource using new_resource.updated_by_last_action to converge resource: devpi/providers/server.rb:132
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
2.0.0 passed this metric
Testing File Metric
2.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
2.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
2.0.0 failed this metric
2.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number