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

doc/manpages: add the man pages to the docs #12165

Merged
merged 3 commits into from
Aug 29, 2023

Conversation

ru-fu
Copy link
Contributor

@ru-fu ru-fu commented Aug 21, 2023

Generate the man pages for the lxc command and add them to the reference documentation.

Draft PR for now to see if this works on RTD.
If it does, I'll check if I can group the output a bit better (instead of having 300 pages on the same level in the TOC ;) ).

@github-actions github-actions bot added the Documentation Documentation needs updating label Aug 21, 2023
@ru-fu ru-fu force-pushed the LXD-420-manpages branch 4 times, most recently from e508998 to 33f25d1 Compare August 22, 2023 13:39
@github-actions github-actions bot added the API Changes to the REST API label Aug 23, 2023
@ru-fu ru-fu force-pushed the LXD-420-manpages branch from 2863eba to 110a098 Compare August 23, 2023 09:03
@ru-fu ru-fu marked this pull request as ready for review August 23, 2023 09:38
@ru-fu ru-fu force-pushed the LXD-420-manpages branch from 110a098 to e5813fc Compare August 24, 2023 15:35
doc/conf.py Outdated

# Download lxc client

if not os.path.isfile('.sphinx/deps/bin.linux.lxc'):
Copy link
Member

Choose a reason for hiding this comment

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

Is there somewhere else we can move the downloading of dependencies out to, like a github workflow or a readthedocs hook, as I'd like to avoid building the docs from a version of the client that is different to the one running locally.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed - let's change to using lxc for local builds (the tool should be in the path if the environment is set up correctly) and building the tool on RTD (see https://github.com/canonical/lxd/blob/main/.github/workflows/tests.yml#L274 ).

@ru-fu ru-fu force-pushed the LXD-420-manpages branch 4 times, most recently from 67fedb3 to f8a785e Compare August 28, 2023 07:44
@ru-fu
Copy link
Contributor Author

ru-fu commented Aug 28, 2023

It looks like the doc build on GitHub is using the lxc that is already installed on the machine instead of the one that we build. I added a requirement to build the client now, but it's still using the wrong lxc.
Any idea how to get it to use the one from the Go build @tomponline ?

@tomponline
Copy link
Member

If you're always building the lxc command based on the local source code version then you could modify the lxc invocation to specify the local build target file rather than just executing lxc and relying on the PATH resolution.

@ru-fu
Copy link
Contributor Author

ru-fu commented Aug 29, 2023

If you're always building the lxc command based on the local source code version then you could modify the lxc invocation to specify the local build target file rather than just executing lxc and relying on the PATH resolution.

Yes, but how do I know where the built file is?

lxd/Makefile

Line 41 in 9136ce4

go install -v -tags "$(TAG_SQLITE3)" $(DEBUG) ./lxc
doesn't specify an output file as far as I understand. So it's probably going to the Go path? But that one isn't necessarily specified in an environment variable, or is it?

@tomponline
Copy link
Member

You can use the value of go env GOPATH and append /bin to it, e.g.

$(go env GOPATH)/bin/lxc

Alternatively, I believe I linked to it during our meeting, but the github work flows for the client testing use a slightly different invocation:

https://github.com/canonical/lxd/blob/main/.github/workflows/tests.yml#L274

To build the binary in a local directory, so it can be used directly.

@ru-fu
Copy link
Contributor Author

ru-fu commented Aug 29, 2023

To build the binary in a local directory, so it can be used directly.

Yes, that's what I'm doing for the RTD build, which works fine - but I don't want to add a second target for building the client to the Makefile.

I'll see if I can get the go env working in Python, thanks!

@tomponline
Copy link
Member

To build the binary in a local directory, so it can be used directly.

Yes, that's what I'm doing for the RTD build, which works fine - but I don't want to add a second target for building the client to the Makefile.

I'll see if I can get the go env working in Python, thanks!

Why do you need a 2nd target, cant you do the build in the hook itself?

@ru-fu
Copy link
Contributor Author

ru-fu commented Aug 29, 2023

Why do you need a 2nd target, cant you do the build in the hook itself?

We have three different build environments: RTD, local build, and GitHub.

@tomponline
Copy link
Member

Ah I thought you were just going to build a local lxc for it in all environments.

@ru-fu ru-fu force-pushed the LXD-420-manpages branch from f8a785e to 9e5fa56 Compare August 29, 2023 08:55
ru-fu added 3 commits August 29, 2023 11:42
Generate the man pages for the `lxc` command and add them to
the reference documentation.

Signed-off-by: Ruth Fuchss <[email protected]>
Add references from mentions of the lxc commands to the corresponding
man pages.

Signed-off-by: Ruth Fuchss <[email protected]>
@ru-fu ru-fu force-pushed the LXD-420-manpages branch from 9e5fa56 to f8f21e8 Compare August 29, 2023 09:42
@ru-fu
Copy link
Contributor Author

ru-fu commented Aug 29, 2023

Working now 😄

@tomponline tomponline merged commit 2146784 into canonical:main Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Changes to the REST API Documentation Documentation needs updating
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants