Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: GreptimeTeam/gtctl
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.1.0-beta.8
Choose a base ref
...
head repository: GreptimeTeam/gtctl
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: develop
Choose a head ref
  • 15 commits
  • 75 files changed
  • 10 contributors

Commits on Dec 27, 2023

  1. fix: change local artifact validation logic from tag to if blocks (#…

    …183)
    
    * fix config invalid validation tag
    
    Signed-off-by: sh2 <[email protected]>
    
    * disable silence errors option
    
    Signed-off-by: sh2 <[email protected]>
    
    * search plugin frontly
    
    Signed-off-by: sh2 <[email protected]>
    
    * fix lint
    
    Signed-off-by: sh2 <[email protected]>
    
    ---------
    
    Signed-off-by: sh2 <[email protected]>
    shawnh2 authored Dec 27, 2023
    Copy the full SHA
    6f534d2 View commit details

Commits on Jan 20, 2024

  1. chore: use hawkeye license checker (#187)

    * fix: failed to start frontend in gtctl playground
    
    * refactor: playground command
    
    * refactor: renew licenses year
    
    * fix: golangci lint error
    
    * refactor: remove playground
    
    * fix: can't e2e test playground
    
    * fix: playground e2e
    
    * fix: test playground
    
    * fix: test playground
    
    * fix: test playground
    
    * fix: test playground
    
    * fix: test playground
    
    * fix: test playground
    
    * fix: test playground
    
    * chore: change dial port
    
    * chore: use new license github action
    
    * chore: license header
    
    * chore: format license header
    
    * refactor: frontend start args
    daviderli614 authored Jan 20, 2024
    Copy the full SHA
    1cdc306 View commit details

Commits on Jan 21, 2024

  1. refactor: add frontend start args (#188)

    daviderli614 authored Jan 21, 2024
    Copy the full SHA
    117cbfb View commit details

Commits on Feb 21, 2024

  1. fix: avoid panic os.Args[1] (#190)

    Signed-off-by: tison <[email protected]>
    tisonkun authored Feb 21, 2024
    Copy the full SHA
    7fb3796 View commit details

Commits on Feb 27, 2024

  1. docs: include noscript installation (#191)

    * docs: recommend noscript installation
    
    * Update README.md
    tisonkun authored Feb 27, 2024
    Copy the full SHA
    038c2b8 View commit details

Commits on Feb 28, 2024

  1. feat: pass command line argument "--user-provider" to frontend (#193)

    MichaelScofield authored Feb 28, 2024
    Copy the full SHA
    7861241 View commit details

Commits on Mar 14, 2024

  1. fix: e2e (#197)

    daviderli614 authored Mar 14, 2024
    Copy the full SHA
    b4c39bb View commit details
  2. fix: avoid pushing invalid addr args (#195)

    Signed-off-by: Ruihang Xia <[email protected]>
    Co-authored-by: tison <[email protected]>
    waynexia and tisonkun authored Mar 14, 2024
    Copy the full SHA
    6e4058c View commit details

Commits on Mar 26, 2024

  1. ci: bump actions version (#198)

    * ci: bump actions version
    
    Signed-off-by: tison <[email protected]>
    
    * Update .github/workflows/ci.yaml
    
    ---------
    
    Signed-off-by: tison <[email protected]>
    tisonkun authored Mar 26, 2024
    Copy the full SHA
    9c7c9fa View commit details

Commits on May 22, 2024

  1. chore: remove opentsdb addr (#203)

    * fix:issue201
    
    * fix2
    
    * fix3
    
    * fix4
    
    * fix5
    
    ---------
    
    Co-authored-by: 庄润梓 <[email protected]>
    confoc and 庄润梓 authored May 22, 2024
    Copy the full SHA
    efa2f7d View commit details

Commits on May 28, 2024

  1. feat: add the new option --memory-meta-storage (#200)

    * all commit
    
    * test
    
    * pret
    
    * pref
    
    * end
    
    * fix
    
    * fix
    
    * fix
    
    * fix2
    
    * fix3
    
    * fix4
    
    * fix5
    
    * test1
    
    * fix6
    
    * fix7
    
    * fix8
    confoc authored May 28, 2024
    Copy the full SHA
    ad6cf8d View commit details

Commits on Jul 5, 2024

  1. chore: add missing s for --metasrv-addr (#208)

    discord9 authored Jul 5, 2024
    Copy the full SHA
    3d16cf7 View commit details

Commits on Jul 9, 2024

  1. fix: start etcd if not using memory as storage for Metasrv (#209)

    MichaelScofield authored Jul 9, 2024
    Copy the full SHA
    451006b View commit details

Commits on Aug 1, 2024

  1. fix: broken link (#210)

    killme2008 authored Aug 1, 2024
    Copy the full SHA
    ff41601 View commit details

Commits on Oct 16, 2024

  1. fix: dead links (#213)

    nicecui authored Oct 16, 2024
    Copy the full SHA
    9dc5c7f View commit details
Showing with 1,156 additions and 973 deletions.
  1. 0 .github/{codecov.yml → codecov.yaml}
  2. +17 −37 .github/workflows/ci.yaml
  3. +2 −2 .github/workflows/license-checker.yaml
  4. +10 −19 .github/workflows/{release.yml → release.yaml}
  5. +0 −15 .licenserc.yaml
  6. +1 −1 LICENSE
  7. +2 −2 Makefile
  8. +14 −6 README.md
  9. +15 −13 cmd/gtctl/cluster.go
  10. +15 −13 cmd/gtctl/cluster_connect.go
  11. +18 −14 cmd/gtctl/cluster_create.go
  12. +15 −13 cmd/gtctl/cluster_delete.go
  13. +15 −13 cmd/gtctl/cluster_get.go
  14. +15 −13 cmd/gtctl/cluster_list.go
  15. +15 −13 cmd/gtctl/cluster_scale.go
  16. +28 −26 cmd/gtctl/main.go
  17. +15 −13 cmd/gtctl/playground.go
  18. +15 −13 cmd/gtctl/version.go
  19. +1 −1 examples/bare-metal/cluster-with-s3-storage.datanode.toml
  20. +1 −2 hack/e2e/setup-e2e-env.sh
  21. +1 −1 hack/install.sh
  22. +1 −2 hack/version.sh
  23. +24 −0 licenserc.toml
  24. +15 −13 pkg/artifacts/constants.go
  25. +15 −13 pkg/artifacts/manager.go
  26. +15 −13 pkg/artifacts/manager_test.go
  27. +28 −19 pkg/cluster/baremetal/cluster.go
  28. +31 −17 pkg/cluster/baremetal/create.go
  29. +15 −13 pkg/cluster/baremetal/delete.go
  30. +15 −13 pkg/cluster/baremetal/get.go
  31. +15 −13 pkg/cluster/baremetal/get_test.go
  32. +15 −13 pkg/cluster/baremetal/not_implemented.go
  33. +15 −13 pkg/cluster/kubernetes/cluster.go
  34. +15 −13 pkg/cluster/kubernetes/connect.go
  35. +19 −17 pkg/cluster/kubernetes/create.go
  36. +15 −13 pkg/cluster/kubernetes/delete.go
  37. +15 −13 pkg/cluster/kubernetes/get.go
  38. +15 −13 pkg/cluster/kubernetes/list.go
  39. +15 −13 pkg/cluster/kubernetes/scale.go
  40. +15 −13 pkg/cluster/types.go
  41. +19 −25 pkg/components/datanode.go
  42. +15 −13 pkg/components/etcd.go
  43. +25 −30 pkg/components/frontend.go
  44. +33 −31 pkg/components/metasrv.go
  45. +15 −13 pkg/components/run.go
  46. +15 −13 pkg/components/types.go
  47. +50 −0 pkg/components/utils.go
  48. +25 −19 pkg/config/baremetal.go
  49. +15 −13 pkg/config/kubernetes.go
  50. +15 −13 pkg/config/kubernetes_test.go
  51. +15 −13 pkg/config/validate.go
  52. +15 −13 pkg/config/validate_test.go
  53. +15 −13 pkg/connector/mysql.go
  54. +15 −13 pkg/connector/postgres.go
  55. +15 −13 pkg/helm/loader.go
  56. +16 −14 pkg/helm/loader_test.go
  57. +28 −11 pkg/helm/testdata/db-manifests.yaml
  58. +15 −13 pkg/helm/values.go
  59. +15 −13 pkg/helm/values_test.go
  60. +15 −13 pkg/kube/client.go
  61. +15 −13 pkg/logger/logger.go
  62. +15 −13 pkg/metadata/manager.go
  63. +15 −13 pkg/metadata/manager_test.go
  64. +21 −17 pkg/plugins/manager.go
  65. +16 −16 pkg/plugins/manager_test.go
  66. +15 −13 pkg/status/status.go
  67. +15 −13 pkg/utils/file/file.go
  68. +15 −13 pkg/utils/file/file_test.go
  69. +15 −13 pkg/utils/file/yaml.go
  70. +15 −13 pkg/utils/file/yaml_test.go
  71. +15 −13 pkg/utils/semver/semver.go
  72. +15 −13 pkg/utils/semver/semver_test.go
  73. +15 −13 pkg/version/version.go
  74. +20 −18 tests/e2e/greptimedbcluster_test.go
  75. +15 −13 tests/e2e/suite_test.go
File renamed without changes.
54 changes: 17 additions & 37 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: CI

on: [
push,
pull_request
]
on: [ push, pull_request ]

env:
GO_VERSION: "1.21"
@@ -13,26 +10,20 @@ permissions:

jobs:
typos-check:
name: spell-typos-check
name: Check typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v3
- name: Check spelling with custom config file
uses: crate-ci/typos@v1.14.8
- uses: actions/checkout@v4
- uses: crate-ci/typos@master

lint:
name: lint
name: Check linters
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Setup Go
uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
@@ -41,43 +32,32 @@ jobs:
args: -v

unit-test:
name: coverage-test
name: Unit test coverage
runs-on: ubuntu-latest
needs: [ lint ]
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Setup Go
uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Unit test
run: |
make coverage
run: make coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: ./coverage.xml
name: codecov-gtctl
verbose: true
e2e:
name: e2e
name: End to End tests
runs-on: ubuntu-latest
needs: [ lint ]
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Setup Go
uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Run e2e
run: |
make e2e
- name: Run End to End tests
run: make e2e
4 changes: 2 additions & 2 deletions .github/workflows/license-checker.yaml
Original file line number Diff line number Diff line change
@@ -11,6 +11,6 @@ jobs:
runs-on: ubuntu-latest
name: license-header-check
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Check License Header
uses: apache/skywalking-eyes/header@main
uses: korandoru/hawkeye@v5
29 changes: 10 additions & 19 deletions .github/workflows/release.yml → .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -43,17 +43,12 @@ jobs:
goarch: amd64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Setup Go
uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Build project
run: |
make
run: make
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
@@ -67,19 +62,17 @@ jobs:
echo $(shasum -a 256 ${{ matrix.file }}.tgz | cut -f1 -d' ') > ${{ matrix.file }}.sha256sum
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.file }}
path: bin/${{ matrix.file }}.tgz

- name: Upload checksum of artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.file }}.sha256sum
path: bin/${{ matrix.file }}.sha256sum

- name: Upload artifacts to S3
uses: nick-invision/retry@v2
uses: nick-invision/retry@v3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_CN_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_CN_SECRET_ACCESS_KEY}}
@@ -107,10 +100,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4

- name: Publish release
uses: ncipollo/release-action@v1
@@ -129,11 +122,9 @@ jobs:
if: ${{ inputs.release-install-script }}
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3

- uses: actions/checkout@v4
- name: Upload install.sh to S3
uses: nick-invision/retry@v2
uses: nick-invision/retry@v4
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_CN_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_CN_SECRET_ACCESS_KEY}}
15 changes: 0 additions & 15 deletions .licenserc.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2022 Greptime Team
Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
# 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
# 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,
@@ -74,7 +74,7 @@ license-eye: ## Install license-eye.

.PHONY: golangci-lint
golangci-lint: ## Install golangci-lint.
@which golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.1
@which golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2

##@ General

20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -12,26 +12,34 @@
<img alt="screenshot" src="./docs/images/screenshot.png" width="800px">
</p>

## Quickstart
## Installation

Install the `gtctl` binary using the following **one-line installatio**n command:
Install `gtctl` using the following **oneliner installation** command:

```console
```shell
curl -fsSL https://raw.githubusercontent.com/greptimeteam/gtctl/develop/hack/install.sh | sh
```

In case of `go` is available, you can alternatively install `gtctl` with:

```shell
go install github.com/GreptimeTeam/gtctl/cmd/gtctl@develop
```

## Quickstart

The **fastest** way to experience the GreptimeDB cluster is to use the playground:

```console
```shell
gtctl playground
```

The `playground` will deploy the minimal GreptimeDB cluster on your environment in bare-metal mode.

## Documentation

* [More](https://docs.greptime.com/user-guide/operations/gtctl) features and usage about `gtctl`
* [More](https://docs.greptime.com/reference/gtctl) features and usage about `gtctl`

## License

`gtctl` uses the [Apache 2.0 license](./LICENSE) to strike a balance between open contributions and allowing you to use the software however you want.
`gtctl` uses the [Apache 2.0 license](LICENSE) to strike a balance between open contributions and allowing you to use the software however you want.
28 changes: 15 additions & 13 deletions cmd/gtctl/cluster.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
// Copyright 2023 Greptime Team
//
// 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.
/*
* Copyright 2023 Greptime Team
*
* 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.
*/

package main

28 changes: 15 additions & 13 deletions cmd/gtctl/cluster_connect.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
// Copyright 2023 Greptime Team
//
// 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.
/*
* Copyright 2023 Greptime Team
*
* 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.
*/

package main

32 changes: 18 additions & 14 deletions cmd/gtctl/cluster_create.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
// Copyright 2023 Greptime Team
//
// 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.
/*
* Copyright 2023 Greptime Team
*
* 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.
*/

package main

@@ -60,6 +62,7 @@ type clusterCreateCliOptions struct {
Config string
GreptimeBinVersion string
EnableCache bool
UseMemoryMeta bool

// Common options.
Timeout int
@@ -107,6 +110,7 @@ func NewCreateClusterCommand(l logger.Logger) *cobra.Command {
cmd.Flags().StringVar(&options.GreptimeDBClusterValuesFile, "greptimedb-cluster-values-file", "", "The values file for greptimedb cluster.")
cmd.Flags().StringVar(&options.EtcdClusterValuesFile, "etcd-cluster-values-file", "", "The values file for etcd cluster.")
cmd.Flags().StringVar(&options.GreptimeDBOperatorValuesFile, "greptimedb-operator-values-file", "", "The values file for greptimedb operator.")
cmd.Flags().BoolVar(&options.UseMemoryMeta, "use-memory-meta", false, "Bootstrap the whole cluster without installing etcd for testing purposes through using the memory storage of metasrv in bare-metal mode.")

return cmd
}
@@ -180,7 +184,7 @@ func NewCluster(args []string, options *clusterCreateCliOptions, l logger.Logger
l.V(0).Infof("Creating GreptimeDB cluster '%s' on bare-metal", logger.Bold(clusterName))

var opts []baremetal.Option
opts = append(opts, baremetal.WithEnableCache(options.EnableCache))
opts = append(opts, baremetal.WithEnableCache(options.EnableCache), baremetal.WithMetastore(options.UseMemoryMeta))
if len(options.GreptimeBinVersion) > 0 {
opts = append(opts, baremetal.WithGreptimeVersion(options.GreptimeBinVersion))
}
Loading