Skip to content
Closed
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
1 change: 1 addition & 0 deletions projects/origin-release/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ build:
./fake-rpm.sh golang-1.11
./fake-rpm.sh golang-1.12
./fake-rpm.sh golang-1.13
./fake-rpm.sh golang-1.14
.PHONY: build
55 changes: 55 additions & 0 deletions projects/origin-release/golang-1.14/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#
# This is the image that controls the standard build environment for releasing OpenShift Origin.
# It is responsible for performing a cross platform build of OpenShift.
#
# The standard name for this image is openshift/origin-release
#
FROM centos:7
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe we can start using 8 for new stuff?


ENV VERSION=1.14.2 \
GOCACHE=/go/.cache \
GOARM=5 \
GOPATH=/go \
GOROOT=/usr/local/go \
GOFLAGS='-mod=vendor' \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

From the Go 1.14 Release Notes:

Go command

Vendoring

When the main module contains a top-level vendor directory and its go.mod file specifies go 1.14 or higher, the go command now defaults to -mod=vendor for operations that accept that flag. A new value for that flag, -mod=mod, causes the go command to instead load modules from the module cache (as when no vendor directory is present).

When -mod=vendor is set (explicitly or by default), the go command now verifies that the main module's vendor/modules.txt file is consistent with its go.mod file.

@stevekuznetsov given the above, I wonder if it would be a good idea to leave this flag out? Without it, Go should now "do the correct thing" depending on whether the project being built vendors dependencies or not.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@grdryn no it does not unless you bump the go.mod:

and its go.mod file specifies go 1.14 or higher

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@alvaroaleman yes, that's true; although I'd assume that projects would update the go.mod to specify that if they were going to use this image. I guess there's no guarantee of that though.

LOGNAME=deadbeef
ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin

COPY cbs-paas7-openshift-multiarch-el7-build.repo /etc/yum.repos.d/
RUN yum install -y epel-release && \
rpm -V epel-release && \
INSTALL_PKGS="bc bind-utils bsdtar bzr ceph-common createrepo device-mapper device-mapper-persistent-data e2fsprogs ethtool file findutils gcc git glibc-static glib2-devel gpgme gpgme-devel hostname iptables jq krb5-devel libassuan libassuan-devel libseccomp-devel libvirt-devel lsof make mercurial nmap-ncat openssl protobuf-compiler protobuf-devel rsync socat systemd-devel sysvinit-tools tar tito tree util-linux wget which xfsprogs zip goversioninfo" && \
yum install -y $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
yum clean all && \
touch /os-build-image && \
git config --system user.name origin-release-container && \
git config --system user.email origin-release@redhat.com

ADD *.rpm /tmp/origin-rpm/
RUN yum install -y /tmp/origin-rpm/*.rpm && \
yum clean all && \
curl https://storage.googleapis.com/golang/go$VERSION.linux-$(uname -m | sed 's/x86_64/amd64/g').tar.gz | tar -C /usr/local -xzf - && \
go get golang.org/x/tools/cmd/cover \
github.com/Masterminds/glide \
golang.org/x/tools/cmd/goimports \
github.com/tools/godep \
golang.org/x/lint/golint \
gotest.tools/gotestsum \
github.com/openshift/release/tools/gotest2junit \
github.com/openshift/imagebuilder/cmd/imagebuilder && \
mv $GOPATH/bin/* /usr/bin/ && \
rm -rf $GOPATH/* $GOPATH/.cache && \
mkdir $GOPATH/bin && \
ln -s /usr/bin/imagebuilder $GOPATH/bin/imagebuilder && \
ln -s /usr/bin/goimports $GOPATH/bin/goimports && \
curl -L https://github.com/golang/dep/releases/download/v0.5.4/dep-linux-amd64 > /usr/bin/dep && \
chmod +x /usr/bin/dep
# TODO: symlink for backwards compatibility with hack/build-images.sh only, remove

RUN chmod g+xw -R $GOPATH && \
chmod g+xw -R $(go env GOROOT)

WORKDIR /go/src/github.com/openshift/origin
LABEL io.k8s.display-name="OpenShift Origin Release Environment (golang-$VERSION)" \
io.k8s.description="This is the standard release image for OpenShift Origin and contains the necessary build tools to build the platform."
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[cbs-paas7-openshift-multiarch-el7-build]
name = CBS OpenShift MultiArch Build
baseurl = http://cbs.centos.org/kojifiles/repos/paas7-openshift-multiarch-el7-build/latest/$basearch
enabled = 1
gpgcheck = 0
sslverify = 0
skip_if_unavailable = 1
includepkgs = golang* protobuf* goversioninfo* openvswitch*
21 changes: 21 additions & 0 deletions projects/origin-release/golang-1.14/golang.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Name: golang
Version: v1.14.0
Release: 1%{?dist}
Summary: Go install from source
Group: Fake
License: BSD
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Provides: golang
BuildArch: noarch
%description
%{summary}
%prep
%setup -c -T
%build
%install
%files
%defattr(-,root,root,-)
%changelog
* Tue Oct 1 2019 Markus Thömmes <mthoemme@redhat.com> 0.0-1
- Initial change
EOF
30 changes: 30 additions & 0 deletions projects/origin-release/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,36 @@ objects:
triggers:
- imageChange: {}
type: ImageChange
- apiVersion: v1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Out of curiosity, what triggers this when a now golang patch version becomes available?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Humans

kind: BuildConfig
metadata:
labels:
app: origin-release
name: "origin-release-golang-1.14"
spec:
successfulBuildsHistoryLimit: 1
failedBuildsHistoryLimit: 2
output:
to:
kind: DockerImage
name: "${PUSH_REPOSITORY}:golang-1.14"
pushSecret:
name: "dockerhub"
source:
git:
ref: "${SOURCE_REF}"
uri: "${SOURCE_URL}"
contextDir: "projects/origin-release/golang-1.14/"
type: Git
strategy:
dockerStrategy:
from:
kind: ImageStreamTag
name: origin-release:base
imageOptimizationPolicy: SkipLayers
triggers:
- imageChange: {}
type: ImageChange
- apiVersion: v1
kind: BuildConfig
metadata:
Expand Down