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

move builder images to use external apis #17699

Merged
merged 2 commits into from
Jan 5, 2018

Conversation

bparees
Copy link
Contributor

@bparees bparees commented Dec 8, 2017

No description provided.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 8, 2017
@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 8, 2017
@bparees bparees force-pushed the external_buildapi2 branch from 39caa0f to 628cbdf Compare December 8, 2017 19:40
@@ -215,14 +215,14 @@ func main() {

// make sure that all the allowed imports are used
if unused := unusedPackageImports(restriction.AllowedImportPackages, packages); len(unused) > 0 {
log.Printf("-- found unused package imports\n")
log.Printf("-- found unused allowed package imports(remove them)\n")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@deads2k

heh. Sure.

@bparees
Copy link
Contributor Author

bparees commented Dec 11, 2017

/retest

@bparees
Copy link
Contributor Author

bparees commented Dec 11, 2017

@openshift/sig-developer-experience @deads2k ptal. Note that I will be relocating the new/duplicated constants from their present "utils" location into the external api types file once the dust settles from the rebase.

Copy link
Contributor

@gabemontero gabemontero left a comment

Choose a reason for hiding this comment

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

lgtm

One question: I saw the verify test passed ... just curious about the need for make update type changes; were they done previously, when the new api packages were first introduced, and simply referencing them here in pkg/build is orthogonal?

@bparees
Copy link
Contributor Author

bparees commented Dec 13, 2017

just curious about the need for make update type changes; were they done previously, when the new api packages were first introduced, and simply referencing them here in pkg/build is orthogonal?

any time you pull external api changes into origin you need to run make update as part of your PR because the conversion code (between the external types and internal types) lives in origin and must be updated.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 14, 2017
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 14, 2017
@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 14, 2017
@openshift-merge-robot openshift-merge-robot added the vendor-update Touching vendor dir or related files label Dec 14, 2017
@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 14, 2017
@bparees bparees force-pushed the external_buildapi2 branch 4 times, most recently from 40b5759 to 7e64054 Compare December 15, 2017 16:36
obj, groupVersionKind, err := legacyscheme.Codecs.UniversalDecoder().Decode([]byte(buildStr), nil, nil)
cfg.build = &buildapiv1.Build{}

obj, groupVersionKind, err := legacyscheme.Codecs.UniversalDecoder().Decode([]byte(buildStr), nil, cfg.build)
Copy link
Contributor

Choose a reason for hiding this comment

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

The legacy scheme keeps you pinned to the internal versions to operate. You'll need a follow up to remove the dependency. Definitely not a blocker.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is there a different decoder/scheme I should be using instead?

@@ -73,11 +71,8 @@ func newBuilderConfigFromEnvironment(out io.Writer, needsDocker bool) (*builderC
}
glog.V(4).Infof("redacted build: %v", string(bytes))
}
if errs := validation.ValidateBuild(cfg.build); len(errs) > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting. What did you want this protection for?

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 think it was belt+suspenders. It sort of confirmed that the build object we serialized into the env variable was in fact still valid when we deserialized it on the other side. The build object would have already been through validation when it was created in the first place. Given how impossible it would have been to retain this check(since validation runs against internal apis), I opted for removing the additional protection.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it was belt+suspenders. It sort of confirmed that the build object we serialized into the env variable was in fact still valid when we deserialized it on the other side. The build object would have already been through validation when it was created in the first place. Given how impossible it would have been to retain this check(since validation runs against internal apis), I opted for removing the additional protection.

Ok. In general, client-side validation on something like this is questionable since the client rules are unlikely to consistently match the server rules.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right, well prior to splitting things out it was using the same rules(same code). but now it's being removed so it's moot.

stages := fromContext(ctx)
return *stages
}

// RecordStageAndStepInfo records details about each build stage and step
func RecordStageAndStepInfo(stages []buildapiv1.StageInfo, stageName buildapiv1.StageName, stepName buildapiv1.StepName, startTime metav1.Time, endTime metav1.Time) []buildapiv1.StageInfo {
Copy link
Contributor

Choose a reason for hiding this comment

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

Straight move?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

other than changing it to use external api objects, yeah.


// OriginVersion is an environment variable key that indicates the version of origin that
// created this build definition.
OriginVersion = "ORIGIN_VERSION"
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these guaranteed in any way for custom builds?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

sort of? we document it here:
https://docs.openshift.org/latest/creating_images/custom.html#custom-builder-image

That makes it sound a lot like an API constant. Doesn't need to move here, but if it is guaranteed, we can't change it, and we expect clients to consume it, then it is a good target for moving to openshift/api.

@deads2k
Copy link
Contributor

deads2k commented Dec 15, 2017

Very minor comments, nothing that would keep me from merging this as-is (minus the bump thing).

lgtm

@bparees bparees changed the title [WIP] move builder images to use external apis move builder images to use external apis Dec 19, 2017
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 19, 2017
@bparees bparees changed the title move builder images to use external apis [WIP] move builder images to use external apis Dec 19, 2017
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 19, 2017
@bparees
Copy link
Contributor Author

bparees commented Dec 19, 2017

/retest

@bparees
Copy link
Contributor Author

bparees commented Dec 20, 2017

/retest

@bparees bparees force-pushed the external_buildapi2 branch from 3ce3e8a to 05adf6e Compare January 2, 2018 14:45
@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 2, 2018
@bparees bparees changed the title [WIP] move builder images to use external apis move builder images to use external apis Jan 2, 2018
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 2, 2018
@bparees bparees force-pushed the external_buildapi2 branch from 05adf6e to 66c9d91 Compare January 3, 2018 15:11
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bparees

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

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 3, 2018
@openshift-merge-robot openshift-merge-robot removed the vendor-update Touching vendor dir or related files label Jan 3, 2018
@bparees bparees added the lgtm Indicates that a PR is ready to be merged. label Jan 3, 2018
@bparees
Copy link
Contributor Author

bparees commented Jan 3, 2018

#17970

/retest

@bparees
Copy link
Contributor Author

bparees commented Jan 4, 2018

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot
Copy link
Contributor

/test all [submit-queue is verifying that this PR is safe to merge]

@openshift-ci-robot
Copy link

@bparees: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/openshift-jenkins/extended_image_ecosystem 05adf6e link /test extended_image_ecosystem
ci/openshift-jenkins/extended_conformance_gce 66c9d91 link /test extended_conformance_gce
ci/openshift-jenkins/extended_conformance_install 66c9d91 link /test extended_conformance_install

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-robot
Copy link
Contributor

Automatic merge from submit-queue (batch tested with PRs 17699, 17820).

@openshift-merge-robot openshift-merge-robot merged commit ceb0625 into openshift:master Jan 5, 2018
@bparees bparees deleted the external_buildapi2 branch January 8, 2018 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants