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

Provide a container image with development tools #873

Closed
wants to merge 1 commit into from

Conversation

akram
Copy link
Contributor

@akram akram commented Sep 22, 2021

Changes

NONE

Fixes #586
Fixes #832

Submitter Checklist

  • Includes tests if functionality changed/was added
  • Includes docs if changes are user-facing
  • Set a kind label on this PR
  • Release notes block has been filled in, or marked NONE

See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.

@openshift-ci openshift-ci bot added the release-note Label for when a PR has specified a release note label Sep 22, 2021
@akram akram force-pushed the development-tools branch 2 times, most recently from 44e7f76 to 7173c36 Compare September 22, 2021 16:20
@akram
Copy link
Contributor Author

akram commented Sep 22, 2021

it is also a workaround for #832 , so let's say: fixes #832 temporarly

@gabemontero
Copy link
Member

it is also a workaround for #832 , so let's say: fixes #832 temporarly

I think we should say it "officially" fixes it .... let's not gate our issue on when they get a new version of controller-gen out with your upstream fix @akram

@gabemontero
Copy link
Member

it is also a workaround for #832 , so let's say: fixes #832 temporarly

I think we should say it "officially" fixes it .... let's not gate our issue on when they get a new version of controller-gen out with your upstream fix @akram

pending the hiccup I'm seeing that we are discussing in slack :-)

@openshift-ci openshift-ci bot added release-note-none Label for when a PR does not need a release note and removed release-note Label for when a PR has specified a release note labels Sep 27, 2021
@akram
Copy link
Contributor Author

akram commented Sep 27, 2021

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 27, 2021

@akram: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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.

@akram
Copy link
Contributor Author

akram commented Sep 27, 2021

/assign @otaviof @gabemontero

Copy link
Member

@SaschaSchwarze0 SaschaSchwarze0 left a 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
Copy link
Member

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:

Subsequently, we don't need make container-image and make container-make can use the image from our shipwright-org.

Copy link
Contributor Author

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.

Makefile Outdated Show resolved Hide resolved
@gabemontero
Copy link
Member

/kind dependency-change

@openshift-ci openshift-ci bot added the kind/dependency-change Categorizes issue or PR as related to changing dependencies label Oct 4, 2021
@gabemontero
Copy link
Member

/approve

will let @SaschaSchwarze0 @otaviof do the LGTM once their requests have been addressed

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 4, 2021

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 4, 2021
@adambkaplan
Copy link
Member

@akram bump on this pull request. Are you still working on this?

@akram akram force-pushed the development-tools branch from 2cde809 to d40d143 Compare October 29, 2021 15:34
@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 29, 2021
@akram
Copy link
Contributor Author

akram commented Oct 29, 2021

@adambkaplan : I just updated it. For sure, that's helpful for the hackaton

@akram akram force-pushed the development-tools branch from d40d143 to 5a148ac Compare October 29, 2021 15:55
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 29, 2021
Copy link
Member

@SaschaSchwarze0 SaschaSchwarze0 left a 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.

HACK.md Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@akram akram force-pushed the development-tools branch from 5a148ac to 34485e6 Compare November 2, 2021 08:18
@akram akram force-pushed the development-tools branch from 34485e6 to 44c5735 Compare November 2, 2021 09:01
Copy link
Member

@SaschaSchwarze0 SaschaSchwarze0 left a 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).

Comment on lines +75 to +84
# 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
Copy link
Member

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.

Suggested change
# 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

Comment on lines +90 to +91
container-image: ## Build a container image for the preview of the website
$(CONTAINER_ENGINE) build -f $(DEVELOPER_TOOLS_DOCKERFILE) --tag $(CONTAINER_IMAGE)
Copy link
Member

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.

Comment on lines +93 to +94
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)
Copy link
Member

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.

Suggested change
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)

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 23, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 23, 2021

@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.

@adambkaplan
Copy link
Member

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 23, 2022
@qu1queee
Copy link
Contributor

qu1queee commented Dec 6, 2023

Closing per the stale status, please feel free to reopen.

@qu1queee qu1queee closed this Dec 6, 2023
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. kind/dependency-change Categorizes issue or PR as related to changing dependencies lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none Label for when a PR does not need a release note
Projects
None yet
6 participants