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

don't use alpine for testing #1840

Merged
merged 2 commits into from Feb 8, 2023
Merged

Conversation

aojea
Copy link
Member

@aojea aojea commented Oct 18, 2022

Alpine image doesn't have gcc installed, that is required if we want to test with the race detector.
It also uses muslc instead of libc, that use to be conflictive with network features.
Switching to the ubuntu images, we have to explicitly use bash, since ubuntu defaults sh to dash, that doesn't support some bashism like set -o pipefail

In addition, remove the BASEIMAGE variable that doesn't seem to be used anywhere, a grep with current state doesn't show any match.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 18, 2022
@aojea
Copy link
Member Author

aojea commented Oct 18, 2022

/assign @panslava @cezarygerard @code-elinka

@k8s-ci-robot
Copy link
Contributor

@aojea: GitHub didn't allow me to assign the following users: code-elinka.

Note that only kubernetes members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign @panslava @cezarygerard @code-elinka

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.

@@ -40,22 +40,6 @@ SRC_DIRS := cmd pkg

ALL_ARCH ?= amd64 arm arm64 ppc64le s390x
NOBODY ?= nobody
# Set default base image dynamically for each arch
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you remove this switch?
the golang:1.18 is na multiarch image?

Copy link
Member Author

Choose a reason for hiding this comment

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

it's in the commit message 😄 , the BASEIMAGE parameter is not being used, at least I don't know where, it must be a legacy thing, because the sed below replaces ARG_FROM for BASEIMAGE, but there is no ARG_FROM 🤷

grep ARG Dockerfile.*
Dockerfile.404-server:ADD bin/ARG_ARCH/ARG_BIN /ARG_BIN
Dockerfile.404-server:ENTRYPOINT ["/ARG_BIN"]
Dockerfile.404-server-with-metrics:ADD bin/ARG_ARCH/ARG_BIN /ARG_BIN
Dockerfile.404-server-with-metrics:ENTRYPOINT ["/ARG_BIN"]
Dockerfile.e2e-test:ADD bin/ARG_ARCH/ARG_BIN /ARG_BIN
Dockerfile.echo:ADD bin/ARG_ARCH/ARG_BIN /ARG_BIN
Dockerfile.echo:ENTRYPOINT ["/ARG_BIN"]
Dockerfile.fuzzer:ADD bin/ARG_ARCH/ARG_BIN /ARG_BIN
Dockerfile.fuzzer:ENTRYPOINT ["/ARG_BIN"]
Dockerfile.glbc:ADD bin/ARG_ARCH/ARG_BIN /ARG_BIN
Dockerfile.glbc:ENTRYPOINT ["/ARG_BIN"]
Dockerfile.workload-controller:ADD bin/ARG_ARCH/ARG_BIN /ARG_BIN
Dockerfile.workload-controller:ENTRYPOINT ["/ARG_BIN"]
Dockerfile.workload-daemon:ADD bin/ARG_ARCH/ARG_BIN /ARG_BIN
Dockerfile.workload-daemon:ENTRYPOINT ["/ARG_BIN"]

@code-elinka
Copy link
Contributor

/lgtm Thank you!

@code-elinka
Copy link
Contributor

/approve Let me check if I can approve it

@aojea
Copy link
Member Author

aojea commented Oct 21, 2022

/assign @swetharepakula @bowei

they may have more historical context

@cezarygerard
Copy link
Contributor

is it possible to use
http://gcr.io/gke-release/gke-distroless/bash

@aojea
Copy link
Member Author

aojea commented Oct 21, 2022

is it possible to use http://gcr.io/gke-release/gke-distroless/bash

This image changed here is used just for testing (and I think for building the binaries), is not the one used for the released artifacts, I see the Makefile calls

ingress-gce/build/rules.mk

Lines 155 to 164 in 3285151

.$(BUILDSTAMP_NAME)-container: bin/$(ARCH)/$(BINARY)
@echo "container: bin/$(ARCH)/$(BINARY) ($(CONTAINER_NAME))"
@docker pull $(BASEIMAGE)
@docker build \
$(DOCKER_BUILD_FLAGS) \
-t $(CONTAINER_NAME):$(VERSION) \
-f .$(BINARY)-$(ARCH)-dockerfile . \
$(VERBOSE_OUTPUT)
@echo "$(CONTAINER_NAME):$(VERSION)" > $$@
@docker images -q $(CONTAINER_NAME):$(VERSION) >> $$@

and each independent dockerfile picks its own base image, per example the glbc image

# This image requires ca-certificate, which is pre-installed in distroless.
FROM gcr.io/distroless/static:latest
ADD bin/ARG_ARCH/ARG_BIN /ARG_BIN
ENTRYPOINT ["/ARG_BIN"]

# This image requires ca-certificate, which is pre-installed in distroless.
FROM gcr.io/distroless/static:latest
ADD bin/ARG_ARCH/ARG_BIN /ARG_BIN
ENTRYPOINT ["/ARG_BIN"]

this was the only way to do these things until docker created the multi-staged buld and the buildx releases, it will be nice to modernize the tooling here, kubernetes/release have some examples on how to use cloudbuild and buildx for it, see an example

https://github.com/kubernetes/release/tree/master/images/build/go-runner

@code-elinka
Copy link
Contributor

@aojea RUN command by default runs sh: https://docs.docker.com/engine/reference/builder/#run. So we need to run moby/moby#7281 (comment)

@aojea
Copy link
Member Author

aojea commented Nov 8, 2022

@aojea RUN command by default runs sh: https://docs.docker.com/engine/reference/builder/#run. So we need to run moby/moby#7281 (comment)

that is why I've changed the shebangson the scripts , to choose bashas interpreter

https://github.com/kubernetes/ingress-gce/pull/1840/files#diff-3f7d49350a6a3bec207a7ebd38c18354d40bdefa5aba9d10a5302e8ac1c5f2bfR1

@code-elinka
Copy link
Contributor

@aojea Do we want to change

/bin/sh -c " \
and
/bin/sh -c " \
as well?

@aojea
Copy link
Member Author

aojea commented Nov 18, 2022

@aojea Do we want to change

/bin/sh -c " \

and

/bin/sh -c " \

as well?

no need

ubuntu images use dash for sh, use bash explicitly
@swetharepakula
Copy link
Member

I don't have the context behind the BASE_IMAGE arg, but I think since this is test, it safe for us to merge. We can monitor and see if any errors occur and make the necessary changes then.

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 8, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aojea, code-elinka, swetharepakula

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 k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 8, 2023
@k8s-ci-robot k8s-ci-robot merged commit 8d91ce9 into kubernetes:master Feb 8, 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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants