Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ linters:
- unconvert
- gci
- goimports
- scopelint
- exportloopref

linters-settings:
govet:
Expand Down
24 changes: 13 additions & 11 deletions Dockerfile.assisted-service
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
FROM registry.access.redhat.com/ubi9/go-toolset:1.20 AS golang

# Build binaries
FROM quay.io/centos/centos:stream8 as builder
FROM quay.io/centos/centos:stream9 as builder

RUN dnf install --enablerepo=crb -y gcc git nmstate-devel openssl-devel && dnf clean all

RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && \
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
ENV GOROOT=/usr/lib/golang
ENV GOPATH=/opt/app-root/src/go
ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin

RUN dnf install --enablerepo=powertools -y gcc git nmstate-devel && dnf clean all
COPY --from=registry.ci.openshift.org/openshift/release:golang-1.20 /usr/local/go /usr/local/go
RUN mkdir -p $GOROOT && mkdir -p $GOPATH

ENV GOROOT=/usr/local/go
ENV PATH=$PATH:$GOROOT/bin
COPY --from=golang $GOROOT $GOROOT

RUN chmod 775 -R $GOPATH && chmod 775 -R $GOROOT

WORKDIR /assisted-service/

Expand All @@ -28,10 +33,7 @@ RUN cd ./cmd/webadmission && CGO_ENABLED=1 GOFLAGS="" GO111MODULE=on go build -o
RUN cd ./cmd/agentbasedinstaller/client && CGO_ENABLED=1 GOFLAGS="" GO111MODULE=on go build -o /build/agent-installer-client

# Create final image
FROM quay.io/centos/centos:stream8

RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && \
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
FROM quay.io/centos/centos:stream9

# multiarch images need it till WRKLDS-222 and https://bugzilla.redhat.com/show_bug.cgi?id=2111537 are fixed
RUN dnf install -y --setopt=install_weak_deps=False skopeo
Expand Down
27 changes: 13 additions & 14 deletions Dockerfile.assisted-service-build
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
FROM registry.ci.openshift.org/openshift/release:golang-1.20 AS golang
RUN chmod g+xw -R /usr/local/go
FROM registry.access.redhat.com/ubi9/go-toolset:1.20 AS golang

FROM quay.io/centos/centos:stream8
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.53.2
RUN go install gotest.tools/gotestsum@latest

RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && \
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
FROM quay.io/centos/centos:stream9

ENV GOPATH=/go
ENV GOROOT=/usr/local/go
ENV GOROOT=/usr/lib/golang
ENV GOPATH=/opt/app-root/src/go
ENV VIRTUAL_ENV=/opt/venv
# A directory in the path with write permission even for non-root users
ENV TOOLS=/tools/
ENV PATH="$VIRTUAL_ENV/bin:$GOROOT/bin:$GOPATH/bin:$TOOLS:$PATH"

RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/bin v1.53.2
COPY --from=golang $GOPATH $GOPATH
COPY --from=golang $GOROOT $GOROOT

RUN chmod 775 -R $GOPATH && chmod 775 -R $GOROOT

# TODO: Replace with version 0.30.4 once it is released.
#
# We need version 5d0a00d of go-swagger because it is the first that contains
Expand All @@ -30,17 +33,13 @@ RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/i
COPY --from=quay.io/goswagger/swagger:sha-5d0a00d /usr/bin/swagger /usr/bin/goswagger

COPY --from=quay.io/edge-infrastructure/swagger-codegen-cli:2.4.18 /opt/swagger-codegen-cli /opt/swagger-codegen-cli
COPY --from=golang /usr/bin/gotestsum /usr/bin/make /usr/bin/
COPY --from=golang /usr/local/go /usr/local/go
COPY --from=quay.io/openshift/origin-cli:latest /usr/bin/oc /usr/bin
COPY --from=quay.io/operator-framework/upstream-opm-builder:v1.16.1 /bin/opm /bin
COPY --from=registry.k8s.io/kustomize/kustomize:v4.3.0 /app/kustomize /usr/bin/
COPY --from=quay.io/coreos/shellcheck-alpine:v0.5.0 /bin/shellcheck /usr/bin/shellcheck

RUN dnf install -y 'dnf-command(config-manager)' && \
dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo && \
dnf install -y --enablerepo=powertools \
openssl postgresql nmstate-devel sqlite gcc genisoimage git docker-ce-cli libvirt-client libvirt-devel java && \
RUN dnf install -y --enablerepo=crb \
openssl openssl-devel postgresql nmstate-devel sqlite gcc genisoimage git libvirt-client libvirt-devel java make && \
dnf clean all

# Git checks if the user that owns the files on the filesystem match the
Expand Down
23 changes: 18 additions & 5 deletions Dockerfile.assisted-service-debug
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
ARG SERVICE=quay.io/edge-infrastructure/assisted-service:latest
FROM registry.ci.openshift.org/openshift/release:golang-1.18 AS download_dlv
FROM registry.access.redhat.com/ubi9/go-toolset:1.20 AS golang

RUN GOFLAGS=-mod=mod go install github.com/go-delve/delve/cmd/dlv@v1.9.1

FROM $SERVICE
FROM quay.io/centos/centos:stream9

RUN dnf install --enablerepo=crb -y gcc git nmstate-devel openssl-devel && dnf clean all

ENV GOROOT=/usr/lib/golang
ENV GOPATH=/opt/app-root/src/go
ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin

COPY --from=golang $GOPATH $GOPATH
COPY --from=golang $GOROOT $GOROOT

RUN chmod 775 -R $GOPATH && chmod 775 -R $GOROOT

ARG DEBUG_SERVICE_PORT=40000
COPY --from=download_dlv /go/bin/dlv /
EXPOSE 8090 $DEBUG_SERVICE_PORT

COPY assisted-service /assisted-service
COPY assisted-service-operator /assisted-service-operator
CMD ["/dlv", "--listen=:40000", "--headless=true", "--continue", "--api-version=2", "--accept-multiclient", "exec", "/assisted-service"]

CMD ["dlv", "--listen=:40000", "--headless=true", "--continue", "--api-version=2", "--accept-multiclient", "exec", "/assisted-service"]
24 changes: 12 additions & 12 deletions ci-images/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
FROM quay.io/centos/centos:stream8
FROM registry.access.redhat.com/ubi9/go-toolset:1.20 AS golang

RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && \
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
RUN go install gotest.tools/gotestsum@latest

RUN dnf install -y 'dnf-command(config-manager)' && \
dnf config-manager --set-enabled powertools && \
dnf install -y git unzip make gcc which nmstate-devel python3
FROM quay.io/centos/centos:stream9

RUN dnf install --enablerepo=crb -y \
git unzip make gcc which nmstate-devel python3 openssl-devel

# Git checks if the user that owns the files on the filesystem match the
# current user. We need to disable this check because tests in Prow are
# running with a random user.
RUN git config --system --add safe.directory '*'

COPY --from=registry.ci.openshift.org/openshift/release:golang-1.20 /usr/local/go /usr/local/go
COPY --from=registry.ci.openshift.org/openshift/release:golang-1.20 /usr/bin/gotestsum /usr/bin/make /usr/bin/

ENV GOPATH=/go
ENV GOROOT=/usr/local/go
ENV GOROOT=/usr/lib/golang
ENV GOPATH=/opt/app-root/src/go
ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin

COPY --from=golang $GOPATH $GOPATH
COPY --from=golang $GOROOT $GOROOT

COPY . /assisted-service/
WORKDIR /assisted-service/

RUN go mod vendor

RUN chmod 775 -R $GOPATH && chmod 775 -R $(go env GOROOT) && chmod 775 -R /assisted-service/ && \
RUN chmod 775 -R $GOPATH && chmod 775 -R $GOROOT && chmod 775 -R /assisted-service/ && \
mkdir /.cache && chmod 775 -R /.cache
1 change: 0 additions & 1 deletion ci-images/Dockerfile.code-generation
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH"
#
# https://issues.redhat.com/browse/MGMT-12697
COPY --from=quay.io/goswagger/swagger:sha-5d0a00d /usr/bin/swagger /usr/bin/goswagger

COPY --from=registry.k8s.io/kustomize/kustomize:v4.3.0 /app/kustomize /usr/bin/

RUN cd / && /assisted-service/hack/setup_env.sh spectral && \
Expand Down
2 changes: 1 addition & 1 deletion subsystem/kubeapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3286,7 +3286,7 @@ var _ = Describe("[kube-api]cluster installation", func() {
Name: infraNsName.Name,
}
// InfraEnv Reconcile takes longer, since it needs to generate the image.
checkInfraEnvCondition(ctx, infraEnvKubeName, v1beta1.ImageCreatedCondition, "Unsupported keys found")
checkInfraEnvCondition(ctx, infraEnvKubeName, v1beta1.ImageCreatedCondition, "Invalid YAML")
})

It("ensure StaticNetworkConfig is empty after NMStateConfig deletion", func() {
Expand Down