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

Add APIs #1

Merged
merged 2 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions .crd-ref-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
processor:
ignoreTypes: []
ignoreFields:
- "status$"
- "TypeMeta$"

render:
kubernetesVersion: 1.28
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
20 changes: 20 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'feat'
- 'enhancement'
- 'enh'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
labels:
- 'chore'
- 'dependencies'
template: |
# What’s Changed

$CHANGES
15 changes: 15 additions & 0 deletions .github/workflows/label-enforcer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Enforce Labels

on:
pull_request:
types: [opened, edited, labeled, unlabeled, synchronize]
jobs:
enforce-label:
permissions:
contents: read # for TimonVS/pr-labeler-action to read config file
pull-requests: write # for TimonVS/pr-labeler-action to add labels in PR
runs-on: ubuntu-latest
steps:
- uses: TimonVS/pr-labeler-action@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
71 changes: 71 additions & 0 deletions .github/workflows/mergedtomain-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Merged to Main
on:
pull_request:
types: [ closed ]
branches: [ 'main' ]

permissions:
contents: read

jobs:
MergedtoMain:
if: github.event.pull_request.merged == true
name: Merged to Main
runs-on: ubuntu-latest
permissions:
# write permission is required to create a github release
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Extract build info
id: extract_build_info
run: |
echo "commit_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

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

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: qdrant/operator
# Docs:
# - https://github.com/docker/metadata-action#date-format-tztimezone
# - https://momentjs.com/docs/#/displaying/format/
tags: |
type=sha,suffix=-{{date 'YYYYMMDD-HHmmss'}}
type=sha,suffix=-{{date 'X'}}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
sbom: true
provenance: true
platforms: linux/amd64,linux/arm64
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
build-args: |
BUILD=${{ steps.extract_build_info.outputs.commit_short }}

- name: Update Release Draft
uses: release-drafter/release-drafter@v6
with:
disable-autolabeler: true
commitish: main
publish: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/pr-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: PR Workflow
on:
pull_request:
types: [ synchronize, opened, reopened]
branches: [ 'main' ]

jobs:
linter:
name: Linter
runs-on: ubuntu-latest
timeout-minutes: 10 # Sets a timeout of 10 minutes for this job (default is 1 minute)
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: '^1.22'
cache: false

- name: Helm lint (CRDs)
run: |
helm lint charts/qdrant-operator-crds

- name: Check Go Formatting
run: |
files=$(gofmt -l .) && echo $files && [ -z "$files" ]

- name: Golang CI Lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59.1 # Specify the golangci-lint version, so we are stable
args: --timeout 10m # Increase the timeout to 10 minutes
73 changes: 73 additions & 0 deletions .github/workflows/release-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Release
on:
push:
branches:
- 'releases/**'

permissions:
contents: read

jobs:
Release:
name: Release Workflow
runs-on: ubuntu-latest
permissions:
# write permission is required to create a github release
contents: write
pull-requests: write
id-token: write # needed for cosign keyless signing with OIDC
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Extract build info
id: extract_build_info
run: |
echo "tag=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
echo "commit_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Install cosign
uses: sigstore/[email protected]

- name: Package helm chart (CRDs)
run: |
# Ensure correct versions in Chart.yaml
sed -i "s/version:.*/version: ${{ steps.extract_build_info.outputs.tag }}/g" charts/qdrant-operator-crds/Chart.yaml
sed -i "s/appVersion:.*/appVersion: ${{ steps.extract_build_info.outputs.tag }}/g" charts/qdrant-operator-crds/Chart.yaml
helm package charts/qdrant-operator-crds/

- name: Tag Release
shell: bash
run: |
git tag ${{ steps.extract_build_info.outputs.tag }}
git push origin ${{ steps.extract_build_info.outputs.tag }}

- name: Publish Release Notes
uses: release-drafter/release-drafter@v6
with:
disable-autolabeler: true
commitish: ${{ github.ref }}
tag: ${{ steps.extract_build_info.outputs.tag }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Push helm (CRDs) chart to registry.cloud.qdrant.io
id: push-helm-chart-crds
env:
HARBOR_USERNAME: ${{ secrets.HARBOR_USERNAME }}
HARBOR_TOKEN: ${{ secrets.HARBOR_TOKEN }}
run: |
helm registry login registry.cloud.qdrant.io -u "${HARBOR_USERNAME}" --password "${HARBOR_TOKEN}"
push_output=$(helm push qdrant-operator-crds-${{ steps.extract_build_info.outputs.tag }}.tgz oci://registry.cloud.qdrant.io/qdrant-charts 2>&1)
echo $push_output
digest=$(echo $push_output | grep -oP '(?<=Digest: ).*')
echo $digest
echo "digest=${digest}" >> $GITHUB_OUTPUT

- name: Sign helm chart (CRDs) at registry.cloud.qdrant.io
run: |
cosign sign --yes "${TAGS}@${DIGEST}"
env:
TAGS: registry.cloud.qdrant.io/qdrant-charts/qdrant-operator-crds:${{ steps.extract_build_info.outputs.tag }}
DIGEST: ${{ steps.push-helm-chart-crds.outputs.digest }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.idea
*.iml
out
gen
vendor/
bin/
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repos:
- repo: https://github.com/golangci/golangci-lint
rev: v1.59.1
hooks:
- id: golangci-lint-full
- repo: https://github.com/tekwizely/pre-commit-golang
rev: v1.0.0-rc.1
hooks:
- id: go-mod-tidy-repo
- id: go-fmt
- id: go-test-repo-mod
- repo: https://github.com/gruntwork-io/pre-commit
rev: v0.1.23
hooks:
- id: helmlint
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This team will own the entire repository
* @qdrant/cloud-unit-regions-clusters
Loading
Loading