Skip to content

Commit

Permalink
PMM-7 Updates due to pmm-update move to pmm repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Kralik committed Dec 8, 2022
1 parent f20f73e commit 9cdb1f3
Show file tree
Hide file tree
Showing 49 changed files with 143 additions and 2,321 deletions.
70 changes: 0 additions & 70 deletions .devcontainer/devcontainer.json

This file was deleted.

1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
/managed/ @BupycHuk @artemgavrilov @percona/pmm-review-be
/managed/services/dbaas @gen1us2k @percona-csalguero @percona/pmm-review-be
/managed/services/management/dbaas @gen1us2k @percona-csalguero @percona/pmm-review-be
/update/ @BupycHuk @atymchuk @talhabinrizwan
/api-tests/ @BupycHuk @artemgavrilov @percona/pmm-review-be
go.mod @BupycHuk @artemgavrilov @percona/pmm-review-be
1 change: 1 addition & 0 deletions .github/workflows/admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- "managed/**"
- "docs/**"
- "qan-api2/**"
- "update/**"
- "vmproxy/**"

workflow_call:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- "managed/**"
- "docs/**"
- "qan-api2/**"
- "update/**"
- "vmproxy/**"

workflow_call:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
uses: actions/checkout@v3

- name: API
uses: readmeio/rdme@7
uses: readmeio/rdme@v7
with:
rdme: openapi ./api/swagger/swagger.json --id=626badcabbc59c02acc1a53f --key=${{ secrets.README_TOKEN }}

- name: Markdown docs
uses: readmeio/rdme@7
uses: readmeio/rdme@v7
with:
rdme: docs docs/api --version=${{ github.event.inputs.version || 'v1.0' }} --key=${{ secrets.README_TOKEN }}
1 change: 1 addition & 0 deletions .github/workflows/managed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
- "agent/**"
- "docs/**"
- "qan-api2/**"
- "update/**"
- "vmproxy/**"

workflow_call:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/qan-api2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- "agent/**"
- "docs/**"
- "managed/**"
- "update/**"
- "vmproxy/**"

workflow_call:
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Update

on:
push:
branches:
- main
- pmm-*
tags:
- v[0-9]+.[0-9]+.[0-9]+*
pull_request:
paths-ignore:
- "admin/**"
- "agent/**"
- "docs/**"
- "managed/**"
- "qan-api2/**"
- "vmproxy/**"

jobs:
build:
name: Build

strategy:
fail-fast: false
matrix:
image:
- percona/pmm-server:2.0.0 # oldest production version
- percona/pmm-server:2.16.0 # version with enabled experimental repo
- percona/pmm-server:2 # latest production version
- perconalab/pmm-server:dev-latest # latest development version

env:
PMM_SERVER_IMAGE: ${{ matrix.image }}

runs-on: ubuntu-latest

defaults:
run:
working-directory: ${{ github.workspace }}/update

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Docker Up
run: docker-compose up -d

- name: Install dev tools in container
run: docker exec pmm-update-server /root/go/src/github.com/percona/pmm/update/.devcontainer/install-dev-tools.sh

- name: Run install
run: docker exec pmm-update-server make -C /root/go/src/github.com/percona/pmm/update install

- name: Run license check and ansible checks
run: docker exec pmm-update-server make -C /root/go/src/github.com/percona/pmm/update check

- name: Run tests
run: docker exec pmm-update-server make -C /root/go/src/github.com/percona/pmm/update test-race

- name: Run with race detector and collect coverage information
run: docker exec pmm-update-server make -C /root/go/src/github.com/percona/pmm/update run-race-cover RUN_FLAGS='-debug -check'

- name: Upload coverage results
uses: codecov/codecov-action@v3
with:
file: cover.out
flags: update
fail_ci_if_error: false
3 changes: 2 additions & 1 deletion .github/workflows/vmproxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ on:
paths-ignore:
- "admin/**"
- "agent/**"
- "managed/**"
- "docs/**"
- "managed/**"
- "qan-api2/**"
- "update/**"

workflow_call:
inputs:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ agent/agents/mysql/slowlog/parser/crashers/
agent/agents/mysql/slowlog/parser/suppressions/
agent/agents/mysql/slowlog/parser/parser-fuzz.zip

