Skip to content

Commit

Permalink
adjust for version 0.18.0 (#144)
Browse files Browse the repository at this point in the history
* adjust for version 0.18.0

* adjust the action deploy-test.yml

* TZ mandantory

* remove the unnecessary charts

* add grafana enabled switch

* set autocreatesecret

* make grafana datasource a configmap that can be imported by grafana sidecar

* add mysql auth secret to grafana env

* adjust HelmSetup

* add grafana-piechart-panel plugins

* adjust the validate

* adjust the README for upgrade note

* adjust the README for upgrade note

* adjust the README for upgrade note

* adjust the README for upgrade note

* adjust the validate fail msg

* adjust the validate fail message

* remove the unneeded file which was pushed by mistake

* adjust README

* adjust readme

* adjust readme

* adjust readme

* use envFromSecrets instead of envFromSecret

* adjust the grafana dashboards

* cp grafana env from lake grafana dockerfile

* add debug info for deploy test

* enable ci manual trigger

* remove debug

* split the grafana dashboards to multiple configmaps

* remove empty line

* enable grafana dashboard sidecar
  • Loading branch information
ZhangNing10 authored Jul 14, 2023
1 parent ceebfcf commit 47d4b97
Show file tree
Hide file tree
Showing 50 changed files with 2,523 additions and 1,064 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ on:
- charts/devlake/**
- .github/workflows/deploy-test.yml
- "!**.md"
workflow_dispatch:

jobs:
deploy-with-helm:
Expand Down Expand Up @@ -66,7 +67,7 @@ jobs:
--set service.uiPort=30000 \
--set mysql.useExternal=true \
--set mysql.externalServer=mysql \
--set option.localtime=""
--set lake.encryptionSecret.secret=$(openssl rand -base64 2000 | tr -dc 'A-Z' | fold -w 128 | head -n 1)
kubectl get pods -o wide
kubectl get services -o wide
Expand All @@ -80,7 +81,7 @@ jobs:
helm install --wait --timeout 300s deploy-test charts/devlake \
--set service.uiPort=30000 \
--set mysql.image.tag=8-debian \
--set option.localtime=""
--set lake.encryptionSecret.secret=$(openssl rand -base64 2000 | tr -dc 'A-Z' | fold -w 128 | head -n 1)
kubectl get pods -o wide
kubectl get services -o wide
Expand Down
133 changes: 71 additions & 62 deletions HelmSetup.md

Large diffs are not rendered by default.

16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ helm install devlake devlake/devlake
```shell
helm repo add devlake https://apache.github.io/incubator-devlake-helm-chart
helm repo update
helm install devlake devlake/devlake --version=0.17.0-beta13
ENCRYPTION_SECRET=$(openssl rand -base64 2000 | tr -dc 'A-Z' | fold -w 128 | head -n 1)
helm install devlake devlake/devlake --version=0.18.0-beta1 --set lake.encryptionSecret.secret=$ENCRYPTION_SECRET
```

If you are using minikube inside your mac, please use the following command to forward the port:
Expand All @@ -55,11 +56,20 @@ Then you can visit:
config-ui by url `http://YOUR-NODE-IP:30090`
grafana by url `http://YOUR-NODE-IP:30091`

## Update
## Upgrade

Note:
If you're upgrading from DevLake v0.17.x or earlier versions to v0.18.x or later versions:

1. Copy the ENCODE_KEY value from /app/config/.env of the lake pod (e.g. devlake-lake-0), and replace the <ENCRYPTION_SECRET> in the upgrade command below.

2. You may encounter the below error when upgrading because the built-in grafana has been replaced by the official grafana dependency. So you may need to delete the grafana deployment first.

> Error: UPGRADE FAILED: cannot patch "devlake-grafana" with kind Deployment: Deployment.apps "devlake-grafana" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app.kubernetes.io/instance":"devlake", "app.kubernetes.io/name":"grafana"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable
```shell
helm repo update
helm upgrade --install devlake devlake/devlake --version=0.17.0-beta13
helm upgrade --install devlake devlake/devlake --version=0.18.0-beta1 --set lake.encryptionSecret.secret=<ENCRYPTION_SECRET>
```

## Uninstall
Expand Down
4 changes: 2 additions & 2 deletions charts/devlake/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ dependencies:
- name: grafana
repository: https://grafana.github.io/helm-charts
version: 6.56.6
digest: sha256:cbe6f07dc05e6699e46ce6da0db5eb937bd3c6203f6a19fc8adcf72f9f7005fb
generated: "2023-05-28T13:53:10.903912+08:00"
digest: sha256:1542c49419e0dc22b2483b1209f102bd669f53c5321d9180152fe3485a6d51e7
generated: "2023-07-06T21:44:11.0947005+08:00"
7 changes: 4 additions & 3 deletions charts/devlake/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ keywords:
type: application

# Chart version
version: 0.17.0-beta13
version: 0.18.0-beta1

# devlake version
appVersion: v0.17.0-beta13
appVersion: v0.18.0-beta1

dependencies:
- name: grafana
- condition: grafana.enabled
name: grafana
version: "6.56.6"
repository: "https://grafana.github.io/helm-charts"
574 changes: 337 additions & 237 deletions charts/devlake/dashboards/DORAByTeam.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions charts/devlake/dashboards/EngineeringOverview.json
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
"rawSql": "select\n count(*)\nfrom\n lake.pull_requests pr\n join project_mapping pm on pr.base_repo_id = pm.row_id\nwhere\n pr.merged_date is not null \n and date(pr.merged_date) between\n STR_TO_DATE('$month','%Y-%m-%d')\n and STR_TO_DATE('$month','%Y-%m-%d') + INTERVAL 1 MONTH - INTERVAL 1 DAY \n and pm.project_name in ($project);",
"rawSql": "select\n count(*)\nfrom\n lake.pull_requests pr\n join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' \nwhere\n pr.merged_date is not null \n and date(pr.merged_date) between\n STR_TO_DATE('$month','%Y-%m-%d')\n and STR_TO_DATE('$month','%Y-%m-%d') + INTERVAL 1 MONTH - INTERVAL 1 DAY \n and pm.project_name in ($project);",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -930,7 +930,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
"rawSql": "with _merged_prs as(\n select\n DATE_ADD(date(pr.merged_date), INTERVAL -DAY(date(pr.merged_date))+1 DAY) as time,\n count(*) as pr_merged_count\n from\n lake.pull_requests pr\n join project_mapping pm on pr.base_repo_id = pm.row_id\n where\n pm.project_name in ($project)\n and pr.merged_date is not null\n and $__timeFilter(pr.merged_date)\n and pr.merged_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by time\n)\n\nselect\n date_format(time,'%M %Y') as month,\n pr_merged_count\nfrom _merged_prs\norder by time asc",
"rawSql": "with _merged_prs as(\n select\n DATE_ADD(date(pr.merged_date), INTERVAL -DAY(date(pr.merged_date))+1 DAY) as time,\n count(*) as pr_merged_count\n from\n lake.pull_requests pr\n join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' \n where\n pm.project_name in ($project)\n and pr.merged_date is not null\n and $__timeFilter(pr.merged_date)\n and pr.merged_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by time\n)\n\nselect\n date_format(time,'%M %Y') as month,\n pr_merged_count\nfrom _merged_prs\norder by time asc",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -1016,7 +1016,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
"rawSql": "select \n 100*sum(case when id in (select pull_request_id from pull_request_issues) then 1 else 0 end)/count(*) as unlinked_pr_rate\nfrom lake.pull_requests pr\njoin project_mapping pm on pr.base_repo_id = pm.row_id\nwhere pm.project_name in ($project)",
"rawSql": "select \n 100*sum(case when id in (select pull_request_id from pull_request_issues) then 1 else 0 end)/count(*) as unlinked_pr_rate\nfrom lake.pull_requests pr\njoin project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' \nwhere pm.project_name in ($project)",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -1121,7 +1121,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
"rawSql": "select\n DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 DAY) as time,\n 100*sum(case when id in (select pull_request_id from pull_request_issues) then 1 else 0 end)/count(*) as unlinked_pr_rate\nfrom lake.pull_requests pr\njoin project_mapping pm on pr.base_repo_id = pm.row_id\nwhere pm.project_name in ($project)\nand $__timeFilter(created_date)\nand created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\ngroup by time\n\n",
"rawSql": "select\n DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 DAY) as time,\n 100*sum(case when id in (select pull_request_id from pull_request_issues) then 1 else 0 end)/count(*) as unlinked_pr_rate\nfrom lake.pull_requests pr\njoin project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' \nwhere pm.project_name in ($project)\nand $__timeFilter(created_date)\nand created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\ngroup by time\n\n",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -1392,7 +1392,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
"rawSql": "select\n AVG(TIMESTAMPDIFF(MINUTE, pr.created_date, pr.merged_date) / 1440)\nfrom\n lake.pull_requests pr\n join project_mapping pm on pr.base_repo_id = pm.row_id\nwhere\n pm.project_name in ($project) and\n pr.merged_date is not null\n and date(pr.created_date) between\n STR_TO_DATE('$month','%Y-%m-%d') \n and STR_TO_DATE('$month','%Y-%m-%d') + INTERVAL 1 MONTH - INTERVAL 1 DAY",
"rawSql": "select\n AVG(TIMESTAMPDIFF(MINUTE, pr.created_date, pr.merged_date) / 1440)\nfrom\n lake.pull_requests pr\n join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' \nwhere\n pm.project_name in ($project) and\n pr.merged_date is not null\n and date(pr.created_date) between\n STR_TO_DATE('$month','%Y-%m-%d') \n and STR_TO_DATE('$month','%Y-%m-%d') + INTERVAL 1 MONTH - INTERVAL 1 DAY",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -1499,7 +1499,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
"rawSql": "select\n DATE_ADD(date(pr.created_date), INTERVAL -DAY(date(pr.created_date))+1 DAY) as time,\n AVG(TIMESTAMPDIFF(MINUTE, pr.created_date, pr.merged_date) / 1440) as pr_cycle_time_in_days\nfrom\n lake.pull_requests pr\n join project_mapping pm on pr.base_repo_id = pm.row_id\nwhere\n pm.project_name in ($project) and\n pr.merged_date is not null\n and $__timeFilter(pr.created_date)\n and pr.created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\ngroup by time\norder by time",
"rawSql": "select\n DATE_ADD(date(pr.created_date), INTERVAL -DAY(date(pr.created_date))+1 DAY) as time,\n AVG(TIMESTAMPDIFF(MINUTE, pr.created_date, pr.merged_date) / 1440) as pr_cycle_time_in_days\nfrom\n lake.pull_requests pr\n join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' \nwhere\n pm.project_name in ($project) and\n pr.merged_date is not null\n and $__timeFilter(pr.created_date)\n and pr.created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\ngroup by time\norder by time",
"refId": "A",
"select": [
[
Expand Down
Loading

0 comments on commit 47d4b97

Please sign in to comment.