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

Switching base image to ubi8-minimal #536

Merged
merged 4 commits into from
Jan 29, 2020
Merged

Switching base image to ubi8-minimal #536

merged 4 commits into from
Jan 29, 2020

Conversation

depohmel
Copy link
Contributor

@depohmel depohmel commented Jan 27, 2020

Change Overview

RedHat recently introduced Universal Base Image (UBI)
https://www.redhat.com/en/blog/introducing-red-hat-universal-base-image

and this is now a requirement for a project to get into OpneShift marketplace
in order to make for kanister possible to be added into OpenShift marketplace
switching the base image to UBI

Pull request type

Please check the type of change your PR introduces:

  • 🌻 Feature

Test Plan

  • 💪 Manual
  • ⚡ Unit test
make test

k  	github.com/kanisterio/kanister/pkg/output	0.002s
=== RUN   Test
PASS: param_test.go:186: ParamsSuite.TestFetchDeploymentParams	12.783s
PASS: param_test.go:208: ParamsSuite.TestFetchPVCParams	0.004s
PASS: param_test.go:132: ParamsSuite.TestFetchStatefulSetParams	6.335s
PASS: param_test.go:233: ParamsSuite.TestNewTemplateParamsDeployment	12.803s
PASS: param_test.go:266: ParamsSuite.TestNewTemplateParamsNamespace	1.399s
PASS: param_test.go:259: ParamsSuite.TestNewTemplateParamsPVC	1.803s
PASS: param_test.go:246: ParamsSuite.TestNewTemplateParamsStatefulSet	6.417s
PASS: param_test.go:271: ParamsSuite.TestNewTemplateParamsUnstructured	1.601s
PASS: param_test.go:533: ParamsSuite.TestPhaseParams	1.599s
PASS: param_test.go:435: ParamsSuite.TestProfile	0.002s
PASS: param_test.go:608: ParamsSuite.TestRenderingPhaseParams	0.002s
PASS: param_test.go:392: ParamsSuite.TestfetchKVSecretCredential	0.001s
PASS: render_test.go:27: RenderSuite.TestRender	0.005s
PASS: render_test.go:137: RenderSuite.TestRenderObjects	0.002s
OK: 14 passed
--- PASS: Test (47.89s)
PASS
ok  	github.com/kanisterio/kanister/pkg/param	47.900s
=== RUN   Test
PASS: poll_test.go:59: PollSuite.TestWaitWithBackoff	0.201s
PASS: poll_test.go:133: PollSuite.TestWaitWithBackoffBackoff	0.010s
PASS: poll_test.go:119: PollSuite.TestWaitWithBackoffCancellation	0.001s
OK: 3 passed
--- PASS: Test (0.21s)
PASS
ok  	github.com/kanisterio/kanister/pkg/poll	0.214s
?   	github.com/kanisterio/kanister/pkg/postgres	[no test files]
=== RUN   Test
PASS: reconcile_test.go:127: ReconcileSuite.TestHandleConflict	1.801s
PASS: reconcile_test.go:109: ReconcileSuite.TestSetFailed	0.595s
OK: 2 passed
--- PASS: Test (2.42s)
PASS
ok  	github.com/kanisterio/kanister/pkg/reconcile	2.435s
=== RUN   Test
PASS: resource_test.go:63: ResourceSuite.TestActionSetClient	1.590s
PASS: resource_test.go:104: ResourceSuite.TestBlueprintClient	1.595s
OK: 2 passed
--- PASS: Test (3.21s)
PASS
ok  	github.com/kanisterio/kanister/pkg/resource	3.216s
=== RUN   Test
PASS: restic_test.go:296: ResticDataSuite.TestDoesRepoExist	0.000s
PASS: restic_test.go:51: ResticDataSuite.TestGetSnapshotID	0.000s
PASS: restic_test.go:35: ResticDataSuite.TestGetSnapshotIDFromTag	0.000s
PASS: restic_test.go:264: ResticDataSuite.TestGetSnapshotIDsFromSnapshotCommand	0.000s
PASS: restic_test.go:312: ResticDataSuite.TestGetSnapshotStatsFromBackupLog	0.003s
PASS: restic_test.go:230: ResticDataSuite.TestGetSnapshotStatsFromStatsLog	0.000s
PASS: restic_test.go:248: ResticDataSuite.TestGetSnapshotStatsModeFromStatsLog	0.000s
PASS: restic_test.go:378: ResticDataSuite.TestGetSpaceFreedFromPruneLog	0.001s
PASS: restic_test.go:280: ResticDataSuite.TestIsPasswordIncorrect	0.000s
PASS: restic_test.go:66: ResticDataSuite.TestResticArgs	0.000s
SKIP: restic_test.go:179: ResticDataSuite.TestResticArgsWithAWSRole (Test ResticDataSuite.TestResticArgsWithAWSRole requires the environemnt variable 'AWS_ACCESS_KEY_ID')
PASS: restic_test.go:418: ResticDataSuite.TestResticSizeStringParser	0.000s
OK: 11 passed, 1 skipped
--- PASS: Test (0.01s)
PASS
ok  	github.com/kanisterio/kanister/pkg/restic	0.018s
=== RUN   Test
PASS: aws_test.go:17: AWSSecretSuite.TestExtractAWSCredentials	0.000s
SKIP: aws_test.go:85: AWSSecretSuite.TestExtractAWSCredentialsWithSessionToken (Test AWSSecretSuite.TestExtractAWSCredentialsWithSessionToken requires the environemnt variable 'AWS_ACCESS_KEY_ID')
OK: 1 passed, 1 skipped
--- PASS: Test (0.00s)
PASS
ok  	github.com/kanisterio/kanister/pkg/secrets	0.006s
=== RUN   Test
OK: 0 passed
--- PASS: Test (0.00s)
PASS
ok  	github.com/kanisterio/kanister/pkg/testing	0.001s
=== RUN   Test
PASS: func_test.go:63: FuncSuite.TestArgsFunc	0.000s
PASS: func_test.go:84: FuncSuite.TestCancelFunc	0.000s
PASS: func_test.go:37: FuncSuite.TestFailFunc	0.000s
PASS: func_test.go:73: FuncSuite.TestOutputFunc	0.000s
PASS: func_test.go:46: FuncSuite.TestWaitFunc	0.000s
PASS: testutil_test.go:36: TestUtilSuite.TestDeployment	0.076s
OK: 6 passed
--- PASS: Test (0.08s)
PASS
ok  	github.com/kanisterio/kanister/pkg/testutil	0.093s
=== RUN   Test
PASS: mockblockstorage_test.go:31: MockSuite.TestMockStorage	0.000s
OK: 1 passed
--- PASS: Test (0.00s)
PASS
ok  	github.com/kanisterio/kanister/pkg/testutil/mockblockstorage	0.017s
=== RUN   Test
PASS: error_test.go:28: ErrorSuite.TestIsError	0.000s
PASS: validate_test.go:34: ValidateSuite.TestActionSet	0.000s
PASS: validate_test.go:336: ValidateSuite.TestActionSetStatus	0.000s
PASS: validate_test.go:479: ValidateSuite.TestBlueprint	0.000s
PASS: validate_test.go:484: ValidateSuite.TestProfileSchema	0.000s
OK: 5 passed
--- PASS: Test (0.00s)
PASS
ok  	github.com/kanisterio/kanister/pkg/validate	0.014s
?   	github.com/kanisterio/kanister/pkg/version	[no test files]

PASS

Copy link
Contributor

@tdmanv tdmanv left a comment

Choose a reason for hiding this comment

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

@@ -1,6 +1,10 @@
FROM ARG_FROM
ARG base_image=registry.access.redhat.com/ubi8/ubi-minimal:8.1
Copy link
Contributor

Choose a reason for hiding this comment

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

do we use this file anymore? Let's remove it if not

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure... let me check.
make file is using package.sh

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's part of goreleaser :(
nice catch

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we probably need a way of auto get docker files for goreleaser

Copy link
Contributor

Choose a reason for hiding this comment

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

we do use Dockerfile.in in k10:

 636 docker_package_kanister() {
 637     local image_tag=${1:?"Image tag unspecified. Pick a tag that is unique for every code change."}
 638     pushd "${KANISTER_PATH}"
 639     cp ${BASE_DIR}/go/bin/controller controller
 640     GO111MODULE=on BIN=controller ARCH=amd64 BASEIMAGE=alpine \
 641         IMAGE=${DOCKER_ECR}/kanister VERSION=${image_tag}     \
 642         SOURCE_BIN=controller                                 \
 643         ./build/package.sh
 644     popd

-e "s|ARG_SOURCE_BIN|${SOURCE_BIN}|g" \
Dockerfile.in > .dockerfile-${ARCH}
docker build -t ${IMAGE}:${VERSION} -f .dockerfile-${ARCH} .
docker build ${baseimagearg:-} -t ${IMAGE}:${VERSION} -f .dockerfile-${ARCH} .
Copy link
Contributor

Choose a reason for hiding this comment

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

build args make way more sense. I think this pattern was something I copied from Tim Hockins. Let's switch to build args completely in a followup.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds good to me ;)

@mergify mergify bot merged commit 13e8742 into master Jan 29, 2020
@mergify mergify bot deleted the ubi-base-image branch January 29, 2020 18:44
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.

2 participants