Skip to content

Commit

Permalink
Deploying to gh-pages from @ 9b9cf54 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed Jan 19, 2024
1 parent 2a8d387 commit 7a28a5a
Show file tree
Hide file tree
Showing 50 changed files with 399 additions and 516 deletions.
2 changes: 1 addition & 1 deletion develop/_modules/bodhi/client/bindings.html
Original file line number Diff line number Diff line change
Expand Up @@ -1197,9 +1197,9 @@ <h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../developer/index.html">Developer documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../developer/releases.html">Release process</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../developer/bcd.html">BCD - the Bodhi Container Development environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../developer/vagrant.html">Vagrant</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../developer/vagrant_vscode.html">Debugging with Visual Studio Code</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../developer/virtualenv.html">Virtualenv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../developer/models.html">Database models</a></li>
</ul>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion develop/_modules/bodhi/messages/schemas/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,9 @@ <h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/index.html">Developer documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/releases.html">Release process</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/bcd.html">BCD - the Bodhi Container Development environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/vagrant.html">Vagrant</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/vagrant_vscode.html">Debugging with Visual Studio Code</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/virtualenv.html">Virtualenv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/models.html">Database models</a></li>
</ul>
<ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,9 @@ <h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/index.html">Developer documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/releases.html">Release process</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/bcd.html">BCD - the Bodhi Container Development environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/vagrant.html">Vagrant</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/vagrant_vscode.html">Debugging with Visual Studio Code</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/virtualenv.html">Virtualenv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/models.html">Database models</a></li>
</ul>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion develop/_modules/bodhi/messages/schemas/compose.html
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,9 @@ <h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/index.html">Developer documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/releases.html">Release process</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/bcd.html">BCD - the Bodhi Container Development environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/vagrant.html">Vagrant</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/vagrant_vscode.html">Debugging with Visual Studio Code</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/virtualenv.html">Virtualenv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/models.html">Database models</a></li>
</ul>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion develop/_modules/bodhi/messages/schemas/errata.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ <h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/index.html">Developer documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/releases.html">Release process</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/bcd.html">BCD - the Bodhi Container Development environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/vagrant.html">Vagrant</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/vagrant_vscode.html">Debugging with Visual Studio Code</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/virtualenv.html">Virtualenv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/models.html">Database models</a></li>
</ul>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion develop/_modules/bodhi/messages/schemas/update.html
Original file line number Diff line number Diff line change
Expand Up @@ -1314,9 +1314,9 @@ <h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/index.html">Developer documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/releases.html">Release process</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/bcd.html">BCD - the Bodhi Container Development environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/vagrant.html">Vagrant</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/vagrant_vscode.html">Debugging with Visual Studio Code</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/virtualenv.html">Virtualenv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../developer/models.html">Database models</a></li>
</ul>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion develop/_modules/bodhi/server/logging.html
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ <h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../developer/index.html">Developer documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../developer/releases.html">Release process</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../developer/bcd.html">BCD - the Bodhi Container Development environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../developer/vagrant.html">Vagrant</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../developer/vagrant_vscode.html">Debugging with Visual Studio Code</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../developer/virtualenv.html">Virtualenv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../developer/models.html">Database models</a></li>
</ul>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion develop/_modules/bodhi/server/models.html
Original file line number Diff line number Diff line change
Expand Up @@ -5529,9 +5529,9 @@ <h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../developer/index.html">Developer documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../developer/releases.html">Release process</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../developer/bcd.html">BCD - the Bodhi Container Development environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../developer/vagrant.html">Vagrant</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../developer/vagrant_vscode.html">Debugging with Visual Studio Code</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../developer/virtualenv.html">Virtualenv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../developer/models.html">Database models</a></li>
</ul>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion develop/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ <h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../developer/index.html">Developer documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../developer/releases.html">Release process</a></li>
<li class="toctree-l1"><a class="reference internal" href="../developer/bcd.html">BCD - the Bodhi Container Development environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../developer/vagrant.html">Vagrant</a></li>
<li class="toctree-l1"><a class="reference internal" href="../developer/vagrant_vscode.html">Debugging with Visual Studio Code</a></li>
<li class="toctree-l1"><a class="reference internal" href="../developer/virtualenv.html">Virtualenv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../developer/models.html">Database models</a></li>
</ul>
<ul>
Expand Down
98 changes: 98 additions & 0 deletions develop/_sources/developer/bcd.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
=================================================
BCD - the Bodhi Container Development environment
=================================================

