opendatahub-io / ai-edge

ODH integration with AI at the Edge usecases
Apache License 2.0
9 stars 18 forks source link

RHOAIENG-203: Use ArgoCD pull controller integration for GitOps #192

Closed grdryn closed 8 months ago

grdryn commented 8 months ago

JIRA: https://issues.redhat.com/browse/RHOAIENG-203

Description

This change moves the GitOps machinery from the ACM AppSubscription model that was used here before, to ACM's integration with the ArgoCD/OpenShift Pipelines pull controller. No changes are needed in the referenced gitops repositories.

How Has This Been Tested?

I've added some kustomize tests to validate that all modifications occur as expected. These can be checked by witnessing that the following command exits with a return code of 0:

kustomize build acm/registration/near-edge/test/

I have also verified that both examples deploy as expected, and can be deleted as expected also. This can be done using the following command:

oc apply -k acm/registration/

and then once satisfied, deletion can be achieved using the following:

oc delete -k acm/registration/

I also tested that ACM section in DEVELOPMENT.md, and associated changes to Makefile and YAML files, works as expected.

Merge criteria:

openshift-ci[bot] commented 8 months ago

Skipping CI for Draft Pull Request. If you want CI signal for your change, please convert it to an actual PR. You can still manually trigger a test run with /test all

openshift-ci[bot] commented 8 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: grdryn

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/opendatahub-io/ai-edge/blob/main/OWNERS)~~ [grdryn] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
openshift-ci-robot commented 8 months ago

@grdryn: This pull request references RHOAIENG-203 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set.

In response to [this](https://github.com/opendatahub-io/ai-edge/pull/192): >JIRA: https://issues.redhat.com/browse/RHOAIENG-203 > >## Description >This change moves the GitOps machinery from the ACM AppSubscription model that was used here before, to ACM's integration with the ArgoCD/OpenShift Pipelines pull controller. No changes are needed in the referenced gitops repositories. > >## How Has This Been Tested? > > > >I've added some kustomize tests to validate that all modifications occur as expected. These can be checked by witnessing that the following command exits with a return code of 0: >``` >kustomize build acm/registration/near-edge/test/ >``` > >I have also verified that both examples deploy as expected, and can be deleted as expected also. This can be done using the following command: >``` >oc apply -k acm/registration/ >``` >and then once satisfied, deletion can be achieved using the following: >``` >oc delete -k acm/registration/ >``` > >I also tested that ACM section in DEVELOPMENT.md, and associated changes to Makefile and YAML files, works as expected. > >## Merge criteria: > > > >- [x] The commits are squashed in a cohesive manner and have meaningful messages. >- [x] Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious). >- [x] The developer has manually tested the changes and verified that the changes work > Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
LaVLaS commented 8 months ago

@grdryn Is the use of the {{name}} intended to be replaced by kustomize or some other command?

When I run kustomize build acm/registration/near-edge/test/, the ApplicationSet as the following for the annotation and labels

      annotations:                                                                                    
        apps.open-cluster-management.io/ocm-managed-cluster: '{{name}}'
        apps.open-cluster-management.io/ocm-managed-cluster-app-namespace: openshift-gitops
        argocd.argoproj.io/skip-reconcile: "true"
      labels:                                  
        apps.open-cluster-management.io/pull-to-ocm-managed-cluster: "true"
      name: '{{name}}-tensorflow-housing-app'   
grdryn commented 8 months ago

Is the use of the {{name}} intended to be replaced by kustomize or some other command?

@LaVLaS That's intended to be replaced at run time rather than build time: the ApplicationSet controller will create an Applications based on the template specified in the ApplicationSet, one per cluster. It will generate a list of cluster details based on the config specified in the "generators" section of the ApplicationSet spec, and replace those template parameters with values from the cluster details in the list.

Here's some more info: https://github.com/argoproj/argo-cd/blob/3224102664b747e88e7330e59b3b44bc9c28cd66/docs/operator-manual/applicationset/index.md#parameter-substitution-into-templates

and: https://access.redhat.com/documentation/en-us/red_hat_advanced_cluster_management_for_kubernetes/2.9/html/gitops/gitops-overview#crd-pull-model

LaVLaS commented 8 months ago

/lgtm