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

Return resource count from ListXXX calls #595

Merged
merged 17 commits into from
Jan 31, 2019

Conversation

yebrahim
Copy link
Contributor

@yebrahim yebrahim commented Dec 26, 2018

Fixes #103.
Adds a second SQL query in the server list objects paths, which runs in a transaction to count matching objects, accounting for filter predicates, but not pagination, and adds a total_size field in list response objects to return the number. Unit and integration tests were updated to make sure the right numbers are returned.

/area back-end


This change is Reviewable

@IronPan
Copy link
Member

IronPan commented Jan 1, 2019

fix #103

Copy link
Member

@IronPan IronPan left a comment

Choose a reason for hiding this comment

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

can you add integration test, or updating the existing integration test for this?

backend/api/experiment.proto Outdated Show resolved Hide resolved
backend/src/apiserver/storage/experiment_store.go Outdated Show resolved Hide resolved
backend/src/apiserver/storage/experiment_store_test.go Outdated Show resolved Hide resolved
backend/src/apiserver/storage/job_store.go Outdated Show resolved Hide resolved
backend/src/apiserver/storage/job_store.go Outdated Show resolved Hide resolved
backend/src/apiserver/storage/pipeline_store.go Outdated Show resolved Hide resolved
@IronPan
Copy link
Member

IronPan commented Jan 1, 2019

/assign @IronPan

backend/src/apiserver/storage/experiment_store.go Outdated Show resolved Hide resolved
backend/src/apiserver/storage/job_store.go Outdated Show resolved Hide resolved
backend/src/apiserver/storage/pipeline_store.go Outdated Show resolved Hide resolved
backend/src/apiserver/storage/experiment_store.go Outdated Show resolved Hide resolved
@yebrahim
Copy link
Contributor Author

yebrahim commented Jan 8, 2019

comments should be resolved now, PTAL.

@yebrahim yebrahim force-pushed the resource-count branch 2 times, most recently from dbb7438 to f5b3d7d Compare January 9, 2019 00:13
Copy link
Contributor

@vicaire vicaire left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the comments. I found a couple more things to address.

backend/src/apiserver/storage/experiment_store.go Outdated Show resolved Hide resolved
backend/src/apiserver/storage/job_store.go Show resolved Hide resolved
backend/src/apiserver/storage/pipeline_store.go Outdated Show resolved Hide resolved
backend/src/apiserver/storage/run_store.go Outdated Show resolved Hide resolved
backend/src/apiserver/storage/run_store.go Outdated Show resolved Hide resolved
backend/src/apiserver/storage/pipeline_store.go Outdated Show resolved Hide resolved
backend/src/apiserver/storage/job_store.go Outdated Show resolved Hide resolved
@yebrahim
Copy link
Contributor Author

yebrahim commented Jan 9, 2019

/test kubeflow-pipeline-build-image