update/*.runcover.out
update/*.test

fuzzing/
*-fuzz.zip
*.bench
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This project is built from several repositories:
* [percona/pmm-managed](https://github.com/percona/pmm/tree/main/managed) manages configuration of PMM server components (VictoriaMetrics, Grafana, etc.) and exposes API for that. APIs are used by [pmm-admin](https://github.com/percona/pmm/tree/main/admin)
* [percona-platform/dbaas-controller](https://github.com/percona-platform/dbaas-controller) exposes a simplified API for managing Percona Kubernetes Operators.
* [percona/qan-api](https://github.com/percona/pmm/tree/main/qan-api2) query analytics API
* [percona/pmm-update](https://github.com/percona/pmm-update) is a tool for updating packages and OS configuration for PMM
* [percona/pmm-update](https://github.com/percona/pmm/tree/main/update) is a tool for updating packages and OS configuration for PMM

#### Frontends

Expand Down
2 changes: 1 addition & 1 deletion Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ clean: clean_swagger ## Remove generated files.
rm -f api/swagger/swagger.json api/swagger/swagger-dev.json api/swagger/swagger-dev-only.json

test-common: ## Run tests from API (and other shared) packages only (i.e it ignores directories that are explicitly listed).
go test $(shell go list ./... | grep -v -e admin -e agent -e managed -e api-tests -e qan-api2)
go test $(shell go list ./... | grep -v -e admin -e agent -e managed -e api-tests -e qan-api2 -e update)

api-test: ## Run API tests on dev env. Use `PMM_KUBECONFIG=/path/to/kubeconfig.yaml make api-test` to run tests for DBaaS.
go test -count=1 -race -p 1 -v ./api-tests/... -pmm.server-insecure-tls
Expand Down
17 changes: 10 additions & 7 deletions build/packages/rpm/server/SPECS/pmm-update.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
%define _binaries_in_noarch_packages_terminate_build 0
%define _unpackaged_files_terminate_build 0

%global repo pmm-update
%global repo pmm
%global provider github.com/percona/%{repo}
%global import_path %{provider}
%global commit 592eddf656bce32a11bd958af0a32c62bd5ea34c
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%define build_timestamp %(date -u +"%y%m%d%H%M")
%define release 66
%define release 67
%define rpm_release %{release}.%{build_timestamp}.%{shortcommit}%{?dist}

# the line below is sed'ed by build/bin/build-server-rpm to set a correct version
%define full_pmm_version 2.0.0

Name: %{repo}
Version: %{version}
Name: pmm-update
Version: %{full_pmm_version}
Release: %{rpm_release}
Summary: Tool for updating packages and OS configuration for PMM Server

Expand All @@ -42,16 +42,16 @@ export PMM_RELEASE_VERSION=%{full_pmm_version}
export PMM_RELEASE_FULLCOMMIT=%{commit}
export PMM_RELEASE_BRANCH=""

cd src/github.com/percona/pmm-update
cd src/github.com/percona/pmm/update
make release


%install
install -d %{buildroot}%{_datadir}/%{name}
cp -pav ./ansible %{buildroot}%{_datadir}/%{name}
cp -pav ./update/ansible %{buildroot}%{_datadir}/%{name}

install -d %{buildroot}%{_sbindir}
cd src/github.com/percona/pmm-update
cd src/github.com/percona/pmm/update
install -p -m 0755 bin/pmm-update %{buildroot}%{_sbindir}/


Expand All @@ -63,6 +63,9 @@ install -p -m 0755 bin/pmm-update %{buildroot}%{_sbindir}/


%changelog
* Thu Dec 8 2022 Michal Kralik <[email protected]> - 2.34.0-67
- PMM-11207 Migrate pmm-update to monorepo

* Mon May 16 2022 Nikita Beletskii <[email protected]> - 2.29.0-1
- https://per.co.na/pmm/latest

Expand Down
2 changes: 1 addition & 1 deletion build/scripts/build-server-rpm-all
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -o xtrace
${bin_dir}/build-server-rpm percona-dashboards grafana-dashboards
${bin_dir}/build-server-rpm pmm-managed pmm
${bin_dir}/build-server-rpm percona-qan-api2 pmm
${bin_dir}/build-server-rpm pmm-update
${bin_dir}/build-server-rpm pmm-update pmm
${bin_dir}/build-server-rpm dbaas-controller
${bin_dir}/build-server-rpm dbaas-tools
${bin_dir}/build-server-rpm pmm-dump
Expand Down
1 change: 0 additions & 1 deletion build/scripts/create-tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
REPOS = [
"sources/grafana/src/github.com/grafana/grafana",
"sources/grafana-dashboards",
"sources/pmm-update/src/github.com/percona/pmm-update",
"sources/pmm/src/github.com/percona/pmm",
".",
]
Expand Down
2 changes: 1 addition & 1 deletion docs/managed/update-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Update of PMM Server which includes `managed` and other components is triggered by sending a [StartUpdate](https://github.com/percona/pmm/blob/6761010b8b30042936c58c022752f6b57581afee/api/serverpb/server.proto#L325) message.
This performs the following actions:
1. Runs [pmm-update](https://github.com/percona/pmm-update) command to initiate an update
1. Runs [pmm-update](https://github.com/percona/pmm/tree/main/update) command to initiate an update
2. `pmm-update` first updates itself to the latest version and restarts
3. `pmm-update` then runs a set of Ansible tasks to update all other components

Expand Down
41 changes: 0 additions & 41 deletions update/.devcontainer/devcontainer.json

This file was deleted.

4 changes: 2 additions & 2 deletions update/.devcontainer/install-dev-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -o errexit
set -o xtrace

# download (in the background) the same verison as used by PMM build process
curl -sS https://dl.google.com/go/go1.17.8.linux-amd64.tar.gz -o /tmp/golang.tar.gz &
curl -sS https://dl.google.com/go/go1.19.4.linux-amd64.tar.gz -o /tmp/golang.tar.gz &

# to install man pages
sed -i '/nodocs/d' /etc/yum.conf
Expand Down Expand Up @@ -43,7 +43,7 @@ env GOPROXY=https://proxy.golang.org go get -v \
github.com/go-delve/delve/cmd/dlv@latest \
golang.org/x/tools/gopls@latest &

cd /root/go/src/github.com/percona/pmm-update
cd /root/go/src/github.com/percona/pmm
make init

fg || true
1 change: 0 additions & 1 deletion update/.github/CODEOWNERS

This file was deleted.

Loading

0 comments on commit 9cdb1f3

Please sign in to comment.