BCD is an Ansible-orchestrated, Podman-powered container-based development environment for Bodhi.
It lets you quickly and easily test your changes in a live Bodhi environment, without any external
dependencies, root privilege requirements, or virtual machines. It's also convenient for running
the unit tests.

To get started on a Fedora or Enterprise Linux-ish system, do::

$ sudo dnf install ansible-core ansible-collection-containers-podman podman
$ ./bcd run

Your newly provisioned bodhi development instance is now available at http://localhost.localdomain:6543/ .

The AMQP message broker web interface is available at http://localhost:15672/. The default username
is ``guest`` and the password is ``guest``.

The Waiverdb web interface is available at http://localhost:6544/ , and the Greenwave web interface
is available at http://localhost:6545/ .

The Ipsilon identity service web interface is available at http://localhost:6546/ (though there
isn't much reason to use it directly in this environment).

Other commands
^^^^^^^^^^^^^^

Other command commands are ``./bcd stop`` to stop all containers, ``./bcd remove`` to remove all
containers, ``bcd logs (container)`` to view the logs for a container, ``bcd shell (container)``
to shell into a container (the Bodhi container by default), and ``./bcd cis`` to clear Ipsilon's
session cache. This is necessary to log in to Bodhi as a different user - first log out, then run
``./bcd cis``, then log in again. If you don't clear the session cache Ipsilon will just keep
logging you in as the same user. Run ``./bcd -h`` or ``./bcd (subcommand) -h`` for more help.

Containers
^^^^^^^^^^

Behind the scenes, BCD uses an Ansible playbook that controls a pod of Podman containers. The
pod is called ``bodhi-dev``. The full names of the containers are ``bodhi-dev-database``,
``bodhi-dev-waiverdb``, ``bodhi-dev-greenwave``, ``bodhi-dev-rabbitmq``, ``bodhi-dev-ipsilon`` and
``bodhi-dev-bodhi``. BCD commands which take a container name use shortened names with 'bodhi-dev-'
omitted, for convenience. You can interact with the pod and the containers directly using normal
podman commands if you wish - to start and stop individual containers, for instance.

The 'database' container runs postgresql and is initialized with a dump of real data for waiverdb
and Bodhi, both of which connect to it. The 'waiverdb' and 'greenwave' containers run those services
respectively, which are used by Bodhi for retrieving test results and test waivers and deciding
on the gating status of updates. Note that the 'greenwave' container is configured to connect to
the real, production ResultsDB and forward results from it, so the results shown and the gating
status calculated will change to reflect the real-world state. The 'rabbitmq' container runs an
instance of the RabbitMQ message broker which Bodhi will publish messages to and consume messages
from. The 'ipsilon' container runs the authentication service (see below for details). And, of
course, the 'bodhi' container runs Bodhi itself. It has your source tree mapped as a volume, so
changes you make to your source tree are immediately reflected in the development environment.
The server will automatically reload when any Python source file is changed.

The Bodhi container uses systemd, so you can shell into it and stop or restart the bodhi service
or any of the ancillary services it runs, if you need to.

Authentication
^^^^^^^^^^^^^^

The BCD environment uses an instance of the Ipsilon authentication service (as also used for
Fedora authentication in the real world). This instance is configured in testauth mode, which means
you can log in as any user at all with the password 'ipsilon'. If you log in as a user that does
not exist in the Bodhi database, it will be added.