backend/src/apiserver/storage/job_store.go Outdated Show resolved Hide resolved
backend/src/apiserver/storage/job_store.go Show resolved Hide resolved
backend/src/apiserver/storage/job_store.go Show resolved Hide resolved
backend/src/apiserver/storage/pipeline_store.go Outdated Show resolved Hide resolved
backend/src/apiserver/storage/run_store.go Outdated Show resolved Hide resolved
}
if len(results) < newContext.PageSize {
return results, "", nil
func FilterOnResourceReference(tableName string, resourceType common.ResourceType, selectCount bool,
Copy link
Member

@IronPan IronPan Jan 28, 2019

Choose a reason for hiding this comment

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

how about passing "*" and "count(*)" string instead of selectCount boolean flag. maybe consider define them as const? it would be more readable from method caller perspective.

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 can do that, but selectCount is passed through from the different implementations of buildSelectXXXQuery. I think that's a better interface there, since it's being relied on to change the way the query is built. If you really want this change, do you think it should be propagated to all 4 implementations?

backend/src/apiserver/storage/list_util_test.go Outdated Show resolved Hide resolved
return sqlBuilder.From("pipelines").Where(sq.Eq{"Status": model.PipelineReady})
}

sqlBuilder := buildQuery(sq.Select("*"))
Copy link
Member

@IronPan IronPan Jan 28, 2019

Choose a reason for hiding this comment

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

please consider define "*" and "count(*)" as const and use them here

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 don't think this adds any safety, but it risks making the code less readable IMO.
What would you call these variables? Also, do you think we should make the rename everywhere?

backend/src/apiserver/storage/run_store.go Show resolved Hide resolved
backend/src/apiserver/storage/list_util.go Outdated Show resolved Hide resolved
@IronPan
Copy link
Member

IronPan commented Jan 28, 2019

please add integration tests for covering corresponding new API features.

@k8s-ci-robot k8s-ci-robot removed the lgtm label Jan 28, 2019
@yebrahim yebrahim force-pushed the resource-count branch 3 times, most recently from 24c9408 to d4d996c Compare January 29, 2019 07:25
@yebrahim
Copy link
Contributor Author

@IronPan changed integration tests to check TotalSize as well, PTAL.

@vicaire
Copy link
Contributor

vicaire commented Jan 30, 2019

/lgtm

@IronPan
Copy link
Member

IronPan commented Jan 31, 2019

/lgtm

@IronPan
Copy link
Member

IronPan commented Jan 31, 2019

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: IronPan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

1 similar comment
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: IronPan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit ec4d7e8 into kubeflow:master Jan 31, 2019
@yebrahim yebrahim deleted the resource-count branch March 6, 2019 19:06
Linchin pushed a commit to Linchin/pipelines that referenced this pull request Apr 11, 2023
* See kubeflow#595
* This PR is creating a reconciler for the auto deployed clusters.

  * The reconciler compares the list of auto-deployed clusters against
    the master and release branches to determine if we need a cluster
    based off a newer commit.

  * If we do we fire off a K8s job to deploy Kubeflow.

* This PR includes some general utilities

  * assertions.py some useful utilities for writing test assertions
    to compare lists and dictionaries

  * gcp_util some common GCP functionality like an iterator to list
    Deployments.

  * git_repo_manager.py a wrapper class to manage a local clone
    of a git repo.
Linchin pushed a commit to Linchin/pipelines that referenced this pull request Apr 11, 2023
* Create a new Kubeflow cluster to run auto-deploy v2.

* kubeflow#595 we are creating a new version of the infrastructure to auto-deploy
  Kubeflow from master and release branches

* This PR contains the GCP and Kustomize manifests for setting up a new
  Kubeflow cluster where this app will run.

* We can't use the existing kubeflow-testing cluster because that doesn't
  have ISTIO or workload identity which we want for the auto-deploy app.

* Remove OWNERs files
Linchin pushed a commit to Linchin/pipelines that referenced this pull request Apr 11, 2023
* Create skaffold configs and kustomize configs
  for deploying the auto_deployer.

* Create a Dockerfile which just copies the source to try to allow fast
rebuilds

* Delete files for the old auto-deploy jobs.

* Modify create_unique_kf_instance to allow setting labels that can be
  used to identify the auto-deployment.

Miscellaneuous

* Update the playbook about quota errors; unrelated to this PR
  but useful.

Fix kubeflow#595 - AutoDeply V2
Linchin pushed a commit to Linchin/pipelines that referenced this pull request Apr 11, 2023
* Add a README explaining how auto deploy works.

* Delete the old cron jobs since these are no longer used.

Related to kubeflow#595
magdalenakuhn17 pushed a commit to magdalenakuhn17/pipelines that referenced this pull request Oct 22, 2023
HumairAK pushed a commit to red-hat-data-services/data-science-pipelines that referenced this pull request Mar 11, 2024
Resolves kubeflow#595

Signed-off-by: Christian Kadner <ckadner@us.ibm.com>
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.

6 participants