Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing operator-ceph #1

Open
wants to merge 65 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
3bb440b
initial commit
NikolayDemchuk Apr 23, 2024
a317b2a
added helm charts
NikolayDemchuk Apr 23, 2024
69afa97
added namespace
NikolayDemchuk Apr 23, 2024
092914c
fix
NikolayDemchuk Apr 23, 2024
108bb31
fix
NikolayDemchuk Apr 23, 2024
ee146f6
fix
NikolayDemchuk Apr 23, 2024
bf991fc
fix
NikolayDemchuk Apr 23, 2024
825c832
fix
NikolayDemchuk Apr 23, 2024
56c82c4
fix
NikolayDemchuk Apr 23, 2024
2a75bef
and now testing latest version..
NikolayDemchuk Apr 23, 2024
4754f4f
trying v1.12.11
NikolayDemchuk Apr 23, 2024
c70b892
v.12.11 attempt
NikolayDemchuk Apr 23, 2024
642200f
trying new CRDs
NikolayDemchuk Apr 24, 2024
4731083
fixes
NikolayDemchuk Apr 24, 2024
c895e09
fix
NikolayDemchuk Apr 25, 2024
0d67dc0
ceph bootstrap bug workaround tryout
NikolayDemchuk Apr 26, 2024
3e86963
revert
NikolayDemchuk Apr 26, 2024
28664e9
some fixes
NikolayDemchuk May 2, 2024
5ae4ef7
[ci] Add previous channel release check
duckhawk Jun 10, 2024
6d26bde
bump for build
NikolayDemchuk Jun 13, 2024
b956fff
Merge branch 'operator-ceph-refactoring' of github.com:deckhouse/sds-…
NikolayDemchuk Jun 13, 2024
617cb6e
adjusted RBAC template for the current version
NikolayDemchuk Jun 17, 2024
0d16670
typo
NikolayDemchuk Jun 17, 2024
e47d6ba
added crds
NikolayDemchuk Jun 17, 2024
d1f1725
fix
NikolayDemchuk Jun 17, 2024
a1c3f2e
fix
NikolayDemchuk Jun 17, 2024
023f038
added one more sa
NikolayDemchuk Jun 18, 2024
a3de17e
fixed clusterrole for objectstorage-provisioner
NikolayDemchuk Jul 9, 2024
547ba1d
objectstorage-provisioner fixes
NikolayDemchuk Jul 9, 2024
3f7478e
[CI] Fixed runners and added dev registry cleanup (#3)
duckhawk Jul 30, 2024
be0f384
[CI] Add golang tests and linter launch
duckhawk Aug 3, 2024
368ba5e
Merge pull request #4 from deckhouse/add-ci-go-tests-run
duckhawk Aug 3, 2024
db21505
Fix
duckhawk Aug 20, 2024
6df2e0d
initial commit
NikolayDemchuk Apr 23, 2024
a07dfb5
added helm charts
NikolayDemchuk Apr 23, 2024
6be1789
added namespace
NikolayDemchuk Apr 23, 2024
94f90f8
fix
NikolayDemchuk Apr 23, 2024
2f36fd8
fix
NikolayDemchuk Apr 23, 2024
b4dd7ea
fix
NikolayDemchuk Apr 23, 2024
ab694e9
fix
NikolayDemchuk Apr 23, 2024
a2efc8e
fix
NikolayDemchuk Apr 23, 2024
f877a04
fix
NikolayDemchuk Apr 23, 2024
37ed61a
and now testing latest version..
NikolayDemchuk Apr 23, 2024
c746fff
trying v1.12.11
NikolayDemchuk Apr 23, 2024
736c4d5
v.12.11 attempt
NikolayDemchuk Apr 23, 2024
4b8739e
trying new CRDs
NikolayDemchuk Apr 24, 2024
e7f4436
fixes
NikolayDemchuk Apr 24, 2024
b5eaa98
fix
NikolayDemchuk Apr 25, 2024
1322700
ceph bootstrap bug workaround tryout
NikolayDemchuk Apr 26, 2024
730a6cd
revert
NikolayDemchuk Apr 26, 2024
3b5a72b
some fixes
NikolayDemchuk May 2, 2024
b8482ef
bump for build
NikolayDemchuk Jun 13, 2024
26e1331
[ci] Add previous channel release check
duckhawk Jun 10, 2024
611751f
adjusted RBAC template for the current version
NikolayDemchuk Jun 17, 2024
d2e832a
typo
NikolayDemchuk Jun 17, 2024
d433484
added crds
NikolayDemchuk Jun 17, 2024
e0575cf
fix
NikolayDemchuk Jun 17, 2024
59193d1
fix
NikolayDemchuk Jun 17, 2024
065a6c1
added one more sa
NikolayDemchuk Jun 18, 2024
3a75787
fixed clusterrole for objectstorage-provisioner
NikolayDemchuk Jul 9, 2024
0163006
objectstorage-provisioner fixes
NikolayDemchuk Jul 9, 2024
b8c3165
Fix
duckhawk Aug 20, 2024
a6b3f55
Merge remote-tracking branch 'origin/operator-ceph-refactoring' into …
duckhawk Aug 20, 2024
2d770c0
bump
NikolayDemchuk Oct 23, 2024
f06b1ac
bump rook version
Nov 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/check_previous_channel_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

crane="/usr/local/bin/crane"
repositoryName=$1
edition=$2
channel=$3
version=$4
user=$5
password=$6

echo "Module $repositoryName, edition $edition, channel $channel, version $version"

if [[ "$channel" == "alpha" ]]; then
echo "Deploying $version to alpha channel"
exit 0
elif [[ "$channel" == "beta" ]]; then
previousChannel="alpha"
elif [[ "$channel" == "early-access" ]]; then
previousChannel="beta"
elif [[ "$channel" == "stable" ]]; then
previousChannel="early-access"
elif [[ "$channel" == "rock-solid" ]]; then
previousChannel="stable"
else
echo "Unknown channel"
exit 1
fi

echo "Checking previous channel $previousChannel"
$crane auth login -u $user -p $password registry.deckhouse.io
previousChannelVersion=$($crane export registry.deckhouse.io/deckhouse/$edition/modules/$repositoryName/release:$previousChannel | grep -aoE '\{"version":".*"\}' | jq -r .version)
if [[ "$version" == "$previousChannelVersion" ]]; then
echo "Previous channel $previousChannel version $previousChannelVersion is equal desired version $version, processing"
exit 0
else
echo "Previous channel $previousChannel version $previousChannelVersion is not equal desired version $version, rejecting"
exit 1
fi
3 changes: 2 additions & 1 deletion .github/workflows/build_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ env:
MODULES_REGISTRY_LOGIN: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }}
MODULES_REGISTRY_PASSWORD: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }}


