Skip to content

Use install-configs when invoking installer #2353

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

Merged
merged 2 commits into from
Dec 11, 2018
Merged

Use install-configs when invoking installer #2353

merged 2 commits into from
Dec 11, 2018

Conversation

crawford
Copy link
Contributor

@crawford crawford commented Dec 11, 2018

The installer is moving away from environment variables. They were
originally added as a work-around for CI, but now that install-configs
can be read directly, these should be used instead.

I have not tested these changes!

cc @wking

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 11, 2018
These variables were removed from the installer recently (in favor of
dynamically generated console credentials) and have no effect.
@crawford
Copy link
Contributor Author

Tested locally with AWS. This seems to work as expected.

Copy link
Contributor

@michaelgugino michaelgugino left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Dec 11, 2018
@michaelgugino
Copy link
Contributor

/lgtm cancel

@openshift-ci-robot openshift-ci-robot removed lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Dec 11, 2018
The installer is moving away from environment variables. They were
originally added as a work-around for CI, but now that install-configs
can be read directly, these should be used instead.
Copy link
Contributor

@michaelgugino michaelgugino left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 11, 2018
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: crawford, michaelgugino

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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 11, 2018
@openshift-merge-robot openshift-merge-robot merged commit a3a8187 into openshift:master Dec 11, 2018
@openshift-ci-robot
Copy link
Contributor

@crawford: Updated the following 3 configmaps:

  • prow-job-cluster-launch-installer-e2e configmap using the following files:
    • key cluster-launch-installer-e2e.yaml using file ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml
  • prow-job-cluster-launch-installer-src configmap using the following files:
    • key cluster-launch-installer-src.yaml using file ci-operator/templates/openshift/installer/cluster-launch-installer-src.yaml
  • prow-job-cluster-launch-e2e-40 configmap using the following files:
    • key cluster-launch-e2e-40.yaml using file ci-operator/templates/openshift/openshift-ansible/cluster-launch-e2e-40.yaml

In response to this:

The installer is moving away from environment variables. They were
originally added as a work-around for CI, but now that install-configs
can be read directly, these should be used instead.

I have not tested these changes!

cc @wking

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.

@crawford crawford deleted the env-vars branch December 11, 2018 23:00
mkdir /tmp/artifacts/installer &&
/bin/openshift-install version >/tmp/artifacts/installer/version

export _CI_ONLY_STAY_AWAY_OPENSHIFT_INSTALL_AWS_USER_TAGS="{\"expirationDate\": \"$(date -d '4 hours' --iso=minutes --utc)\"}"
/bin/openshift-install --dir=/tmp/artifacts/installer --log-level=debug create install-config
export CLUSTER_ID=$(uuidgen --random)
Copy link
Member

Choose a reason for hiding this comment

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

Why not use JOB_NAME_HASH? This would help us identify which resources are created by particular CI job

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The cluster ID has to be a version 4 UUID. If JOB_NAME_HASH satisfies that constraint we can use it. Do you know if it does?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, right, it doesn't. Seems this value would be logged in the container logs, so resource can be tracked down to the CI job

- name: OPENSHIFT_INSTALL_PLATFORM
value: ${CLUSTER_TYPE}
- name: OPENSHIFT_INSTALL_AWS_REGION
value: us-east-1
- name: OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE
Copy link
Member

Choose a reason for hiding this comment

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

This is now silently dropped, so CI would use pinned release instead of latest

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, that variable is still respected; even after my installer PR.

else
echo "Unsupported cluster type '${CLUSTER_NAME}'"
exit 1
fi

/bin/openshift-install --dir=/tmp/artifacts/installer --log-level=debug create ignition-configs &
Copy link
Member

Choose a reason for hiding this comment

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

ignition-configs would destroy install-config.yml - is this an installer bug? In any case in CI we should be backing install config since its now cannot be reconstructed using env vars

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is core to the design of the installer (so no, not a bug). Why is the install config needed after the Ignition Configs are generated?

Copy link
Member

Choose a reason for hiding this comment

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

I'd keep the backup to ensure that the all the vars got templated correctly, this is not required though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The installer's state file (.openshift_install_state.json) should be archived, so the install-config can be pulled out of there if we need to inspect it after the fact.

Copy link
Member

@vrutkovs vrutkovs Dec 12, 2018

Choose a reason for hiding this comment

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

CI stores this file, but it doesn't seem to contain any config - https://storage.googleapis.com/origin-ci-test/pr-logs/pull/openshift_installer/861/pull-ci-openshift-installer-master-e2e-aws/2219/artifacts/e2e-aws/installer/.openshift_install_state.json - a bug in PR 861?

nevermind, it does - installconfig.InstallConfig

pullSecret: |
${PULL_SECRET}
sshKey: |
${SSH_PUB_KEY}
Copy link
Member

Choose a reason for hiding this comment

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

This should be left blank for BYOR - public key is being injected via playbook

vrutkovs added a commit to vrutkovs/release that referenced this pull request Dec 12, 2018
The change should first land in the installer, see 
openshift/installer#861
wking added a commit to wking/openshift-release that referenced this pull request Apr 24, 2019
…SECRET and similar

These are local variables; we don't need to leak them down into child
processes.  At least some of these were introduced in 4134347 (Use
install-configs when invoking installer, 2018-12-10, openshift#2353).  The
motivation behind the old approach is not clear to me, but I suspect
overly broad pattern-matching ;).
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. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants