Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v3' into PMM-11079-remove-integr…
Browse files Browse the repository at this point in the history
  • Loading branch information
artemgavrilov committed Sep 28, 2023
2 parents 72534ea + bbb794f commit 8c69b4e
Show file tree
Hide file tree
Showing 914 changed files with 15,892 additions and 6,010 deletions.
27 changes: 11 additions & 16 deletions .devcontainer/setup.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#!/usr/bin/python2
#!/usr/bin/python3

# See CONTRIBUTING.md.

from __future__ import print_function, unicode_literals
import os
import subprocess
import time


GO_VERSION = os.getenv("GO_VERSION")
if GO_VERSION is None:
raise "GO_VERSION is not set"
raise RuntimeError("GO_VERSION is not set")


def run_commands(commands):
Expand All @@ -25,21 +24,16 @@ def install_packages():
"""Installs required and useful RPM packages."""

run_commands([
# to install man pages
"sed -i '/nodocs/d' /etc/yum.conf",

# reinstall with man pages
"yum reinstall -y yum rpm",

"yum install -y gcc git make pkgconfig glibc-static \
"dnf install -y gcc git make pkgconfig \
vim \
ansible-lint \
mc tmux psmisc lsof which iproute \
bash-completion bash-completion-extras \
bash-completion \
man man-pages \
dh-autoreconf \
openssl-devel \
wget"
wget",

"dnf install -y ansible-lint glibc-static --enablerepo=ol9_codeready_builder"

])


Expand All @@ -51,7 +45,7 @@ def install_go():
"chmod +x /usr/local/bin/gimme"
])

go_version = str(subprocess.check_output("gimme -r " + GO_VERSION, shell=True).strip())
go_version = str(subprocess.check_output("gimme -r " + GO_VERSION, shell=True).strip().decode())