on:
pull_request:
push:
Expand All @@ -16,7 +17,7 @@ on:

jobs:
dev_setup_build:
runs-on: ubuntu-latest
runs-on: [self-hosted, regular, selectel]
name: Build and Push images
steps:
- name: Set vars for PR
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:

jobs:
prod_ce_setup_build:
runs-on: ubuntu-latest
runs-on: [self-hosted, regular, selectel]
name: Build and Push CE
steps:
- name: SET VAR
Expand All @@ -35,7 +35,7 @@ jobs:
- uses: deckhouse/modules-actions/build@v1

prod_ee_setup_build:
runs-on: ubuntu-latest
runs-on: [self-hosted, regular, selectel]
name: Build and Push EE
steps:
- name: SET VAR
Expand All @@ -54,7 +54,7 @@ jobs:
- uses: deckhouse/modules-actions/build@v1

prod_fe_setup_build:
runs-on: ubuntu-latest
runs-on: [self-hosted, regular, selectel]
name: Build and Push FE
steps:
- name: SET VAR
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
release-label:
name: Release note label
runs-on: ubuntu-latest
runs-on: [self-hosted, regular]

steps:
- name: Check minimum labels
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ on:

jobs:
deploy-dev:
runs-on: ubuntu-latest
runs-on: [self-hosted, regular, selectel]
name: Deploy dev
steps:
- name: PRINT VARS
Expand Down
56 changes: 42 additions & 14 deletions .github/workflows/deploy_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ env:
MODULE_SOURCE_NAME: ${{ vars.PROD_MODULE_SOURCE_NAME }}
CI_COMMIT_REF_NAME: ${{ github.ref_name }}
MODULES_MODULE_NAME: ${{ vars.MODULE_NAME }}
RELEASE_CHANNEL: ${{ github.event.inputs.version }}
RELEASE_CHANNEL: ${{ github.event.inputs.channel }}
MODULES_REGISTRY_LOGIN: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }}
MODULES_REGISTRY_PASSWORD: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
MODULES_READ_REGISTRY_PASSWORD: ${{ secrets.PROD_MODULES_READ_REGISTRY_PASSWORD }}
MODULES_MODULE_TAG: ${{ github.event.inputs.tag }}

