Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into observability-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Zvirovyi committed May 6, 2024
2 parents 4d2222b + 2c25228 commit 76437bc
Show file tree
Hide file tree
Showing 39 changed files with 6,225 additions and 3,406 deletions.
62 changes: 61 additions & 1 deletion .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>canonical/data-platform//renovate_presets/charm.json5"],
"reviewers": ["dragomirp", "marceloneppel", "taurus-forever"],
"reviewers": ["dragomirp", "lucasgameiroborges", "marceloneppel", "taurus-forever"],
"packageRules": [
// Later rules override earlier rules
{
Expand All @@ -10,6 +10,66 @@
}, {
"matchPackageNames": ["python"],
"allowedVersions": "<3.11"
},
{
"matchDepNames": ["Juju 2"],
"matchPackageNames": ["juju/juju"],
"allowedVersions": "<3.0.0",
"extractVersion": "^v(?<version>.*)$",
"groupName": "Juju 2"
},
{
"matchDepNames": ["Juju 3"],
"matchPackageNames": ["juju/juju"],
"allowedVersions": "<3.2.0",
"extractVersion": "^v(?<version>.*)$",
"groupName": "Juju 3"
},
{
"matchDepNames": ["libjuju 2"],
"matchPackageNames": ["juju"],
"matchManagers": ["regex"],
"matchDatasources": ["pypi"],
"versioning": "loose",
"allowedVersions": "<3",
"groupName": "Juju 2"
}
],
"regexManagers": [
{
"customType": "regex",
"fileMatch": ["^(workflow-templates|\\.github/workflows)/[^/]+\\.ya?ml$"],
"matchStrings": [
"(- agent: )(?<currentValue>.*?) +# renovate: latest juju 2"
],
"depNameTemplate": "Juju 2",
"packageNameTemplate": "juju/juju",
"datasourceTemplate": "github-releases",
"versioningTemplate": "loose",
"extractVersionTemplate": "Juju release"
},
{
"customType": "regex",
"fileMatch": ["^(workflow-templates|\\.github/workflows)/[^/]+\\.ya?ml$"],
"matchStrings": [
"(- agent: )(?<currentValue>.*?) +# renovate: latest juju 3"
],
"depNameTemplate": "Juju 3",
"packageNameTemplate": "juju/juju",
"datasourceTemplate": "github-releases",
"versioningTemplate": "loose",
"extractVersionTemplate": "Juju release"
},
{
"customType": "regex",
"fileMatch": ["^(workflow-templates|\\.github/workflows)/[^/]+\\.ya?ml$"],
"matchStrings": [
"(libjuju: )==(?<currentValue>.*?) +# renovate: latest libjuju 2"
],
"depNameTemplate": "libjuju 2",
"packageNameTemplate": "juju",
"datasourceTemplate": "pypi",
"versioningTemplate": "loose"
}
]
}
14 changes: 8 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
jobs:
lint:
name: Lint
uses: canonical/data-platform-workflows/.github/workflows/lint.yaml@v13.1.0
uses: canonical/data-platform-workflows/.github/workflows/lint.yaml@v13.1.2

unit-test:
name: Unit test charm
Expand All @@ -43,7 +43,7 @@ jobs:

build:
name: Build charm
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v13.1.0
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v13.1.2
with:
cache: true

Expand All @@ -52,17 +52,17 @@ jobs:
fail-fast: false
matrix:
juju:
- agent: 2.9.46
libjuju: ^2
- agent: 2.9.49 # renovate: latest juju 2
libjuju: ==2.9.46.1 # renovate: latest libjuju 2
allure: false
- agent: 3.1.7
- agent: 3.1.8 # renovate: latest juju 3
allure: true
name: Integration test charm | ${{ matrix.juju.agent }}
needs:
- lint
- unit-test
- build
uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v13.1.0
uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v13.1.2
with:
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
cloud: lxd
Expand All @@ -77,6 +77,8 @@ jobs:
"GCP_ACCESS_KEY": "${{ secrets.GCP_ACCESS_KEY }}",
"GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}",
"UBUNTU_PRO_TOKEN" : "${{ secrets.UBUNTU_PRO_TOKEN }}",
"LANDSCAPE_ACCOUNT_NAME": "${{ secrets.LANDSCAPE_ACCOUNT_NAME }}",
"LANDSCAPE_REGISTRATION_KEY": "${{ secrets.LANDSCAPE_REGISTRATION_KEY }}",
}
permissions:
contents: write # Needed for Allure Report beta
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ jobs:

build:
name: Build charm
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v13.1.0
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v13.1.2

release:
name: Release charm
needs:
- ci-tests
- build
uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v13.1.0
uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v13.1.2
with:
channel: 14/edge
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync_issue_to_jira.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
sync:
name: Sync GitHub issue to Jira
uses: canonical/data-platform-workflows/.github/workflows/sync_issue_to_jira.yaml@v13.1.0
uses: canonical/data-platform-workflows/.github/workflows/sync_issue_to_jira.yaml@v13.1.2
with:
jira-base-url: https://warthogs.atlassian.net
jira-project-key: DPE
Expand Down
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://github.com/canonical/charmcraftcache)
* [pipx](https://pipx.pypa.io/stable/installation/)
* [libpq-dev](https://www.postgresql.org/docs/current/libpq.html)

To build the charm it is also necessary at least 5GB of free disk space and
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

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

pipx ensurepath
pipx install tox
pipx install poetry
pipx install charmcraftcache
```

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
6 changes: 6 additions & 0 deletions actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ list-backups:
description: Lists backups in s3 storage.
pre-upgrade-check:
description: Run necessary pre-upgrade checks and preparations before executing a charm refresh.
promote-cluster:
description: Promotes the cluster of choice to a primary cluster. Must be ran against the leader unit.
params:
force-promotion:
type: boolean
description: Force the promotion of a cluster when there is already a primary cluster.
restore:
description: Restore a database backup using pgBackRest.
S3 credentials are retrieved from a relation with the S3 integrator charm.
Expand Down
Loading

0 comments on commit 76437bc

Please sign in to comment.