1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-06 00:48:45 +01:00
Commit Graph

142 Commits

Author SHA1 Message Date
Yaakov Selkowitz
62107af8c2 Add GOOS_GOARCH to all terraform build paths
This avoids the wrong binaries from the previous build being included in
the installer binary when (cross-)compiling locally for multiple targets
in sequence.
2022-05-12 18:16:06 -04:00
Yaakov Selkowitz
540ec958a1 Always run go generate natively
go generate always needs to be run natively, even when cross-compiling.
Handling that in build.sh simplifies cross-compiling both manually and
in installer-artifacts.
2022-05-12 18:16:06 -04:00
Christoph Stäbler
2c09bc5276 Use golang 1.17
Signed-off-by: Christoph Stäbler <cstabler@redhat.com>
2022-05-06 09:03:58 +02:00
staebler
fb18dab8c6 terraform: add terraform verification to ./hack/verify-vendor.sh
Add verification that the vendoring of the terraform sub-modules is
in-sync with what is needed for building the sub-modules.

https://issues.redhat.com/browse/CORS-1909
2022-03-23 23:09:03 -04:00
staebler
75ac8baad3 hack: update go version used in hack/verify-vendor.sh
Update the go version used for verifying vendoring from 1.16 to 1.17.
The CI job uses its own image and does not use the image specified
in the script. Therefore, the go version in the script must match
the go version in the CI job, particularly when there are breaking
changes between go versions (as there are between 1.16 and 1.17
when it comes to modules).
2022-03-15 14:22:11 -04:00
staebler
352b913780 terraform: only build binaries when go.mod changes
To reduce the time to build the installer binary, let's change the terraform
Makefile so that it only builds the binaries when there are changes to the
respective go.mod. For example, the aws terraform provider will only be
re-built when there is a change to the go.mod file in the aws sub-module.
2022-03-02 20:45:11 -05:00
staebler
76eb1eae49 terraform: allow for building terraform locally
Create a sub-module for building the terraform binary locally.
2022-02-28 22:52:30 -05:00
staebler
0394dba1d1 terraform: remove downloading of terraform binary
Remove the script for downloading the terraform binary. Since terraform
does not officially support some of the architectures that the installer
targets, the terraform binary needs to be built locally rather than
downloaded.
2022-02-28 22:52:29 -05:00
staebler
3fbc693815 terraform: zip terraform providers
To reduce the size of the installer binary, zip each terraform provider
after building it. Terraform can use the zip directly without requiring
the installer to unzip the provider first.
2022-02-28 22:52:29 -05:00
staebler
d0c440d58a terraform: remove the use of remote providers
Remove the code that supports pulling the terraform providers from
public registries.
2022-02-28 22:52:28 -05:00
staebler
2164afd71d terrafrom: add support for FreeBSD
* Add "freebsd_amd64" to the target OS/arches downloaded by the
./hack/download-terraform.sh script.
* Download terraform and providers for FreeBSD.
2022-02-24 08:31:21 -05:00
staebler
09cd3f503b terraform: unpack providers from binary data
Unpack the providers needed for completing a stage from the embedded
data in the installer's binary. This replaces the previous method of
creating symlinks to the installer binary, where the installer binary
masqueraded as each of the terraform providers.
2022-02-21 10:31:34 -05:00
staebler
6a89a46f3c terraform: allow for downloading remote providers individually
This will download remote terraform providers individually. The remote terraform
providers are the providers that can be used as-is from a public registry.

This will also grab the terraform binary to embed in the installer from the
same terraform image used to download the terraform providers.

Use the latest version available for all of the remote providers.
2022-02-21 10:30:58 -05:00
John Hixson
9c77d6a437 terraform: allow for building local providers individually
This will build local terraform providers individually. The local terraform
providers are the providers that either (1) are not published in a public
regisrty or (2) require patches.

