Skip to content

Commit

Permalink
Work on ci (#1)
Browse files Browse the repository at this point in the history
[CI] Add GitHub workflows. Migrate commits from gitlab
---------

Signed-off-by: v.oleynikov <[email protected]>
Signed-off-by: Aleksandr Zimin <[email protected]>
Signed-off-by: Alexandr Okhrimenko <[email protected]>
Co-authored-by: Aleksandr Zimin <[email protected]>
Co-authored-by: Alexandr Okhrimenko <[email protected]>
Co-authored-by: Kirill Kononovich <[email protected]>
Co-authored-by: Viktor Kramarenko <[email protected]>
  • Loading branch information
5 people authored Dec 27, 2023
1 parent 8a5e2a9 commit 303114a
Show file tree
Hide file tree
Showing 16 changed files with 376 additions and 97 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
pull_request:

jobs:
dev_setup_build:
runs-on: ubuntu-latest
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: ${{ secrets.DEV_MODULES_REGISTRY_LOGIN }}
MODULES_REGISTRY_PASSWORD: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }}
name: Build and Push images
steps:
- run: |
MODULES_MODULE_TAG="$(echo pr${{ github.ref_name }} | sed 's/\/.*//g')"
echo $MODULES_REGISTRY
echo $CI_COMMIT_REF_NAME
echo "MODULES_MODULE_TAG=$MODULES_MODULE_TAG" >> "$GITHUB_ENV"
echo $MODULES_MODULE_NAME
echo $MODULES_MODULE_SOURCE
echo $MODULES_MODULE_TAG
shell: bash
name: Show vars
- uses: actions/checkout@v4
- uses: deckhouse/modules-actions/setup@v1
- uses: deckhouse/modules-actions/build@v1
73 changes: 73 additions & 0 deletions .github/workflows/build_prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Build and push for prod

env:
MODULES_REGISTRY: ${{ vars.PROD_REGISTRY }}
CI_COMMIT_REF_NAME: ${{ github.ref_name }}
MODULES_MODULE_NAME: ${{ vars.MODULE_NAME }}
MODULE_SOURCE_NAME: ${{ vars.PROD_MODULE_SOURCE_NAME }}
MODULES_REGISTRY_LOGIN: ${{ secrets.PROD_MODULES_REGISTRY_LOGIN }}
MODULES_REGISTRY_PASSWORD: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
MODULES_MODULE_TAG: ${{ github.ref_name }}

on:
push:
tags:
- '**'

jobs:
prod_ce_setup_build:
runs-on: ubuntu-latest
name: Build and Push CE
steps:
- name: SET VAR
run: |
echo "MODULES_MODULE_SOURCE=$MODULES_REGISTRY/$MODULE_SOURCE_NAME/ce/modules" >> "$GITHUB_ENV"
- run: |
echo $MODULES_REGISTRY
echo $MODULES_MODULE_NAME
echo $MODULES_MODULE_SOURCE
echo $MODULES_MODULE_TAG
shell: bash
name: Show vars
- uses: actions/checkout@v4
- uses: deckhouse/modules-actions/setup@v1
- uses: deckhouse/modules-actions/build@v1

prod_ee_setup_build:
runs-on: ubuntu-latest
name: Build and Push EE
steps:
- name: SET VAR
run: |
echo "MODULES_MODULE_SOURCE=$MODULES_REGISTRY/$MODULE_SOURCE_NAME/ee/modules" >> "$GITHUB_ENV"
- run: |
echo $MODULES_REGISTRY
echo $MODULES_MODULE_NAME
echo $MODULES_MODULE_SOURCE
echo $MODULES_MODULE_TAG
shell: bash
name: Show vars
- uses: actions/checkout@v4
- uses: deckhouse/modules-actions/setup@v1
- uses: deckhouse/modules-actions/build@v1

prod_fe_setup_build:
runs-on: ubuntu-latest
name: Build and Push FE
steps:
- name: SET VAR
run: |
echo "MODULES_MODULE_SOURCE=$MODULES_REGISTRY/$MODULE_SOURCE_NAME/fe/modules" >> "$GITHUB_ENV"
- run: |
echo $MODULES_REGISTRY
echo $MODULES_MODULE_NAME
echo $MODULES_MODULE_SOURCE
echo $MODULES_MODULE_TAG
shell: bash
name: Show vars
- uses: actions/checkout@v4
- uses: deckhouse/modules-actions/setup@v1
- uses: deckhouse/modules-actions/build@v1
48 changes: 0 additions & 48 deletions .github/workflows/deploy_dev.yml

This file was deleted.

