-
Notifications
You must be signed in to change notification settings - Fork 113
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
Provide a container image with development tools #873
Conversation
44e7f76
to
7173c36
Compare
/retest |
@akram: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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. |
/assign @otaviof @gabemontero |
7173c36
to
2cde809
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be a nice tool, thank you. Suggesting a "little" relocation.
Dockerfile
Outdated
@@ -0,0 +1,10 @@ | |||
FROM ubuntu:21.04 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should not be such prominent in the root directory of the project, I think, people might think that this builds the project output. Here is my proposal:
- move it to a sub-directory inside https://github.com/shipwright-io/build/tree/main/images
- we can build the image nightly, for example in https://github.com/shipwright-io/build/blob/main/.github/workflows/base-images.yaml, the file name is a bit mis-leading (could be images.yaml instead), I think you can even let it build multi-platform like we do for the git base image
Subsequently, we don't need make container-image
and make container-make
can use the image from our shipwright-org.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it @SaschaSchwarze0 except the last point
Subsequently, we don't need make container-image and make container-make can use the image from our shipwright-org.
/kind dependency-change |
/approve will let @SaschaSchwarze0 @otaviof do the LGTM once their requests have been addressed |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gabemontero 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 |
@akram bump on this pull request. Are you still working on this? |
2cde809
to
d40d143
Compare
@adambkaplan : I just updated it. For sure, that's helpful for the hackaton |
d40d143
to
5a148ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll have to make changes to the images.yaml to build the image.
5a148ac
to
34485e6
Compare
34485e6
to
44c5735
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @akram, in response to #873 (comment).
# The CONTAINER_ENGINE variable is used for specifying the container engine. By default 'docker' is used | ||
# # but this can be overridden when calling make, e.g. | ||
# # CONTAINER_ENGINE=podman make container-image | ||
CONTAINER_ENGINE ?= docker | ||
IMAGE_REGISTRY ?= ghcr.io/shipwright-io | ||
SHIPWRIGHT_VERSION = latest | ||
DEVELOPER_TOOLS_DOCKERFILE = images/developer-tools/Dockerfile | ||
IMAGE_VERSION = $(shell scripts/hash-files.sh $(DEVELOPER_TOOLS_DOCKERFILE) Makefile | cut -c 1-12) | ||
CONTAINER_IMAGE = $(IMAGE_REGISTRY)/shipwright-builder-image:$(SHIPWRIGHT_VERSION)-$(IMAGE_VERSION) | ||
CONTAINER_RUN = $(CONTAINER_ENGINE) run --rm --interactive --tty --volume $(CURDIR):/src |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imo overcomplicated wrt the amount of variables used here.
# The CONTAINER_ENGINE variable is used for specifying the container engine. By default 'docker' is used | |
# # but this can be overridden when calling make, e.g. | |
# # CONTAINER_ENGINE=podman make container-image | |
CONTAINER_ENGINE ?= docker | |
IMAGE_REGISTRY ?= ghcr.io/shipwright-io | |
SHIPWRIGHT_VERSION = latest | |
DEVELOPER_TOOLS_DOCKERFILE = images/developer-tools/Dockerfile | |
IMAGE_VERSION = $(shell scripts/hash-files.sh $(DEVELOPER_TOOLS_DOCKERFILE) Makefile | cut -c 1-12) | |
CONTAINER_IMAGE = $(IMAGE_REGISTRY)/shipwright-builder-image:$(SHIPWRIGHT_VERSION)-$(IMAGE_VERSION) | |
CONTAINER_RUN = $(CONTAINER_ENGINE) run --rm --interactive --tty --volume $(CURDIR):/src | |
# The CONTAINER_ENGINE variable is used for specifying the container engine. By default 'docker' is used | |
# # but this can be overridden when calling make, e.g. | |
# # CONTAINER_ENGINE=podman make container-make | |
CONTAINER_ENGINE ?= docker | |
BUILDER_IMAGE ?= ghcr.io/shipwright-io/shipwright-builder-image:latest |
container-image: ## Build a container image for the preview of the website | ||
$(CONTAINER_ENGINE) build -f $(DEVELOPER_TOOLS_DOCKERFILE) --tag $(CONTAINER_IMAGE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd remove this because the image is built by the GitHub action and can be consumed instead of everybody being required to build it locally. The only use other use case would be to locally build it for developer purposes. If we really think that we need a make target for this, then I'd rename the target to build-shipwright-builder-image
.
container-make: container-image ## Run make using the development container. A target can be passed using the TARGET=my-target argument. Example: `make container-make TARGET=ginkgo` Run `make container-image` before this. | ||
$(CONTAINER_RUN) --cap-drop=ALL --cap-add=AUDIT_WRITE --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 $(CONTAINER_IMAGE) make $(TARGET) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use the public one.
container-make: container-image ## Run make using the development container. A target can be passed using the TARGET=my-target argument. Example: `make container-make TARGET=ginkgo` Run `make container-image` before this. | |
$(CONTAINER_RUN) --cap-drop=ALL --cap-add=AUDIT_WRITE --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 $(CONTAINER_IMAGE) make $(TARGET) | |
container-make: ## Run make using the development container. A target can be passed using the TARGET=my-target argument. Example: `make container-make TARGET=ginkgo` | |
$(CONTAINER_ENGINE) run --rm --interactive --tty --volume $(CURDIR):/src --cap-drop=ALL --cap-add=AUDIT_WRITE --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 $(BUILDER_IMAGE) make $(TARGET) |
@akram: PR needs rebase. 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. |
/lifecycle stale |
Closing per the stale status, please feel free to reopen. |
Changes
Fixes #586
Fixes #832
Submitter Checklist
See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.