Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Create gcloud-bazel image for running e2e tests #156

Merged
merged 1 commit into from
Jul 3, 2018

Conversation

fejta
Copy link
Contributor

@fejta fejta commented Jul 2, 2018

/assign @erain

Next will create a prow job which uses this image and runs test-e2e.sh

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fejta

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
Copy link

Hi @fejta. Thanks for your PR.

I'm waiting for a bazelbuild member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

I understand the commands that are listed here.

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.

Copy link
Contributor

@erain erain left a comment

Choose a reason for hiding this comment

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

Most of the part LGTM, especially starting the e2e tests from a docker container.

Some minor comments.


# Ubuntu with bazel, gcloud and its dependencies preinstalled.

FROM ubuntu:16.04
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we use a google-maintained base image?

https://console.cloud.google.com/launcher/details/google/ubuntu16_04

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -0,0 +1,2 @@
# TODO(fejta): replace Dockerfile with an equivalent bazel rule. This seems promising:
# https://github.com/GoogleContainerTools/base-images-docker/blob/master/package_managers/bootstrap_image.bzl
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes I think (for TODO) package manager is the way to go.

@xingao267 has done quite many works around package manager.

Copy link
Member

Choose a reason for hiding this comment

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

Yes. Using package manager is promising. We've been using that to install java, wget, git, bazel, docker, and etc in our containers. But we haven't tried gcloud yet (it's on our list), and we are not sure if extra work will be needed to make that work (it could be just as simple as what we did below for Bazel).

I think we can use Dockerfile for now. I'll look into installing gcloud, and once that works. We can change this Dockerfile to bazel rules.

For your interest, we use rules here https://github.com/bazelbuild/bazel-toolchains/blob/master/container/rules/docker_toolchains.bzl to create containers. These rules wrap rules in https://github.com/GoogleContainerTools/base-images-docker/blob/master/package_managers. Example usage of the rules are:

https://github.com/bazelbuild/bazel-toolchains/blob/master/container/ubuntu16_04/builders/bazel/BUILD#L23
https://github.com/bazelbuild/bazel-toolchains/blob/master/container/ubuntu16_04/layers/bazel/BUILD

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ack

I'll circle back later and try and figure out how to use these rules.

@@ -0,0 +1,30 @@
# Copyright 2017 The Bazel Authors. All rights reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

Using a Makefile is not ideal to me...

We usually use a cloudbuild.yaml to build a container even for only one step (build from a Dockerfile). In this way we can ensure all the containers are build in a controlled environment with Google Cloud Container Builder

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

The Makefile is necessary to get the tags I want, but it now uses gcb to push builds.

@@ -0,0 +1,2 @@
# TODO(fejta): replace Dockerfile with an equivalent bazel rule. This seems promising:
Copy link
Member

Choose a reason for hiding this comment

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

License header

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -0,0 +1,2 @@
# TODO(fejta): replace Dockerfile with an equivalent bazel rule. This seems promising:
# https://github.com/GoogleContainerTools/base-images-docker/blob/master/package_managers/bootstrap_image.bzl
Copy link
Member

Choose a reason for hiding this comment

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

Yes. Using package manager is promising. We've been using that to install java, wget, git, bazel, docker, and etc in our containers. But we haven't tried gcloud yet (it's on our list), and we are not sure if extra work will be needed to make that work (it could be just as simple as what we did below for Bazel).

I think we can use Dockerfile for now. I'll look into installing gcloud, and once that works. We can change this Dockerfile to bazel rules.

For your interest, we use rules here https://github.com/bazelbuild/bazel-toolchains/blob/master/container/rules/docker_toolchains.bzl to create containers. These rules wrap rules in https://github.com/GoogleContainerTools/base-images-docker/blob/master/package_managers. Example usage of the rules are:

https://github.com/bazelbuild/bazel-toolchains/blob/master/container/ubuntu16_04/builders/bazel/BUILD#L23
https://github.com/bazelbuild/bazel-toolchains/blob/master/container/ubuntu16_04/layers/bazel/BUILD

Copy link
Contributor Author

@fejta fejta 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 all the great comments!

@@ -0,0 +1,2 @@
# TODO(fejta): replace Dockerfile with an equivalent bazel rule. This seems promising:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -0,0 +1,2 @@
# TODO(fejta): replace Dockerfile with an equivalent bazel rule. This seems promising:
# https://github.com/GoogleContainerTools/base-images-docker/blob/master/package_managers/bootstrap_image.bzl
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ack

I'll circle back later and try and figure out how to use these rules.


# Ubuntu with bazel, gcloud and its dependencies preinstalled.

FROM ubuntu:16.04
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -0,0 +1,30 @@
# Copyright 2017 The Bazel Authors. All rights reserved.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

The Makefile is necessary to get the tags I want, but it now uses gcb to push builds.

@fejta fejta merged commit d6e1b65 into bazelbuild:master Jul 3, 2018
@fejta fejta deleted the prow branch July 3, 2018 19:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants