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

Update CONTRIBUTING.md to represent the recent build dependencies #408

Merged
merged 5 commits into from
Apr 18, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 36 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ this operator.
- Generally, before developing enhancements to this charm, you should consider [opening an issue
](https://github.com/canonical/postgresql-operator/issues) explaining your use case.
- If you would like to chat with us about your use-cases or proposed implementation, you can reach
us at [public Canonical Data Platform channel](https://chat.charmhub.io/charmhub/channels/data-platform)
or [Discourse](https://discourse.charmhub.io/).
us using any channel from our [Contacts](https://charmhub.io/postgresql/docs/r-contacts).
- Familiarising yourself with the [Charmed Operator Framework](https://juju.is/docs/sdk) library
will help you a lot when working on new features or bug fixes.
- All enhancements require review before being merged. Code review typically examines
Expand Down Expand Up @@ -40,13 +39,45 @@ tox # runs 'lint' and 'unit' environments

## Build charm

Build the charm in this git repository using:
The build environment assumes that there are preinstalled on the system:
* [tox](https://tox.wiki/) (version 4+ !!!)
* [poetry](https://python-poetry.org/)
* [charmcraft](https://snapcraft.io/charmcraft)
* [charmcraftcache](https://pypi.org/project/charmcraftcache/)
taurus-forever marked this conversation as resolved.
Show resolved Hide resolved
* [pipx](https://python.land/virtual-environments/pipx)
taurus-forever marked this conversation as resolved.
Show resolved Hide resolved
* [libpq-dev](https://www.postgresql.org/docs/current/libpq.html)

To build the charm it is also necessary at least 5GB if free disk space and
taurus-forever marked this conversation as resolved.
Show resolved Hide resolved
it is recommended to provide 4+ CPU cores and 8GB+ RAM for a decent build speed.

To install all above build dependencies (assuming you are on Ubuntu 22.04 LTS):

```shell
tox run -e build-dev
sudo snap install charmcraft --classic

sudo snap install lxd # should be pre-installed on 22.04
lxd init --auto # init LXD (if never used earlier)

sudo apt update && sudo apt install --yes libpq-dev pipx
taurus-forever marked this conversation as resolved.
Show resolved Hide resolved

sudo apt purge tox # if old tox version is installed from apt

pipx install tox
pipx install poetry
pipx install charmcraftcache
pipx ensurepath
taurus-forever marked this conversation as resolved.
Show resolved Hide resolved
```

The tox build environment assumes that there is a preinstalled [poetry](https://python-poetry.org/) on the system.
Ensure local pip binaries are in your $PATH (otherwise re-login to your shell):
```shell
charmcraftcache --help
```

Build the charm (inside this Git repository):

```shell
tox run -e build-dev
```

### Deploy

Expand Down
Loading