Note that the group memberships and email addresses for real users are not the same as in the real
world. This Ipsilon instance is configured by default to say that all users are members of the
groups "fedora-contributors" and "packagers" and also a group of the same name as their username,
and have the email address "[email protected]". These values will be changed in the Bodhi
database on login.

There is a special mechanism for testing different group memberships. You can login with a username
like 'someuser:groups=somegroup1,somegroup2' to log in as user 'someuser' but with your groups
reported as 'somegroup1' and 'somegroup2' (you will *not* be reported as a member of 'packagers'
or 'fedora-contributors' in this case). You can also take advantage of the 'user is a member of
the group with the same name' mechanism, e.g. by logging in as 'provenpackager' to be reported as
a member of the 'provenpackager' group.

As mentioned above, switching users can be a bit tricky, as Ipsilon likes to cache the session
(this is sort of what it's supposed to do, after all). To switch users, log out, run ``./bcd cis``,
then log in again. If things get really messy you may need to stop and remove the bodhi and ipsilon
containers to get back to a clean state.

Quick tips about the BCD environment
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

You can shell into the running Bodhi container like this::

# Make sure your bodhi checkout is your shell's cwd
$ ./bcd shell

Note the container must be running, or this will fail. Once you are inside the development
environment, there are a helpful set of commands in your ``.bashrc`` that will be printed to the
screen via the ``/etc/motd`` file. These work exactly as documented in :ref:`the Vagrant doc <vagrant-tips>`,
except that ``bci`` is not available in this environment (as we can't nest containers like that).
15 changes: 5 additions & 10 deletions develop/_sources/developer/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,13 @@ that runs ``sudo devel/ci/bodhi-ci`` for you.
Create a Bodhi development environment
======================================

There are two ways to bootstrap a Bodhi development environment. You can use Vagrant, or you can use
virtualenv on an existing host. `Vagrant`_ allows contributors to get quickly up and running with a
Bodhi development environment by automatically configuring a virtual machine. `Virtualenv`_ is
a more manual option for building a development environment on an existing system. If you aren't
sure which development environment you would like to use, Vagrant is recommended as it get you a
working system more quickly and with less effort. If you would like to use Vagrant, see the
:doc:`Bodhi Vagrant Guide <vagrant>`. If you would like to use Virtualenv, see the
:doc:`Bodhi Virtualenv Guide <virtualenv>`.
You can use Bodhi's "BCD" container-based development environment, or use Vagrant to create a VM-
based development environment. Using a local Python virtualenv is no longer supported. See the
:doc:`BCD Guide <bcd>` for instructions on using BCD, or the :doc:`Bodhi Vagrant Guide <vagrant>`
for instructions on using Vagrant.

If you use Vagrant, you can configure Visual Studio Code to run unit-tests inside with :doc:`Bodhi Vagrant - VS Code Guide <vagrant_vscode>`.
You can configure Visual Studio Code to run unit-tests inside with :doc:`Bodhi Vagrant - VS Code Guide <vagrant_vscode>`.

.. _docs/user/release_notes.rst: https://github.com/fedora-infra/bodhi/blob/develop/docs/user/release_notes.rst#release-notes
.. _type hints: https://docs.python.org/3/library/typing.html
.. _Vagrant: https://www.vagrantup.com
.. _Virtualenv: https://virtualenv.pypa.io/en/stable/
2 changes: 2 additions & 0 deletions develop/_sources/developer/vagrant.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ edit the ``fas_username`` variable in the Vagrantfile and re-provision the VM. B
not be a copy of your real fas account, it will just have the same username with the default password
``password`` and fake complementary data.

.. _vagrant-tips:

Quick tips about the Bodhi Vagrant environment
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -114,3 +115,4 @@ the host::

If you wish to use a custom ``Vagrantfile``, you can set the environment variable
``VAGRANT_VAGRANTFILE`` as a path to a script.

Loading

0 comments on commit 7a28a5a

Please sign in to comment.