Skip to content
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

MCO-664: adds on-cluster build dev preview docs #3885

Conversation

cheesesashimi
Copy link
Member

- What I did

Adds on-cluster build docs. There are two docs and a diagram as described below:

  • MachineOSBuildDesign.md - This doc is primarily for MCO developers to understand how the on-cluster builds mechanism works. It includes a description of the various components such as BuildController, ImageBuilder, and CustomPodBuilder as well as an SVG version of my diagram outlining these things.
  • OnClusterBuildInstructions.md - This doc is primarily for cluster admins wishing to give on-cluster builds a try in their dev preview clusters.
  • MachineOSBuilderDiagram.svg - This is the aforementioned diagram in SVG format.

- How to verify it

Run through the instructions and see if you can bring up a 4.14 cluster with a custom layered OS.

- Description for the changelog
Adds on-cluster build dev preview docs

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Aug 24, 2023

@cheesesashimi: This pull request references MCO-664 which is a valid jira issue.

In response to this:

- What I did

Adds on-cluster build docs. There are two docs and a diagram as described below:

  • MachineOSBuildDesign.md - This doc is primarily for MCO developers to understand how the on-cluster builds mechanism works. It includes a description of the various components such as BuildController, ImageBuilder, and CustomPodBuilder as well as an SVG version of my diagram outlining these things.
  • OnClusterBuildInstructions.md - This doc is primarily for cluster admins wishing to give on-cluster builds a try in their dev preview clusters.
  • MachineOSBuilderDiagram.svg - This is the aforementioned diagram in SVG format.

- How to verify it

Run through the instructions and see if you can bring up a 4.14 cluster with a custom layered OS.

- Description for the changelog
Adds on-cluster build dev preview docs

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.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 24, 2023
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 24, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 24, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 24, 2023
@cheesesashimi cheesesashimi marked this pull request as ready for review August 25, 2023 19:45
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 25, 2023
@cheesesashimi
Copy link
Member Author

/test unit

global-pull-secret-copy -n openshift-machine-config-operator
--from-file=.dockerconfigjson=<(oc get secret/pull-secret
-n openshift-config -o json | jq -r
'.data\[".dockerconfigjson"\] | @base64d'`).
Copy link
Contributor

Choose a reason for hiding this comment

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

Escaping didn't work for me. Is it needed?

Suggested change
'.data\[".dockerconfigjson"\] | @base64d'`).
'.data[".dockerconfigjson"] | @base64d')

Choose a reason for hiding this comment

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

Agree. I had the same problem, and it seems that it lacks a ")" at the end, doesn't it? or maybe the first "(" should not exist.

Copy link
Member Author

Choose a reason for hiding this comment

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

This was a Pandoc thing. Will fix!

2. The name of a pull secret for the base OS image and the
extensions container. This must be created as a Secret within
the MCO namespace. One can clone the global pull secret, if
desired: (`$ oc create secret docker-registry
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can put the command as code block for better formatting

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that's a great idea!

## Building the image

1. Label the MachineConfigPool to opt it into layering: `$ oc label
mcp/layered 'machineconfiguration.openshift.io/layering-enabled='`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
mcp/layered 'machineconfiguration.openshift.io/layering-enabled='`.
mcp/layering 'machineconfiguration.openshift.io/layering-enabled='`.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice catch!

@rioliu-rh
Copy link

add QE for review
/cc @sergiordlr

@cheesesashimi
Copy link
Member Author

cheesesashimi commented Nov 10, 2023

I've made some minor formatting changes. Other than that, the docs should still be up-to-date.

EDIT: I've reverted the Mermaid diagram change because it was getting too difficult to manage.

global-pull-secret-copy -n openshift-machine-config-operator
--from-file=.dockerconfigjson=<(oc get secret/pull-secret
-n openshift-config -o json | jq -r
'.data\[".dockerconfigjson"\] | @base64d'`).

Choose a reason for hiding this comment

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

Agree. I had the same problem, and it seems that it lacks a ")" at the end, doesn't it? or maybe the first "(" should not exist.

