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

[patch] add storage backup option to agent #367

Merged
merged 6 commits into from
May 12, 2020

Conversation

kpango
Copy link
Collaborator

@kpango kpango commented May 11, 2020

Signed-off-by: kpango i.can.feel.gravity@gmail.com

Description:

Vald's agent is not compatible with ngtd, there is no persistent file backup.
so I implement it for the persistence storage store.

Related Issue:

How Has This Been Tested?:

Environment:

  • Golang Version: 1.14
  • Docker Version: 19.03.5
  • Kubernetes Version: 1.17.3
  • NGT Version: 1.9.1

Types of changes:

  • Bug fix [type/bug]
  • New feature [type/feature]
  • Add tests [type/test]
  • Security related changes [type/security]
  • Add documents [type/documentation]
  • Refactoring [type/refactoring]
  • Update dependencies [type/dependency]
  • Update benchmarks and performances [type/bench]
  • Update CI [type/ci]

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Checklist:

  • I have read the CONTRIBUTING document.
  • I have checked open Pull Requests for the similar feature or fixes?
  • I have added tests and benchmarks to cover my changes.
  • I have ensured all new and existing tests passed.
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly.

@pull-assistant
Copy link

pull-assistant bot commented May 11, 2020

Score: 0.98

Best reviewed: commit by commit


Optimal code review plan (2 warnings)

[patch] add storage backup option to agent

charts/vald/values.yaml 56% changes removed in fix

Update charts/vald/values.yaml

charts/vald/values.yaml 50% changes removed in fix

     fix

     fix

     Merge branch 'master' into feature/agent-ngt/add-storage-backup-functi...

     🤖 Update license headers and formatting go codes

Powered by Pull Assistant. Last update 5d3fd4f ... aa23c97. Read the comment docs.

Copy link
Contributor

@rinx rinx left a comment

Choose a reason for hiding this comment

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

@kpango it seems okay.
there's no changes in stetefulset.yaml of agent?

Makefile.d/functions.mk Show resolved Hide resolved
charts/vald/templates/agent/pvc.yaml Outdated Show resolved Hide resolved
@@ -616,6 +616,15 @@ agent:
terminationGracePeriodSeconds: 30
# agent.podManagementPolicy -- pod management policy: OrderedReady or Parallel
podManagementPolicy: OrderedReady
volumeStore:
Copy link
Contributor

Choose a reason for hiding this comment

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

badge
Does this object volumeStore mean PVC settings? If it is, it should be named as pvc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

PVC is quite difficult to understand, some users such as k8s professional can understand about pv, I think it is better to describe this field as a different common name.
how about just storage

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree.
but storage sounds too ambiguous for me.
how about to use persistentVolume like cockroachdb chart or persistence like cassandra chart?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

but cockroachdb uses storage for their values.yaml

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think persistence or storage looks good

Copy link
Contributor

Choose a reason for hiding this comment

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

in the case of cockroachdb, storage is treated as a bigger category. not in the case of us.

it's okay to use storage as the name of this field if it is included to the description that it enables PVC. 👌

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

okay, I agree with 'persistentVolume'

charts/vald/values.yaml Outdated Show resolved Hide resolved
Signed-off-by: kpango <i.can.feel.gravity@gmail.com>
@kpango kpango force-pushed the feature/agent-ngt/add-storage-backup-functionality branch from 41c2ba9 to 5d3fd4f Compare May 11, 2020 06:35
Yusuke Kato and others added 2 commits May 11, 2020 15:42
Co-authored-by: Rintaro Okamura <rintaro.okamura@gmail.com>
fix
Signed-off-by: kpango <i.can.feel.gravity@gmail.com>
@kpango
Copy link
Collaborator Author

kpango commented May 11, 2020

@rinx thank you for your review, I revised about you pointed out

@codecov
Copy link

codecov bot commented May 11, 2020

Codecov Report

Merging #367 into master will decrease coverage by 0.02%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #367      +/-   ##
=========================================
- Coverage    7.94%   7.91%   -0.03%     
=========================================
  Files         345     346       +1     
  Lines       17733   17796      +63     
=========================================
  Hits         1408    1408              
- Misses      16144   16207      +63     
  Partials      181     181              
Impacted Files Coverage Δ
hack/benchmark/internal/assets/loader.go 0.00% <0.00%> (ø)
internal/file/file.go 0.00% <0.00%> (ø)
pkg/agent/ngt/handler/grpc/handler.go 0.00% <0.00%> (ø)
pkg/agent/ngt/service/ngt.go 0.00% <0.00%> (ø)
pkg/agent/ngt/usecase/agentd.go 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca49f71...aa23c97. Read the comment docs.

@rinx
Copy link
Contributor

rinx commented May 11, 2020

come to think of it, we should add volumeMount entry in our statefulset.yaml template to mount pvc

@rinx rinx closed this May 11, 2020
@rinx rinx reopened this May 11, 2020
@rinx
Copy link
Contributor

rinx commented May 11, 2020

Sorry i just closed and reopen this PR accidentally 🙇

fix
Signed-off-by: kpango <i.can.feel.gravity@gmail.com>
@kpango
Copy link
Collaborator Author

kpango commented May 11, 2020

@rinx fixed

@kpango
Copy link
Collaborator Author

kpango commented May 11, 2020

/rebase
/format

@vdaas-ci
Copy link
Collaborator

[REBASE] Rebase triggered by kpango for branch: feature/agent-ngt/add-storage-backup-functionality

@vdaas-ci
Copy link
Collaborator

[REBASE] Failed to rebase.

@kpango
Copy link
Collaborator Author

kpango commented May 12, 2020

@rinx could you please re-review? I revised them.
/format

@vdaas-ci
Copy link
Collaborator

[FORMAT] Updating license headers and formatting go codes triggered by kpango.

Signed-off-by: vdaas-ci <ci@vdaas.org>
Copy link
Contributor

@rinx rinx left a comment

Choose a reason for hiding this comment

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

Others okay. 👍 Thanks for revising.

i'm going to investigate about filepath in mountPath

{{- if .Values.agent.ngt.index_path }}
{{- if .Values.agent.persistentVolume.enabled }}
- name: {{ .Values.agent.name }}-pvc
mountPath: {{ .Values.agent.ngt.index_path }}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure it's ok to use file path here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think its okay index_path means index dir, ngt core lib writes idx & grp files there also kvsdb writes same dir

@rinx
Copy link
Contributor

rinx commented May 12, 2020

/approve

Copy link
Collaborator

@vdaas-ci vdaas-ci left a comment

Choose a reason for hiding this comment

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

[APPROVED] This PR is approved by rinx.

@kpango kpango merged commit f5ea3ef into master May 12, 2020
@kpango kpango deleted the feature/agent-ngt/add-storage-backup-functionality branch May 12, 2020 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants