UffizziCloud / uffizzi

Build self-serve developer platforms in minutes, not months with out-of-the-box Kubernetes multi-tenancy, virtual clusters, cloud-based dev environments, customizable templating, and more.
https://uffizzi.com
Apache License 2.0
325 stars 26 forks source link

Uffizzi Platform Add Github Container Registry Integration #59

Open 7R41N33 opened 2 years ago

7R41N33 commented 2 years ago

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

NealArw commented 2 years ago

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
sergeykirillovdb commented 2 years ago

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

sergeykirillovdb commented 2 years ago

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

NealArw commented 2 years ago

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
sergeykirillovdb commented 2 years ago

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

NealArw commented 2 years ago

:point_right: 1.

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
sergeykirillovdb commented 2 years ago

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
NealArw commented 2 years ago

TESTED - OK

image image image image
NealArw commented 2 years ago

TESTED on prod - OK