on:
workflow_dispatch:
inputs:
version:
description: "Select version"
inputs:
channel:
description: "Select release channel"
type: choice
default: alpha
options:
Expand All @@ -41,7 +42,7 @@ on:

jobs:
print-vars:
runs-on: ubuntu-latest
runs-on: [self-hosted, regular, selectel]
name: Print vars
steps:
- name: PRINT VARS
Expand All @@ -53,10 +54,10 @@ jobs:
echo $RELEASE_CHANNEL
echo $MODULES_MODULE_TAG
shell: bash

job-CE:
name: Edition CE
runs-on: ubuntu-latest
runs-on: [self-hosted, regular, selectel]
if: github.event.inputs.ce == 'true'
steps:
- run: echo "CE"
Expand All @@ -70,34 +71,61 @@ jobs:
- uses: deckhouse/modules-actions/setup@v1
- uses: deckhouse/modules-actions/deploy@v1

name: Edition CE
runs-on: ubuntu-latest
if: github.event.inputs.ce == 'true'
steps:
- run: echo "CE"
- name: SET VAR
run: |
echo "MODULES_MODULE_SOURCE=$MODULES_REGISTRY/$MODULE_SOURCE_NAME/ce/modules" >> "$GITHUB_ENV"
- name: ECHO VAR
run: |
echo $MODULES_MODULE_SOURCE
- uses: actions/checkout@v4
- uses: deckhouse/modules-actions/setup@v1
- name: Check previous release
run: |
chmod +x .github/check_previous_channel_release.sh
.github/check_previous_channel_release.sh $MODULES_MODULE_NAME ce $RELEASE_CHANNEL $MODULES_MODULE_TAG license-token $MODULES_READ_REGISTRY_PASSWORD
- uses: deckhouse/modules-actions/deploy@v1

job-EE:
name: Edition EE
runs-on: ubuntu-latest
runs-on: [self-hosted, regular, selectel]
if: github.event.inputs.ee == 'true'
steps:
- run: echo "EE"
- name: SET VAR
run: |
echo "MODULES_MODULE_SOURCE=$MODULES_REGISTRY/$MODULE_SOURCE_NAME/ee/modules" >> "$GITHUB_ENV"
echo "MODULES_MODULE_SOURCE=$MODULES_REGISTRY/$MODULE_SOURCE_NAME/ee/modules" >> "$GITHUB_ENV"
- name: ECHO VAR
run: |
echo $MODULES_MODULE_SOURCE
echo $MODULES_MODULE_SOURCE
- uses: actions/checkout@v4
- uses: deckhouse/modules-actions/setup@v1
- name: Check previous release
run: |
chmod +x .github/check_previous_channel_release.sh
.github/check_previous_channel_release.sh $MODULES_MODULE_NAME ee $RELEASE_CHANNEL $MODULES_MODULE_TAG license-token $MODULES_READ_REGISTRY_PASSWORD
- uses: deckhouse/modules-actions/deploy@v1