if GO_VERSION == "tip":
run_commands([
Expand Down Expand Up @@ -105,7 +99,8 @@ def main():
make_init()

# do basic setup
setup()
# TODO: fix the setup and revert
# setup()


MARKER = "/tmp/devcontainer-setup-done"
Expand Down
5 changes: 0 additions & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
* @percona/pmm-review-be
/build/ @atymchuk @percona/pmm-review-be
/admin/ @percona/pmm-review-be
/agent/agents/postgres/ @JiriCtvrtka @percona/pmm-review-be
/agent/runner/ @artemgavrilov @percona/pmm-review-be
/api/ @BupycHuk @percona/pmm-review-be
/docs/api/ @atymchuk @percona/pmm-review-be
/managed/services/checks/ @idoqo @percona/pmm-review-be
/managed/ @percona/pmm-review-be
/managed/services/dbaas @gen1us2k @recharte @percona/pmm-review-be
/managed/services/management/dbaas @gen1us2k @recharte @percona/pmm-review-be
/update/ @BupycHuk @talhabinrizwan @percona/pmm-review-be
/api-tests/ @percona/pmm-review-be
**/go.mod @percona/pmm-review-dependency @percona/pmm-review-be
**/Dockerfile @percona/pmm-review-dependency @percona/pmm-review-be
/cli-tests/package.json @percona/pmm-review-dependency @yurkovychv
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

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

- name: Set up Go release
uses: actions/setup-go@v4
Expand Down Expand Up @@ -82,6 +82,7 @@ jobs:
cli-test:
name: CLI Tests
if: false
runs-on: ubuntu-22.04
strategy:
fail-fast: false
Expand All @@ -94,7 +95,7 @@ jobs:

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

- name: Set up Go release
uses: actions/setup-go@v4
Expand Down Expand Up @@ -126,7 +127,6 @@ jobs:

- name: Setup tools
run: |
sudo apt-get install -y wget jq
sudo ln -sf /home/runner/go/bin/pmm /usr/bin
sudo chown -R runner:docker /usr/bin/pmm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:

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

- name: Set up Go release
uses: actions/setup-go@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/clean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
go:
- version: 1.20.x
- version: 1.21.x
may-fail: false
- version: tip
may-fail: true
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV
echo "$HOME/gotip/bin" >> $GITHUB_PATH
- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
lfs: true

Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Dependabot
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
name: Enable auto-merge
runs-on: ubuntu-20.04
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
62 changes: 62 additions & 0 deletions .github/workflows/devcontainer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Devcontainer
on:
workflow_dispatch:
inputs:
branch:
description: "The branch to build the devcontainer from"
default: "main"
required: true
type: string
workflow_call:
inputs:
branch:
description: "The branch to build the devcontainer from"
default: "main"
required: true
type: string

jobs:
devcontainer:
name: Build
runs-on: ubuntu-22.04
timeout-minutes: 15
strategy:
fail-fast: false
permissions:
packages: write

env:
LAB_DEVCONTAINER_IMAGE: perconalab/pmm-server:dev-container
GH_DEVCONTAINER_IMAGE: ghcr.io/percona/pmm:dev-container

steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to ghcr.io registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to docker.io registry
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build and push to registries
uses: docker/build-push-action@v5
with:
file: ./devcontainer.Dockerfile
push: true
tags: |
${{ env.GH_DEVCONTAINER_IMAGE }}
${{ env.LAB_DEVCONTAINER_IMAGE }}
2 changes: 1 addition & 1 deletion .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: API
uses: readmeio/rdme@v8
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dockerhub-readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
environment: Production
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Update Docker Hub Readme for perconalab/pmm-server
uses: peter-evans/dockerhub-description@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

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

- name: Set up Go release
uses: actions/setup-go@v4
Expand Down
38 changes: 19 additions & 19 deletions .github/workflows/managed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ on:

pull_request:
paths-ignore:
- "admin/**"
- "agent/**"
- "api-tests/**"
- "cli-tests/**"
- "docs/**"
- "qan-api2/**"
- "update/**"
- "vmproxy/**"
- 'admin/**'
- 'agent/**'
- 'api-tests/**'
- 'cli-tests/**'
- 'docs/**'
- 'qan-api2/**'
- 'update/**'
- 'vmproxy/**'

jobs:
test:
Expand All @@ -36,7 +36,7 @@ jobs:

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

- name: Enable Go build cache
if: ${{ fromJSON(env.DEVCONTAINER_CACHE_ENABLED) }}
Expand All @@ -63,7 +63,7 @@ jobs:
popd && go mod download -x
- name: Initialize CI environment
run: make env-compose-up
run: make env-compose-up # the container workdir is /root/go/src/github.com/percona/pmm

- name: Restore Go build cache
if: ${{ fromJSON(env.DEVCONTAINER_CACHE_ENABLED) }}
Expand All @@ -75,14 +75,17 @@ jobs:
continue-on-error: true
run: docker cp ~/go/pkg/mod pmm-server:/root/go/pkg/mod

- name: Mark the root directory of pmm as safe
run: docker exec -i pmm-server git config --global --add safe.directory /root/go/src/github.com/percona/pmm

- name: Update binaries
run: docker exec -i --workdir=/root/go/src/github.com/percona/pmm pmm-server make run-managed-ci run-agent run-vmproxy
run: docker exec -i pmm-server make run-managed-ci run-agent run-vmproxy

- name: Run tests
run: docker exec -i --workdir=/root/go/src/github.com/percona/pmm/managed pmm-server make test-cover
run: docker exec -i pmm-server make -C managed test-cover

- name: Run PMM server update test
run: docker exec -i --workdir=/root/go/src/github.com/percona/pmm/managed pmm-server make test-update
run: docker exec -i pmm-server make -C managed test-update

- name: Upload coverage results
uses: codecov/codecov-action@v3
Expand All @@ -96,17 +99,14 @@ jobs:
if: ${{ fromJSON(env.DEVCONTAINER_CACHE_ENABLED) }}
run: |
docker exec pmm-server go clean -testcache
docker exec --workdir=/root/go/src/github.com/percona/pmm/managed pmm-server find . -type d -name fuzzdata -exec rm -r {} +
docker exec pmm-server find ./managed -type d -name fuzzdata -exec rm -r {} +
rm -fr ~/.cache/go-build
mkdir -p ~/.cache
docker cp pmm-server:/root/.cache/go-build ~/.cache/go-build
- name: Run debug commands on failure
if: ${{ failure() }}
run: |
env
go version
go env
pwd
env | sort
go env | sort
git status
kubectl version
2 changes: 1 addition & 1 deletion .github/workflows/qan-api2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go release
uses: actions/setup-go@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sbom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Create SBOM for PMM
uses: anchore/sbom-action@v0
Expand All @@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Create SBOM for vmproxy
uses: anchore/sbom-action@v0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

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

- name: Docker Up
run: docker compose up -d
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vmproxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

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

- name: Set up Go release
uses: actions/setup-go@v4
Expand Down
Loading

0 comments on commit 8c69b4e

Please sign in to comment.