azureprivatedns: private to the installer repo
azurestack: requires patches
ibm: arm build is not published
ignition: arm buid is not published
ironic: not published
ovirt: not published
vsphere: requires patches
vsphereprivate: private to the installer repo

Building these has been added hack/build.sh. In the future a better way of
handling the vendoring in the individual directories will be necessary.

co-authored: staebler
2022-02-21 10:30:46 -05:00
staebler
ce3169772c hack: use go 1.17 for verifying codegen
The hack/verify-codegen.sh script was using an image that included
go 1.16. However, the updated k8s.io/json module calls the
`(reflect.StructField) IsExported` function, which is new in go 1.17.
Consequently, the script needs to be updated to use an image that
include go 1.17 rather than 1.16.
2022-01-21 16:55:13 -05:00
staebler
abca904596 rhcos: ami regions from rhcos stream at runtime
Currently, the installer relies on a generated go file for determining
the AWS region in which the RHCOS image is published. The `go generate`
directive was inadvertently removed in https://github.com/openshift/installer/pull/4582.
Rather than resurrecting the directive, this commit removes the generated
code in favor of gathering the regions directly from the rhcos stream
data when needed.

https://issues.redhat.com/browse/CORS-1838
2021-12-09 15:19:54 -05:00
Christy Norman
421e1e20c6 close a verify-codegen ci failure loophole
if the go codegen commands failed, the the hack/verify-codegen.sh script
continued and the CI check passed. see #5406 for an example. the script
was not set to fail on a non-zero return code. this pr adds the bash e
option to the set builtin to catch errors and exit on failure.

Signed-off-by: Christy Norman <christy@linux.vnet.ibm.com>
2021-12-08 17:37:03 -06:00
Yaakov Selkowitz
1456b5e7e5 Require golang 1.17
This is the version being used in OpenShift 4.10, but the code still
compiles for now with golang 1.16.
2021-11-24 02:01:13 -05:00
Yaakov Selkowitz
7ec510fecb Revert "Workaround golang linux/arm64 link error"
golang 1.17 fixed the underlying bug.

This reverts commit 801ece6513.
2021-11-24 02:01:13 -05:00
Colin Walters
61605bdcac Move CoreOS stream metadata to data/data/coreos, add OWNERS
It's more logically owned by the CoreOS team and this will
allow us to have a separate `OWNERS` file.

The `OWNERS` file is copied from the current one in openshift/os.
2021-10-27 16:37:52 -04:00
Colin Walters
d773ee5573 Remove old RHCOS and FCOS metadata (not stream metadata)
In https://github.com/openshift/enhancements/pull/679
we landed support for a stream metadata format already used
by FCOS and now by RHCOS/OCP consumers to find the bootimages.

We kept the old metadata because the UPI CI jobs used it.
In https://github.com/openshift/release/pull/17482 I tried
to port the UPI CI jobs, but ran into huge levels of technical debt.

As best I can tell, the UPI CI jobs are not running on this repo
now and are likely broken for other reasons.

Let's remove the old data and avoid the confusing duplication.
Anyone who goes to work on the UPI CI jobs and sanitizes things
should be able to pick up the work to port to stream metadata
relatively easily.
2021-10-21 17:09:06 -04:00
Evgeny Slutsky
f821cbe00a Bump golang to version 1.16
Signed-off-by: Evgeny Slutsky <eslutsky@redhat.com>
2021-08-31 14:59:23 +03:00
Jonathan Lebon
f9f3f67a4d hack/update-rhcos-bootimage.py: update RHCOS_RELEASES_APP
I think this was supposed to be part of #4928.