job-FE:
name: Edition FE
runs-on: ubuntu-latest
runs-on: [self-hosted, regular, selectel]
if: github.event.inputs.fe == 'true'
steps:
- run: echo "FE"
- name: SET VAR
run: |
echo "MODULES_MODULE_SOURCE=$MODULES_REGISTRY/$MODULE_SOURCE_NAME/fe/modules" >> "$GITHUB_ENV"
echo "MODULES_MODULE_SOURCE=$MODULES_REGISTRY/$MODULE_SOURCE_NAME/fe/modules" >> "$GITHUB_ENV"
- name: ECHO VAR
run: |
echo $MODULES_MODULE_SOURCE
echo $MODULES_MODULE_SOURCE
- uses: actions/checkout@v4
- uses: deckhouse/modules-actions/setup@v1
- name: Check previous release
run: |
chmod +x .github/check_previous_channel_release.sh
.github/check_previous_channel_release.sh $MODULES_MODULE_NAME fe $RELEASE_CHANNEL $MODULES_MODULE_TAG license-token $MODULES_READ_REGISTRY_PASSWORD
- uses: deckhouse/modules-actions/deploy@v1
47 changes: 47 additions & 0 deletions .github/workflows/dev_registry-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright 2024 Flant JSC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Cleanup dev registries

env:
MODULES_REGISTRY: ${{ vars.DEV_REGISTRY }}
CI_COMMIT_REF_NAME: ${{ github.ref_name }}
MODULES_MODULE_NAME: ${{ vars.MODULE_NAME }}
MODULES_MODULE_SOURCE: ${{ vars.DEV_MODULE_SOURCE }}
MODULES_REGISTRY_LOGIN: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }}
MODULES_REGISTRY_PASSWORD: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }}
WERF_DRY_RUN: "false"

on:
workflow_dispatch:
schedule:
- cron: "12 0 * * 6"

defaults:
run:
shell: bash

jobs:
lint:
runs-on: [self-hosted, regular, selectel]
name: Run cleanup
steps:
- uses: actions/checkout@v4
- uses: deckhouse/modules-actions/setup@v1

- name: Cleanup
run: |
werf cleanup \
--repo ${MODULES_MODULE_SOURCE}/${MODULES_MODULE_NAME} \
--without-kube=true --config werf_cleanup.yaml
44 changes: 44 additions & 0 deletions .github/workflows/go_lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Go linter for images

on:
pull_request:
push:
branches:
- main

jobs:
test:
name: Go linter for images
runs-on: [self-hosted, regular]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Go environment
uses: actions/setup-go@v5
with:
go-version: '1.22'

- name: Install golangci-lint
run: go install github.com/golangci/golangci-lint/cmd/[email protected]

- name: Run Go lint
run: |
basedir=$(pwd)
failed='false'
for dir in $(find images -type d); do
if ls $dir/go.mod &> /dev/null; then
echo "Running linter in $dir"
cd $dir
golangci-lint run
if [ $? -ne 0 ]; then
echo "Linter failed in $dir"
failed='true'
fi
cd $basedir
fi
done
if [ $failed == 'true' ]; then
exit 1
fi
41 changes: 41 additions & 0 deletions .github/workflows/go_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Go tests for images

on:
pull_request:
push:
branches:
- main

jobs:
test:
name: Go tests for images
runs-on: [self-hosted, regular]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Go environment
uses: actions/setup-go@v5
with:
go-version: '1.22'

- name: Run Go tests
run: |
basedir=$(pwd)
failed='false'
for dir in $(find images -type d); do
if ls $dir/*_test.go &> /dev/null; then
echo "Running tests in $dir"
cd $dir
go test -v
if [ $? -ne 0 ]; then
echo "Tests failed in $dir"
failed='true'
fi
cd $basedir
fi
done
if [ $failed == 'true' ]; then
exit 1
fi
39 changes: 39 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
run:
timeout: 10m

issues:
exclude:
- ST1005.*
- "should not use dot imports"
- "don't use an underscore in package name"
- "exported: .*"

linters-settings:
gci:
sections:
- standard
- default
errcheck:
ignore: fmt:.*,[rR]ead|[wW]rite|[cC]lose,io:Copy

linters:
disable-all: true
enable:
- dogsled
- errcheck
- gci
- gocritic
- gofmt
- goimports
- gosimple
- govet
- ineffassign
- misspell
- revive
- staticcheck
# - structcheck
- typecheck
- unconvert
- unparam
- whitespace
- copyloopvar
Loading
Loading