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

fix: remove the downloaded packages when install failed #66

Merged
merged 3 commits into from
Sep 12, 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
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

## Documentation

- [English](https://docs.opengemini.org/guide/reference/gemix/gemix_documentation_guide.html)
- [简体中文](https://docs.opengemini.org/zh/guide/reference/gemix/gemix_documentation_guide)
- [English]()
- [简体中文](https://docs.opengemini.org/zh/guide/reference/gemix_manual.html)

## Installation

Expand All @@ -32,6 +32,11 @@ gemix playground
gemix cluster insall opengemini_demo v1.1.1 ./topology.yaml --skip-create-user -p
```

Tips:

> If there are network issues with the automatic download of the installation package,
> please place the installation package under `~/.gemix/storage/cluster/packages/`

## Usage

After installing `gemix`, you can use it to install binaries of openGemini components and create clusters.
Expand Down
10 changes: 6 additions & 4 deletions pkg/cluster/operation/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ func Download(prefix, component, nodeOS, arch, version string) error {

if component == spec.ComponentGrafana {
// FIXME: download from opengemini.org
fileName = fmt.Sprintf("%s-%s.%s-%s.tar.gz", component, ver.GrafanaVersion, nodeOS, arch)
if nodeOS == "darwin" {
arch = "amd64"
}
fileName = fmt.Sprintf("%s-enterprise-%s.%s-%s.tar.gz", component, ver.GrafanaVersion, nodeOS, arch)
componentUrl = strings.Join([]string{"https://dl.grafana.com/oss/release", fileName}, "/")
}
dstPath := spec.ProfilePath(spec.OpenGeminiPackageCacheDir, fileName)
Expand All @@ -55,9 +58,8 @@ func Download(prefix, component, nodeOS, arch, version string) error {

if utils2.IsExist(dstPath) {
if component == spec.ComponentOpenGemini {
if err := repository.VerifyComponent(version, dstPath); err != nil {
_ = os.Remove(dstPath) // nolint
}
// TODO: do not remote package
_ = repository.VerifyComponent(version, dstPath) // nolint
}
}

Expand Down
3 changes: 2 additions & 1 deletion pkg/repository/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ func VerifyComponent(version, target string) error {
checksums := spec.ProfilePath(spec.OpenGeminiPackageCacheDir, CHECKSUMS)
if utils.IsNotExist(checksums) {
if err := tryToDownloadCheckSumsFile(version); err != nil {
return errors.WithStack(err)
// FIXME: assume that the user downloaded the component without problems
return nil
}
}

Expand Down
91 changes: 0 additions & 91 deletions util/clusterInfo.go

This file was deleted.

144 changes: 0 additions & 144 deletions util/connect.go

This file was deleted.

Loading
Loading