Skip to content

docs: add description about our code structure #26394

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Luap99
Copy link
Member

@Luap99 Luap99 commented Jun 12, 2025

Document most important directories when trying to understand our project.

Comments welcome, this is mostly meant as quick getting started guide for new folks trying to understand the codebase.

Does this PR introduce a user-facing change?

None

@openshift-ci openshift-ci bot added release-note-none do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Jun 12, 2025
Copy link
Contributor

openshift-ci bot commented Jun 12, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Luap99

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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 12, 2025
Copy link
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

Perhaps add a link to CONTRIBUTING.md?


#### pkg/machine/

- core code for podman machine commands
Copy link
Member

Choose a reason for hiding this comment

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

maybe #####pkg/machine/tests ?

- core code for podman machine commands

### test/

Copy link
Member

Choose a reason for hiding this comment

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

i think @ninja-quokka had some initial trouble understanding these subdirectories. I would be fine with merging this PR without them but maybe that's something we can do soon thereafter? @ninja-quokka im kind of thinking you would be a good candidate for that?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah I can post a follow up PR with a small addition about the test directory structure. I should really add more content to podman/test/apiv2/README.md before my ideas get oom_reaper'd


Description about important directories in our repository.

### cmd/
Copy link
Member

Choose a reason for hiding this comment

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

### contrib ?

@baude
Copy link
Member

baude commented Jun 13, 2025

i like this pr

Copy link
Member

@Honny1 Honny1 left a comment

Choose a reason for hiding this comment

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

I like this idea.


- various packages to do all sorts of different things

#### pkg/api/
Copy link
Member

Choose a reason for hiding this comment

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

Maybe ##### pkg/api/handlers/compat and ##### pkg/api/handlers/libpod.

Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

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

I guess I’ll just raise the topic:

Should we change some of the paths instead of documenting them?

  • pkg/domain/infra/abipkg/engine/local
  • pkg/domain/infra/tunnelpkg/engine/remote
  • pkg/bindingspkg/remote/client
  • pkg/api/handlerspkg/remote/server

or something vaguely like that?

There’s never a good time to make these changes (and, ugh, we would need to have a naming discussion), but just about every time I’m working on Podman, I wish they had already happened, and after a few years of this wish, it gets old.

(Do we have a stable API commitment / external consumers that mean that we can’t, or shouldn’t, rename the packages?)

@mtrmac
Copy link
Collaborator

mtrmac commented Jun 13, 2025

Should we change some of the paths instead of documenting them?

… these are not exclusive, a renaming discussion, if any, is not really a reason to block the PR.

@Luap99
Copy link
Member Author

Luap99 commented Jun 14, 2025

@mtrmac It is worth to discuss so I created #26431 as the PR is nor really related and changing this doc file later is easy enough.

Document most important directories when trying to understand our
project.

Signed-off-by: Paul Holzinger <[email protected]>
Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

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

The contents of the PR LGTM; there are some discussions about adding more content, let’s give that a few days to play out.

Copy link

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

Copy link
Collaborator

@ninja-quokka ninja-quokka left a comment

Choose a reason for hiding this comment

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

As a new contributor, a document like this would have saved @baude a few hours so +1 and thank you!

Added some thoughts.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree the content serves the purpose of the PR of a "getting started guide for new folks"

Before merging a few small grammatical issues should be resolved:

  • Capitalise proper nouns like Podman, Sphinx, SQLite, BoltDB.
  • Capitalise the first letter in each of the dot points.
  • Add periods to the end of each dot point.

- directory created with "go mod vendor"
- this includes all go deps in our repo, DO NOT edit this directory directly, changes in dependencies must be made in their respective upstream repositories and then updated in go.mod

#### bin/
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Should this be added to the top to keep the order?


#### cmd/podman/

- podman cli code, cli commands and flags are defined here, we are using github.com/spf13/cobra as library for command line parsing
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- podman cli code, cli commands and flags are defined here, we are using github.com/spf13/cobra as library for command line parsing
- Podman CLI code, CLI commands and flags are defined here, we are using the [Cobra CLI library](https://github.com/spf13/cobra) for command line parsing.


### docs/

- sphinx based documentation for podman that is build on readthedocs (docs.podman.io)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- sphinx based documentation for podman that is build on readthedocs (docs.podman.io)
- Sphinx based documentation for Podman that is build on [Read the Docs](https://readthedocs.com/) and hosted at [docs.podman.io](https://docs.podman.io/en/latest/)

- underlying core for most podman operations, defines container, pod, volume management opartions
- contains the database to store these information on disk, either sqlite or botldb (our old db format)
- integrates with our other libraries such as:
- containers/storage create and mount container storage
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Do we want to use 4 indents here? If so please ignore.


- CI scripts, packaging files some container image build files

### docs/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe also link to docs/REAME.md in this section? It goes into more depth on the directory structure for docs/

- core code for podman machine commands

### test/

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah I can post a follow up PR with a small addition about the test directory structure. I should really add more content to podman/test/apiv2/README.md before my ideas get oom_reaper'd

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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants