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

Load sample when pipeline initially started #615

Merged
merged 9 commits into from
Jan 4, 2019

Conversation

IronPan
Copy link
Member

@IronPan IronPan commented Jan 3, 2019

Instead of using a K8s Job to load the sample, this change load the sample when pipeline backend is started and create a permanent system info table to store the state, so we don't load them again in case of pod failover or during upgrade.

The K8s Job doesn't work well because it's immutable once created, ksonnet throw an error of "merging object with existing state failure" in case of upgrading the system.

The system info table will potentially also be useful in the future for storing the debugging information such as versions, upgrade history, DB version etc.


This change is Reviewable

if !rows.Next() {
sql, args, err := sq.
Insert("system_infos").
SetMap(sq.Eq{"IsSampleLoaded": false}).
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this NoSQL in SQL? :)
Can you add some more description of what SystemInfoStore does? It sounds to me similar to what a config file does.

Copy link
Member Author

Choose a reason for hiding this comment

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

it's actually only storing the status of the database. so i rename it to db_status_store. it would make more sense to be stored inside the db itself.

if !rows.Next() {
sql, args, err := sq.
Insert("system_infos").
SetMap(sq.Eq{"IsSampleLoaded": false}).
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Can we move the map to a constant at the top of the file, since this is basically the system's default config?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

rows, err := tx.Query(getSystemInfoSql, getSystemInfoArgs...)
if err != nil {
tx.Rollback()
return util.NewInternalServerError(err, "Failed to get load sample status")
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this should say "Failed to load system information/state/..."

Copy link
Member Author

Choose a reason for hiding this comment

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

done

}

func (s *SystemInfoStore) InitializeSystemInfoTable() error {
getSystemInfoSql, getSystemInfoArgs, err := sq.Select("*").From("system_infos").ToSql()
Copy link
Contributor

Choose a reason for hiding this comment

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

s/system_infos/system_configmap/? or maybe system_config?

Copy link
Member Author

Choose a reason for hiding this comment

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

ack

)

type SystemInfoStoreInterface interface {
IsSampleLoaded() (bool, error)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: maybe haveSamplesLoaded?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@yebrahim
Copy link
Contributor

yebrahim commented Jan 3, 2019

/lgtm

@IronPan
Copy link
Member Author

IronPan commented Jan 4, 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

@IronPan
Copy link
Member Author

IronPan commented Jan 4, 2019

Fix #615

@k8s-ci-robot k8s-ci-robot merged commit 808a83c into kubeflow:master Jan 4, 2019
Linchin pushed a commit to Linchin/pipelines that referenced this pull request Apr 11, 2023
* add pytest

* install kubernetes

* install google-api-client & yq

* install google-cloud

* update

* update img to pass kfctl e2e test

* add httplib

* remove httplib

* sort
magdalenakuhn17 pushed a commit to magdalenakuhn17/pipelines that referenced this pull request Oct 22, 2023
* Return application/json as content-type header

* Call validate after preprocess in ExplainHandler

* Add new line at end of file
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.

4 participants