Comment on lines 257 to 258
'.data\["machineconfig.json.gz"\] | @base64d' | gunzip -`. However, if
the build is successful, this ConfigMap will be deleted upon completion

Choose a reason for hiding this comment

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

The command is not working. It seems that the escaped "[" and "]" are not working fine.

On top of that, if I fix the escaped characters I get this error

$ oc get configmap/mc-rendered-layering-a5dfd76db247a1787fecb955e2280c8a -n openshift-machine-config-operator -o json | jq -r '.data["machineconfig.json.gz"] | @base64d' | gunzip -

gzip: stdin: not in gzip format

This is what worked for me:

$  oc get configmap/mc-rendered-layering-a5dfd76db247a1787fecb955e2280c8a -n openshift-machine-config-operator -o json | jq -r '.data["machineconfig.json.gz"]' |base64 -d | gunzip | jq |head
{
  "metadata": {
    "name": "rendered-layering-a5dfd76db247a1787fecb955e2280c8a",
    "uid": "d36d7a89-b6b9-4e35-bdd4-0f12b3bd8e59",
    "resourceVersion": "111607",
    "generation": 1,
....

Choose a reason for hiding this comment

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

Another version that worked for me

$ oc get configmap/mc-rendered-layering-a5dfd76db247a1787fecb955e2280c8a -n openshift-machine-config-operator --template='{{index .data "machineconfig.json.gz" | base64decode}}'  | gunzip | jq |head
{
  "metadata": {
    "name": "rendered-layering-a5dfd76db247a1787fecb955e2280c8a",

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, this was another example of Pandoc escaping things that shouldn't have been escaped. I think another issue may be that I've got a Mac which has different versions of common userland utilities such as gunzip. I'll use your second option since it's the closest to the version that I have.

@sergiordlr
Copy link

It looks good to me. Once we fix the commands, we can add the qe-approved label.

Thank you so much for such a detailed documentation, it has been really helpful for us in QE. i very much appreciate it. Thanks!

@cheesesashimi cheesesashimi force-pushed the zzlotnik/on-cluster-build-docs branch 2 times, most recently from 389946b to 26fcc35 Compare November 10, 2023 19:55
@cheesesashimi
Copy link
Member Author

I've fixed more formatting issues and decided that the Mermaid version of the SVG diagram was too difficult to produce.

that is stored within the ConfigMap may be viewed by running:

```console
$ oc get configmap/mc-<rendered MachineConfig name> -n openshift-machine-config-operator -o json | jq -r '.data["machineconfig.json.gz"]' | base64 -d | gunzip | jq | head

Choose a reason for hiding this comment

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

oc get configmap/mc-<rendered MachineConfig name> -n openshift-machine-config-operator -o json | jq -r '.data["machineconfig.json.gz"]' | base64 -d | gunzip | jq | head

I'm sorry, I pasted the "|head" part of the command that I used to cut the output so that it would be easier to read. We should remove it, or anyone copying the command will not get the full configuration.

Sorry.

Copy link
Member Author

Choose a reason for hiding this comment

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

No worries, I'll fix it!

@sergiordlr
Copy link

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Nov 15, 2023
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Nov 15, 2023

@cheesesashimi: This pull request references MCO-664 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.15.0" version, but no target version was set.

In response to this:

- What I did

Adds on-cluster build docs. There are two docs and a diagram as described below:

  • MachineOSBuildDesign.md - This doc is primarily for MCO developers to understand how the on-cluster builds mechanism works. It includes a description of the various components such as BuildController, ImageBuilder, and CustomPodBuilder as well as an SVG version of my diagram outlining these things.
  • OnClusterBuildInstructions.md - This doc is primarily for cluster admins wishing to give on-cluster builds a try in their dev preview clusters.
  • MachineOSBuilderDiagram.svg - This is the aforementioned diagram in SVG format.

- How to verify it

Run through the instructions and see if you can bring up a 4.14 cluster with a custom layered OS.

- Description for the changelog
Adds on-cluster build dev preview docs

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.

@sinnykumari
Copy link
Contributor

Thanks Zack. Any further changes can be added as follow-up.
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 30, 2023
Copy link
Contributor

openshift-ci bot commented Nov 30, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cheesesashimi, sinnykumari

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:
  • OWNERS [cheesesashimi,sinnykumari]

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
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 65e704c and 2 for PR HEAD b72e625 in total

Copy link
Contributor

openshift-ci bot commented Nov 30, 2023

@cheesesashimi: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit ff30882 into openshift:master Nov 30, 2023
5 checks passed
@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

This PR has been included in build openshift-proxy-pull-test-container-v4.15.0-202311302048.p0.gff30882.assembly.stream for distgit openshift-proxy-pull-test.
All builds following this will include this PR.

wking added a commit to wking/machine-config-operator that referenced this pull request Dec 19, 2023
Connecting the two Markdown files added in b72e625 (adds
machine-os-builder documentation, 2023-08-23, openshift#3885).
wking added a commit to wking/machine-config-operator that referenced this pull request Dec 19, 2023
Connecting the two Markdown files added in b72e625 (adds
machine-os-builder documentation, 2023-08-23, openshift#3885).
@cheesesashimi cheesesashimi deleted the zzlotnik/on-cluster-build-docs branch March 21, 2024 14:03
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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants