This repository has been archived by the owner on Oct 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MGMT-1233 - support v4.6, use official openshift-installer extracted …
…from release (#19)
- Loading branch information
1 parent
b375f7f
commit fa0e2d5
Showing
12 changed files
with
88 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,60 @@ | ||
### This is a image for generating ignition manifests & kubeconfig | ||
1) Dockerfile.assisted-ignition-generator - dockerfile for building the assisted-ignition-generator image | ||
2) installer_dir - testing directory that includes all the files needed for local testing (on laptop) | ||
- install-config.yaml.baremetal - install-config for baremetal environment | ||
- test_env.txt - environment variables for testing | ||
- test_hosts_list.yaml - simulated output of Get Host from assisted-service command.Used as an input for testing | ||
|
||
1) Dockerfile (deprecated) - dockerfile for building the assisted-ignition-generator image with openshift-installer platform none | ||
2) Dockerfile.baremetal - dockerfile for building the assisted-ignition-generator image with openshift-installer platform baremetal | ||
3) installer_dir/install-config.yaml - example of install-config.yaml for none platform | ||
4) installer_dir/install-config.yaml.baremetal - example of install-config.yaml for baremetal platform. | ||
5) openshift-install - executable that produces ignition files. It is copied from installer repository before issuing docker build command. Should be build in accordance with the platform we are running on | ||
a) none platform - should be build with command <TAGS="none" hack/build.sh> | ||
b) baremetal platform - should be build with command <TAGS="baremetal" hack/build.sh>. Prior to that the following files in the installer source code should be changed: | ||
- hack/build.sh - CGO_ENABLED flag should be enable in case of baremetal platform also: <if (echo "${TAGS}" | grep -q 'libvirt\|baremetal')> | ||
- pkg/types/baremetal/validation/libvirt.go - build tag should be changed from baremetal to libvirt ( to avoid validations via libvirt) | ||
|
||
Environment variables: | ||
----------------------------- | ||
|
||
Since this image will be run as a job initiated by assisted-service, all input parameters are passed as environment variables: | ||
|
||
1) WORK_DIR - directory inside the container where we run all our code. Default: /data | ||
2) INSTALLER_CONFIG - directory where the install-config.yaml is created/set and where the output ( ignitions) are created. Default: /data/installer_dir | ||
3) CLUSTER_ID - input parameter for the job | ||
4) INVENTORY_ENDPOINT - url that defines how python client connects to assisted-service. | ||
5) S3_ENDPOINT_URL - S3 endpoint. results of the job will be uploaded to that S3 | ||
6) S3_BUCKET - the S3 bucket to upload to | ||
7) aws_access_key_id - AWS access key id | ||
8) aws_secret_access_key - AWS secret access key | ||
9) OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE - the OCP release image that we are working on | ||
|
||
Building: | ||
---------------- | ||
1) currently we use our own openshift-install executable. We save it into the container using Dockerfile.installer-image and pushing it to a repository ( make sure to make it public. Currently | ||
we use quay.io/yshnaidm/openshift-installer. In case we recompile openshift-install, we need to update this image: | ||
docker build -f Dockerfile.installer-image -t <repository> . | ||
Example: docker build -f Dockerfile.installer-image -t quay.io/yshnaidm/openshift-installer:latest . | ||
2) we are using the image built in step 1 to get the needed openshift-install. Once we start using openshift-install from the release, we can update Dockerfile.baremetal accordingly | ||
docker build -f Dockerfile.baremetal . -t quay.io/ocpmetal/assisted-ignition-generator:stable | ||
--------------------------------------- | ||
1) Build quay.io/ocpmetal/assisted-ignition-generator - image for running ignition generation job. Uses assisted-service container to install assisted-service python client. Install OC client by wget appropriate package | ||
Note: beforebuilding make sure that you deleted all the files under installer_dir that were created during testing: | ||
|
||
cd installer_dir && sudo rm -rf auth bootstrap.ign install-config.yaml master.ign metadata.json worker.ign .openshift_install.log .openshift_install_state.json | ||
|
||
make build | ||
docker tag <image id> quay.io/ocpmetal/assisted-ignition-generator | ||
|
||
Testing: | ||
--------------- | ||
Testing can be done in 2 stages: | ||
|
||
1) test generation of the ignition files , locally on your laptop. | ||
a) copy install-config.yaml.baremetal to installer-config.yaml in installer_dir. | ||
b) run assisted-ignition-generator image that you previously created. | ||
|
||
docker run -v $(pwd)/installer_dir:/data/installer_dir -it assisted-ignition-generator:ad6939c67c115cef7877ab7d06d72f2d06cebe0 | ||
Testing: | ||
------------------------------------- | ||
|
||
if no error is printed, then the ignition files are generated in the installer_dir | ||
Testing can be done in 2 stages: | ||
|
||
2) test specific manipulations on generated ignition. Currently only BMH annotations generations is checked. This stage must be run only after first stage | ||
a) change permissions of the file generated in the first stage. from installer_dir run: | ||
sudo chmod -R 777 auth bootstrap.ign master.ign metadata.json worker.ign .openshift_install.log .openshift_install_state.json | ||
b) run: | ||
skipper run python3 test_bmh_annotations.py | ||
1) Test generation of the ignition files , locally on your laptop. | ||
|
||
a) Copy install-config.yaml.baremetal to installer-config.yaml in installer_dir. | ||
|
||
b) Run assisted-ignition-generator immage that you previously created. | ||
Since 4.6 we use release image to extract installer.The value of release-image is set as environment value by bm-envtory. when testing we use env file installer-dir/test_env.txt | ||
If no error is printed, then test was successsful and the ignition files are generated in the installer_dir | ||
|
||
docker run -v $(pwd)/installer_dir:/data/installer_dir --env-file $(pwd)/installer_dir/test_env.txt -it assisted-ignition-generator:<hash> | ||
|
||
Usage: | ||
``` | ||
usage: process-ignition-manifests-and-kubeconfig.py [-h] | ||
[--file_name FILE_NAME] | ||
[--s3_endpoint_url S3_ENDPOINT_URL] | ||
[--s3_bucket S3_BUCKET] | ||
2) Test specific manipulations on generated ignition. Currently only BMH annotations generations is checked. This stage must be run only after first stage | ||
|
||
Generate ignition manifest & kubeconfig | ||
a) Change permissions of the file generated in the first stage. | ||
From installer_dir run: | ||
|
||
sudo chmod -R 777 auth bootstrap.ign master.ign metadata.json worker.ign .openshift_install.log .openshift_install_state.json | ||
|
||
optional arguments: | ||
-h, --help show this help message and exit | ||
--file_name FILE_NAME | ||
output directory name | ||
--s3_endpoint_url S3_ENDPOINT_URL | ||
s3 endpoint url | ||
--s3_bucket S3_BUCKET | ||
s3 bucket | ||
``` | ||
b) Test code that changes the ignitions: | ||
|
||
skipper run python3 test_bmh_annotations.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,5 +69,4 @@ platform: | |
bootMode: UEFI | ||
hardwareProfile: unknown | ||
|
||
pullSecret: '{"auths":{"cloud.openshift.com":{"auth":"b3BlbnNoaWZ0LXJlbGVhc2UtZGV2K3lzaG5haWRtMXkxdTZhempjaGJ0cm5hZDFkb3U1Z3FtcnliOlVBNjU0SVZFQzZPMFFBM0ZJTDA2WjY1WDRSSjM0WElNM0JYRVkzVFBCVU9IUkZESEhRSkkxMFFJNUI5MEY1Tks=","email":"[email protected]"},"quay.io":{"auth":"b3BlbnNoaWZ0LXJlbGVhc2UtZGV2K3lzaG5haWRtMXkxdTZhempjaGJ0cm5hZDFkb3U1Z3FtcnliOlVBNjU0SVZFQzZPMFFBM0ZJTDA2WjY1WDRSSjM0WElNM0JYRVkzVFBCVU9IUkZESEhRSkkxMFFJNUI5MEY1Tks=","email":"[email protected]"},"registry.connect.redhat.com":{"auth":"NTMxOTg0MDl8dWhjLTFZMXU2QXpqY0hidHJOYUQxZE91NUdxbVJZQjpleUpoYkdjaU9pSlNVelV4TWlKOS5leUp6ZFdJaU9pSmpPREUzWVRZMk1qQXhOR00wTlRFMFlqWXlPR1ppTkROaE9UazNNek0xTUNKOS5temRzdWFYTHY1VWMzQ0Y5OVRsT2lCNlJ1bnhOMmNlaTJGTmZsZ2RKTG5WWEdqQVVSMDlqd3FiNXlJXzV2blhYUjlydVAxem5MaEh3NU1acG1iMDA3cl9jVllNWk53WHVtZGZDLWQxdlVhY1NmMjR1Yl9yM0RRT04tQ3Q2U2FQWnc3a3ZtLTU3anlvNXU4YUhYSlNWZ0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d4dyagb6lmrryUUAAbfmn/HalJTHB73LyjilKiPvJ+x2bG7AeiqyVHwtQSpt02FCdQGptmsSqqWF/b9botOO38eUsqPNppMn7LT5wzDZdDlfwTCBWkpqijPcdo/LTD9dJlNHjwXZtHETtiid6N3ZZWpA0/VKjqUeQdSnHqLEzTidswsnOjCIoIhmJFqczeP5kOty/MWdq1II/FX/EpYCJxoSWkT/hVwD6VOamGwJbLVw9LkEb0VVWFRJB5suT/T8DtPdPl+A0qUGiN4KM= [email protected]' | ||
pullSecret: '{"auths": ...}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE=quay.io/openshift-release-dev/ocp-release@sha256:029d56f7cf4a0de420f84f9178e030a3cfb83a480f3d086a7f5ed31b62bc08d0 | ||
OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE=registry.svc.ci.openshift.org/ocp/release:4.6.0-0.nightly-2020-08-31-220837 | ||
CLUSTER_ID=36f9da71-dbed-4cba-a974-7e103285fe55 | ||
DHCP_ALLOCATION_FILE=whatever |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.