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

Importing cortextool from separate repo cortex-tools #708

Merged
merged 258 commits into from
Jan 18, 2022

Conversation

simonswine
Copy link
Contributor

@simonswine simonswine commented Jan 7, 2022

This is an automated import of the https://github.com/grafana/cortex-tools repo.

For preparing the remote repo this script was used:

#!/usr/bin/env bash

CHECKOUT_PATH=$(mktemp -d $TEMPLATE)

git clone git@github.com:grafana/cortex-tools.git "${CHECKOUT_PATH}"

cd $CHECKOUT_PATH
git filter-repo \
  --filename-callback '
if filename.startswith(b"vendor/") or filename in [b"go.mod", b"go.sum"]:
  return None
if filename.startswith(b"cmd/"):
    if filename.startswith(b"cmd/cortextool"):
        return filename
    else:
        return None
return b"cmd/cortextool/" + filename
' --message-callback '
import re
return re.sub(b"#([0-9]+)", b"https://github.com/grafana/cortex-tools/pull/\\1", message)
'
# replace import paths
git ls-files '**/*.go' | xargs sed -i 's#github.com/cortexproject/cortex#github.com/grafana/mimir#g'
git ls-files '**/*.go' | xargs sed -i 's#github.com/grafana/mimir/pkg/cortex#github.com/grafana/mimir/pkg/mimir#g'
git ls-files '**/*.go' | xargs sed -i 's#github.com/grafana/cortex-tools#github.com/grafana/mimir/cmd/cortextool#g'
git ls-files '**/*.go' | xargs sed -i 's#github.com/prometheus/prometheus/pkg/#github.com/prometheus/prometheus/model/#g'
git ls-files '**/*.go' | xargs sed -i 's#github.com/prometheus/alertmanager/pkg/#github.com/prometheus/alertmanager/model/#g'
git commit -m "Change import paths" .

This fixes https://github.com/grafana/mimir-squad/issues/437

jtlisi and others added 30 commits July 8, 2019 14:06
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
…ool -> cortex-cli

Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
…_deleting_tool

add chunk-tool with initial delete function
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
…elete_series_functionality

add delete series command
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
…olumns

Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
…_series_deletion

20190812 label series deletion, merging to get instrumentation
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
@simonswine
Copy link
Contributor Author

simonswine commented Jan 12, 2022

I think I have addressed most issues that have arisen:

  • Removed Loki reference of ruler CLI.
  • Removed unused code paths of repo (e.g. bench, chunktool and overrides-exporter)

The ones remaining are:

  • Rename the command itself, once there is some clarity which name will be chosen
  • Will the CLI be Apache 2 or AGPL?

cmd/cortextool/.errcheck-exclude Outdated Show resolved Hide resolved
cmd/cortextool/.github/workflows/validate_pr.yml Outdated Show resolved Hide resolved
cmd/cortextool/.gitignore Outdated Show resolved Hide resolved
cmd/cortextool/.golangci.yml Outdated Show resolved Hide resolved
@@ -0,0 +1,152 @@
before:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we wanna keep using it? I didn't have a very nice experience with that. I'm wondering if we can release using Mimir tooling.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not found to many issues when releasing, but I think we should have something that is run in a more automated fashion than cortex-tools had.

I think we should address this in a separate PR and have created #747

cmd/cortextool/Makefile Outdated Show resolved Hide resolved
cmd/cortextool/docs/benchtool.md Outdated Show resolved Hide resolved
@@ -0,0 +1,199 @@
package analyse
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move cmd/cortextool/pkg to pkg/cortextool (or whatever the name will be)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to deffer that to the time when we have a name.

@simonswine simonswine changed the title Importing tools from separate repo cortex-tools Importing cortetool from separate repo cortex-tools Jan 13, 2022
@simonswine simonswine marked this pull request as ready for review January 14, 2022 14:05
@simonswine
Copy link
Contributor Author

I think it makes sense to merge this state and work on the remaining work in separate PRs:

  • renaming
  • release automation
  • integration of documentation from README.md to docs/

@simonswine simonswine changed the title Importing cortetool from separate repo cortex-tools Importing cortextool from separate repo cortex-tools Jan 14, 2022
Copy link
Collaborator

@pracucci pracucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense to merge this state and work on the remaining work in separate PRs:

I agree. Could you rebase to fix confclits, so we can merge, please?

@pracucci pracucci enabled auto-merge (squash) January 17, 2022 16:11
@pracucci
Copy link
Collaborator

pracucci commented Jan 17, 2022

This PR must be merged WITHOUT squashing (just a merge commit).

@pracucci pracucci merged commit f8c3be8 into main Jan 18, 2022
@pracucci pracucci deleted the 20220107_import-cortex-tools branch January 18, 2022 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet