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

docs: add platforms reference and how-to #2080

Merged
merged 5 commits into from
Jan 18, 2025

Conversation

mr-cal
Copy link
Contributor

@mr-cal mr-cal commented Jan 14, 2025

Adds reference and how-to documentation for platforms, bases, and architectures in Charmcraft, including information on the new multi-base support.

Fixes #2009
(CRAFT-3720)

@mr-cal mr-cal force-pushed the work/CRAFT-3720-multi-base-docs branch from a156c79 to 3827095 Compare January 14, 2025 23:28
@mr-cal mr-cal force-pushed the work/CRAFT-3720-multi-base-docs branch from 3827095 to 651c5be Compare January 15, 2025 14:39
@mr-cal mr-cal changed the base branch from main to hotfix/3.3 January 15, 2025 14:39
@mr-cal mr-cal marked this pull request as ready for review January 15, 2025 14:53
@mr-cal
Copy link
Contributor Author

mr-cal commented Jan 15, 2025

@jnsgruk - do you mind reviewing this documentation? I'm looking for feedback from a charm dev who hasn't already tried building multi-base charms.

For some reason, I can't add you as a PR reviewer.

docs/howto/build-guides/platforms.rst Outdated Show resolved Hide resolved
docs/howto/build-guides/platforms.rst Outdated Show resolved Hide resolved
docs/howto/build-guides/platforms.rst Outdated Show resolved Hide resolved
.. code-block:: yaml

platforms:
[email protected]:amd64:
Copy link
Member

Choose a reason for hiding this comment

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

I’m kinda surprised by the difference between ‘ubuntu-22.04-amd64’ and ‘[email protected]:amd64’ - the two seem quite different and not in a very ‘obvious’ way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I think I was too strict with the validation and am circumventing my own rules.

I made the validation strict to prevent ambiguous definitions, like this one that is a hybrid of shorthand and longhand notation with mismatched bases:

platforms:
  [email protected]:riscv64:
    build-on: [[email protected]:amd64, [email protected]:riscv64]
    build-for: [[email protected]:riscv64]

But I can circumvent my own validation by not using <base>:<arch> in the platform name:

platforms:
  ubuntu-24.04-riscv64:
    build-on: [[email protected]:amd64, [email protected]:riscv64]
    build-for: [[email protected]:riscv64]

I could use simple platform names like noble-riscv64 or I could drop the validation, such that the platform name is completely arbitrary when build-on and build-for are defined. @lengau, any thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(and my examples were wrong, to add to the confusion)

Copy link
Collaborator

Choose a reason for hiding this comment

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

My preference would be that the only time we have limitations on the name of a platform is when it's used to infer the build-on and build-for. Otherwise Järvfjället is a perfectly good platform name.

Copy link
Contributor Author

@mr-cal mr-cal Jan 16, 2025

Choose a reason for hiding this comment

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

I'm fine with that. Once you, Claudio, and I agree on it, I can update the spec, relax the validation (which is trivial), and update the docs.

I don't think we need to block this PR, it can be a future improvement.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Signed-off-by: Callahan Kovacs <[email protected]>
@mr-cal mr-cal requested a review from lengau January 15, 2025 22:17
Copy link
Contributor

@medubelko medubelko left a comment

Choose a reason for hiding this comment

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

Since this is a critical topic, I've made some fairly in-depth suggestions.

I'm probably late to the party, but some of my points relate to the platform-architecture question, and affect the page and section titles. For clearer language that mimics natural speech, I'm leaning toward the notion of "build architecture" and "target architecture" (Docker uses this pair). I hope these proposals won't lead to blockages. If they do, feel free to ignore them.

I didn't give every line the same amount of attention, but I'm sure JJ and I will revisit these pages more than once later.

docs/howto/build-guides/platforms.rst Outdated Show resolved Hide resolved
docs/howto/build-guides/platforms.rst Outdated Show resolved Hide resolved
docs/howto/build-guides/platforms.rst Outdated Show resolved Hide resolved
docs/howto/build-guides/platforms.rst Outdated Show resolved Hide resolved
docs/howto/build-guides/platforms.rst Outdated Show resolved Hide resolved
docs/reference/platforms.rst Outdated Show resolved Hide resolved
docs/howto/build-guides/platforms.rst Outdated Show resolved Hide resolved
docs/reference/platforms.rst Outdated Show resolved Hide resolved
docs/reference/platforms.rst Outdated Show resolved Hide resolved
docs/reference/platforms.rst Outdated Show resolved Hide resolved
@lengau lengau requested a review from medubelko January 17, 2025 19:43
@lengau
Copy link
Collaborator

lengau commented Jan 17, 2025

@medubelko requesting you again as I've got some follow-up questions. I haven't yet handled all the changes.

docs/howto/build-guides/select-platforms.rst Outdated Show resolved Hide resolved
docs/howto/build-guides/select-platforms.rst Outdated Show resolved Hide resolved
docs/howto/build-guides/select-platforms.rst Outdated Show resolved Hide resolved
Comment on lines 191 to 193
With both snippets, building on amd64 will produce two charms, one for
amd64 systems running Ubuntu 22.04 and one for amd64 systems running
Ubuntu 24.04.
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
With both snippets, building on amd64 will produce two charms, one for
amd64 systems running Ubuntu 22.04 and one for amd64 systems running
Ubuntu 24.04.
With both snippets, building on AMD64 will produce two charms, one for
AMD64 hosts running Ubuntu 22.04 LTS and one for AMD64 hosts running
Ubuntu 24.04 LTS.

Since you changed it to "hosts" earlier in the page.

Copy link
Collaborator

@lengau lengau Jan 17, 2025

Choose a reason for hiding this comment

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

I'm distinguishing here the build host from the runtime system, which is why I kept these as systems.

Copy link
Contributor

Choose a reason for hiding this comment

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

Non-blocking, but what makes runtime different? Don't charms run on every kind of machine?

docs/howto/build-guides/select-platforms.rst Outdated Show resolved Hide resolved
docs/howto/build-guides/select-platforms.rst Outdated Show resolved Hide resolved
docs/howto/build-guides/select-platforms.rst Outdated Show resolved Hide resolved
docs/howto/build-guides/platforms.rst Outdated Show resolved Hide resolved
Copy link
Contributor

@medubelko medubelko left a comment

Choose a reason for hiding this comment

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

@lengau I like the changes you've made. I've closed the ones we can't handle for now. The rest of these are mechanical improvements which should be easy to do, with one suggestion to resolve a semantic question. If you're short on time I can commit them today.

docs/reference/platforms.rst Outdated Show resolved Hide resolved
@lengau lengau force-pushed the work/CRAFT-3720-multi-base-docs branch from 5cc482b to fc7df45 Compare January 17, 2025 23:20
@lengau lengau requested a review from medubelko January 17, 2025 23:22
Copy link
Collaborator

@lengau lengau left a comment

Choose a reason for hiding this comment

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

I feel cheeky approving my own changes, but I'm hitting approve here so we have ample approvals for a merge.

@lengau lengau merged commit 142fa82 into hotfix/3.3 Jan 18, 2025
28 checks passed
@lengau lengau deleted the work/CRAFT-3720-multi-base-docs branch January 18, 2025 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document multi-base support and build-plans
5 participants