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

WIP #16

Draft
wants to merge 29 commits into
base: main
Choose a base branch
from
Draft

WIP #16

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
359b099
Bump helm.sh/helm/v3 from 3.16.1 to 3.16.2
dependabot[bot] Oct 10, 2024
aba826a
Added EKS template (#430)
slysunkin Oct 11, 2024
41b36be
Add rbac roles for new resources (#469)
Kshatrix Oct 11, 2024
50b5e88
Fix chartRef for delivered Templates (#478)
eromanova Oct 14, 2024
a6f0700
Bump github.com/projectsveltos/libsveltos from 0.39.0 to 0.40.0
dependabot[bot] Oct 14, 2024
33c5919
Bump github.com/projectsveltos/addon-controller from 0.39.0 to 0.40.0
dependabot[bot] Oct 15, 2024
835a640
Add support for compatibility attributes
zerospiel Sep 27, 2024
571dc77
Enforce compatibility attributes
zerospiel Oct 4, 2024
545f2ba
Addressed comments on compatibility attrs
zerospiel Oct 8, 2024
29f63eb
Wait for templates creation in Release controller
Kshatrix Oct 15, 2024
b7e1f22
Compatibility attributes amends
zerospiel Oct 15, 2024
3f9a2ad
Publish Release object to gh release assets
Kshatrix Oct 16, 2024
b719662
Upgrade k0smotron to v1.1.2
Schnitzel Oct 16, 2024
87f195d
use the official `k0sproject-k0smotron` provider
Schnitzel Oct 16, 2024
0c4a7be
remove in-template BeachHeadServices
Schnitzel Oct 16, 2024
49c8c81
Update provider versions to latest
Kshatrix Oct 17, 2024
31cc845
Strip leading v in VERSION
Kshatrix Oct 17, 2024
8557714
Fix wrong providers names in telemetry
zerospiel Oct 17, 2024
bb2fb12
Fix sveltos tpls version in the Release
zerospiel Oct 17, 2024
4ae3821
Add self-hosted runner, break E2E tests into labeled Specs
squizzi Sep 20, 2024
ba1d43a
Update workflow to use pull_request_target
squizzi Oct 10, 2024
c34be1b
Update TODO comments, validate both Azure controllers
squizzi Oct 11, 2024
e2ffd2b
Iterate over deployList objects
squizzi Oct 11, 2024
76f1b29
Strip leading v from VERSION in Get outputs job
squizzi Oct 17, 2024
7f73bfb
Update README.md
randybias Oct 17, 2024
c36f5c9
Fix an issue with EKS cluster removal
slysunkin Oct 15, 2024
c47254d
Update template versions for 0.0.3
Kshatrix Oct 18, 2024
a4c12b1
Update k0s version to 1.31.1+k0s.1
Kshatrix Oct 18, 2024
72c2932
Reconcile MultiClusterService
wahabmk Oct 16, 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
52 changes: 0 additions & 52 deletions .github/workflows/build.yml

This file was deleted.

245 changes: 245 additions & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
name: CI
on:
pull_request_target:
types:
- labeled
- opened
- synchronize
- reopened
branches:
- main
- release-*
paths-ignore:
- 'config/**'
- '**.md'
push:
tags:
- '*'

env:
GO_VERSION: '1.22'
REGISTRY_REPO: 'oci://ghcr.io/mirantis/hmc/charts-ci'

jobs:
build:
concurrency:
group: build-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
name: Build and Unit Test
runs-on: ubuntu-latest
outputs:
version: ${{ steps.vars.outputs.version }}
clustername: ${{ steps.vars.outputs.clustername }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Lint
uses: golangci/golangci-lint-action@v6
with:
args: --timeout 10m0s
- name: Verify all generated pieces are up-to-date
run: make generate-all && git add -N . && git diff --exit-code
- name: Unit tests
run: |
make test
- name: Set up Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get outputs
id: vars
run: |
GIT_VERSION=$(git describe --tags --always)
echo "version=${GIT_VERSION:1}" >> $GITHUB_OUTPUT
echo "clustername=ci-$(date +%s | cut -b6-10)" >> $GITHUB_OUTPUT
- name: Build and push HMC controller image
uses: docker/build-push-action@v6
with:
build-args: |
LD_FLAGS=-s -w -X github.com/Mirantis/hmc/internal/build.Version=${{ steps.vars.outputs.version }}
context: .
platforms: linux/amd64
tags: |
ghcr.io/mirantis/hmc/controller-ci:${{ steps.vars.outputs.version }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Prepare and push HMC template charts
run: |
make hmc-chart-release
make helm-push

controller-e2etest:
name: E2E Controller
runs-on: ubuntu-latest
needs: build
concurrency:
group: controller-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
outputs:
clustername: ${{ needs.build.outputs.clustername }}
version: ${{ needs.build.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup kubectl
uses: azure/setup-kubectl@v4
- name: Run E2E tests
env:
GINKGO_LABEL_FILTER: 'controller'
MANAGED_CLUSTER_NAME: ${{ needs.build.outputs.clustername }}
IMG: 'ghcr.io/mirantis/hmc/controller-ci:${{ needs.build.outputs.version }}'
VERSION: ${{ needs.build.outputs.version }}
run: |
make test-e2e
- name: Archive test results
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: cloud-e2etest-logs
path: |
test/e2e/*.log

provider-cloud-e2etest:
name: E2E Cloud Providers
runs-on: ubuntu-latest
if: ${{ contains( github.event.pull_request.labels.*.name, 'test e2e') }}
needs: build
concurrency:
group: cloud-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
outputs:
clustername: ${{ needs.build.outputs.clustername }}
version: ${{ needs.build.outputs.version }}
env:
AWS_REGION: us-west-2
AWS_ACCESS_KEY_ID: ${{ secrets.CI_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_AWS_SECRET_ACCESS_KEY }}
AZURE_REGION: westus2
AZURE_SUBSCRIPTION_ID: ${{ secrets.CI_AZURE_SUBSCRIPTION_ID }}
AZURE_TENANT_ID: ${{ secrets.CI_AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.CI_AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.CI_AZURE_CLIENT_SECRET }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup kubectl
uses: azure/setup-kubectl@v4
- uses: actions/checkout@v4
- name: Run E2E tests
env:
GINKGO_LABEL_FILTER: 'provider:cloud'
MANAGED_CLUSTER_NAME: ${{ needs.build.outputs.clustername }}
IMG: 'ghcr.io/mirantis/hmc/controller-ci:${{ needs.build.outputs.version }}'
VERSION: ${{ needs.build.outputs.version }}
run: |
make test-e2e
- name: Archive test results
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: cloud-e2etest-logs
path: |
test/e2e/*.log

provider-onprem-e2etest:
name: E2E On-Prem Providers
runs-on: self-hosted
if: ${{ contains( github.event.pull_request.labels.*.name, 'test e2e') }}
needs: build
concurrency:
group: onprem-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
outputs:
clustername: ${{ needs.build.outputs.clustername }}
version: ${{ needs.build.outputs.version }}
env:
VSPHERE_USER: ${{ secrets.CI_VSPHERE_USER }}
VSPHERE_PASSWORD: ${{ secrets.CI_VSPHERE_PASSWORD }}
VSPHERE_SERVER: ${{ secrets.CI_VSPHERE_SERVER }}
VSPHERE_THUMBPRINT: ${{ secrets.CI_VSPHERE_THUMBPRINT }}
VSPHERE_DATACENTER: ${{ secrets.CI_VSPHERE_DATACENTER }}
VSPHERE_DATASTORE: ${{ secrets.CI_VSPHERE_DATASTORE }}
VSPHERE_RESOURCEPOOL: ${{ secrets.CI_VSPHERE_RESOURCEPOOL }}
VSPHERE_FOLDER: ${{ secrets.CI_VSPHERE_FOLDER }}
VSPHERE_CONTROL_PLANE_ENDPOINT: ${{ secrets.CI_VSPHERE_CONTROL_PLANE_ENDPOINT }}
VSPHERE_VM_TEMPLATE: ${{ secrets.CI_VSPHERE_VM_TEMPLATE }}
VSPHERE_NETWORK: ${{ secrets.CI_VSPHERE_NETWORK }}
VSPHERE_SSH_KEY: ${{ secrets.CI_VSPHERE_SSH_KEY }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup kubectl
uses: azure/setup-kubectl@v4
- name: Run E2E tests
env:
GINKGO_LABEL_FILTER: 'provider:onprem'
MANAGED_CLUSTER_NAME: ${{ needs.build.outputs.clustername }}
IMG: 'ghcr.io/mirantis/hmc/controller-ci:${{ needs.build.outputs.version }}'
VERSION: ${{ needs.build.outputs.version }}
run: |
make test-e2e
- name: Archive test results
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: onprem-e2etest-logs
path: |
test/e2e/*.log

cleanup:
name: Cleanup
needs:
- build
- provider-cloud-e2etest
runs-on: ubuntu-latest
if: ${{ always() && !contains(needs.provider-cloud-e2etest.result, 'skipped') && contains(needs.build.result, 'success') }}
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: AWS Test Resources
env:
AWS_REGION: us-west-2
AWS_ACCESS_KEY_ID: ${{ secrets.CI_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_AWS_SECRET_ACCESS_KEY }}
AZURE_REGION: westus2
AZURE_SUBSCRIPTION_ID: ${{ secrets.CI_AZURE_SUBSCRIPTION_ID }}
AZURE_TENANT_ID: ${{ secrets.CI_AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.CI_AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.CI_AZURE_CLIENT_SECRET }}
CLUSTER_NAME: '${{ needs.build.outputs.clustername }}'
run: |
make dev-aws-nuke
make dev-azure-nuke
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,7 @@ jobs:
with:
generate_release_notes: true
prerelease: ${{ contains(github.ref_name, '-') }}
files: dist/install.yaml
files: |
dist/install.yaml
templates/provider/hmc-templates/files/release.yaml
draft: true
Loading