incubator-devlake icon indicating copy to clipboard operation
incubator-devlake copied to clipboard

[Feature] ArgoCD Integration

Open 1ddo opened this issue 2 years ago • 66 comments

Search before asking

  • [X] I had searched in the issues and found no similar feature requirement.

Use case

Most of our CD are done with Kubernetes ArgoCD and we wanted to add this data connection to DevLake so we could leverage DORA for our deployment frequency.

Description

Add Kubernetes ArgoCD as new data connection to DevLake

Related issues

No response

Are you willing to submit a PR?

  • [X] Yes I am willing to submit a PR!

Code of Conduct

1ddo avatar May 16 '23 09:05 1ddo

hi @1ddo, thank you for your report.

We have received your information and will consider your needs.

mintsweet avatar May 17 '23 06:05 mintsweet

@1ddo Hi, I see you checked the Yes I am willing to submit a PR!, would you like to work on it? If so, we could assign the issue to you and you can start working on it.

klesh avatar May 18 '23 04:05 klesh

Hi @klesh , I'm currently working on it locally, I'm new to this stuff and I'm having difficulty in making devlake work locally in windows. Was able to run the components in Docker Windows however I'm getting API Down in the config UI (localhost:4000), the tutorial said just wait for a few minutes to let the API up and running but mines seems not working. Do you have any more docs on setting devlake locally using windows or any docs that could help me speed things up?

1ddo avatar May 18 '23 05:05 1ddo

@1ddo Hi, I'm using Windows too because of Feishu(Good collaborative software but lousy Linux support). Sadly, development in Native Windows is not supported, I am using WSL2, which is practically an Ubuntu Linux environment in conjunction with VSCode Remote WSL plugin, you may take a look, it is a far superior development experience than Native Windows.

klesh avatar May 18 '23 06:05 klesh

Hi @klesh, thanks for the advice. Will try to set up a WSL2

1ddo avatar May 18 '23 11:05 1ddo

Hi @klesh , do you know the reason why I don't have a Project menu in my config-ui:4000? I only see Data Connections, Blue Print, Disabled button for Connection and Dashboard menu options?

1ddo avatar May 18 '23 16:05 1ddo

@1ddo It should be that your version is not the latest, you can use v0.17.0-beta5 version, the installation method can refer to here: https://devlake.apache.org/docs/next/GettingStarted/DockerComposeSetup

abeizn avatar May 19 '23 01:05 abeizn

Hi @klesh , do you know the reason why I don't have a Project menu in my config-ui:4000? I only see Data Connections, Blue Print, Disabled button for Connection and Dashboard menu options?

How did you launch devlake backend and config-ui ? Were you using the docker version for the config-ui?

klesh avatar May 19 '23 08:05 klesh

I've been working all day with the upgrade, by default the version value for the config-ui, grafana and devlake is set to "latest" then I replaced it with the version "v0.17.0-beta5" then ran docker-compose up -d but after that I encountered lots of issues one after another like token, certificate issue, installing grafana cli and others. Till now I'm working with those issues. Did you encounter this issue before? I'm using WSL Ubuntu by the way.

Here's one of the issue I'm getting:

failed to solve: failed to fetch anonymous token: Get "https://auth.docker.io/token?scope=repository%3Alibrary%2Fpython%3Apull&service=registry.docker.io": tls: failed to verify certificate: x509: certificate signed by unknown authority

For the Docker, I've connected my Docker Desktop to WSL Ubuntu and I have the latest Docker Desktop version and was able to run the 4 components (devlake, mysql, config-ui, grafana) but since I'm currently upgrading it to the latest version I haven't tried to run them again since I have a bunch of issues to work on.

1ddo avatar May 19 '23 14:05 1ddo

I'm also interested in the ArgoCD connection

BrookeKatalon avatar May 19 '23 14:05 BrookeKatalon

Hi @BrookeKatalon, are you willing to contribute with the ArgoCD development? If yes then we could collab with it.

1ddo avatar May 19 '23 14:05 1ddo

@1ddo I'm confused, are you trying to code for devlake or just use it to collect and observe data? For the former, you don't need the docker-compose for bringing up devlake and config-ui, please follow this guide to setup the Development Env https://devlake.apache.org/docs/next/DeveloperManuals/DeveloperSetup For the latter, don't use the docker-compose.yml from the repo, download the one from the release page.

The error message seems like a network problem

klesh avatar May 22 '23 09:05 klesh

Hi @klesh , we need both since we need collect Data and observed data from ArgoCD but since it's not yet supported then we need to integrate it with DevLake. So don't we need to make DevLake work locally first before start coding, that way we could verify/test it later?

1ddo avatar May 22 '23 10:05 1ddo

This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.

github-actions[bot] avatar Jun 22 '23 00:06 github-actions[bot]

This issue has been closed because it has not received response for too long time. You could reopen it if you encountered similar problems in the future.

