uffizzi icon indicating copy to clipboard operation
uffizzi copied to clipboard

Uffizzi Platform Add Github Container Registry Integration

Open 7R41N33 opened this issue 2 years ago • 9 comments

We need support for GHCR in the same way we have support for GCR, ACR etc Compose will need to support pulling images from GHCR - same integration functionality as the other registries

7R41N33 avatar Apr 13 '22 09:04 7R41N33

1. Can't add file with GHCR repo:

Example of the file:

services:
  webhooks-test-app:
    image: ghcr.io/nealarw/webhook-test-app:latest
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres

x-uffizzi-ingress:
  service: webhooks-test-app
  port: 80

x-uffizzi-continuous-preview:
  share_to_github: true
  delete_preview_after: 99h
  tag_pattern: uffizzi_request_*
  delete_preview_when_image_tag_is_updated: true
  deploy_preview_when_image_tag_is_created: true
  delete_preview_when_pull_request_is_closed: true
  deploy_preview_when_pull_request_is_opened: true

Result: image

2. What type of credentials should I connect to deploy from GHCR?

image

NealArw avatar Apr 21 '22 16:04 NealArw

https://gitlab.com/dualbootpartners/idyl/uffizzi_app/-/merge_requests/1040/diffs

sergeykirillovdb avatar May 23 '22 11:05 sergeykirillovdb

https://github.com/UffizziCloud/uffizzi_platform/pull/39

sergeykirillovdb avatar Jun 15 '22 13:06 sergeykirillovdb

Deploynig from GHCR from compose file does not work:

File:

services:
  webhooks-test-app:
    image: ghcr.io/nealarw/webhook-test-app:latest
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres

x-uffizzi-ingress:
  service: webhooks-test-app
  port: 80

x-uffizzi-continuous-preview:
  share_to_github: true
  delete_preview_after: 99h
  tag_pattern: uffizzi_request_*
  delete_preview_when_image_tag_is_updated: true
  deploy_preview_when_image_tag_is_created: true
  delete_preview_when_pull_request_is_closed: true
  deploy_preview_when_pull_request_is_opened: true  
image image

NealArw avatar Jun 20 '22 14:06 NealArw

https://github.com/UffizziCloud/uffizzi_platform/pull/39 - updated container image parsing https://github.com/UffizziCloud/uffizzi_app/pull/167 - in core the same

sergeykirillovdb avatar Jun 28 '22 13:06 sergeykirillovdb

:point_right: 1.

  • Push package into GHCR with latest tag
  • Add compose into Uffizzi
  • Push feature tag into GHCR (tag should start with uffizzi_request_)

Result: Deployment does not start.

services:
  webhooks-test-app:
    image: ghcr.io/nealarw/webhook-test-app:latest
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres

x-uffizzi-ingress:
  service: webhooks-test-app
  port: 80

x-uffizzi-continuous-preview:
  share_to_github: true
  delete_preview_after: 1h
  tag_pattern: uffizzi_request_*
  delete_preview_when_image_tag_is_updated: true
  deploy_preview_when_image_tag_is_created: true
  delete_preview_when_pull_request_is_closed: true
  deploy_preview_when_pull_request_is_opened: true
image

NealArw avatar Jun 30 '22 13:06 NealArw

Important !

Conditions to webhook packages working

  1. Github application has access to read packages (Permissions tab in the Github Application settings). Url example: https://github.com/organizations/UffizziCloud/settings/apps/uffizzi-dev/permissions Снимок экрана 2022-07-18 в 14 08 50
  2. Github application is subscribed to "Registry package" event. The same tab as 1. Снимок экрана 2022-07-18 в 14 10 26
  3. Package connected to the repository Снимок экрана 2022-07-18 в 14 12 46
  4. Repository has installed Github application Снимок экрана 2022-07-18 в 14 13 56

sergeykirillovdb avatar Jul 18 '22 10:07 sergeykirillovdb

TESTED - OK

image image image image

NealArw avatar Jul 18 '22 10:07 NealArw

TESTED on prod - OK

NealArw avatar Jul 18 '22 14:07 NealArw