(cherry picked from commit f9165307f9)
2021-07-20 19:40:27 -04:00
OpenShift Merge Robot
36d10af265 Merge pull request #5062 from multi-arch/goflags
Fix build with multiple GOFLAGS
2021-07-15 19:56:15 -04:00
patrickdillon
1022e0d8ac verify-vendor: add go mod tidy
A recent commit passed the CI test for go mod tidy but introduced a bug
in master when we run go mod tidy. By including go mod tidy, we can
catch these earlier.
2021-07-14 16:53:31 -04:00
Yaakov Selkowitz
51869a7020 Fix build with multiple GOFLAGS
GOFLAGS is a space-separated value; quoting it here results in errors.
2021-07-08 12:17:13 -04:00
Yaakov Selkowitz
729882a8a2 Set default cluster architecture based on build host
All installer binaries extracted from a payload, regardless of their
runtime OS or architecture, are built on the payload architecture.
Therefore, GOHOSTARCH can be used to assume the cluster architecture for
which its payload was built.  This is set through the Dockerfiles so that
manual builds of installer will continue to default to amd64.
2021-06-20 00:58:44 -04:00
Timothée Ravier
2f41c0a7fa hack/update-rhcos-bootimage: Add aarch64 support 2021-05-19 10:48:57 +02:00
Yaakov Selkowitz
9017e2bf3a Revert "Link ppc64le binary dynamically"
This unblocked the build on other architectures, but the resulting
ppc64le binary had issues.  The golang bug which affected static linking
has been fixed with a one-line patch, which we are carrying downstream
until the upstream backports land.

This reverts commit 24ac0a15e7.
2021-04-29 12:42:26 -04:00
Yaakov Selkowitz
24ac0a15e7 Link ppc64le binary dynamically
Recent versions of Go have had issues statically linking some ppc64le
binaries:

https://github.com/golang/go/issues/45564
2021-04-26 15:41:05 -04:00
staebler
d3fbc32817 hack: use yaml for coreos manifest
Marshal the coreos-bootimages ConfigMap included in the installer
manifests as yaml instead of json. This allows `oc` to replace
the `0.0.1-snapshot` value of the `releaseVersion`. The quotes
around the value when marshalled as json were preventing the
value from matching the regular expression that `oc` uses.

/fixes https://github.com/openshift/installer/issues/4797
2021-04-02 12:30:59 -04:00
Colin Walters
260b21cbb9 Inject CoreOS stream metadata as configmap via CVO manifest
Split out from https://github.com/openshift/installer/pull/4582

This copies the bits from https://github.com/cgwalters/rhel-coreos-bootimages
which builds a ConfigMap out of the stream metadata and injects
it into the cluster.

We have an `installer` image in the release image today; this adds
the "is an operator" label, even though it's not really an
operator.  We just want the CVO to inject the manifest.

Among other important semantics, this will ensure that in-place
cluster upgrades that have new pinned CoreOS stream data will
have this configmap updated.
2021-03-25 13:28:05 +00:00
Colin Walters
7a7b055d32 Add docs/dev/pinned-coreos.md
Briefly describe the history and future of the pinned {RHEL, Fedora} CoreOS
metadata in the installer.

Co-authored-by: Matthew Staebler <staebler@redhat.com>
2021-03-24 18:21:29 +00:00
Colin Walters
b64d699a13 Add stream metadata for RHCOS
This implements part of the plan from:
https://github.com/openshift/os/issues/477

When we originally added the pinned RHCOS metadata `rhcos.json`
to the installer, we also changed the coreos-assembler `meta.json`
format into an arbitrary new format in the name of some cleanups.
In retrospect, this was a big mistake because we now have two
formats.

Then Fedora CoreOS appeared and added streams JSON as a public API.

We decided to unify on streams metadata; there's now a published
Go library for it: https://github.com/coreos/stream-metadata-go

Among other benefits, it is a single file that supports multiple
architectures.

UPI installs should now use stream metadata, particularly
to find public cloud images.  This is exposed via a new
`openshift-install coreos print-stream-json` command.

This is an important preparatory step for exposing this via
`oc` as well as having something in the cluster update to
it.

HOWEVER as a (really hopefully temporary) hack, we *duplicate*
the metadata so that IPI installs use the new stream format,
and UPI CI jobs can still use the old format (with different RHCOS versions).

We will port the UPI docs and CI jobs after this merges.