github-actions[bot] avatar Jun 29 '23 00:06 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.

github-actions[bot] avatar Aug 14 '23 00:08 github-actions[bot]

What's the status on this?

klemen-df avatar Sep 18 '23 07:09 klemen-df

@KlemenDanfoss Under discussion, no plan or volunteer at this point AFAIK 😂

klesh avatar Sep 19 '23 05:09 klesh

a requirement for the pluginshould be to support argocd multisource applications. Currently devlake takes in one value for repo_url. For argocd apps with mulitple sources the repourl returns a list of multiple repoURL's

gespi1 avatar Sep 27 '23 19:09 gespi1

Hi @klesh ,we have a scenario with ArgoCD too. We have multiple repos for a single project and then a single team repo . Team repo has image version and from here ArgoCD takes up image versions and do its deployment. So only this team repo's main HEAD commit_sha gets noted in Devlake production deployment from ArgoCD webhook .

We would like to know how Devlake can club multiple repo deployments into a single deployment . In our case , there shall be multiple github repo in a Devlake project and a team repo present in multiple Devlake projects. Plus ArgoCD linked to a single team repo's main branch's HEAD commit only . Could you please suggest a project configuration for us ?

Like clubbing of multiple deployments into one as shown here in blue one .

pratiyush05 avatar Nov 07 '23 06:11 pratiyush05

@pratiyush05 you may create deployment via the webhook plugin , but it actually are creating cicd_deployment_commit records at the moment. We are planning to support multiple repos in the near future by https://github.com/apache/incubator-devlake/issues/6262

klesh avatar Nov 07 '23 07:11 klesh

Hi @klesh Screenshot 2023-11-07 at 4 56 27 PM Above diagram shows our current setup . So we would need to add github data connection in this way format - Devlake_Proj_1 - Github Repo_1 + Repo_7 Devlake_Proj_2 - Github Repo_2 + Repo_7 Devlake_Proj_3 - Github Repo_3 + Repo_7 Devlake_Proj_4 - Github Repo_4 + Repo_7 ... total 6 Devlake_projs

My query is how to get deployments of Repo_1 to Repo_6 in their Devlake projects , so that the graph "Median Lead Time to Change" correctly get deployments related to a project . ArgoCD can send commits of Repo_7 only . Since that graph first finds deployments in repos , then the commits and PRs of those commits . So we would need commits from Repo_1 to Repo_6 in Devlake as well .

We are not using Github actions for deployment , so we cannot track deployment in github plugin itself .

pratiyush05 avatar Nov 07 '23 11:11 pratiyush05

Any idea when can this be releasesd for integration with argocd?

nirmaljeet-singh-groww avatar Dec 27 '23 08:12 nirmaljeet-singh-groww

hi, i am willing to help in getting argocd supported. currently, we have a mixed setup. for scm we uses azure repo. for CD, we uses both ArgoCD and Azure DevOps .. with argocd, planning to do https://argocd-notifications.readthedocs.io/en/stable/services/webhook/#send-form-data ..is this the right way to go about it?

thiDucTran avatar Feb 20 '24 08:02 thiDucTran

@thiDucTran I think we should add an ArgoCD plugin and collect deployments(and other data) from ArgoCD, then we can combine data from AzureDevops and ArgoCD into one dashboard with some SQL.

d4x1 avatar Feb 20 '24 08:02 d4x1

i think the issue, for us, is that our ArgoCD auto sync and deploys based on non-application repos (basically whenever argocd see changes to our kustomize overlays)... meaning there needs to be a way to correlate the fact that an ArgoCD deployment was a deployment of which app, which commit of that app etc..

thiDucTran avatar Feb 20 '24 09:02 thiDucTran

Can Applications in ArgoCD be related to Azure Repos ?

d4x1 avatar Feb 20 '24 09:02 d4x1

In my opinion, to use ArgoCD, DevLake needs to make a relationship between deployment repository commit (for manifests) and application repository commit (for source codes).

YuseopKim avatar Feb 21 '24 13:02 YuseopKim

@YuseopKim We need a separate repo to host ArgoCD stuff, right? We can create one if someone is interested in working on it.

klesh avatar Feb 22 '24 00:02 klesh

In my opinion, to use ArgoCD, DevLake needs to make a relationship between deployment repository commit (for manifests) and application repository commit (for source codes).

im thinking about the same. one way that i can think of is this flow:

  1. CI tool (jenkins, tekton, any CI tool) builds from application repo and produces new docker image. the same CI tool would create a PR to update deployment repo (update manifests to use new docker image); when creating the PR ...we can put the commit hash of the app's repo some where..part of the docker image's tag ..part of the PR's name? this is because when ArgoCD deploys the new docker image ..upon deployment completion, ArgoCD can do some parsing to get the app repo's commit hash and POST it to devlake via webhook?

thiDucTran avatar Feb 22 '24 07:02 thiDucTran