-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
214 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Build and push CI Docker image | ||
description: Build and push CI Docker image to local registry | ||
inputs: | ||
binary_path: | ||
default: "./bin" | ||
description: "Binary path" | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Build and push to local registry | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./docker/ci/ubuntu/Dockerfile.ci | ||
push: true | ||
tags: localhost:5001/greptime/greptimedb:latest | ||
build-args: | | ||
BINARY_PATH=${{ inputs.binary_path }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
name: Setup GreptimeDB cluster | ||
description: Deploy GreptimeDB cluster on Kubernetes | ||
inputs: | ||
frontend-replica-count: | ||
default: 1 | ||
description: "Frontend replica count" | ||
datanode-replica-count: | ||
default: 2 | ||
description: "Datanode replica count" | ||
metasrv-replica-count: | ||
default: 1 | ||
description: "Metasrv replica count" | ||
etcd-replica-count: | ||
default: 1 | ||
description: "Etcd replica count" | ||
image-registry: | ||
default: "docker.io" | ||
description: "Image registry" | ||
image-repository: | ||
default: "greptime/greptimedb" | ||
description: "Image repository" | ||
image-tag: | ||
required: true | ||
description: 'Image tag' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Install greptime operator | ||
shell: bash | ||
run: | | ||
helm repo add greptime https://greptimeteam.github.io/helm-charts/ | ||
helm repo update | ||
helm upgrade \ | ||
--install \ | ||
--create-namespace \ | ||
greptimedb-operator greptime/greptimedb-operator \ | ||
-n greptimedb-admin | ||
- name: Install etcd cluster | ||
shell: bash | ||
run: | | ||
helm upgrade \ | ||
--install etcd oci://registry-1.docker.io/bitnamicharts/etcd \ | ||
--set replicaCount=${{ inputs.etcd-replica-count }} \ | ||
--set auth.rbac.create=false \ | ||
--set auth.rbac.token.enabled=false \ | ||
--set persistence.size=1Gi \ | ||
--create-namespace \ | ||
-n etcd-cluster | ||
- name: Wait for etcd | ||
run: | | ||
kubectl wait \ | ||
--for=condition=Ready \ | ||
pod -l app.kubernetes.io/instance=etcd \ | ||
--timeout=120s \ | ||
-n etcd-cluster | ||
- name: Print etcd info | ||
run: kubectl get all --show-labels -n etcd-cluster | ||
- name: Install GreptimeDB cluster | ||
shell: bash | ||
run: | | ||
helm upgrade \ | ||
--install my-greptimedb \ | ||
--set meta.etcdEndpoints=etcd.etcd-cluster.svc.cluster.local:2379 \ | ||
--set image.registry=${{ inputs.image-registry }} \ | ||
--set image.repository=${{ inputs.image-repository }} \ | ||
--set image.tag=${{ inputs.image-tag }} \ | ||
greptime/greptimedb-cluster \ | ||
--create-namespace \ | ||
-n my-greptimedb | ||
- name: Wait for GreptimeDB | ||
shell: bash | ||
run: | | ||
kubectl wait \ | ||
--for=condition=Ready \ | ||
pod -l app.greptime.io/component=my-greptimedb-meta \ | ||
--timeout=120s \ | ||
-n my-greptimedb | ||
kubectl wait \ | ||
--for=condition=Ready \ | ||
pod -l app.greptime.io/component=my-greptimedb-datanode \ | ||
--timeout=120s \ | ||
-n my-greptimedb | ||
kubectl wait \ | ||
--for=condition=Ready \ | ||
pod -l app.greptime.io/component=my-greptimedb-frontend \ | ||
--timeout=120s \ | ||
-n my-greptimedb | ||
- name: Print GreptimeDB info | ||
if: always() | ||
shell: bash | ||
run: | | ||
kubectl get all --show-labels -n my-greptimedb | ||
- name: Export kind logs | ||
if: failure() | ||
shell: bash | ||
run: | | ||
kind export logs /tmp/kind | ||
- name: Upload logs | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: kind-logs | ||
path: /tmp/kind | ||
retention-days: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Setup Kind | ||
description: Deploy Kind | ||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Kind | ||
shell: bash | ||
run: | | ||
[ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.23.0/kind-linux-amd64 | ||
chmod +x ./kind | ||
sudo mv ./kind /usr/local/bin/kind | ||
- name: Create kind cluster | ||
shell: bash | ||
run: | | ||
./.github/scripts/kind-with-registry.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM ubuntu:22.04 | ||
|
||
# The binary name of GreptimeDB executable. | ||
# Defaults to "greptime", but sometimes in other projects it might be different. | ||
ARG TARGET_BIN=greptime | ||
|
||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
ca-certificates \ | ||
curl | ||
|
||
ARG BINARY_PATH | ||
ADD $BINARY_PATH/$TARGET_BIN /greptime/bin/ | ||
|
||
ENV PATH /greptime/bin/:$PATH | ||
|
||
ENTRYPOINT ["greptime"] |