102 changes: 73 additions & 29 deletions .github/workflows/deploy_prod.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
name: Deploy Prod

env:
MODULES_REGISTRY: ${{ vars.PROD_REGISTRY }}
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 }}
MODULES_REGISTRY_LOGIN: ${{ secrets.PROD_MODULES_REGISTRY_LOGIN }}
MODULES_REGISTRY_PASSWORD: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
MODULES_MODULE_TAG: ${{ github.event.inputs.tag }}

on:
workflow_dispatch:
inputs:
Expand All @@ -13,47 +23,81 @@ on:
- "early-access"
- "stable"
- "rock-solid"

edition:
description: "Select edition"
type: choice
default: fe
options:
- "ce"
- "ee"
- "fe"

ce:
type: boolean
description: CE
ee:
type: boolean
description: EE
fe:
type: boolean
description: FE

tag:
description: "Tag of the module, exapmle v1.21.1"
description: "Tag of the module, example v1.21.1"
type: string
required: true

jobs:
deploy:
print-vars:
runs-on: ubuntu-latest
env:
MODULES_REGISTRY: ${{ vars.PROD_REGISTRY }}
MODULE_SOURCE_NAME: ${{ vars.PROD_MODULE_SOURCE_NAME }}
CI_COMMIT_REF_NAME: ${{ github.ref_name }}
MODULES_MODULE_NAME: ${{ vars.MODULE_NAME }}
MODULES_MODULE_SOURCE: $MODULES_REGISTRY/$MODULE_SOURCE_NAME/${{ github.event.inputs.edition }}/modules
RELEASE_CHANNEL: ${{ github.event.inputs.version }}
MODULES_MODULE_TAG: ${{ github.event.inputs.tag }}
name: Build and Push images
name: Print vars
steps:
- run: |
- name: PRINT VARS
run: |
echo $MODULES_REGISTRY
echo $MODULE_SOURCE_NAME
echo $CI_COMMIT_REF_NAME
echo $MODULES_MODULE_NAME
echo $MODULES_MODULE_SOURCE
echo $RELEASE_CHANNEL
echo $MODULES_MODULE_TAG
shell: bash
name: Show vars
# steps:
# - uses: actions/checkout@v4
# - uses: deckhouse/modules-actions/setup@v1
# - uses: deckhouse/modules-actions/deploy@v1

job-CE:
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
- uses: deckhouse/modules-actions/deploy@v1

job-EE:
name: Edition EE
runs-on: ubuntu-latest
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"
- name: ECHO VAR
run: |
echo $MODULES_MODULE_SOURCE
- uses: actions/checkout@v4
- uses: deckhouse/modules-actions/setup@v1
- uses: deckhouse/modules-actions/deploy@v1

job-FE:
name: Edition FE
runs-on: ubuntu-latest
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"
- name: ECHO VAR
run: |
echo $MODULES_MODULE_SOURCE
- uses: actions/checkout@v4
- uses: deckhouse/modules-actions/setup@v1
- uses: deckhouse/modules-actions/deploy@v1
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: sds-node-configurator
version: 0.0.25-dev.1701781997
version: 0.0.1
dependencies:
- name: deckhouse_lib_helm
version: 1.1.3
Expand Down
1 change: 0 additions & 1 deletion crds/blockdevices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ spec:
name: Path
type: string
description: Actual device path (name).
priority: 1
- jsonPath: .status.actualVGNameOnTheNode
name: VG
type: string
Expand Down
9 changes: 4 additions & 5 deletions crds/lvmvolumegroup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ spec:
type: string
description: |
The global state of the Volume Group. Might be:
- Operational (if everything is fine)
- NonOperational (if there are some problems in the volume group)
enum:
- Operational (if everything is fine with the Volume Group)
- NonOperational (if there are some problems with the Volume Group)
- NonOperational (if there are some problems in the Volume Group)
enum:
- Operational
- NonOperational
message:
type: string
description: |
Expand Down Expand Up @@ -192,7 +192,6 @@ spec:
name: VG
type: string
description: Actual VG name.
priority: 1
- jsonPath: .spec.type
name: type
type: string
Expand Down
14 changes: 14 additions & 0 deletions docs/CONFIGURATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: "The Sds-Node-Configurator module: settings"
---
{% alert level="warning" %}
The module is guaranteed to work in the following cases only:
- if stock kernels shipped with [supported distributions](../../supported_versions.html#linux) are used;
- if a 10Gbps network is used.

As for any other configurations, the module may work, but its smooth operation is not guaranteed.
{% endalert %}

{% include module-bundle.liquid %}

No configuration on the user's side is required
Loading

0 comments on commit 303114a

Please sign in to comment.