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

CSS-4546 - Backport Jimm ci/cd #961

Closed
wants to merge 206 commits into from
Closed

Conversation

kian99
Copy link
Contributor

@kian99 kian99 commented Jun 20, 2023

Description

This ticket was intended to backport JIMM's CI/CD from feature-rebac into main, but I went ahead and just merged all of feature-rebac and then proceeded to remove all the OpenFGA bits and other code changes, keeping only the changes that are common to both branches (i.e. charm changes, CI/CD, Dockerfile changes, etc.).

Going forward, I think any changes that are common to JIMM v1 main and v2 feature-rebac should land in main and then main can be merged into feature-rebac regularly. And then of course any v2 specific features go straight in feature-rebac.

Engineering checklist

Check only items that apply

  • Documentation updated
  • Covered by unit tests
  • Covered by integration tests

alesstimec and others added 30 commits December 5, 2022 16:36
CSS-2764 Added AddGroup method to the JIMM facade.
- added database method enabling us to rename a group
- added a JIMM facaed method to rename a group
- added a CLI command to rename a group
Upgraded all deps besides juju
* Local dev env (#867)

* Initial facade stubs

- Adds facade stubs
- Drags openfgaapi through to controller root
- TODO: apply auth model on start.

* Bump to 1.18 for generics.

* Update compose to connect successfully.

* WIP CreateStore

The client is a little funky and even though we give an 'Id',
it actually means 'Name'...

So we'll need to store our created store and name in DB
and crossreference on startup unfortunately.

* Add facade stubs

* Local env running

* Wrap ofga client

* Update for PR comments

* Update tests to look at compose

This updates the tests which use vault, openfga and postgres to target the docker-compose.

* Hotfix group table index

* Merge AddGroup facade

* Update README on how to locally develop & test

* Initial tests for OFGA wrapper

* Address comments

* Address further comments

* Test to see if CI updates per PR

* Build candid in CI

* Tab issue

* Enable buildkit

* Remove ssh flag

* Remove service container

* Commit approle.yaml "once" for CI to pickup on it

* Readjust gitignore

* Address comments
- added database method enabling us to rename a group
- added a JIMM facade method to rename a group
- added a CLI command to rename a group
…er-unavailable

CSS-2794 Fix test watcher set controller unavailable
OpenFGA relation for the JIMM machine charm.
alesstimec and others added 26 commits May 26, 2023 10:02
…ired-errors

proxy poc: Adding additional claims to the JWT
* Delete cmd/proxy package

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Update dependencies after removing cmd/proxy package

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

---------

Signed-off-by: babakks <babak.k.shandiz@canonical.com>
* Fix error channel loop/life-cycle

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Predicate JWKS key rotator enablement to env vars

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Enable JWKS key rotation for leader unit

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Enable JWKS key rotation for leader unit (k8s)

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Add `JIMM_ENABLE_JWKS_ROTATOR=1`

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Add `jimm_enable_jwks_rotator` to template args

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

---------

Signed-off-by: babakks <babak.k.shandiz@canonical.com>
If Vault is not present, we cannot create a JWKS service and JIMM would panic starting
the JWKS rotator.
If Vault is not present, we cannot create a JWKS service and JIMM would panic starting
the JWKS rotator.
* Update docs

* PR comments
K8s charm now has two separate relations:
- traefik_ingress, which can be used to relate to traefik
- ingress, which can be used to relate to nginx-ingress-integrator
CSS-4442 Adds nginx relation to the juju-jimm-k8s charm.
…n-library

Updated the openfga relation library for jimm charms.
* Added charm-release workflow

* Fixed machine charm tests

* linting fixes and removed generated test files

* Updated workflow runs-on

* Integration test takes localCharm option

- localCharm option allows an initial workflow to build the charm and a subsequent workflow to perform integration tests without rebuilding the charm

* Updated postgres deploy to trust=True

Changed charm OCI image name to match everywhere

* Commented integration test

---------

Co-authored-by: Ales Stimec <ales.stimec@canonical.com>
* Collect k8s charm libs

* Prom rules & Graf dashboard dirs with README's

* O11Y for JIMM-k8s

* Add machine relation to grafana agent

* New line

* Juju topology lib

* linting errors

* Linting

* Linting

* Update metadata

* Fix test deps
…m integration (#958)

* Rename database relation/interface

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Rename database relation/interface in tests

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Add `data_platform_libs` library

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Replace literal OpenFGA store name with const

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Update database relation name

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Replace database relation handling with `data_platforms_lib`

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Fix database event argument type annotation

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Replace literal database name with const

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Replace literal OpenFGA store name with const

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Add assertion for JWKS rotator env vars

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Add log to database relation broken event

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Update dependency description

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Update renamed database relation

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Apply formatting

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Fix snapcraft build errors

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Remove merge conflict remnants

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Apply linter suggestion

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Revert incorrect event-arg type

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Update tests to conform with `data_platform_libs`

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

---------

Signed-off-by: babakks <babak.k.shandiz@canonical.com>
* Update log entry

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Add upgrade test

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Apply linter suggestion

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

* Add `local_charm` support to upgrade test

Signed-off-by: babakks <babak.k.shandiz@canonical.com>

---------

Signed-off-by: babakks <babak.k.shandiz@canonical.com>
- Removed all openfga related code and config but kept all CI/CD, docker and other related improvements.
* Improved charm build speed

- Improved the k8s charms build time by removing unneeded dependencies.

* added more packages to build from binary
@kian99
Copy link
Contributor Author

kian99 commented Jun 21, 2023

To avoid polluting the git history of main, if we decide to merge this, we could do a squash and merge to bring it in as one commit and then avoid ever merging feature-rebac into main, and in the future only go main -> feature-rebac

@kian99 kian99 closed this Jun 21, 2023
@kian99
Copy link
Contributor Author

kian99 commented Jun 21, 2023

Closing this in favour of creating a separate PR that doesn't bring all of feature-rebac's changes into main. I'll also split it into 3 PRs,

  1. For just the CI/CD and automated release of the of the charms (though the CI/CD will be marked as ignore on error because the charms are missing tox files).
  2. A PR to bring in the charm changes and test them with JIMM in main.
  3. A PR for the remaining items like makefile changes, etc.

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.

4 participants