Co-authored-by: Matthew Staebler <staebler@redhat.com>
2021-03-24 18:21:26 +00:00
staebler
6b1daea951 hack: use mockgen from vendor
Rather than building an image to run mockgen and having that image
always get the latest verion of mockgen, use the mockgen from the
vendor directory. This has a couple benefits.
 1) We do not get changes to the client mocks that pop up in random
    PRs when a new version of mockgen is released.
 2) Contributors that do not have access to the CI registry can
    generate the mock clients.
2021-02-21 11:21:09 -05:00
OpenShift Merge Robot
98387b7421 Merge pull request #4243 from multi-arch/master
Workaround golang linux/arm64 link error
2021-02-12 16:32:45 -05:00
OpenShift Merge Robot
19dc9ed7e9 Merge pull request #4608 from Fedosin/env_var_typo
Bug 1924140: fix a typo in an env variable name
2021-02-11 10:39:59 -05:00
Mike Fedosin
bdce4b17c6 Fix OWNERS for openstack
Now OwWNERS is a symbolic link and looks like github doesn't accept
it.
2021-02-10 17:00:06 +01:00
Mike Fedosin
3d8d58114e Bug 1924140: fix a typo in the env variable name
It should be called OPENSHIFT_INSTALL_SKIP_PREFLIGHT_VALIDATIONS.
2021-02-02 18:10:47 +01:00
OpenShift Merge Robot
35d7aa255a Merge pull request #4459 from shiftstack/python-manifest-test
openstack: Test Nova AZ manifest generation
2020-12-08 14:11:05 -05:00
OpenShift Merge Robot
0b8525c49a Merge pull request #4421 from shiftstack/verify-gosum
hack/verify-vendor.sh: Fail early if error
2020-12-07 17:11:49 -05:00
Pierre Prinetti
feebe4c70c openstack: Test Nova AZ manifest generation
* instrument the manifest-generation test-framework to execute Python
testfiles
* test machinesets with availability zones
2020-12-07 14:32:58 +01:00
Pierre Prinetti
b85276295a openstack: Test manifest creation
Add a script for testing OpenStack manifest generation.

Co-Authored-By: Matthew Booth <mbooth@redhat.com>
2020-12-02 11:23:33 +01:00
Pierre Prinetti
9e7155389c hack/verify-vendor.sh: Fail early if error
Prior to this patch, errors in vendoring or verification were ignored.

With this patch, `verify-vendor` fails if the dependency files are
corrupted.
2020-11-26 12:10:05 +01:00
Yaakov Selkowitz
801ece6513 Workaround golang linux/arm64 link error
There is a bug with the golang internal linker for the linux/arm64 target
that has yet to be fixed:

https://github.com/golang/go/issues/40492
2020-10-05 14:53:57 -04:00
Benjamin Gilbert
6651680105 hack/update-rhcos-bootimage: update usage example
The example URL is missing the /art/ path prefix, which makes it unclear
how to derive the external URL from the meta.json link in the ART build
browser.
2020-09-01 13:25:28 -04:00
Abhinav Dahiya
46a5f49709 bump the minimum version for building installer to go 1.14
With Go 1.14 the handling of modules has improved in the sense that all the subcommands `go {test, generate}` now use the vendor when available by default. This makes it easier for us to run generate using the vendored tools like controller-tools etc. as it now uses the checked in vendor.
2020-07-06 12:19:20 -07:00
Abhinav Dahiya
cedd117f62 pkg/asset/installconfig/gcp: update go generate for moc generation
update the destination of the generated mocks
2020-05-13 21:18:34 -07:00
Abhinav Dahiya
6f929ae507 hack: include verify-codegen script 2020-05-08 09:26:11 -07:00
Andy McCrae
25e0be9aeb Add ppc64le to update-rhcos-bootimage.py
(cherry picked from commit 28fb0bd40ce2071ca2bc3768fb20591895a4d559)
2020-04-15 18:28:21 +01:00